Sensor Demo for CTIA

Dependencies:   LoRaWAN-lib SX1272Lib lib_gps lib_mma8451q lib_mpl3115a2 mbed

Fork of LoRaWAN-NAMote72-Application-Demo by Semtech

Revision:
6:f8194e691dd4
Parent:
0:69f2e28d12c1
Child:
7:92f4f419f91f
--- a/app/LoRaApp.cpp	Wed Jun 08 01:40:42 2016 +0000
+++ b/app/LoRaApp.cpp	Wed Jun 08 22:06:26 2016 +0000
@@ -35,7 +35,7 @@
 {
     BuffAddr = memptr;
     memset( BuffAddr, 0, LORAWAN_APP_DATA_MAX_SIZE );
-    BuffPtr = 0;
+    BuffPtr = 0;    
 }
 
 Application::~Application( )
@@ -84,7 +84,7 @@
             Mpl3115a2.ReadTemperature( );
             if( ( BuffPtr + 1 ) <= LORAWAN_APP_DATA_SIZE )
             {
-                BuffAddr[BuffPtr++] = ( int32_t )Mpl3115a2.Temperature;     // Signed degrees Celcius in half degree units. So, +/-63 °C                         
+                BuffAddr[BuffPtr++] = ( int32_t )Mpl3115a2.Temperature;     // Signed degrees Celcius in half degree units. So, +/-63 °C                         
             }
             break;
         }
@@ -155,7 +155,7 @@
             }       
             
             break;
-        }
+        }       
 
         case AppAcclSenet:
         {   
@@ -184,6 +184,18 @@
             break;
         }
 
+        case AppPushButton:
+        {   
+            uint16_t PushButtonCnt;
+            uint8_t *p = (uint8_t *) &PushButtonCnt;
+
+            PushButtonCnt = LoRaMacUplinkStatus.UplinkCounter;
+                
+            memcpy( &BuffAddr[BuffPtr], p, sizeof(uint16_t) );
+            
+            break;
+        }
+
         default:
         {            
             break;