2 #include "../../gsmstate.h"
4 #ifdef GSM_ENABLE_SERIALDEVICE
7 #include "../../gsmcomon.h"
10 /* Close the serial port and restore old settings. */
11 static GSM_Error
serial_close(GSM_StateMachine
*s
)
13 GSM_Device_SerialData
*d
= &s
->Device
.Data
.Serial
;
18 static GSM_Error
serial_open (GSM_StateMachine
*s
)
20 GSM_Device_SerialData
*d
= &s
->Device
.Data
.Serial
;
25 static GSM_Error
serial_setparity(GSM_StateMachine
*s
, bool parity
)
27 GSM_Device_SerialData
*d
= &s
->Device
.Data
.Serial
;
32 /* Set the DTR and RTS bit of the serial device. */
33 static GSM_Error
serial_setdtrrts(GSM_StateMachine
*s
, bool dtr
, bool rts
)
35 GSM_Device_SerialData
*d
= &s
->Device
.Data
.Serial
;
38 // return GE_DEVICEDTRRTSERROR;
41 /* Change the speed of the serial device.
44 static GSM_Error
serial_setspeed(GSM_StateMachine
*s
, int speed
)
46 GSM_Device_SerialData
*d
= &s
->Device
.Data
.Serial
;
50 /* Read from serial device. */
51 static int serial_read(GSM_StateMachine
*s
, void *buf
, size_t nbytes
)
53 GSM_Device_SerialData
*d
= &s
->Device
.Data
.Serial
;
57 /* Write to serial device. */
58 static int serial_write(GSM_StateMachine
*s
, void *buf
, size_t nbytes
)
60 GSM_Device_SerialData
*d
= &s
->Device
.Data
.Serial
;
64 GSM_Device_Functions SerialDevice
= {
77 /* How should editor hadle tabs in this file? Add editor commands here.
78 * vim: noexpandtab sw=8 ts=8 sts=8: