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 22:779971811c46, committed 2019-04-10
- Comitter:
- wajahat.abbas@u-blox.com
- Date:
- Wed Apr 10 12:05:55 2019 +0500
- Parent:
- 21:98aea8f49cd8
- Child:
- 23:eaab8e812a5d
- Commit message:
- Changed arguments type to int for get uart/mno methods
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 Fri Mar 22 15:47:18 2019 +0500 +++ b/UbloxCellularBase.cpp Wed Apr 10 12:05:55 2019 +0500 @@ -1095,7 +1095,7 @@ return success; } -bool UbloxCellularBase::get_modem_rat(RAT *selected_rat, RAT *preferred_rat, RAT *second_preferred_rat) +bool UbloxCellularBase::get_modem_rat(int *selected_rat, int *preferred_rat, int *second_preferred_rat) { bool success = false; char buf[24] = {0x00}; @@ -1114,11 +1114,11 @@ LOCK(); if (_at->send("AT+URAT?") && _at->recv("%23[^\n]\nOK\n", buf)) { - if (sscanf(buf, "+URAT: %d,%d,%d", (int*)selected_rat, (int*)preferred_rat, (int*)second_preferred_rat) == 3) { + if (sscanf(buf, "+URAT: %d,%d,%d", selected_rat, preferred_rat, second_preferred_rat) == 3) { success = true; - } else if (sscanf(buf, "+URAT: %d,%d", (int*)selected_rat, (int*)preferred_rat) == 2) { + } else if (sscanf(buf, "+URAT: %d,%d", selected_rat, preferred_rat) == 2) { success = true; - } else if (sscanf(buf, "+URAT: %d", (int*)selected_rat) == 1) { + } else if (sscanf(buf, "+URAT: %d", selected_rat) == 1) { success = true; } } @@ -1160,9 +1160,9 @@ { bool return_val = false; - MNOProfile mno_profile; + int mno_profile; if (get_mno_profile(&mno_profile)) { - tr_info("Current MNO profile is: %d", (int)mno_profile); + tr_info("Current MNO profile is: %d", mno_profile); if (mno_profile != profile) { if (is_registered_csd() || is_registered_psd() || is_registered_eps()) { @@ -1188,7 +1188,7 @@ return return_val; } -bool UbloxCellularBase::get_mno_profile(MNOProfile *profile) +bool UbloxCellularBase::get_mno_profile(int *profile) { bool return_val = false; @@ -1199,7 +1199,7 @@ LOCK(); MBED_ASSERT(_at != NULL); - if ( (_at->send("AT+UMNOPROF?") && _at->recv("+UMNOPROF: %d", (int*)profile) && _at->recv("OK")) ) { + if ( (_at->send("AT+UMNOPROF?") && _at->recv("+UMNOPROF: %d", profile) && _at->recv("OK")) ) { return_val = true; }
--- a/UbloxCellularBase.h Fri Mar 22 15:47:18 2019 +0500 +++ b/UbloxCellularBase.h Wed Apr 10 12:05:55 2019 +0500 @@ -188,7 +188,7 @@ LTE_CATM1 = 7, LTE_CATNB1 = 8, GPRS_EGPRS = 9, - NOT_USED = 255 + NOT_USED = -1 } RAT; #ifdef TARGET_UBLOX_C030_R41XM @@ -229,7 +229,7 @@ * @param profile pointer to variable that can hold the value for returned profile * @return true if operation was successful, false if there was an error */ - bool get_mno_profile(MNOProfile *profile); + bool get_mno_profile(int *profile); #endif /** Set Radio Access Technology on modem. @@ -254,7 +254,7 @@ * * @return true if successful, otherwise false. */ - bool get_modem_rat(RAT *selected_rat, RAT *preferred_rat, RAT *second_preferred_rat); + bool get_modem_rat(int *selected_rat, int *preferred_rat, int *second_preferred_rat); /** reboot the modem using AT+CFUN=15. *