BG96 Cat.M1 basic sample for WIZnet IoT Shield based on Mbed-OS Cellular APIs (SK telecom network in Korea)

Overview

This code could be access via Cat.M1(BG96 module) of SK telecom network in Korea. Need a WIZnet IoT Shield BG96 board and development board. The code forked Daniel_Lee's mbed-os-example-cellular-BG96 repository and added some features.

/media/uploads/hkjung/wiznetiotshield_bg96_nucleo-l476rg_stacking.png /media/uploads/hkjung/wiznetiotshield_bg96_nucleo-l476rg_separate.png

Tested with

  • NUCLEO_L476RG
  • DISCO_L475VG_IOT01A
  • K64F

Example functionality

This example showcases the following device functionality:

1. Import the application into your desktop:

mbed import https://os.mbed.com/users/hkjung/code/mbed-os-example-cellular-BG96/
 
cd mbed-os-example-cellular-BG96

2. Compile and program:

mbed compile -t <toolchain> -m <TARGET_BOARD>

(supported toolchains : GCC_ARM / ARM / IAR)

3. Download binary to a target board

If need more information such as how to test, please look at https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-cellular/.

Revision:
26:348eec457e58
Parent:
21:e356e039f917
Child:
27:97054be1a741
--- a/main.cpp	Mon Nov 19 07:00:32 2018 +0000
+++ b/main.cpp	Tue Nov 20 09:45:32 2018 +0000
@@ -105,7 +105,7 @@
 void dot_event()
 {
     while (true) {
-        Thread::wait(4000);
+        ThisThread::sleep_for(4000);
         if (iface && iface->is_connected()) {
             break;
         } else {
@@ -244,13 +244,20 @@
         retcode = test_send_recv();
     }
 
+    if (iface->disconnect() != NSAPI_ERROR_OK) {
+        print_function("\n\n disconnect failed.\n\n");
+    }
+
     if (retcode == NSAPI_ERROR_OK) {
         print_function("\n\nSuccess. Exiting \n\n");
     } else {
         print_function("\n\nFailure. Exiting \n\n");
     }
+
 #if MBED_CONF_MBED_TRACE_ENABLE
     trace_close();
+#else
+    dot_thread.terminate();
 #endif // #if MBED_CONF_MBED_TRACE_ENABLE
 
     return 0;