Driver for the Dreamcast's built-in 56k Modem
More...
|
file | mconst.h |
| Constants used in the modem driver.
|
|
file | modem.h |
| Definitions to use the Dreamcast modem.
|
|
Driver for the Dreamcast's built-in 56k Modem
◆ MODEM_MAKE_SPEED
#define MODEM_MAKE_SPEED |
( |
| p, |
|
|
| s ) |
Value:
unsigned char modem_speed_t
Modem speed/protocol value type.
Definition mconst.h:123
Combine a protocol and speed into a single value.
- Parameters
-
p | The protocol to use. |
s | The speed to use. |
- Returns
- The full speed/protocol value.
- See also
- Protocol Values
-
Speed Values
◆ MODEM_SPEED_GET_PROTOCOL
#define MODEM_SPEED_GET_PROTOCOL |
( |
| x | ) |
|
Value:
Extract the protocol from a full speed/protocol value.
- Parameters
-
x | The speed/protocol value to look at. |
- Returns
- The protocol in use.
- See also
- Protocol Values
◆ MODEM_SPEED_GET_SPEED
#define MODEM_SPEED_GET_SPEED |
( |
| x | ) |
|
Value:
Extract the speed from a full speed/protocol value.
- Parameters
-
x | The speed/protocol value to look at. |
- Returns
- The speed in use.
- See also
- Speed Values
◆ modem_speed_t
Modem speed/protocol value type.
◆ MODEMEVENTHANDLERPROC
Type of a modem event handling function.
◆ modemEvent_t
Modem Event Types.
These are the events that a modem event handler should be expected to receive at any given point in time.
Enumerator |
---|
MODEM_EVENT_CONNECTION_FAILED | The modem tried to establish a connection, but failed.
|
MODEM_EVENT_CONNECTED | A connection has been established.
|
MODEM_EVENT_DISCONNECTED | The remote modem dropped the connection.
|
MODEM_EVENT_RX_NOT_EMPTY | New data has entered the previously empty receive buffer.
|
MODEM_EVENT_OVERFLOW | The receive buffer overflowed and was cleared.
|
MODEM_EVENT_TX_EMPTY | The transmit buffer has been emptied.
|
◆ modem_dial()
int modem_dial |
( |
const char * | digits | ) |
|
Dial the specified number on the modem.
- Parameters
-
digits | The number to dial, as a string. |
- Return values
-
0 | On failure. |
1 | On success. |
◆ modem_disconnect()
void modem_disconnect |
( |
void | | ) |
|
Disconnect the modem.
This function instructs the modem to disconnect from the remote modem.
◆ modem_get_connection_rate()
unsigned long modem_get_connection_rate |
( |
void | | ) |
|
Get the connection rate that the modem is connected at.
- Returns
- The connection rate in bits per second.
◆ modem_has_data()
int modem_has_data |
( |
void | | ) |
|
Check if the modem has data waiting to be read.
- Returns
- 0 if no data available, non-zero otherwise.
◆ modem_init()
Initialize the modem.
This function initializes the modem for use.
- Return values
-
0 | On failure. |
1 | On success. |
◆ modem_is_connected()
int modem_is_connected |
( |
void | | ) |
|
Check if the modem is connected.
- Returns
- 0 if the modem is not currently connected, non-zero otherwise.
◆ modem_is_connecting()
int modem_is_connecting |
( |
void | | ) |
|
Check if the modem is connecting.
- Returns
- 0 if the modem is not currently connecting, non-zero otherwise.
◆ modem_read_data()
int modem_read_data |
( |
unsigned char * | data, |
|
|
int | size ) |
Read data from the modem buffers.
- Parameters
-
data | The buffer to read into. |
size | The maximum number of bytes to read. |
- Returns
- The actual number of bytes read.
◆ modem_set_event_handler()
Set the event handler for the modem.
This function sets up an event handler for when things happen on the modem.
- Parameters
-
eventHandler | The function to call when an event occurs. |
◆ modem_set_mode()
◆ modem_shutdown()
void modem_shutdown |
( |
void | | ) |
|
Shut down the modem.
This function shuts down the modem after it has been initialized, resetting all of the registers to their defaults.
◆ modem_wait_dialtone()
int modem_wait_dialtone |
( |
int | ms_timeout | ) |
|
Wait for the modem to detect a dialtone.
This function waits for a dialtone to be detected on the modem.
- Parameters
-
ms_timeout | The number of milliseconds to wait, in multiples of 100. |
- Return values
-
0 | If a dialtone is detected before timeout. |
-1 | If no dialtone is detected. |
◆ modem_write_data()
int modem_write_data |
( |
unsigned char * | data, |
|
|
int | size ) |
Write data to the modem buffers.
- Parameters
-
data | The buffer to write from. |
size | The maximum number of bytes to write. |
- Returns
- The actual number of bytes written.