getmno

Revision:
29:d75e2e4084a6
Parent:
27:250eaef6232d
--- 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;
     }