Network Component  Version 7.19.0
MDK Middleware for IPv4 and IPv6 Networking
Modem Driver Functions

Modem driver functions. More...

Structures

struct  DRIVER_MODEM
 Access structure of the Modem Driver. More...
 

Enumerations

enum  MODEM_STATUS {
  MODEM_OK = 0 ,
  MODEM_ERROR = 1
}
 
enum  MODEM_EVENT {
  MODEM_EVENT_OK ,
  MODEM_EVENT_TIMEOUT ,
  MODEM_EVENT_RESPONSE ,
  MODEM_EVENT_ERROR
}
 

Functions

MODEM_STATUS Modem_Initialize (Modem_Request_t cb_request, const char *init_string)
 Initialize Modem Device. More...
 
MODEM_STATUS Modem_Uninitialize (void)
 De-initialize Modem Device. More...
 
MODEM_STATUS Modem_Listen (void)
 Start Modem Device listening mode. More...
 
MODEM_STATUS Modem_Dial (const char *dial_num)
 Start dialing target number. More...
 
MODEM_STATUS Modem_Hangup (void)
 Hangup the line. More...
 
bool Modem_IsOnline (void)
 Check if modem is online. More...
 
MODEM_STATUS Modem_Notify (MODEM_EVENT event, const char *response)
 Notify the Modem Driver of completion event. More...
 
void Modem_Request (const char *command, const char *response, uint32_t timeout, uint32_t retries)
 Request Callback function for the driver. More...
 

Description

Modem driver functions.

The functions are part of the Network Component and are defined in Modem_Null.c and Modem_Standard.c.


Data Structure Documentation

◆ DRIVER_MODEM

struct DRIVER_MODEM

Access structure of the Modem Driver.

Data Fields

MODEM_STATUS(* Initialize )(Modem_Request_t cb_request, const char *init_string)
 Pointer to Modem_Initialize : Initialize Modem Device. More...
 
MODEM_STATUS(* Uninitialize )(void)
 Pointer to Modem_Uninitialize : De-initialize Modem Device. More...
 
MODEM_STATUS(* Listen )(void)
 Pointer to Modem_Listen : Start Modem Device listening mode. More...
 
MODEM_STATUS(* Dial )(const char *dial_num)
 Pointer to Modem_Dial : Start dialing target number. More...
 
MODEM_STATUS(* Hangup )(void)
 Pointer to Modem_Hangup : Hangup the line. More...
 
bool(* IsOnline )(void)
 Pointer to Modem_IsOnline : Check if modem is online. More...
 
void(* Notify )(MODEM_EVENT event, const char *response)
 Pointer to Modem_Notify : Notify the driver of completion event. More...
 

Field Documentation

◆ Dial

MODEM_STATUS(* Dial) (const char *dial_num)

Pointer to Modem_Dial : Start dialing target number.

◆ Hangup

MODEM_STATUS(* Hangup) (void)

Pointer to Modem_Hangup : Hangup the line.

◆ Initialize

MODEM_STATUS(* Initialize) (Modem_Request_t cb_request, const char *init_string)

Pointer to Modem_Initialize : Initialize Modem Device.

◆ IsOnline

bool(* IsOnline) (void)

Pointer to Modem_IsOnline : Check if modem is online.

◆ Listen

MODEM_STATUS(* Listen) (void)

Pointer to Modem_Listen : Start Modem Device listening mode.

◆ Notify

void(* Notify) (MODEM_EVENT event, const char *response)

Pointer to Modem_Notify : Notify the driver of completion event.

◆ Uninitialize

MODEM_STATUS(* Uninitialize) (void)

Pointer to Modem_Uninitialize : De-initialize Modem Device.

Enumeration Type Documentation

◆ MODEM_EVENT

Modem Driver Callback Events

Enumerator
MODEM_EVENT_OK 

Operation succeeded.

MODEM_EVENT_TIMEOUT 

Operation timeout.

MODEM_EVENT_RESPONSE 

Modem response returned.

MODEM_EVENT_ERROR 

Unspecified error.

◆ MODEM_STATUS

Modem Driver Status

Enumerator
MODEM_OK 

Operation succeeded.

MODEM_ERROR 

Unspecified error.

Function Documentation

◆ Modem_Dial()

MODEM_STATUS Modem_Dial ( const char *  dial_num)

Start dialing target number.

Parameters
[in]dial_numTarget number, a null-terminated string.
Returns
execution status MODEM_STATUS.

◆ Modem_Hangup()

MODEM_STATUS Modem_Hangup ( void  )

Hangup the line.

Returns
execution status MODEM_STATUS.

◆ Modem_Initialize()

MODEM_STATUS Modem_Initialize ( Modem_Request_t  cb_request,
const char *  init_string 
)

Initialize Modem Device.

Parameters
[in]cb_requestPointer to Modem_Request.
[in]init_stringPointer to modem initialization string.
Returns
execution status MODEM_STATUS.

◆ Modem_IsOnline()

bool Modem_IsOnline ( void  )

Check if modem is online.

Returns
  • true Modem is Online.
  • false Modem is Offline.

◆ Modem_Listen()

MODEM_STATUS Modem_Listen ( void  )

Start Modem Device listening mode.

Returns
execution status MODEM_STATUS.

◆ Modem_Notify()

void Modem_Notify ( MODEM_EVENT  event,
const char *  response 
)

Notify the Modem Driver of completion event.

Parameters
[in]eventNotification event MODEM_EVENT.
[in]responseActual modem response, a null-terminated string.
Returns
None.

◆ Modem_Request()

void Modem_Request ( const char *  command,
const char *  response,
uint32_t  timeout,
uint32_t  retries 
)

Request Callback function for the driver.

Parameters
[in]commandCommand to send to modem.
[in]responseExpected response from modem, or "#" for any response.
[in]timeoutResponse timeout in milliseconds.
[in]retriesNumber of retries.
Returns
None.
Note
Any response "#" disables internal processing and delivers modem responses in Modem_Notify.

◆ Modem_Uninitialize()

MODEM_STATUS Modem_Uninitialize ( void  )

De-initialize Modem Device.

Returns
execution status MODEM_STATUS.