2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Stubs for Serial and SerialUnit class
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>
22 #include <hidd/serial.h>
24 //#include "serial_intern.h"
29 #include <aros/debug.h>
32 #define OOPBase ((struct Library *)OOP_OCLASS(obj)->OOPBasePtr)
34 #ifdef AROS_CREATE_ROM
35 # define STATIC_MID OOP_MethodID mid = 0
37 # define STATIC_MID static OOP_MethodID mid
40 /***************************************************************/
42 OOP_Object
* HIDD_Serial_NewUnit(OOP_Object
*obj
, ULONG unitnum
)
45 struct pHidd_Serial_NewUnit p
, *msg
= &p
;
47 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_Serial
, moHidd_Serial_NewUnit
);
52 return((OOP_Object
*) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
54 /***************************************************************/
56 VOID
HIDD_Serial_DisposeUnit(OOP_Object
*obj
, OOP_Object
*unit
)
59 struct pHidd_Serial_DisposeUnit p
, *msg
= &p
;
61 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_Serial
, moHidd_Serial_DisposeUnit
);
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
)
77 struct pHidd_SerialUnit_Init p
, *msg
= &p
;
79 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_Init
);
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
)
94 struct pHidd_SerialUnit_Write p
, *msg
= &p
;
96 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_Write
);
102 return ((ULONG
) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
105 /***************************************************************/
107 BOOL
HIDD_SerialUnit_SetBaudrate(OOP_Object
*obj
, ULONG baudrate
)
110 struct pHidd_SerialUnit_SetBaudrate p
, *msg
= &p
;
112 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_SetBaudrate
);
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
)
125 struct pHidd_SerialUnit_SetParameters p
, *msg
= &p
;
127 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_SetParameters
);
132 return ((BOOL
) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
135 /***************************************************************/
137 BYTE
HIDD_SerialUnit_SendBreak(OOP_Object
*obj
, int duration
)
140 struct pHidd_SerialUnit_SendBreak p
, *msg
= &p
;
142 if(!mid
) mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_SendBreak
);
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
)
155 struct pHidd_SerialUnit_GetCapabilities p
, *msg
= &p
;
157 if (!mid
) mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_GetCapabilities
);
162 OOP_DoMethod(obj
, (OOP_Msg
) msg
);
165 /***************************************************************/
167 VOID
HIDD_SerialUnit_Start(OOP_Object
*obj
)
170 struct pHidd_SerialUnit_Start p
, *msg
= &p
;
172 if (!mid
) mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_Start
);
176 OOP_DoMethod(obj
, (OOP_Msg
) msg
);
180 /***************************************************************/
182 VOID
HIDD_SerialUnit_Stop(OOP_Object
*obj
)
185 struct pHidd_SerialUnit_Stop p
, *msg
= &p
;
187 if (!mid
) mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_Stop
);
191 OOP_DoMethod(obj
, (OOP_Msg
) msg
);
194 /***************************************************************/
196 UWORD
HIDD_SerialUnit_GetStatus(OOP_Object
*obj
)
199 struct pHidd_SerialUnit_GetStatus p
, *msg
= &p
;
201 if (!mid
) mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_GetStatus
);
205 return ((UWORD
)OOP_DoMethod(obj
, (OOP_Msg
) msg
));