Public Member Functions | |
virtual nsapi_error_t | clear () |
Clear modem to a default initial state. More... | |
virtual nsapi_error_t | hard_power_on () |
Sets the modem up for powering on This is equivalent to plugging in the device, i.e., attaching power and serial port. More... | |
virtual nsapi_error_t | hard_power_off () |
Sets the modem in unplugged state. More... | |
virtual nsapi_error_t | soft_power_on () |
Powers up the modem. More... | |
virtual nsapi_error_t | soft_power_off () |
Powers down the modem. More... | |
virtual nsapi_error_t | set_pin (const char *sim_pin) |
Open the SIM card by setting the pin code for SIM. More... | |
virtual nsapi_error_t | get_sim_state (SimState &state) |
Get SIM card's state. More... | |
virtual CellularContext * | create_context (const char *apn=NULL, bool cp_req=false, bool nonip_req=false) |
Creates a new CellularContext interface. More... | |
virtual void | delete_context (CellularContext *context) |
Deletes the given CellularContext instance. More... | |
virtual CellularNetwork * | open_network () |
Create new CellularNetwork interface. More... | |
virtual CellularInformation * | open_information () |
Create new CellularInformation interface. More... | |
virtual void | close_network () |
Closes the opened CellularNetwork by deleting the CellularNetwork instance. More... | |
virtual void | close_information () |
Closes the opened CellularInformation by deleting the CellularInformation instance. More... | |
virtual void | set_timeout (int timeout) |
Set the default response timeout. More... | |
virtual void | modem_debug_on (bool on) |
Turn modem debug traces on. More... | |
virtual nsapi_error_t | shutdown () |
Shutdown cellular device to minimum functionality. More... | |
virtual nsapi_error_t | is_ready () |
Check whether the device is ready to accept commands. More... | |
virtual void | set_ready_cb (Callback< void()> callback) |
Set callback function to listen when device is ready. More... | |
virtual nsapi_error_t | set_power_save_mode (int periodic_time, int active_time=0) |
Set power save mode. More... | |
virtual ATHandler * | get_at_handler () |
Get the current ATHandler instance in use for debug purposes etc. More... | |
virtual CellularContext * | get_context_list () const |
Get the linked list of CellularContext instances. More... | |
virtual nsapi_error_t | set_baud_rate (int baud_rate) |
Sets cellular modem to given baud rate. More... | |
intptr_t | get_property (CellularProperty key) |
Get value for the given key. More... | |
void | set_cellular_properties (const intptr_t *property_array) |
Cellular module need to define an array of cellular properties which defines module supported property values. More... | |
virtual events::EventQueue * | get_queue () |
Get event queue that can be chained to main event queue. More... | |
virtual CellularSMS * | open_sms ()=0 |
Create new CellularSMS interface. More... | |
virtual void | close_sms ()=0 |
Closes the opened CellularSMS by deleting the CellularSMS instance. More... | |
void | set_sim_pin (const char *sim_pin) |
Set the pin code for SIM card. More... | |
void | set_plmn (const char *plmn) |
Plmn to use when registering to cellular network. More... | |
nsapi_error_t | set_device_ready () |
Start the interface. More... | |
nsapi_error_t | set_sim_ready () |
Start the interface. More... | |
nsapi_error_t | register_to_network () |
Start the interface. More... | |
nsapi_error_t | attach_to_network () |
Start the interface. More... | |
void | attach (Callback< void(nsapi_event_t, intptr_t)> status_cb) |
Register callback for status reporting. More... | |
void | set_retry_timeout_array (const uint16_t timeout[], int array_len) |
Set an array of timeouts to wait before CellularStateMachine retries after failure. More... | |
Static Public Member Functions | |
static CellularDevice * | get_default_instance () |
Returns singleton instance of CellularDevice, if Mbed target board has a supported onboard modem, or provide-default is defined for a cellular driver in JSON configuration files. More... | |
static CellularDevice * | get_target_default_instance () |
Return target onboard instance of CellularDevice. More... | |
Protected Member Functions | |
virtual AT_CellularNetwork * | open_network_impl (ATHandler &at) |
Create new instance of AT_CellularNetwork or if overridden, modem specific implementation. More... | |
virtual AT_CellularContext * | create_context_impl (ATHandler &at, const char *apn, bool cp_req=false, bool nonip_req=false) |
Creates new instance of AT_CellularContext or if overridden, modem specific implementation. More... | |
virtual nsapi_error_t | init () |
Initialize cellular device must be called right after the module is ready. More... | |
virtual AT_CellularInformation * | open_information_impl (ATHandler &at) |
Create new instance of AT_CellularInformation or if overridden, modem specific implementation. More... | |
virtual void | cellular_callback (nsapi_event_t ev, intptr_t ptr, CellularContext *ctx=NULL) |
Cellular callback to be attached to Network and CellularStateMachine classes. More... | |
void | get_retry_timeout_array (uint16_t *timeout, int &array_len) const |
Get the retry array from the CellularStateMachine. More... | |
Definition at line 25 of file RM1000_AT.h.
|
inherited |
Register callback for status reporting.
The specified status callback function will be called on the network and cellular device status changes. The parameters on the callback are the event type and event-type dependent reason parameter.
status_cb | The callback for status changes. |
|
inherited |
Start the interface.
Attempts to attach the device to cellular network. API is asynchronous. Application can get results from CellularContext callback, which is set with attach(...), or callback, which is set by attach(...), in this class.
|
protectedvirtualinherited |
Cellular callback to be attached to Network and CellularStateMachine classes.
CellularContext calls this when in PPP mode to provide network changes. This method will broadcast to every interested classes: CellularContext (might be many) and CellularStateMachine if available.
Reimplemented from CellularDevice.
|
virtualinherited |
Clear modem to a default initial state.
Clear persistent user data from the modem, such as PDP contexts.
cellular.clear-on-connect: true
.Implements CellularDevice.
|
virtualinherited |
Closes the opened CellularInformation by deleting the CellularInformation instance.
Implements CellularDevice.
|
virtualinherited |
Closes the opened CellularNetwork by deleting the CellularNetwork instance.
Implements CellularDevice.
|
pure virtualinherited |
Closes the opened CellularSMS by deleting the CellularSMS instance.
|
virtualinherited |
Creates a new CellularContext interface.
fh | file handle used in communication to modem. This can be, for example, UART handle. If null, then the default file handle is used. |
apn | access point to use with context, can be null. |
cp_req | flag indicating if EPS control plane optimization is required |
nonip_req | flag indicating if this context is required to be Non-IP |
Implements CellularDevice.
|
protectedvirtual |
Creates new instance of AT_CellularContext or if overridden, modem specific implementation.
at | ATHandler reference for communication with the modem. |
apn | access point to use with context |
cp_req | flag indicating if control plane EPS optimization needs to be setup |
nonip_req | flag indicating if PDP context needs to be Non-IP |
Reimplemented from AT_CellularDevice.
|
virtualinherited |
Deletes the given CellularContext instance.
context | CellularContext to delete |
Implements CellularDevice.
|
virtualinherited |
Get the current ATHandler instance in use for debug purposes etc.
Implements CellularDevice.
|
virtualinherited |
Get the linked list of CellularContext instances.
Implements CellularDevice.
|
staticinherited |
Returns singleton instance of CellularDevice, if Mbed target board has a supported onboard modem, or provide-default is defined for a cellular driver in JSON configuration files.
Otherwise returns NULL. See NetworkInterface::get_default_instance for details.
|
inherited |
Get value for the given key.
key | key for value to be fetched |
|
virtualinherited |
Get event queue that can be chained to main event queue.
|
protectedinherited |
Get the retry array from the CellularStateMachine.
Array is used in retry logic. Array contains seconds and retry logic uses those second to wait before trying again.
timeout | timeout array containing seconds for retry logic. Must have space for CELLULAR_RETRY_ARRAY_SIZE (defined in CellularCommon.h) |
array_len | length of the timeout array on return |
|
virtualinherited |
Get SIM card's state.
state | current state of SIM |
Implements CellularDevice.
Reimplemented in UBLOX_N2XX, QUECTEL_BC95, and QUECTEL_M26.
|
staticinherited |
Return target onboard instance of CellularDevice.
|
virtualinherited |
Sets the modem in unplugged state.
This is equivalent to pulling the plug off of the device, i.e., detaching power and serial port.
This puts the modem in the lowest power state.
Implements CellularDevice.
Reimplemented in TELIT_ME310, TELIT_ME910, and QUECTEL_EC2X.
|
virtualinherited |
Sets the modem up for powering on This is equivalent to plugging in the device, i.e., attaching power and serial port.
In general, hard_power_on and soft_power_on provides a simple hardware abstraction layer on top of the modem drivers written for Mbed OS; they can be overridden in a derived class to perform custom power controls in a particular board configuration. In many boards this will be a no-op if there is no separate power supply control circuitry.
Implements CellularDevice.
Reimplemented in TELIT_ME310, TELIT_ME910, and QUECTEL_EC2X.
|
protectedvirtual |
Initialize cellular device must be called right after the module is ready.
For example, when multiple cellular modules are supported in a single driver this function detects and adapts to an actual module at runtime.
Reimplemented from AT_CellularDevice.
|
virtualinherited |
Check whether the device is ready to accept commands.
Implements CellularDevice.
|
virtualinherited |
|
virtualinherited |
Create new CellularInformation interface.
fh | file handle used in communication to modem. This can be, for example, UART handle. If null, then the default file handle is used. |
Implements CellularDevice.
|
protectedvirtualinherited |
Create new instance of AT_CellularInformation or if overridden, modem specific implementation.
at | ATHandler reference for communication with the modem. |
Reimplemented in GEMALTO_CINTERION, QUECTEL_BC95, and QUECTEL_BG96.
|
virtualinherited |
Create new CellularNetwork interface.
fh | file handle used in communication to modem. This can be, for example, UART handle. If null, then the default file handle is used. |
Implements CellularDevice.
|
protectedvirtual |
Create new instance of AT_CellularNetwork or if overridden, modem specific implementation.
at | ATHandler reference for communication with the modem. |
Reimplemented from AT_CellularDevice.
|
pure virtualinherited |
Create new CellularSMS interface.
fh | file handle used in communication to modem. This can be, for example, UART handle. If null, then the default file handle is used. |
|
inherited |
Start the interface.
Attempts to register the device to cellular network. API is asynchronous. Application can get results from CellularContext callback, which is set with attach(...), or callback, which is set by attach(...), in this class.
|
virtualinherited |
Sets cellular modem to given baud rate.
baud_rate |
Implements CellularDevice.
|
inherited |
Cellular module need to define an array of cellular properties which defines module supported property values.
property_array | array of module properties |
|
inherited |
Start the interface.
Initializes the modem for communication. API is asynchronous. Application can get results from CellularContext callback, which is set with attach(...), or callback, which is set by attach(...), in this class.
|
virtualinherited |
Open the SIM card by setting the pin code for SIM.
sim_pin | PIN for the SIM card |
Implements CellularDevice.
Reimplemented in UBLOX_N2XX.
|
inherited |
Plmn to use when registering to cellular network.
If plmn is set, then registering is forced to this plmn. If plmn is not set, then automatic registering is used when registering to a cellular network. It doesn't start any operations.
plmn | plmn used when registering to cellular network |
|
virtualinherited |
Set power save mode.
periodic_time | in seconds to enable power save, or zero to disable |
active_time | in seconds to wait before entering power save mode |
Implements CellularDevice.
Reimplemented in SARA4_PPP.
|
virtualinherited |
Set callback function to listen when device is ready.
callback | function to call on device ready, or NULL to remove callback. |
Implements CellularDevice.
Reimplemented in QUECTEL_BG96.
|
inherited |
Set an array of timeouts to wait before CellularStateMachine retries after failure.
To disable retry behavior completely use set_retry_timeout_array(NULL, 0)
. CellularContext callback event cell_callback_data_t.final_try
indicates true when all retries have failed.
set_retry_timeout_array
for CellularStateMachine to wait before it retries again after failure, this is useful to send repetitive requests when don't know exactly when modem is ready to accept requests. Use set_timeout
for timeout how long to wait for a response from modem for each request, this is useful if modem can accept requests but processing takes long time before sending response.timeout | timeout array using seconds |
array_len | length of the array |
|
inherited |
Set the pin code for SIM card.
sim_pin | PIN for the SIM card |
|
inherited |
Start the interface.
Attempts to open the sim. API is asynchronous. Application can get results from CellularContext callback, which is set with attach(...), or callback, which is set by attach(...), in this class.
|
virtualinherited |
Set the default response timeout.
timeout
.timeout | milliseconds to wait response from modem |
Implements CellularDevice.
|
virtualinherited |
Shutdown cellular device to minimum functionality.
Actual functionality is modem specific, for example UART may is not be responsive without explicit wakeup signal (such as RTS) after shutdown.
Reimplemented from CellularDevice.
Reimplemented in QUECTEL_M26.
|
virtualinherited |
Powers down the modem.
This is equivalent to turning off the modem by button press.
Implements CellularDevice.
Reimplemented in STModCellular, TELIT_ME310, TELIT_ME910, QUECTEL_BG96, and QUECTEL_EC2X.
|
virtualinherited |
Powers up the modem.
This is equivalent to pressing the "power button" to activate or reset the modem and usually implemented as a short pulse on a dedicated GPIO signal. It is expected to be present to make it possible to reset the modem. The driver may repeat this if the modem is not responsive to AT commands.
Implements CellularDevice.
Reimplemented in STModCellular, TELIT_ME310, TELIT_ME910, QUECTEL_BG96, ALT1250_PPP, and QUECTEL_EC2X.