Hint added.
[AROS.git] / workbench / hidds / serial / serial_stubs.c
blob807bb03b8ab723ea44a4a49e92cd44e75a07eab0
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 <oop/static_mid.h>
23 #include <hidd/serial.h>
25 //#include "serial_intern.h"
27 #undef SDEBUG
28 #undef DEBUG
29 #define DEBUG 0
30 #include <aros/debug.h>
32 #undef OOPBase
33 #define OOPBase ((struct Library *)OOP_OCLASS(obj)->OOPBasePtr)
35 /***************************************************************/
37 OOP_Object * HIDD_Serial_NewUnit(OOP_Object *obj, ULONG unitnum)
39 STATIC_MID;
40 struct pHidd_Serial_NewUnit p, *msg = &p;
42 if(!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_Serial, moHidd_Serial_NewUnit);
44 p.mID = static_mid;
45 p.unitnum = unitnum;
47 return((OOP_Object *) OOP_DoMethod(obj, (OOP_Msg) msg));
49 /***************************************************************/
51 VOID HIDD_Serial_DisposeUnit(OOP_Object *obj, OOP_Object *unit)
53 STATIC_MID;
54 struct pHidd_Serial_DisposeUnit p, *msg = &p;
56 if(!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_Serial, moHidd_Serial_DisposeUnit);
58 p.mID = static_mid;
59 p.unit = unit;
61 OOP_DoMethod(obj, (OOP_Msg) msg);
67 /********************** Stubs for serial unit **********************/
69 BOOL HIDD_SerialUnit_Init(OOP_Object *obj, VOID * DataReceived, VOID * DataReceivedUserData, VOID * WriteData, VOID * WriteDataUserData)
71 STATIC_MID;
72 struct pHidd_SerialUnit_Init p, *msg = &p;
74 if(!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_Init);
76 p.mID = static_mid;
77 p.DataReceived = DataReceived;
78 p.DataReceivedUserData = DataReceivedUserData;
79 p.WriteData = WriteData;
80 p.WriteDataUserData = WriteDataUserData;
82 return((BOOL) OOP_DoMethod(obj, (OOP_Msg) msg));
84 /***************************************************************/
86 ULONG HIDD_SerialUnit_Write (OOP_Object *obj, UBYTE * data, ULONG length)
88 STATIC_MID;
89 struct pHidd_SerialUnit_Write p, *msg = &p;
91 if(!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_Write);
93 p.mID = static_mid;
94 p.Length = length;
95 p.Outbuffer = data;
97 return ((ULONG) OOP_DoMethod(obj, (OOP_Msg) msg));
100 /***************************************************************/
102 BOOL HIDD_SerialUnit_SetBaudrate(OOP_Object *obj, ULONG baudrate)
104 STATIC_MID;
105 struct pHidd_SerialUnit_SetBaudrate p, *msg = &p;
107 if(!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_SetBaudrate);
109 p.mID = static_mid;
110 p.baudrate = baudrate;
112 return ((BOOL) OOP_DoMethod(obj, (OOP_Msg) msg));
115 /***************************************************************/
117 BOOL HIDD_SerialUnit_SetParameters(OOP_Object *obj, struct TagItem * tags)
119 STATIC_MID;
120 struct pHidd_SerialUnit_SetParameters p, *msg = &p;
122 if(!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_SetParameters);
124 p.mID = static_mid;
125 p.tags = tags;
127 return ((BOOL) OOP_DoMethod(obj, (OOP_Msg) msg));
130 /***************************************************************/
132 BYTE HIDD_SerialUnit_SendBreak(OOP_Object *obj, int duration)
134 STATIC_MID;
135 struct pHidd_SerialUnit_SendBreak p, *msg = &p;
137 if(!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_SendBreak);
139 p.mID = static_mid;
140 p.duration = duration;
142 return ((BYTE)OOP_DoMethod(obj, (OOP_Msg) msg));
145 /***************************************************************/
147 VOID HIDD_SerialUnit_GetCapabilities(OOP_Object *obj, struct TagItem * tags)
149 STATIC_MID;
150 struct pHidd_SerialUnit_GetCapabilities p, *msg = &p;
152 if (!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_GetCapabilities);
154 p.mID = static_mid;
155 p.taglist = tags;
157 OOP_DoMethod(obj, (OOP_Msg) msg);
160 /***************************************************************/
162 VOID HIDD_SerialUnit_Start(OOP_Object *obj)
164 STATIC_MID;
165 struct pHidd_SerialUnit_Start p, *msg = &p;
167 if (!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_Start);
169 p.mID = static_mid;
171 OOP_DoMethod(obj, (OOP_Msg) msg);
175 /***************************************************************/
177 VOID HIDD_SerialUnit_Stop(OOP_Object *obj)
179 STATIC_MID;
180 struct pHidd_SerialUnit_Stop p, *msg = &p;
182 if (!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_Stop);
184 p.mID = static_mid;
186 OOP_DoMethod(obj, (OOP_Msg) msg);
189 /***************************************************************/
191 UWORD HIDD_SerialUnit_GetStatus(OOP_Object *obj)
193 STATIC_MID;
194 struct pHidd_SerialUnit_GetStatus p, *msg = &p;
196 if (!static_mid) static_mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_GetStatus);
198 p.mID = static_mid;
200 return ((UWORD)OOP_DoMethod(obj, (OOP_Msg) msg));