LR Initial Publish
Dependencies: X_NUCLEO_IKS01A2 driver_mbed_TH02 mbed LoRaWAN-lib-v1_0_1 SX1272Lib
Fork of Training-Aug2018-SX1272-X-NUCLEO-IKS01A2 by
Diff: app/LoRaDeviceStateProc.cpp
- Revision:
- 4:d49b89361b67
- Parent:
- 0:6cc76d70e2a1
--- a/app/LoRaDeviceStateProc.cpp Sat Nov 04 20:07:00 2017 +0000 +++ b/app/LoRaDeviceStateProc.cpp Fri Nov 10 09:22:47 2017 +0000 @@ -30,6 +30,7 @@ MlmeReq_t mlmeReq; +uint16_t ChannelMaskTemp[6] = {0}; /*! * \brief Function executed on TxNextPacket Timeout event @@ -79,6 +80,86 @@ LoRaMibReq.Type = MIB_CHANNELS_TX_POWER; LoRaMibReq.Param.ChannelsTxPower = LORAWAN_TX_POWER; LoRaMacMibSetRequestConfirm( &LoRaMibReq ); + + LoRaMibReq.Type = MIB_CHANNELS_MASK; + LoRaMibReq.Param.ChannelsMask = ChannelMaskTemp; + +#ifdef USE_BAND_915_HYBRID_BLOCK_A + + ChannelMaskTemp[0] = 0x00FF; + ChannelMaskTemp[1] = 0x0000; + ChannelMaskTemp[2] = 0x0000; + ChannelMaskTemp[3] = 0x0000; + ChannelMaskTemp[4] = 0x0001; + +#elif defined USE_BAND_915_HYBRID_BLOCK_B + + ChannelMaskTemp[0] = 0xFF00; + ChannelMaskTemp[1] = 0x0000; + ChannelMaskTemp[2] = 0x0000; + ChannelMaskTemp[3] = 0x0000; + ChannelMaskTemp[4] = 0x0002; + +#elif defined USE_BAND_915_HYBRID_BLOCK_C + + ChannelMaskTemp[0] = 0x0000; + ChannelMaskTemp[1] = 0x00FF; + ChannelMaskTemp[2] = 0x0000; + ChannelMaskTemp[3] = 0x0000; + ChannelMaskTemp[4] = 0x0004; + +#elif defined USE_BAND_915_HYBRID_BLOCK_D + + ChannelMaskTemp[0] = 0x0000; + ChannelMaskTemp[1] = 0xFF00; + ChannelMaskTemp[2] = 0x0000; + ChannelMaskTemp[3] = 0x0000; + ChannelMaskTemp[4] = 0x0008; + +#elif defined USE_BAND_915_HYBRID_BLOCK_E + + ChannelMaskTemp[0] = 0x0000; + ChannelMaskTemp[1] = 0x0000; + ChannelMaskTemp[2] = 0x00FF; + ChannelMaskTemp[3] = 0x0000; + ChannelMaskTemp[4] = 0x0010; + +#elif defined USE_BAND_915_HYBRID_BLOCK_F + + ChannelMaskTemp[0] = 0x0000; + ChannelMaskTemp[1] = 0x0000; + ChannelMaskTemp[2] = 0xFF00; + ChannelMaskTemp[3] = 0x0000; + ChannelMaskTemp[4] = 0x0020; + +#elif defined USE_BAND_915_HYBRID_BLOCK_G + + ChannelMaskTemp[0] = 0x0000; + ChannelMaskTemp[1] = 0x0000; + ChannelMaskTemp[2] = 0x0000; + ChannelMaskTemp[3] = 0x00FF; + ChannelMaskTemp[4] = 0x0040; + +#elif defined USE_BAND_915_HYBRID_BLOCK_H + + ChannelMaskTemp[0] = 0x0000; + ChannelMaskTemp[1] = 0x0000; + ChannelMaskTemp[2] = 0x0000; + ChannelMaskTemp[3] = 0xFF00; + ChannelMaskTemp[4] = 0x0080; + +#elif defined USE_BAND_915 + + ChannelMaskTemp[0] = 0xFFFF; + ChannelMaskTemp[1] = 0xFFFF; + ChannelMaskTemp[2] = 0xFFFF; + ChannelMaskTemp[3] = 0xFFFF; + ChannelMaskTemp[4] = 0x00FF; + ChannelMaskTemp[5] = 0x0000; + +#endif + + LoRaMacMibSetRequestConfirm( &LoRaMibReq ); LoRaMacDownlinkStatus.DownlinkCounter = 0; }