getmno

Files at this revision

API Documentation at this revision

Comitter:
wajahat.abbas@u-blox.com
Date:
Thu Aug 22 10:11:00 2019 +0500
Parent:
28:a8e1f25a8a52
Commit message:
%d not working as expected

Changed in this revision

UbloxCellularBase.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a8e1f25a8a52 -r d75e2e4084a6 UbloxCellularBase.cpp
--- a/UbloxCellularBase.cpp	Mon Aug 05 11:55:52 2019 +0500
+++ b/UbloxCellularBase.cpp	Thu Aug 22 10:11:00 2019 +0500
@@ -1313,6 +1313,7 @@
 bool UbloxCellularBase::get_mno_profile(int *profile)
 {
     bool return_val = false;
+    char buf[4] = {0x00};
 
     if (profile == NULL) {
         return false;
@@ -1321,7 +1322,8 @@
     LOCK();
     MBED_ASSERT(_at != NULL);
 
-    if ( (_at->send("AT+UMNOPROF?") && _at->recv("+UMNOPROF: %d", profile) && _at->recv("OK")) )  {
+    if (_at->send("AT+UMNOPROF?") && _at->recv("+UMNOPROF: %3[^\n]\nOK\n", buf))  {
+        *profile = atoi(buf);
         return_val = true;
     }