KallistiOS
##version##
|
Definitions to use the Dreamcast modem. More...
#include "mconst.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | MODEMEVENTHANDLERPROC )(modemEvent_t event) |
Type of a modem event handling function. More... | |
Enumerations | |
enum | modemEvent_t { MODEM_EVENT_CONNECTION_FAILED = 0, MODEM_EVENT_CONNECTED, MODEM_EVENT_DISCONNECTED, MODEM_EVENT_RX_NOT_EMPTY, MODEM_EVENT_OVERFLOW, MODEM_EVENT_TX_EMPTY } |
Modem event types. More... | |
Functions | |
int | modem_init (void) |
Initialize the modem. More... | |
void | modem_shutdown (void) |
Shut down the modem. More... | |
int | modem_set_mode (int mode, modem_speed_t speed) |
Set the modem up for the specified mode. More... | |
int | modem_wait_dialtone (int ms_timeout) |
Wait for the modem to detect a dialtone. More... | |
int | modem_dial (const char *digits) |
Dial the specified number on the modem. More... | |
void | modem_set_event_handler (MODEMEVENTHANDLERPROC eventHandler) |
Set the event handler for the modem. More... | |
void | modem_disconnect (void) |
Disconnect the modem. More... | |
int | modem_is_connecting (void) |
Check if the modem is connecting. More... | |
int | modem_is_connected (void) |
Check if the modem is connected. More... | |
unsigned long | modem_get_connection_rate (void) |
Get the connection rate that the modem is connected at. More... | |
int | modem_read_data (unsigned char *data, int size) |
Read data from the modem buffers. More... | |
int | modem_write_data (unsigned char *data, int size) |
Write data to the modem buffers. More... | |
int | modem_has_data (void) |
Check if the modem has data waiting to be read. More... | |
Definitions to use the Dreamcast modem.
This file contains functions and constants to be used with the Dreamcast modem driver.
typedef void(* MODEMEVENTHANDLERPROC)(modemEvent_t event) |
Type of a modem event handling function.
enum modemEvent_t |
Modem event types.
These are teh events that a modem event handler should be expected to receive at any given point in time.
int modem_dial | ( | const char * | digits | ) |
Dial the specified number on the modem.
digits | The number to dial, as a string. |
0 | On failure. |
1 | On success. |
void modem_disconnect | ( | void | ) |
Disconnect the modem.
This function instructs the modem to disconnect from the remote modem.
unsigned long modem_get_connection_rate | ( | void | ) |
Get the connection rate that the modem is connected at.
int modem_has_data | ( | void | ) |
Check if the modem has data waiting to be read.
int modem_init | ( | void | ) |
Initialize the modem.
This function initializes the modem for use.
0 | On failure. |
1 | On success. |
int modem_is_connected | ( | void | ) |
Check if the modem is connected.
int modem_is_connecting | ( | void | ) |
Check if the modem is connecting.
int modem_read_data | ( | unsigned char * | data, |
int | size | ||
) |
Read data from the modem buffers.
data | The buffer to read into. |
size | The maximum number of bytes to read. |
void modem_set_event_handler | ( | MODEMEVENTHANDLERPROC | eventHandler | ) |
Set the event handler for the modem.
This function sets up an event handler for when things happen on the modem.
eventHandler | The function to call when an event occurs. |
int modem_set_mode | ( | int | mode, |
modem_speed_t | speed | ||
) |
Set the modem up for the specified mode.
This function sets up the modem's registers for the specified mode and speed combination.
mode | The mode to use. |
speed | The speed to use. |
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.
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.
ms_timeout | The number of milliseconds to wait, in multiples of 100. |
0 | If a dialtone is detected before timeout. |
-1 | If no dialtone is detected. |
int modem_write_data | ( | unsigned char * | data, |
int | size | ||
) |
Write data to the modem buffers.
data | The buffer to write from. |
size | The maximum number of bytes to write. |