Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: X_NUCLEO_IKS01A2 driver_mbed_TH02 mbed LoRaWAN-lib-v1_0_1 SX1272Lib
Fork of Training-Aug2018-SX1272-X-NUCLEO-IKS01A2 by
Revision 9:a47750bce9f8, committed 2018-08-12
- Comitter:
- ubhat
- Date:
- Sun Aug 12 06:09:53 2018 +0000
- Parent:
- 8:7ddaacb6dda6
- Child:
- 10:bba416e2c3e1
- Commit message:
- Add Cayenne Application for Push Button
Changed in this revision
--- a/app/Config.h Tue Nov 28 07:30:45 2017 +0000 +++ b/app/Config.h Sun Aug 12 06:09:53 2018 +0000 @@ -130,7 +130,7 @@ /*! * User application data buffer size */ -#define LORAWAN_APP_DATA_SIZE 2 +#define LORAWAN_APP_DATA_SIZE 3 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
--- a/app/LoRaApp.cpp Tue Nov 28 07:30:45 2017 +0000
+++ b/app/LoRaApp.cpp Sun Aug 12 06:09:53 2018 +0000
@@ -193,12 +193,14 @@
case AppPushButton:
{
- uint16_t PushButtonCnt;
+ static uint8_t PushButtonCnt = 0;
uint8_t *p = (uint8_t *) &PushButtonCnt;
PushButtonCnt = LoRaMacUplinkStatus.UplinkCounter;
+ PushButtonCnt = (PushButtonCnt + 1) & 0xFF;
- memcpy( &BuffAddr[BuffPtr], p, sizeof(uint16_t) );
+ //memcpy( &BuffAddr[BuffPtr], p, sizeof(uint16_t) );
+ BuffAddr[BuffPtr] = PushButtonCnt;
break;
}
--- a/app/LoRaEventProc.cpp Tue Nov 28 07:30:45 2017 +0000
+++ b/app/LoRaEventProc.cpp Sun Aug 12 06:09:53 2018 +0000
@@ -186,9 +186,15 @@
// Push-Button Demo
case 11: {
uint8_t ptrIndex = 0;
+
+ uint8_t tmp[2] = {0};
//Point the pointer to position index of Tx Buffer
LoRaApp.ApplicationPtrPos( ptrIndex );
+
+ tmp[0] = 0;
+ tmp[1] = 0;
+ LoRaApp.ApplicationAppendData( tmp, 2 );
LoRaApp.ApplicationCall( AppPushButton ); // Transmit uplink counter
