Basic xdot code to check how many memory is available for user APP after initializing libxdot lorawan stack

Revision:
42:20f6b29a9903
Parent:
33:15ea8f985c54
diff -r 67feacfab49c -r 20f6b29a9903 examples/src/class_c_example.cpp
--- a/examples/src/class_c_example.cpp	Mon May 18 13:12:47 2020 -0500
+++ b/examples/src/class_c_example.cpp	Tue May 25 09:54:33 2021 -0500
@@ -35,7 +35,7 @@
 mDot* dot = NULL;
 lora::ChannelPlan* plan = NULL;
 
-Serial pc(USBTX, USBRX);
+mbed::UnbufferedSerial pc(USBTX, USBRX);
 
 #if defined(TARGET_XDOT_L151CC)
 I2C i2c(I2C_SDA, I2C_SCL);
@@ -55,22 +55,9 @@
 #endif
 
     mts::MTSLog::setLogLevel(mts::MTSLog::TRACE_LEVEL);
-    
-#if CHANNEL_PLAN == CP_US915
-    plan = new lora::ChannelPlan_US915();
-#elif CHANNEL_PLAN == CP_AU915
-    plan = new lora::ChannelPlan_AU915();
-#elif CHANNEL_PLAN == CP_EU868
-    plan = new lora::ChannelPlan_EU868();
-#elif CHANNEL_PLAN == CP_KR920
-    plan = new lora::ChannelPlan_KR920();
-#elif CHANNEL_PLAN == CP_AS923
-    plan = new lora::ChannelPlan_AS923();
-#elif CHANNEL_PLAN == CP_AS923_JAPAN
-    plan = new lora::ChannelPlan_AS923_Japan();
-#elif CHANNEL_PLAN == CP_IN865
-    plan = new lora::ChannelPlan_IN865();
-#endif
+
+    // Create channel plan
+    plan = create_channel_plan();
     assert(plan);
 
     dot = mDot::getInstance(plan);
@@ -164,7 +151,7 @@
         // it must be waiting for data from the gateway
         // send data every 30s
         logInfo("waiting for 30s");
-        wait(30);
+        ThisThread::sleep_for(30s);
     }
  
     return 0;