Embedded Wireless Framework
Macros | Functions
Modem adapter common API

The common modem functions. More...

Macros

#define EWF_ADAPTER_MODEM_FUNCTIONALITY_MINIMUM   ("0")
 
#define EWF_ADAPTER_MODEM_FUNCTIONALITY_FULL   ("1")
 
#define EWF_ADAPTER_MODEM_FUNCTIONALITY_DISABLE_TX   ("2")
 
#define EWF_ADAPTER_MODEM_FUNCTIONALITY_DISABLE_RX   ("3")
 
#define EWF_ADAPTER_MODEM_FUNCTIONALITY_DISABLE_ME   ("4")
 

Functions

ewf_result ewf_adapter_modem_custom_command_send (ewf_adapter *adapter_ptr, const char *command_str)
 Function to send command that is not implmented in the framework. More...
 
ewf_result ewf_adapter_modem_custom_command_receive (ewf_adapter *adapter_ptr, char **buffer_ptr_ptr, uint32_t *buffer_length_ptr)
 Function to read command that is not implmented in the framework. More...
 
ewf_result ewf_adapter_modem_functionality_set (ewf_adapter *adapter_ptr, const char *fun_str)
 Set the modem functionality (+cfun) More...
 
ewf_result ewf_adapter_modem_functionality_read (ewf_adapter *adapter_ptr, uint8_t *fun)
 Read the modem functionality (+cfun?) More...
 
ewf_result ewf_adapter_modem_clock_set (ewf_adapter *adapter_ptr, ewf_adapter_modem_time *time_info_ptr)
 Set the clock (+cclk) More...
 
ewf_result ewf_adapter_modem_clock_read (ewf_adapter *adapter_ptr, ewf_adapter_modem_time *time_info_ptr)
 Read the clock (+cclk) More...
 
ewf_result ewf_adapter_modem_alarm_set (ewf_adapter *adapter_ptr, ewf_adapter_modem_time *alarm_info_ptr, uint8_t n, uint32_t type, const char *text_str, uint32_t text_len, const char *recurr_str, uint32_t recurr_len, bool silent)
 Set the alarm (+cala) More...
 
ewf_result ewf_adapter_modem_alarm_delete (ewf_adapter *adapter_ptr, uint32_t index)
 Delete the alarm (+cald) More...
 
ewf_result ewf_adapter_modem_commands_list_read (ewf_adapter *adapter_ptr, const char **buffer_ptr_ptr, uint32_t *response_length_ptr)
 Read the list of commands (+clac) More...
 
ewf_result ewf_adapter_modem_extended_err_report_read (ewf_adapter *adapter_ptr, uint16_t *report)
 Read extended error report (+ceer) More...
 
ewf_result ewf_adapter_modem_indicator_status_read (ewf_adapter *adapter_ptr, char *indicator_ptr, uint32_t *indicator_len)
 Read status of MT indicators (+cind) More...
 

Detailed Description

The common modem functions.

Parameters
[in]adapter_ptrA pointer to the adapter structure

Macro Definition Documentation

◆ EWF_ADAPTER_MODEM_FUNCTIONALITY_DISABLE_ME

#define EWF_ADAPTER_MODEM_FUNCTIONALITY_DISABLE_ME   ("4")

Disable ME

◆ EWF_ADAPTER_MODEM_FUNCTIONALITY_DISABLE_RX

#define EWF_ADAPTER_MODEM_FUNCTIONALITY_DISABLE_RX   ("3")

Disable reception

◆ EWF_ADAPTER_MODEM_FUNCTIONALITY_DISABLE_TX

#define EWF_ADAPTER_MODEM_FUNCTIONALITY_DISABLE_TX   ("2")

Disable transmission

◆ EWF_ADAPTER_MODEM_FUNCTIONALITY_FULL

#define EWF_ADAPTER_MODEM_FUNCTIONALITY_FULL   ("1")

Full modem functionality

◆ EWF_ADAPTER_MODEM_FUNCTIONALITY_MINIMUM

#define EWF_ADAPTER_MODEM_FUNCTIONALITY_MINIMUM   ("0")

Minimum modem functionality

Function Documentation

◆ ewf_adapter_modem_alarm_delete()

ewf_result ewf_adapter_modem_alarm_delete ( ewf_adapter adapter_ptr,
uint32_t  index 
)

Delete the alarm (+cald)

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]indexIndex of the alarm to be deleted.
Returns
ewf_result status code

◆ ewf_adapter_modem_alarm_set()

ewf_result ewf_adapter_modem_alarm_set ( ewf_adapter adapter_ptr,
ewf_adapter_modem_time alarm_info_ptr,
uint8_t  n,
uint32_t  type,
const char *  text_str,
uint32_t  text_len,
const char *  recurr_str,
uint32_t  recurr_len,
bool  silent 
)

