Base class for the ublox-xxx-cellular-xxx classes. Cannot be used standalone, only inherited by classes that do properly useful stuff. Or, to put it another way, if you are using any of the ublox-xxx-cellular-xxx classes, you will need this class also.
Dependents: example-ublox-cellular-interface example-ublox-cellular-driver-gen HelloMQTT example-ublox-cellular-interface_r410M ... more
Diff: UbloxCellularBase.h
- Revision:
- 34:d239824bfb8f
- Parent:
- 31:b0a6a610d114
- Child:
- 35:24f29bf0d810
--- a/UbloxCellularBase.h Wed Sep 04 16:29:43 2019 +0500 +++ b/UbloxCellularBase.h Wed Oct 09 15:13:04 2019 +0500 @@ -187,12 +187,12 @@ */ bool change_sim_pin(const char *new_pin); - /** Get the IMEI. + /** Get the IMEI. * * @return true if successful, otherwise false. */ MBED_DEPRECATED("This method is now replaced by const char * imei(), please use that instead") - bool get_imei(char *imei_to_send, int size); + bool get_imei(char *imei_to_send, int size); /** Get the IMEI of the module. * @@ -259,23 +259,20 @@ } FunctionalityMode; #ifdef TARGET_UBLOX_C030_R41XM - - #if MBED_CONF_UBLOX_CELL_DEFAULT_MNO_PROFILE - #define DEFAULT_MNO_PROFILE (MNOProfile)MBED_CONF_UBLOX_CELL_DEFAULT_MNO_PROFILE - #else - #define DEFAULT_MNO_PROFILE SW_DEFAULT - #endif - - /** Reads the current MNO profile from modem and sets it to user specified profile. - * User can also specify profile in mbed_lib.json file and call set_mno_profile without any arguments. + /** Set MNO profile. Profile will be applied on next boot. + * + * User can also specify profile in mbed_lib.json ("default-mno-profile": 100) and in that case profile will be applied in init(). + * Modem will also be rebooted so that profile parameters can be applied. * * Note: MNO profile should only be set in detached state and a reboot is required for settings to take effect * Note 2: ref to UBX-17003787 B.5, setting MNO profile can change other parameters such as PSM, Band mask, URAT etc. * Application must always set a profile first and if required, change parameters afterwards. + * Note 3: ref to UBX-17003787 B.5, some profiles have locked parameters and modem will return ERROR if you try to change those. + * It is suggested to switch to a profile e.g. STANDARD_EU (100) and then change the parameters as required. * @param profile MNO profile to use * @return true if operation was successful, false if there was an error */ - bool set_mno_profile(MNOProfile profile = DEFAULT_MNO_PROFILE); + bool set_mno_profile(MNOProfile profile); /** Get current MNO profile. * @@ -492,6 +489,12 @@ * @return True if successful, otherwise false. */ bool get_band_bitmask(uint64_t *m1_bitmask, uint64_t *nb1_bitmask); + + /** disables the PSM + * + * @return True if successful, otherwise false. + */ + bool disable_psm(); #endif protected: @@ -690,6 +693,24 @@ */ bool power_up(); + /** Setup the modem baudrate, echo and flow control + * + * @return true if successful, otherwise false. + */ + bool setup_modem(); + + /** Check if modem is accepting AT commands + * + * @return true if successful, otherwise false. + */ + bool is_modem_ready(); + + /** Powers up the modem and set it up for application use. + * + * @return true if successful, otherwise false. + */ + bool initialize_modem(); + /** Power down the modem. */ void power_down(); @@ -773,8 +794,14 @@ void CEREG_URC(); void UMWI_URC(); #ifdef TARGET_UBLOX_C030_R412M + typedef enum { + DISABLED = 0, + ENABLED = 1, + UNKNOWN = 2 + } PSMStatus; + bool set_psm_urcs(bool enable); void UUPSMR_URC(); - bool _psm_status; + PSMStatus _psm_status; void *_cb_param_psm_going_in; Callback<void(void*)> _func_psm_going_in; /**< Callback. */ void *_cb_param_psm_coming_out; @@ -782,7 +809,7 @@ void set_modem_psm_state(int state); #endif #ifdef TARGET_UBLOX_C030_R41XM - bool _edrx_configured; + bool _default_profile_is_set; #endif };