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 <oop/static_mid.h>
23 #include <hidd/serial.h>
25 //#include "serial_intern.h"
30 #include <aros/debug.h>
33 #define OOPBase ((struct Library *)OOP_OCLASS(obj)->OOPBasePtr)
35 /***************************************************************/
37 OOP_Object
* HIDD_Serial_NewUnit(OOP_Object
*obj
, ULONG unitnum
)
40 struct pHidd_Serial_NewUnit p
, *msg
= &p
;
42 if(!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_Serial
, moHidd_Serial_NewUnit
);
47 return((OOP_Object
*) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
49 /***************************************************************/
51 VOID
HIDD_Serial_DisposeUnit(OOP_Object
*obj
, OOP_Object
*unit
)
54 struct pHidd_Serial_DisposeUnit p
, *msg
= &p
;
56 if(!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_Serial
, moHidd_Serial_DisposeUnit
);
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
)
72 struct pHidd_SerialUnit_Init p
, *msg
= &p
;
74 if(!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_Init
);
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
)
89 struct pHidd_SerialUnit_Write p
, *msg
= &p
;
91 if(!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_Write
);
97 return ((ULONG
) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
100 /***************************************************************/
102 BOOL
HIDD_SerialUnit_SetBaudrate(OOP_Object
*obj
, ULONG baudrate
)
105 struct pHidd_SerialUnit_SetBaudrate p
, *msg
= &p
;
107 if(!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_SetBaudrate
);
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
)
120 struct pHidd_SerialUnit_SetParameters p
, *msg
= &p
;
122 if(!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_SetParameters
);
127 return ((BOOL
) OOP_DoMethod(obj
, (OOP_Msg
) msg
));
130 /***************************************************************/
132 BYTE
HIDD_SerialUnit_SendBreak(OOP_Object
*obj
, int duration
)
135 struct pHidd_SerialUnit_SendBreak p
, *msg
= &p
;
137 if(!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_SendBreak
);
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
)
150 struct pHidd_SerialUnit_GetCapabilities p
, *msg
= &p
;
152 if (!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_GetCapabilities
);
157 OOP_DoMethod(obj
, (OOP_Msg
) msg
);
160 /***************************************************************/
162 VOID
HIDD_SerialUnit_Start(OOP_Object
*obj
)
165 struct pHidd_SerialUnit_Start p
, *msg
= &p
;
167 if (!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_Start
);
171 OOP_DoMethod(obj
, (OOP_Msg
) msg
);
175 /***************************************************************/
177 VOID
HIDD_SerialUnit_Stop(OOP_Object
*obj
)
180 struct pHidd_SerialUnit_Stop p
, *msg
= &p
;
182 if (!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_Stop
);
186 OOP_DoMethod(obj
, (OOP_Msg
) msg
);
189 /***************************************************************/
191 UWORD
HIDD_SerialUnit_GetStatus(OOP_Object
*obj
)
194 struct pHidd_SerialUnit_GetStatus p
, *msg
= &p
;
196 if (!static_mid
) static_mid
= OOP_GetMethodID(IID_Hidd_SerialUnit
, moHidd_SerialUnit_GetStatus
);
200 return ((UWORD
)OOP_DoMethod(obj
, (OOP_Msg
) msg
));