Set the alarm (+cala)

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]alarm_infoPointer to structure holding alarm time values.
[in]nInteger indicaitng the index of alarm
[in]typeInteger indicating type of alarm. Defaults are manufacturer specific
[in]text_strPointer to string indicating the text to be displayed
[in]text_lenMaximum Lenght of text
[in]recurr_strPointer to string indicating days of week for recurring alarm. Eg If alarm is to recurr on Monday, Wednesday and Sunday then the string will be "1,3,7". The string "1,2,3,4,5" is used to set an alarm for all weekdays.
[in]recurr_lenMaximum length of recurr string
[in]silentInteger to indicate if alarm is silent or not.
Returns
ewf_result status code

◆ ewf_adapter_modem_clock_read()

ewf_result ewf_adapter_modem_clock_read ( ewf_adapter adapter_ptr,
ewf_adapter_modem_time time_info_ptr 
)

Read the clock (+cclk)

Parameters
[in]adapter_ptrA pointer to the adapter structure
[out]time_info_ptrpointer to structure holding clock time values.
Returns
ewf_result status code

◆ ewf_adapter_modem_clock_set()

ewf_result ewf_adapter_modem_clock_set ( ewf_adapter adapter_ptr,
ewf_adapter_modem_time time_info_ptr 
)

Set the clock (+cclk)

Parameters
[in]adapter_ptrA pointer to the adapter structure
[out]time_info_ptrpointer to structure holding clock time values.
Returns
ewf_result status code

◆ ewf_adapter_modem_commands_list_read()

ewf_result ewf_adapter_modem_commands_list_read ( ewf_adapter adapter_ptr,
const char **  buffer_ptr_ptr,
uint32_t *  response_length_ptr 
)

Read the list of commands (+clac)

Parameters
[in]adapter_ptrA pointer to the adapter structure
[out]buffer_ptr_ptrPointer to buffer holding the output list of all the commands
[out]buffer_length_ptr_ptrPointer to lenght of buffer
Returns
ewf_result status code

◆ ewf_adapter_modem_custom_command_receive()

ewf_result ewf_adapter_modem_custom_command_receive ( ewf_adapter adapter_ptr,
char **  buffer_ptr_ptr,
uint32_t *  buffer_length_ptr 
)

Function to read command that is not implmented in the framework.

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]buffer_ptr_ptrA pointer to a string destination holding the output of read command
[in]buffer_length_ptrLenght of the data in output buffer
Returns
ewf_result status code

◆ ewf_adapter_modem_custom_command_send()

ewf_result ewf_adapter_modem_custom_command_send ( ewf_adapter adapter_ptr,
const char *  command_str 
)

Function to send command that is not implmented in the framework.

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]buffer_ptrA pointer to a string holding the command to be sent
[in]buffer_lenght_ptrLenght of the command to be sent to the modem
Returns
ewf_result status code

◆ ewf_adapter_modem_extended_err_report_read()

ewf_result ewf_adapter_modem_extended_err_report_read ( ewf_adapter adapter_ptr,
uint16_t *  report 
)

Read extended error report (+ceer)

Parameters
[in]adapter_ptrA pointer to the adapter structure
[out]reportPointer to integer indicating report
Note
This is an optional command and not all modems will have this implemented
Returns
ewf_result status code

◆ ewf_adapter_modem_functionality_read()

ewf_result ewf_adapter_modem_functionality_read ( ewf_adapter adapter_ptr,
uint8_t *  fun 
)

Read the modem functionality (+cfun?)

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]optionA pointer to a integer with the functionality level
Returns
ewf_result status code

◆ ewf_adapter_modem_functionality_set()

ewf_result ewf_adapter_modem_functionality_set ( ewf_adapter adapter_ptr,
const char *  fun_str 
)

Set the modem functionality (+cfun)

Parameters
[in]adapter_ptrA pointer to the adapter structure
[in]funString indicating the functionality value
Returns
ewf_result status code

◆ ewf_adapter_modem_indicator_status_read()

ewf_result ewf_adapter_modem_indicator_status_read ( ewf_adapter adapter_ptr,
char *  indicator_ptr,
uint32_t *  indicator_len 
)

Read status of MT indicators (+cind)

Parameters
[in]adapter_ptrA pointer to the adapter structure
[out]indicator_ptrPointer to buffer contianing inidcator status options
[out]indicator_lenLenght of data in indicator buffer
Note
This api will output complete output string from +cind. User application is expected to parse the output to get required values as per the modem used as the descriptions will differ accross modem manufacturers
Returns
ewf_result status code