This is an example based on mbed-os cellular APIs that demonstrates a TCP or UDP echo transaction with a public echo server.

Files at this revision

API Documentation at this revision

Comitter:
pimco01
Date:
Fri Feb 21 12:27:35 2020 +0000
Parent:
52:46406cd9c64a
Commit message:
Cellular Power Off function add

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Jan 30 06:49:19 2020 +0000
+++ b/main.cpp	Fri Feb 21 12:27:35 2020 +0000
@@ -41,7 +41,24 @@
     ThisThread::sleep_for(5000);
     
     if(BG96_STATUS)
-        printf("Module Power On~~\r\n");
+        printf("Module Power On\r\n");
+    else
+        printf("Check Module Power Line!!\r\n");        
+}
+
+void BG96_Modem_PowerOFF(void)
+{
+    DigitalIn BG96_STATUS(D2);
+    DigitalOut BG96_PWRKEY(D3);
+
+    ThisThread::sleep_for(50);
+    BG96_PWRKEY = 1;
+    ThisThread::sleep_for(800);
+    BG96_PWRKEY = 0;
+    ThisThread::sleep_for(3000);
+    
+    if(BG96_STATUS == 0)
+        printf("Module Power Off\r\n");
     else
         printf("Check Module Power Line!!\r\n");        
 }