mQ Branch for NA mote testing
Dependencies: LoRaWAN-lib SX1272Lib-mQ lib_gps lib_mma8451q lib_mpl3115a2 mbed
Fork of LoRaWAN-NAMote72-Application-Demo by
Diff: app/LoRaEventProc.cpp
- Revision:
- 5:6ffeac53b7cb
- Parent:
- 0:69f2e28d12c1
- Child:
- 6:f8194e691dd4
diff -r 7a3ceb1ce02c -r 6ffeac53b7cb app/LoRaEventProc.cpp --- a/app/LoRaEventProc.cpp Thu May 19 18:40:59 2016 +0000 +++ b/app/LoRaEventProc.cpp Wed Jun 08 01:40:42 2016 +0000 @@ -16,6 +16,11 @@ #include "LoRaEventProc.h" +/*! + * Defines the application data transmission duty cycle + */ +uint32_t TxDutyCycleTime = APP_TX_DUTYCYCLE; + bool AppLed = 0; /*! @@ -120,6 +125,73 @@ } } + +/*! + * \brief Sets Interrupt for next payload transmission + */ +void InitNextTxInterrupt( uint8_t port ) +{ + switch( port ) + { + /* GPS Application Demo + Set Timer interrupt for next uplink + */ + case 5: + { + } + + /* Senet + M2X demo + Set Timer interrupt for next uplink + */ + case 6: + { + + } + + /* Senet GPS Demo + Set Timer interrupt for next uplink + */ + case 7: + { + // Schedule next packet transmission + TxDutyCycleTime = APP_TX_DUTYCYCLE + randr( -APP_TX_DUTYCYCLE_RND, APP_TX_DUTYCYCLE_RND ); + TimerSetValue( &TxNextPacketTimer, TxDutyCycleTime ); + TimerStart( &TxNextPacketTimer ); + break; + } + + /* Push Button Demo + Send Packet Immedietly + */ + case 11: + { + DeviceState = DEVICE_STATE_SEND; + NextTx = true; + break; + } + + /* Compliance Test + Set Timer interrupt for next uplink + */ + case 224: + { + // Schedule next packet transmission + TimerSetValue( &TxNextPacketTimer, COMPLIANCE_TX_DUTYCYCLE ); + TimerStart( &TxNextPacketTimer ); + break; + } + + default: + { + // Schedule next packet transmission + TimerSetValue( &TxNextPacketTimer, TxDutyCycleTime ); + TimerStart( &TxNextPacketTimer ); + break; + } + } + +} + /*! * \brief What to do during JOIN process ? blink/toggle LED etc. */