libMDot form for loop/dht22 project
Dependents: mDot_LoRa_Connect_ABPA_DHT22_sleep mDot_LoRa_Connect_ABPA FrostyBoySensor mDot_LoRa_Connect_ABPA_Lux ... more
Fork of libmDot-mbed5 by
plans/ChannelPlan_AU915.h@63:af2fa55cbace, 2017-08-21 (annotated)
- Committer:
- kellybs1
- Date:
- Mon Aug 21 05:00:54 2017 +0000
- Revision:
- 63:af2fa55cbace
- Parent:
- 61:58ed1e136af5
Working version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 1 | /** __ ___ ____ _ ______ __ ____ __ ____ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 2 | * / |/ /_ __/ / /_(_)__/_ __/__ ____/ / / __/_ _____ / /____ __ _ ___ / _/__ ____ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 3 | * / /|_/ / // / / __/ /___// / / -_) __/ _ \ _\ \/ // (_-</ __/ -_) ' \(_-< _/ // _ \/ __/ __ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 4 | * /_/ /_/\_,_/_/\__/_/ /_/ \__/\__/_//_/ /___/\_, /___/\__/\__/_/_/_/___/ /___/_//_/\__/ /_/ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 5 | * Copyright (C) 2015 by Multi-Tech Systems /___/ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 6 | * |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 7 | * |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 8 | * @author Jason Reiss |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 9 | * @date 10-31-2015 |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 10 | * @brief lora::ChannelPlan provides an interface for LoRaWAN channel schemes |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 11 | * |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 12 | * @details |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 13 | * |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 14 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 15 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 16 | #ifndef __CHANNEL_PLAN_AU915_H__ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 17 | #define __CHANNEL_PLAN_AU915_H__ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 18 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 19 | #include "Lora.h" |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 20 | #include "SxRadio.h" |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 21 | #include "ChannelPlan.h" |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 22 | #include <vector> |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 23 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 24 | namespace lora { |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 25 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 26 | class ChannelPlan_AU915 : public lora::ChannelPlan { |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 27 | public: |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 28 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 29 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 30 | * ChannelPlan constructor |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 31 | * @param radio SxRadio object used to set Tx/Rx config |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 32 | * @param settings Settings object |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 33 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 34 | ChannelPlan_AU915(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 35 | ChannelPlan_AU915(Settings* settings); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 36 | ChannelPlan_AU915(SxRadio* radio, Settings* settings); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 37 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 38 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 39 | * ChannelPlan destructor |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 40 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 41 | virtual ~ChannelPlan_AU915(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 42 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 43 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 44 | * Initialize channels, datarates and duty cycle bands according to current channel plan in settings |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 45 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 46 | virtual void Init(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 47 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 48 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 49 | * Get the next channel to use to transmit |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 50 | * @return LORA_OK if channel was found |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 51 | * @return LORA_NO_CHANS_ENABLED |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 52 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 53 | virtual uint8_t GetNextChannel(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 54 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 55 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 56 | * Set the number of channels in the plan |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 57 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 58 | virtual void SetNumberOfChannels(uint8_t channels, bool resize = true); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 59 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 60 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 61 | * Check if channel is enabled |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 62 | * @return true if enabled |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 63 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 64 | virtual bool IsChannelEnabled(uint8_t channel); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 65 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 66 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 67 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 68 | * Add a channel to the ChannelPlan |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 69 | * @param index of channel, use -1 to add to end |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 70 | * @param channel settings to add |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 71 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 72 | virtual uint8_t AddChannel(int8_t index, Channel channel); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 73 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 74 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 75 | * Get channel at index |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 76 | * @return Channel |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 77 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 78 | virtual Channel GetChannel(int8_t index); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 79 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 80 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 81 | * Get rx window settings for requested window |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 82 | * RX_1, RX_2, RX_BEACON, RX_SLOT |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 83 | * @param window |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 84 | * @return RxWindow |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 85 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 86 | virtual RxWindow GetRxWindow(uint8_t window); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 87 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 88 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 89 | * Get datarate to use on the join request |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 90 | * @return datarate index |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 91 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 92 | virtual uint8_t GetJoinDatarate(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 93 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 94 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 95 | * Calculate the next time a join request is possible |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 96 | * @param size of join frame |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 97 | * @returns LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 98 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 99 | virtual uint8_t CalculateJoinBackoff(uint8_t size); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 100 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 101 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 102 | * Set the datarate offset used for first receive window |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 103 | * @param offset |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 104 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 105 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 106 | virtual uint8_t SetRx1Offset(uint8_t offset); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 107 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 108 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 109 | * Set the frequency for second receive window |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 110 | * @param freq |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 111 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 112 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 113 | virtual uint8_t SetRx2Frequency(uint32_t freq); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 114 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 115 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 116 | * Set the datarate index used for second receive window |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 117 | * @param index |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 118 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 119 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 120 | virtual uint8_t SetRx2DatarateIndex(uint8_t index); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 121 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 122 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 123 | * Get next channel and set the SxRadio tx config with current settings |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 124 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 125 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 126 | virtual uint8_t SetTxConfig(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 127 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 128 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 129 | * Set the SxRadio rx config provided window |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 130 | * @param window to be opened |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 131 | * @param continuous keep window open |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 132 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 133 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 134 | virtual uint8_t SetRxConfig(uint8_t window, bool continuous); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 135 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 136 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 137 | * Set frequency sub band if supported by plan |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 138 | * @param sub_band |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 139 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 140 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 141 | virtual uint8_t SetFrequencySubBand(uint8_t sub_band); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 142 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 143 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 144 | * Callback for Join Accept packet to load optional channels |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 145 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 146 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 147 | virtual uint8_t HandleJoinAccept(const uint8_t* buffer, uint8_t size); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 148 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 149 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 150 | * Callback to for rx parameter setup ServerCommand |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 151 | * @param payload packet data |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 152 | * @param index of start of command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 153 | * @param size number of bytes in command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 154 | * @param[out] status to be returned in MoteCommand answer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 155 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 156 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 157 | virtual uint8_t HandleRxParamSetup(const uint8_t* payload, uint8_t index, uint8_t size, uint8_t& status); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 158 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 159 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 160 | * Callback to for new channel ServerCommand |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 161 | * @param payload packet data |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 162 | * @param index of start of command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 163 | * @param size number of bytes in command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 164 | * @param[out] status to be returned in MoteCommand answer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 165 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 166 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 167 | virtual uint8_t HandleNewChannel(const uint8_t* payload, uint8_t index, uint8_t size, uint8_t& status); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 168 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 169 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 170 | * Callback to for ping slot channel request ServerCommand |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 171 | * @param payload packet data |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 172 | * @param index of start of command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 173 | * @param size number of bytes in command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 174 | * @param[out] status to be returned in MoteCommand answer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 175 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 176 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 177 | virtual uint8_t HandlePingSlotChannelReq(const uint8_t* payload, uint8_t index, uint8_t size, uint8_t& status); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 178 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 179 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 180 | * Callback to for beacon frequency request ServerCommand |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 181 | * @param payload packet data |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 182 | * @param index of start of command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 183 | * @param size number of bytes in command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 184 | * @param[out] status to be returned in MoteCommand answer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 185 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 186 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 187 | virtual uint8_t HandleBeaconFrequencyReq(const uint8_t* payload, uint8_t index, uint8_t size, uint8_t& status); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 188 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 189 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 190 | * Callback to for adaptive datarate ServerCommand |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 191 | * @param payload packet data |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 192 | * @param index of start of command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 193 | * @param size number of bytes in command buffer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 194 | * @param[out] status to be returned in MoteCommand answer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 195 | * @return LORA_OK |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 196 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 197 | virtual uint8_t HandleAdrCommand(const uint8_t* payload, uint8_t index, uint8_t size, uint8_t& status); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 198 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 199 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 200 | * Validate the configuration after multiple ADR commands have been applied |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 201 | * @return status to be returned in MoteCommand answer |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 202 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 203 | virtual uint8_t ValidateAdrConfiguration(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 204 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 205 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 206 | * Get the time the radio must be off air to comply with regulations |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 207 | * Time to wait may be dependent on duty-cycle restrictions per channel |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 208 | * Or duty-cycle of join requests if OTAA is being attempted |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 209 | * @return ms of time to wait for next tx opportunity |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 210 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 211 | virtual uint32_t GetTimeOffAir(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 212 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 213 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 214 | * Get the channels in use by current channel plan |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 215 | * @return channel frequencies |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 216 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 217 | virtual std::vector<uint32_t> GetChannels(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 218 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 219 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 220 | * Get the channel datarate ranges in use by current channel plan |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 221 | * @return channel datarate ranges |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 222 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 223 | virtual std::vector<uint8_t> GetChannelRanges(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 224 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 225 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 226 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 227 | * Print log message for given rx window |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 228 | * @param wnd 1 or 2 |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 229 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 230 | virtual void LogRxWindow(uint8_t wnd); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 231 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 232 | /** |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 233 | * Enable the default channels of the channel plan |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 234 | */ |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 235 | virtual void EnableDefaultChannels(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 236 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 237 | virtual uint8_t GetMinDatarate(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 238 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 239 | virtual uint8_t GetMaxDatarate(); |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 240 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 241 | protected: |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 242 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 243 | static const uint8_t AU915_TX_POWERS[11]; //!< List of available tx powers |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 244 | static const uint8_t AU915_RADIO_POWERS[21]; //!< List of calibrated tx powers |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 245 | static const uint8_t AU915_MAX_PAYLOAD_SIZE[]; //!< List of max payload sizes for each datarate |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 246 | static const uint8_t AU915_MAX_PAYLOAD_SIZE_REPEATER[]; //!< List of repeater compatible max payload sizes for each datarate |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 247 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 248 | }; |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 249 | } |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 250 | |
Jenkins@KEILDM1.dc.multitech.prv | 61:58ed1e136af5 | 251 | #endif // __CHANNEL_PLAN_AU915_H__ |