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
Revision 30:38230504a646, committed 2019-08-27
- Comitter:
- fahimalavi
- Date:
- Tue Aug 27 18:38:29 2019 +0500
- Parent:
- 29:8a38f91009ad
- Child:
- 31:b0a6a610d114
- Commit message:
- Support for Band select bitmask feature added
Changed in this revision
UbloxCellularBase.cpp | Show annotated file Show diff for this revision Revisions of this file |
UbloxCellularBase.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/UbloxCellularBase.cpp Mon Aug 26 14:55:37 2019 +0500 +++ b/UbloxCellularBase.cpp Tue Aug 27 18:38:29 2019 +0500 @@ -1511,7 +1511,37 @@ return integer_output; } -#endif + +bool UbloxCellularBase::set_band_bitmask(RAT rat, uint64_t bitmask) { + + bool status = false; + UBandmaskRAT eBandMastRat; + + if(rat == LTE_CATM1) { + eBandMastRat = UBANDMASK_RAT_LTE_CATM1; + } + else if(rat == LTE_CATNB1) { + eBandMastRat = UBANDMASK_RAT_LTE_CATNB1; + } + else { + tr_error("Invalid RAT for Band mask selection: %d", rat); + + return false; + } + + tr_info("UBANDMASK RAT %d, bitmask : %llu", eBandMastRat, bitmask); + + LOCK(); + + if (_at->send("AT+UBANDMASK=%d,%llu", eBandMastRat, bitmask) && _at->recv("OK")) { + + status = true; + } + UNLOCK(); + + return status; +} +#endif //TARGET_UBLOX_C030_R41XM #ifdef TARGET_UBLOX_C030_R412M bool UbloxCellularBase::get_power_saving_mode(int *status, int *periodic_time, int *active_time)
--- a/UbloxCellularBase.h Mon Aug 26 14:55:37 2019 +0500 +++ b/UbloxCellularBase.h Tue Aug 27 18:38:29 2019 +0500 @@ -100,6 +100,33 @@ EDRXEUTRAN_NB_S1_mode }tEDRXAccessTechnology; +#ifdef TARGET_UBLOX_C030_R41XM + /** Supported MNO profiles for SARA-R4. + */ + typedef enum { + SW_DEFAULT = 0, + SIM_ICCID = 1, + ATT = 2, + TMO = 5, + VODAFONE = 19, + DT = 31, + STANDARD_EU = 100 +#ifdef TARGET_UBLOX_C030_R410M + , VERIZON = 3, + TELSTRA = 4, + CT = 6, + SPRINT = 8, + TELUS = 21 +#endif + } MNOProfile; + + typedef enum { + UBANDMASK_RAT_LTE_CATM1 = 0, + UBANDMASK_RAT_LTE_CATNB1 = 1 + + } UBandmaskRAT; +#endif + /** Initialise the modem, ready for use. * * @param pin PIN for the SIM card. @@ -232,24 +259,6 @@ } FunctionalityMode; #ifdef TARGET_UBLOX_C030_R41XM - /** Supported MNO profiles for SARA-R4. - */ - typedef enum { - SW_DEFAULT = 0, - SIM_ICCID = 1, - ATT = 2, - TMO = 5, - VODAFONE = 19, - DT = 31, - STANDARD_EU = 100 -#ifdef TARGET_UBLOX_C030_R410M - , VERIZON = 3, - TELSTRA = 4, - CT = 6, - SPRINT = 8, - TELUS = 21 -#endif - } MNOProfile; #if MBED_CONF_UBLOX_CELL_DEFAULT_MNO_PROFILE #define DEFAULT_MNO_PROFILE (MNOProfile)MBED_CONF_UBLOX_CELL_DEFAULT_MNO_PROFILE @@ -467,6 +476,14 @@ * @return uint32_t */ uint32_t get_receive_period(); + + /** set band select bitmask + * + * @param RAT RAT type + * @param bitmask bitmask + * @return True if successful, otherwise false. + */ + bool set_band_bitmask(RAT rat, uint64_t bitmask); #endif protected: