LoRA production board
Dependencies: mbed LoRaWAN-lib SX1272Liby
Fork of frdm_LoRa_Connect_Woodstream_Demo_tjm by
Diff: app/main.cpp
- Revision:
- 5:df5350d5e2fc
- Parent:
- 4:35c4373393c3
- Child:
- 6:ee58dcb61940
--- a/app/main.cpp Wed Mar 09 20:31:37 2016 +0000 +++ b/app/main.cpp Wed Mar 09 21:21:53 2016 +0000 @@ -28,7 +28,8 @@ /*! * Defines the application data transmission duty cycle. 5s, value in [us]. */ -#define APP_TX_DUTYCYCLE 5000000 +//#define APP_TX_DUTYCYCLE 5000000 +#define APP_TX_DUTYCYCLE 2000000 /*! * Defines a random delay for application data transmission duty cycle. 1s, @@ -287,6 +288,9 @@ * \brief Prepares the payload of the frame */ int randVoltage; +int randKillStatus; +int randPowerOn; +int sendSignal; static void PrepareTxFrame( uint8_t port ) { char str[30]; @@ -295,21 +299,24 @@ { case 15: { - switch(randVoltage%3) + switch(sendSignal%3) { case 0: sprintf(str,"Voltage %2.2f",2.30 + (randVoltage%10 * .1)); + randVoltage++; break; case 1: - sprintf(str,"KillStatus %d",(randVoltage & 0x04)?1:0); + sprintf(str,"KillStatus %d",(randKillStatus & 0x02)?1:0); + randKillStatus++; break; case 2: - sprintf(str,"PowerOn %d",(randVoltage & 0x08)?1:0); - break; + sprintf(str,"PowerOn %d",(randPowerOn & 0x04)?1:0); + randPowerOn++; + break; } - randVoltage++; + sendSignal++; memcpy(AppData,str,strlen(str)); AppDataSize = strlen(str); #if 0