20#ifndef __DC_MODEM_MODEM_H
21#define __DC_MODEM_MODEM_H
40#define MODEM_MODE_REMOTE 0
43#define MODEM_MODE_ANSWER 1
46#define MODEM_MODE_NULL 255
55#define MODEM_SPEED_V22BIS_1200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V22BIS, MODEM_SPEED_1200)
58#define MODEM_SPEED_V22BIS_2400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V22BIS, MODEM_SPEED_2400)
67#define MODEM_SPEED_V22_1200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V22, MODEM_SPEED_1200)
76#define MODEM_SPEED_V32_4800 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32, MODEM_SPEED_4800)
79#define MODEM_SPEED_V32_9600 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32, MODEM_SPEED_9600)
88#define MODEM_SPEED_V32BIS_7200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32BIS, MODEM_SPEED_7200)
91#define MODEM_SPEED_V32BIS_12000 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32BIS, MODEM_SPEED_12000)
94#define MODEM_SPEED_V32BIS_14400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V32BIS, MODEM_SPEED_14400)
103#define MODEM_SPEED_V8_2400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_2400)
106#define MODEM_SPEED_V8_4800 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_4800)
109#define MODEM_SPEED_V8_7200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_7200)
112#define MODEM_SPEED_V8_9600 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_9600)
115#define MODEM_SPEED_V8_12000 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_12000)
118#define MODEM_SPEED_V8_14400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_14400)
121#define MODEM_SPEED_V8_16800 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_16800)
124#define MODEM_SPEED_V8_19200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_19200)
127#define MODEM_SPEED_V8_21600 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_21600)
130#define MODEM_SPEED_V8_24000 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_24000)
133#define MODEM_SPEED_V8_26400 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_26400)
136#define MODEM_SPEED_V8_28000 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_28000)
139#define MODEM_SPEED_V8_31200 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_31200)
142#define MODEM_SPEED_V8_33600 MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_33600)
145#define MODEM_SPEED_V8_AUTO MODEM_MAKE_SPEED(MODEM_PROTOCOL_V8, MODEM_SPEED_1200)
int modem_set_mode(int mode, modem_speed_t speed)
Set the modem up for the specified mode.
void(* MODEMEVENTHANDLERPROC)(modemEvent_t event)
Type of a modem event handling function.
Definition modem.h:177
void modem_shutdown(void)
Shut down the modem.
int modem_init(void)
Initialize the modem.
unsigned char modem_speed_t
Modem speed/protocol value type.
Definition mconst.h:123
int modem_read_data(unsigned char *data, int size)
Read data from the modem buffers.
int modem_write_data(unsigned char *data, int size)
Write data to the modem buffers.
int modem_is_connected(void)
Check if the modem is connected.
void modem_set_event_handler(MODEMEVENTHANDLERPROC eventHandler)
Set the event handler for the modem.
int modem_has_data(void)
Check if the modem has data waiting to be read.
unsigned long modem_get_connection_rate(void)
Get the connection rate that the modem is connected at.
int modem_dial(const char *digits)
Dial the specified number on the modem.
void modem_disconnect(void)
Disconnect the modem.
int modem_is_connecting(void)
Check if the modem is connecting.
int modem_wait_dialtone(int ms_timeout)
Wait for the modem to detect a dialtone.
modemEvent_t
Modem Event Types.
Definition modem.h:154
@ MODEM_EVENT_DISCONNECTED
The remote modem dropped the connection.
Definition modem.h:162
@ MODEM_EVENT_CONNECTION_FAILED
The modem tried to establish a connection, but failed.
Definition modem.h:156
@ MODEM_EVENT_RX_NOT_EMPTY
New data has entered the previously empty receive buffer.
Definition modem.h:165
@ MODEM_EVENT_OVERFLOW
The receive buffer overflowed and was cleared.
Definition modem.h:168
@ MODEM_EVENT_TX_EMPTY
The transmit buffer has been emptied.
Definition modem.h:171
@ MODEM_EVENT_CONNECTED
A connection has been established.
Definition modem.h:159
Constants used in the modem driver.