ublox-at-cellular-interface

Files at this revision

API Documentation at this revision

Comitter:
mudassar0121
Date:
Mon Jan 06 14:29:40 2020 +0500
Parent:
41:69998003d95a
Child:
45:14fb8a6a5c03
Commit message:
Replaced depreciated wait_ms with ThisThread::sleep_for

Changed in this revision

TESTS/unit_tests/default/main.cpp Show annotated file Show diff for this revision Revisions of this file
TESTS/unit_tests/dynamic/main.cpp Show annotated file Show diff for this revision Revisions of this file
UbloxATCellularInterface.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/TESTS/unit_tests/default/main.cpp	Wed Jan 01 11:47:24 2020 +0500
+++ b/TESTS/unit_tests/default/main.cpp	Mon Jan 06 14:29:40 2020 +0500
@@ -312,7 +312,7 @@
                     TEST_ASSERT(strcmp(sender_address.get_ip_address(), host_address->get_ip_address()) == 0);
                     TEST_ASSERT(sender_address.get_port() == host_address->get_port());
                 }
-                wait_ms(10);
+                ThisThread::sleep_for(10);
             }
             timer.stop();
             timer.reset();
@@ -352,7 +352,7 @@
             count += x;
             tr_debug("%d byte(s) sent, %d left to send.", count, size - count);
         }
-        wait_ms(10);
+        ThisThread::sleep_for(10);
     }
     timer.stop();
 
@@ -382,7 +382,7 @@
             recv_size += x;
             tr_debug("%d byte(s) echoed back so far, %d to go.", recv_size, size - recv_size);
         }
-        wait_ms(10);
+        ThisThread::sleep_for(10);
     }
     TEST_ASSERT(recv_size == size);
     y = memcmp(send_data, recv_data, size);
@@ -1176,7 +1176,7 @@
     // Rebooting modem for settings to take effect
 	TEST_ASSERT(interface->reboot_modem());
 	tr_debug("Reboot successful\n");
-	wait_ms(5000);
+	ThisThread::sleep_for(5000);
 
 	TEST_ASSERT(interface->init(MBED_CONF_APP_DEFAULT_PIN));
 
@@ -1226,7 +1226,7 @@
     //re-apply default mno profile
     TEST_ASSERT(interface->set_mno_profile(UbloxATCellularInterface::STANDARD_EU));
     TEST_ASSERT(interface->reboot_modem());
-    wait_ms(5000);
+    ThisThread::sleep_for(5000);
     TEST_ASSERT(interface->init(MBED_CONF_APP_DEFAULT_PIN));
     TEST_ASSERT(interface->disable_power_saving_mode());
 }
--- a/TESTS/unit_tests/dynamic/main.cpp	Wed Jan 01 11:47:24 2020 +0500
+++ b/TESTS/unit_tests/dynamic/main.cpp	Mon Jan 06 14:29:40 2020 +0500
@@ -240,7 +240,7 @@
             TEST_ASSERT(interface->set_mno_profile(UbloxATCellularInterface::STANDARD_EU));
             TEST_ASSERT(interface->reboot_modem());
             tr_debug("Reboot successful\n");
-            wait_ms(5000);
+            hisThread::sleep_for(5000);
         }
     }
     TEST_ASSERT(interface->init(MBED_CONF_APP_DEFAULT_PIN));
--- a/UbloxATCellularInterface.cpp	Wed Jan 01 11:47:24 2020 +0500
+++ b/UbloxATCellularInterface.cpp	Mon Jan 06 14:29:40 2020 +0500
@@ -701,7 +701,7 @@
         LOCK();
 
         if (_at->send("AT+USOWR=%d,%d", socket->modem_handle, blk) && _at->recv("@")) {
-            wait_ms(50);
+            ThisThread::sleep_for(50);
             if ((_at->write(buf, blk) < (int) blk) ||
                  !_at->recv("OK")) {
                 success = false;
@@ -756,7 +756,7 @@
         if (_at->send("AT+USOST=%d,\"%s\",%d,%d", socket->modem_handle,
                       address.get_ip_address(), address.get_port(), blk) &&
             _at->recv("@")) {
-            wait_ms(50);
+            ThisThread::sleep_for(50);
             if ((_at->write(buf, blk) >= (int) blk) &&
                  _at->recv("OK")) {
             } else {