This is an example application based on Mbed-OS LoRaWAN protocol APIs. The Mbed-OS LoRaWAN stack implementation is compliant with LoRaWAN v1.0.2 specification.

Dependencies:   Lorawan_Version_0_1

Dependents:   Lorawan_Version_0_1

Revision:
72:67c5bce77999
Parent:
71:ca2425c0a864
Child:
73:974c1df98553
diff -r ca2425c0a864 -r 67c5bce77999 GPS/GPS.cpp
--- a/GPS/GPS.cpp	Fri Jan 24 07:32:42 2020 +0000
+++ b/GPS/GPS.cpp	Tue Jan 28 14:22:48 2020 +0000
@@ -35,7 +35,8 @@
  
 void GPS::idle(bool idle) 
  {     
-    this->is_idle = idle;
+    this->is_idle = idle; 
+    gps_off->write(!idle);
  }
   
   
@@ -116,32 +117,21 @@
 }
 
 
-void GPS::GPS_aktiv()
+void GPS::get_Position()
 {  
+
+
     if (manual_tracking or !is_idle){
+         gps_off->write(0);
          printf("\n[GPS] active");
          if (this->sample()) {  
-            printf("[GPS] Position: %f , %f\n", longitude,latitude);
+            printf("\n[GPS] Position: %f , %f\n", longitude,latitude);
             }
      }
      else {
-         printf("[GPS] idle");    
+         gps_off->write(1);
+         printf("\n[GPS] idle");    
     }
 }
 
 
-
-//    uint8_t GPSoff[] = {0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00,0x08, 0x00, 0x16, 0x74};
-//     uint8_t GPSon[] = {0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00,0x09, 0x00, 0x17, 0x76};
-//     uint8_t GPS_Powersafemode[] = {0xB5, 0x62, 0x06, 0x11, 0x02, 0x00, 0x08, 0x01, 0x22, 0x92};
-//     
-//     uint8_t GPS_MaxPerformance[] = {0xB5, 0x62, 0x06, 0x11, 0x02, 0x00, 0x08, 0x00, 0x21, 0x91};
-//     
-//     uint8_t GPS_10s_Period[] ={0xB5, 0x62, 0x06, 0x3B, 0x2C, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x90, 0x03, 0x00, 0x10, 0x27, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x4F, 0xC1, 0x03, 0x00, 0x87, 0x02, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x64, 0x40, 0x01, 0x00, 0xE4, 0x8B};
-//    //_gps.printf((GPSoff, sizeof(GPSoff)/sizeof(uint8_t));
-    
-  //  _gps.printf("%c",GPSoff);
-    
- //
-//    uint8_t GPSon[] = {0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00,0x09, 0x00, 0x17, 0x76};
-//    sendUBX(GPSon, sizeof(GPSon)/sizeof(uint8_t));