Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
AT_CellularPower Class Reference
Class AT_CellularPower. More...
#include <AT_CellularPower.h>
Inherits mbed::CellularPower, and mbed::AT_CellularBase.
Inherited by QUECTEL_BC95_CellularPower, QUECTEL_BG96_CellularPower, QUECTEL_UG96_CellularPower, SARA4_PPP_CellularPower, TELIT_HE910_CellularPower, UBLOX_AT_CellularPower, and UBLOX_PPP_CellularPower.
Public Types | |
enum | SupportedFeature |
Cellular module need to define an array of unsupported features if any, by default all features are supported. More... | |
Public Member Functions | |
virtual nsapi_error_t | on () |
Set cellular device power on. | |
virtual nsapi_error_t | off () |
Set cellular device power off. | |
virtual nsapi_error_t | set_at_mode () |
Set AT command mode. | |
virtual nsapi_error_t | set_power_level (int func_level, int do_reset=0) |
Set cellular device power level by enabling/disabling functionality. | |
virtual nsapi_error_t | reset () |
Reset and wake-up cellular device. | |
virtual nsapi_error_t | opt_power_save_mode (int periodic_time, int active_time) |
Opt for power save setting on cellular device. | |
virtual nsapi_error_t | opt_receive_period (int mode, EDRXAccessTechnology act_type, uint8_t edrx_value) |
Opt for discontinuous reception on cellular device. | |
virtual nsapi_error_t | is_device_ready () |
Check whether the device is ready to accept commands. | |
virtual nsapi_error_t | set_device_ready_urc_cb (mbed::Callback< void()> callback) |
Set URC callback function for device specific ready urc. | |
virtual void | remove_device_ready_urc_cb (mbed::Callback< void()> callback) |
Removes the device ready urc from the list of urc's. | |
ATHandler & | get_at_handler () |
Getter for at handler. | |
device_err_t | get_device_error () const |
Gets the device error that happened when using AT commands/responses. | |
Static Protected Attributes | |
static const SupportedFeature * | _unsupported_features |
Check if some functionality is supported by a cellular module. |
Detailed Description
Class AT_CellularPower.
Class that provides power handling functions for modem/module.
Definition at line 31 of file AT_CellularPower.h.
Member Enumeration Documentation
enum SupportedFeature [inherited] |
Cellular module need to define an array of unsupported features if any, by default all features are supported.
- Parameters:
-
features Array of type SupportedFeature with last element FEATURE_END_MARK
Definition at line 50 of file AT_CellularBase.h.
Member Function Documentation
ATHandler & get_at_handler | ( | ) | [inherited] |
Getter for at handler.
Common method for all AT-classes.
- Returns:
- reference to ATHandler
Definition at line 27 of file AT_CellularBase.cpp.
device_err_t get_device_error | ( | ) | const [inherited] |
Gets the device error that happened when using AT commands/responses.
This is at error returned by the device. Returned CME/CMS errors can be found from 3gpp documents 27007 and 27005.
- Returns:
- at error (CME/CMS) while communicating with the device
Definition at line 32 of file AT_CellularBase.cpp.
nsapi_error_t is_device_ready | ( | ) | [virtual] |
Check whether the device is ready to accept commands.
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularPower.
Definition at line 237 of file AT_CellularPower.cpp.
nsapi_error_t off | ( | ) | [virtual] |
Set cellular device power off.
Default implementation is empty. Device power on/off is modem/board specific behavior and must be done on inherited class if needed. Power off is done by toggling power pin/button.
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_UNSUPPORTED if not overridden by the target modem
Implements CellularPower.
Definition at line 42 of file AT_CellularPower.cpp.
nsapi_error_t on | ( | ) | [virtual] |
Set cellular device power on.
Default implementation is empty. Device power on/off is modem/board specific behavior and must be done on inherited class if needed. Power on is done by toggling power pin/button.
- Remarks:
- set_at_mode must be called to initialise modem
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_UNSUPPORTED if not overridden by the target modem
Implements CellularPower.
Definition at line 37 of file AT_CellularPower.cpp.
nsapi_error_t opt_power_save_mode | ( | int | periodic_time, |
int | active_time | ||
) | [virtual] |
Opt for power save setting on cellular device.
If both parameters are zero, this disables PSM.
- Remarks:
- See 3GPP TS 27.007 PSM for details
- Parameters:
-
periodic_time Timeout in seconds IoT subsystem is not expecting messaging active_time Timeout in seconds IoT subsystem waits for response
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Table 10.5.163a/3GPP TS 24.008: GPRS Timer 3 information element
Bits 5 to 1 represent the binary coded timer value.
Bits 6 to 8 defines the timer value unit for the GPRS timer as follows: 8 7 6 0 0 0 value is incremented in multiples of 10 minutes 0 0 1 value is incremented in multiples of 1 hour 0 1 0 value is incremented in multiples of 10 hours 0 1 1 value is incremented in multiples of 2 seconds 1 0 0 value is incremented in multiples of 30 seconds 1 0 1 value is incremented in multiples of 1 minute 1 1 0 value is incremented in multiples of 320 hours (NOTE 1) 1 1 1 value indicates that the timer is deactivated (NOTE 2).
Table 10.5.172/3GPP TS 24.008: GPRS Timer information element
Bits 5 to 1 represent the binary coded timer value.
Bits 6 to 8 defines the timer value unit for the GPRS timer as follows:
8 7 6 0 0 0 value is incremented in multiples of 2 seconds 0 0 1 value is incremented in multiples of 1 minute 0 1 0 value is incremented in multiples of decihours 1 1 1 value indicates that the timer is deactivated.
Other values shall be interpreted as multiples of 1 minute in this version of the protocol.
Implements CellularPower.
Definition at line 87 of file AT_CellularPower.cpp.
nsapi_error_t opt_receive_period | ( | int | mode, |
EDRXAccessTechnology | act_type, | ||
uint8_t | edrx_value | ||
) | [virtual] |
Opt for discontinuous reception on cellular device.
- Remarks:
- See 3GPP TS 27.007 eDRX for details.
- Parameters:
-
mode disable or enable the use of eDRX act_type type of access technology edrx_value requested edxr value. Extended DRX parameters information element.
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularPower.
Definition at line 218 of file AT_CellularPower.cpp.
void remove_device_ready_urc_cb | ( | mbed::Callback< void()> | callback ) | [virtual] |
Removes the device ready urc from the list of urc's.
- Parameters:
-
callback callback to remove from the list of urc's
Implements CellularPower.
Definition at line 261 of file AT_CellularPower.cpp.
nsapi_error_t reset | ( | ) | [virtual] |
Reset and wake-up cellular device.
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularPower.
Definition at line 75 of file AT_CellularPower.cpp.
nsapi_error_t set_at_mode | ( | ) | [virtual] |
Set AT command mode.
Blocking until success or failure.
- Remarks:
- must be called after power on to prepare correct AT mode
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularPower.
Definition at line 47 of file AT_CellularPower.cpp.
nsapi_error_t set_device_ready_urc_cb | ( | mbed::Callback< void()> | callback ) | [virtual] |
Set URC callback function for device specific ready urc.
URC is defined in device specific power API. Used in startup sequence to listen when device is ready for using at commands and possible sim.
- Parameters:
-
callback Callback function called when urc received
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_NO_MEMORY on memory failure NSAPI_ERROR_UNSUPPORTED if not overridden by the target modem
Implements CellularPower.
Definition at line 256 of file AT_CellularPower.cpp.
nsapi_error_t set_power_level | ( | int | func_level, |
int | do_reset = 0 |
||
) | [virtual] |
Set cellular device power level by enabling/disabling functionality.
- Parameters:
-
func_level,: 0 minimum functionality 1 full functionality. Enable (turn on) the transmit and receive RF circuits for all supported radio access technologies. For MTs supporting +CSRA, this equals the RATs indicated by the response of +CSRA=?. Current +CSRA setting is ignored. It is not required that the MT transmit and receive RF circuits are in a disabled state for this setting to have effect. 2 disable (turn off) MT transmit RF circuits only 3 disable (turn off) MT receive RF circuits only 4 disable (turn off) both MT transmit and receive RF circuits do_reset 0 for do not reset, 1 for reset the device when changing the functionality
- Remarks:
- See 3GPP TS 27.007 CFUN for more details
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularPower.
Definition at line 63 of file AT_CellularPower.cpp.
Field Documentation
AT_CellularBase::SupportedFeature const * _unsupported_features [static, protected, inherited] |
Check if some functionality is supported by a cellular module.
For example, most of standard AT commands are optional and not implemented by all cellular modules.
- Parameters:
-
feature check for feature to support
- Returns:
- true on supported, otherwise false
Definition at line 67 of file AT_CellularBase.h.
Generated on Tue Aug 9 2022 00:37:38 by
