LoRa on Multitech with Semtech mote
Dependencies: LoRaWAN-lib SX1272Lib lib_gps lib_mma8451q lib_mpl3115a2 mbed
Fork of LoRaWAN-NAMote72-Application-Demo_Multitech by
Revision 15:39a23f5affd1, committed 2016-08-31
- Comitter:
- ubhat
- Date:
- Wed Aug 31 21:01:03 2016 +0000
- Parent:
- 14:f687ec277e1b
- Child:
- 16:85cfe4bb33e8
- Commit message:
- Port13 application updates
Changed in this revision
app/LoRaApp.cpp | Show annotated file Show diff for this revision Revisions of this file |
app/LoRaEventProc.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/app/LoRaApp.cpp Tue Aug 30 18:56:17 2016 +0000 +++ b/app/LoRaApp.cpp Wed Aug 31 21:01:03 2016 +0000 @@ -46,8 +46,11 @@ void Application::ApplicationAppendData( uint8_t *pData, uint8_t len ) { - memcpy( BuffAddr + BuffPtr, pData, len ); - BuffPtr += len; + if( ( BuffPtr + len ) <= LORAWAN_APP_DATA_SIZE ) + { + memcpy( BuffAddr + BuffPtr, pData, len ); + BuffPtr += len; + } } void Application::ApplicationPtrPos( uint8_t ptrPos )
--- a/app/LoRaEventProc.cpp Tue Aug 30 18:56:17 2016 +0000 +++ b/app/LoRaEventProc.cpp Wed Aug 31 21:01:03 2016 +0000 @@ -154,6 +154,7 @@ case 13: { uint8_t ptrIndex = 0; + uint8_t tmp = 0; //Point the pointer to position index of Tx Buffer LoRaApp.ApplicationPtrPos( ptrIndex ); @@ -165,7 +166,17 @@ LoRaApp.ApplicationCall( AppBat ); LoRaApp.ApplicationCall( AppAcclSensor ); // Generate Accelerometer data bytes - + + if( AppLed == 1 ) + { + tmp = 0x01; + } + else + { + tmp = 0x00; + } + + LoRaApp.ApplicationAppendData( &tmp, 1 ); break; }