New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / workbench / hidds / serial / serial_stubs.c
blob10eef1e4716b4aeb33f6635a68895b024be07764
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Stubs for Serial and SerialUnit class
6 Lang: english
7 */
9 #ifndef AROS_USE_OOP
10 # define AROS_USE_OOP
11 #endif
13 #include <aros/config.h>
14 #include <exec/types.h>
15 #include <exec/libraries.h>
17 #include <proto/oop.h>
19 #include <utility/tagitem.h>
21 #include <oop/oop.h>
22 #include <hidd/serial.h>
24 //#include "serial_intern.h"
26 #undef SDEBUG
27 #undef DEBUG
28 #define DEBUG 0
29 #include <aros/debug.h>
31 #undef OOPBase
32 #define OOPBase ((struct Library *)OOP_OCLASS(obj)->OOPBasePtr)
34 #ifdef AROS_CREATE_ROM
35 # define STATIC_MID OOP_MethodID mid = 0
36 #else
37 # define STATIC_MID static OOP_MethodID mid
38 #endif
40 /***************************************************************/
42 OOP_Object * HIDD_Serial_NewUnit(OOP_Object *obj, ULONG unitnum)
44 STATIC_MID;
45 struct pHidd_Serial_NewUnit p, *msg = &p;
47 if(!mid) mid = OOP_GetMethodID(IID_Hidd_Serial, moHidd_Serial_NewUnit);
49 p.mID = mid;
50 p.unitnum = unitnum;
52 return((OOP_Object *) OOP_DoMethod(obj, (OOP_Msg) msg));
54 /***************************************************************/
56 VOID HIDD_Serial_DisposeUnit(OOP_Object *obj, OOP_Object *unit)
58 STATIC_MID;
59 struct pHidd_Serial_DisposeUnit p, *msg = &p;
61 if(!mid) mid = OOP_GetMethodID(IID_Hidd_Serial, moHidd_Serial_DisposeUnit);
63 p.mID = mid;
64 p.unit = unit;
66 OOP_DoMethod(obj, (OOP_Msg) msg);
72 /********************** Stubs for serial unit **********************/
74 BOOL HIDD_SerialUnit_Init(OOP_Object *obj, VOID * DataReceived, VOID * DataReceivedUserData, VOID * WriteData, VOID * WriteDataUserData)
76 STATIC_MID;
77 struct pHidd_SerialUnit_Init p, *msg = &p;
79 if(!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_Init);
81 p.mID = mid;
82 p.DataReceived = DataReceived;
83 p.DataReceivedUserData = DataReceivedUserData;
84 p.WriteData = WriteData;
85 p.WriteDataUserData = WriteDataUserData;
87 return((BOOL) OOP_DoMethod(obj, (OOP_Msg) msg));
89 /***************************************************************/
91 ULONG HIDD_SerialUnit_Write (OOP_Object *obj, UBYTE * data, ULONG length)
93 STATIC_MID;
94 struct pHidd_SerialUnit_Write p, *msg = &p;
96 if(!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_Write);
98 p.mID = mid;
99 p.Length = length;
100 p.Outbuffer = data;
102 return ((ULONG) OOP_DoMethod(obj, (OOP_Msg) msg));
105 /***************************************************************/
107 BOOL HIDD_SerialUnit_SetBaudrate(OOP_Object *obj, ULONG baudrate)
109 STATIC_MID;
110 struct pHidd_SerialUnit_SetBaudrate p, *msg = &p;
112 if(!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_SetBaudrate);
114 p.mID = mid;
115 p.baudrate = baudrate;
117 return ((BOOL) OOP_DoMethod(obj, (OOP_Msg) msg));
120 /***************************************************************/
122 BOOL HIDD_SerialUnit_SetParameters(OOP_Object *obj, struct TagItem * tags)
124 STATIC_MID;
125 struct pHidd_SerialUnit_SetParameters p, *msg = &p;
127 if(!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_SetParameters);
129 p.mID = mid;
130 p.tags = tags;
132 return ((BOOL) OOP_DoMethod(obj, (OOP_Msg) msg));
135 /***************************************************************/
137 BYTE HIDD_SerialUnit_SendBreak(OOP_Object *obj, int duration)
139 STATIC_MID;
140 struct pHidd_SerialUnit_SendBreak p, *msg = &p;
142 if(!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_SendBreak);
144 p.mID = mid;
145 p.duration = duration;
147 return ((BYTE)OOP_DoMethod(obj, (OOP_Msg) msg));
150 /***************************************************************/
152 VOID HIDD_SerialUnit_GetCapabilities(OOP_Object *obj, struct TagItem * tags)
154 STATIC_MID;
155 struct pHidd_SerialUnit_GetCapabilities p, *msg = &p;
157 if (!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_GetCapabilities);
159 p.mID = mid;
160 p.taglist = tags;
162 OOP_DoMethod(obj, (OOP_Msg) msg);
165 /***************************************************************/
167 VOID HIDD_SerialUnit_Start(OOP_Object *obj)
169 STATIC_MID;
170 struct pHidd_SerialUnit_Start p, *msg = &p;
172 if (!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_Start);
174 p.mID = mid;
176 OOP_DoMethod(obj, (OOP_Msg) msg);
180 /***************************************************************/
182 VOID HIDD_SerialUnit_Stop(OOP_Object *obj)
184 STATIC_MID;
185 struct pHidd_SerialUnit_Stop p, *msg = &p;
187 if (!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_Stop);
189 p.mID = mid;
191 OOP_DoMethod(obj, (OOP_Msg) msg);
194 /***************************************************************/
196 UWORD HIDD_SerialUnit_GetStatus(OOP_Object *obj)
198 STATIC_MID;
199 struct pHidd_SerialUnit_GetStatus p, *msg = &p;
201 if (!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_GetStatus);
203 p.mID = mid;
205 return ((UWORD)OOP_DoMethod(obj, (OOP_Msg) msg));