19 #ifndef __DC_MODEM_MODEM_H
20 #define __DC_MODEM_MODEM_H
32 #define MODEM_MODE_REMOTE 0
35 #define MODEM_MODE_ANSWER 1
38 #define MODEM_MODE_NULL 255
45 #define MODEM_SPEED_V22BIS_1200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V22BIS, MODEM_SPEED_1200)
48 #define MODEM_SPEED_V22BIS_2400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V22BIS, MODEM_SPEED_2400)
55 #define MODEM_SPEED_V22_1200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V22, MODEM_SPEED_1200)
62 #define MODEM_SPEED_V32_4800 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32, MODEM_SPEED_4800)
65 #define MODEM_SPEED_V32_9600 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32, MODEM_SPEED_9600)
72 #define MODEM_SPEED_V32BIS_7200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32BIS, MODEM_SPEED_7200)
75 #define MODEM_SPEED_V32BIS_12000 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32BIS, MODEM_SPEED_12000)
78 #define MODEM_SPEED_V32BIS_14400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32BIS, MODEM_SPEED_14400)
85 #define MODEM_SPEED_V8_2400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_2400)
88 #define MODEM_SPEED_V8_4800 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_4800)
91 #define MODEM_SPEED_V8_7200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_7200)
94 #define MODEM_SPEED_V8_9600 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_9600)
97 #define MODEM_SPEED_V8_12000 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_12000)
100 #define MODEM_SPEED_V8_14400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_14400)
103 #define MODEM_SPEED_V8_16800 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_16800)
106 #define MODEM_SPEED_V8_19200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_19200)
109 #define MODEM_SPEED_V8_21600 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_21600)
112 #define MODEM_SPEED_V8_24000 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_24000)
115 #define MODEM_SPEED_V8_26400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_26400)
118 #define MODEM_SPEED_V8_28000 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_28000)
121 #define MODEM_SPEED_V8_31200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_31200)
124 #define MODEM_SPEED_V8_33600 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_33600)
127 #define MODEM_SPEED_V8_AUTO MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_1200)
int modem_dial(const char *digits)
Dial the specified number on the modem.
The remote modem dropped the connection.
Definition: modem.h:143
void modem_set_event_handler(MODEMEVENTHANDLERPROC eventHandler)
Set the event handler for the modem.
int modem_is_connecting(void)
Check if the modem is connecting.
The transmit buffer has been emptied.
Definition: modem.h:152
int modem_has_data(void)
Check if the modem has data waiting to be read.
int modem_set_mode(int mode, modem_speed_t speed)
Set the modem up for the specified mode.
int modem_wait_dialtone(int ms_timeout)
Wait for the modem to detect a dialtone.
int modem_write_data(unsigned char *data, int size)
Write data to the modem buffers.
unsigned long modem_get_connection_rate(void)
Get the connection rate that the modem is connected at.
void(* MODEMEVENTHANDLERPROC)(modemEvent_t event)
Type of a modem event handling function.
Definition: modem.h:156
The receive buffer overflowed and was cleared.
Definition: modem.h:149
int modem_is_connected(void)
Check if the modem is connected.
A connection has been established.
Definition: modem.h:140
modemEvent_t
Modem event types.
Definition: modem.h:135
int modem_init(void)
Initialize the modem.
New data has entered the previously empty receive buffer.
Definition: modem.h:146
Constants used in the modem driver.
void modem_disconnect(void)
Disconnect the modem.
void modem_shutdown(void)
Shut down the modem.
int modem_read_data(unsigned char *data, int size)
Read data from the modem buffers.
The modem tried to establish a connection, but failed.
Definition: modem.h:137
unsigned char modem_speed_t
Modem speed/protocol value type.
Definition: mconst.h:110