NuMaker Cellular(NB-IoT/4G)

Files at this revision

API Documentation at this revision

Comitter:
SHLIU1@OANBE02333.nuvoton.com
Date:
Thu Feb 25 11:31:56 2021 +0800
Parent:
3:6f804b5237be
Child:
5:9a7b534517d7
Commit message:
Support the both V5.X and V6.X for mbed-os

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6f804b5237be -r 9432d7355f2b main.cpp
--- a/main.cpp	Mon Feb 03 03:29:07 2020 +0000
+++ b/main.cpp	Thu Feb 25 11:31:56 2021 +0800
@@ -206,6 +206,9 @@
 
 int main()
 {
+#ifdef MBED_MAJOR_VERSION
+    printf("Mbed OS version %d.%d.%d\r\n\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION);
+#endif
     print_function("\n\nmbed-os-example-cellular\n");
     print_function("\n\nBuilt: %s, %s\n", __DATE__, __TIME__);
 #ifdef MBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN
@@ -227,7 +230,10 @@
 
     /* Attempt to connect to a cellular network */
     if (do_connect() == NSAPI_ERROR_OK) {
-        printf("IP Address is %s\r\n", iface->get_ip_address());
+       SocketAddress a;
+       iface->get_ip_address(&a);
+        printf("IP Address is %s\r\n", a.get_ip_address());
+ //       printf("IP Address is %s\r\n", iface->get_ip_address());
         retcode = test_send_recv();
     }