The Modified Dot Library for SX1272

This version has been restoring as initial changes.

Verify the following dependencies:

Mbed-os 5.11 libmdot 3.2.0 for Mbed OS5.11

Committer:
Jenkins@KEILDM1.dc.multitech.prv
Date:
Thu Aug 23 14:18:55 2018 -0500
Revision:
64:64982192a2af
Parent:
60:7985b4783af9
Child:
65:acc0468b9aec
mdot-library revision 3.1.0 and mbed-os revision mbed-os-5.7.7

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jreiss 9:ec2fffe31793 1 // TODO: add license header
mfiore 0:c62615f15125 2
mfiore 0:c62615f15125 3 #ifndef MDOT_H
mfiore 0:c62615f15125 4 #define MDOT_H
mfiore 0:c62615f15125 5
mfiore 0:c62615f15125 6 #include "mbed.h"
mfiore 0:c62615f15125 7 #include "rtos.h"
Mike Fiore 16:b630e18103e5 8 #include "Mote.h"
mfiore 0:c62615f15125 9 #include <vector>
mfiore 0:c62615f15125 10 #include <map>
mfiore 0:c62615f15125 11 #include <string>
mfiore 0:c62615f15125 12
Mike Fiore 12:54f9cac9d690 13 class mDotEvent;
mfiore 0:c62615f15125 14 class LoRaConfig;
mfiore 0:c62615f15125 15
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 16
mfiore 0:c62615f15125 17 class mDot {
Mike Fiore 16:b630e18103e5 18 friend class mDotEvent;
mfiore 0:c62615f15125 19
mfiore 0:c62615f15125 20 private:
mfiore 0:c62615f15125 21
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 22 mDot(lora::ChannelPlan* plan);
mfiore 0:c62615f15125 23 ~mDot();
mfiore 0:c62615f15125 24
Mike Fiore 16:b630e18103e5 25 void initLora();
Mike Fiore 16:b630e18103e5 26
mfiore 0:c62615f15125 27 void setLastError(const std::string& str);
mfiore 0:c62615f15125 28
mfiore 0:c62615f15125 29 static bool validateBaudRate(const uint32_t& baud);
mfiore 0:c62615f15125 30 static bool validateFrequencySubBand(const uint8_t& band);
mfiore 0:c62615f15125 31 bool validateDataRate(const uint8_t& dr);
mfiore 0:c62615f15125 32
mfiore 0:c62615f15125 33 int32_t joinBase(const uint32_t& retries);
mfiore 0:c62615f15125 34 int32_t sendBase(const std::vector<uint8_t>& data, const bool& confirmed = false, const bool& blocking = true, const bool& highBw = false);
mfiore 0:c62615f15125 35 void waitForPacket();
mfiore 0:c62615f15125 36 void waitForLinkCheck();
mfiore 0:c62615f15125 37
mfiore 0:c62615f15125 38 void setActivityLedState(const uint8_t& state);
mfiore 0:c62615f15125 39 uint8_t getActivityLedState();
mfiore 0:c62615f15125 40
mfiore 0:c62615f15125 41 void blinkActivityLed(void) {
Mike Fiore 6:390fc83d588d 42 if (_activity_led) {
Mike Fiore 6:390fc83d588d 43 int val = _activity_led->read();
Mike Fiore 6:390fc83d588d 44 _activity_led->write(!val);
Mike Fiore 6:390fc83d588d 45 }
mfiore 0:c62615f15125 46 }
mfiore 0:c62615f15125 47
mfiore 0:c62615f15125 48 mDot(const mDot&);
mfiore 0:c62615f15125 49 mDot& operator=(const mDot&);
mfiore 0:c62615f15125 50
Mike Fiore 7:683dba5d576f 51 uint32_t RTC_ReadBackupRegister(uint32_t RTC_BKP_DR);
Mike Fiore 7:683dba5d576f 52 void RTC_WriteBackupRegister(uint32_t RTC_BKP_DR, uint32_t Data);
Mike Fiore 7:683dba5d576f 53
Mike Fiore 12:54f9cac9d690 54 void enterStopMode(const uint32_t& interval, const uint8_t& wakeup_mode = RTC_ALARM);
Mike Fiore 12:54f9cac9d690 55 void enterStandbyMode(const uint32_t& interval, const uint8_t& wakeup_mode = RTC_ALARM);
Mike Fiore 12:54f9cac9d690 56
mfiore 0:c62615f15125 57 static mDot* _instance;
mfiore 0:c62615f15125 58
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 59 lora::Mote* _mote;
mfiore 0:c62615f15125 60 LoRaConfig* _config;
Mike Fiore 16:b630e18103e5 61 lora::Settings _settings;
Mike Fiore 16:b630e18103e5 62 mDotEvent* _events;
Mike Fiore 16:b630e18103e5 63
mfiore 0:c62615f15125 64 std::string _last_error;
mfiore 0:c62615f15125 65 static const uint32_t _baud_rates[];
mfiore 0:c62615f15125 66 uint8_t _activity_led_state;
mfiore 0:c62615f15125 67 Ticker _tick;
Mike Fiore 6:390fc83d588d 68 DigitalOut* _activity_led;
Mike Fiore 6:390fc83d588d 69 bool _activity_led_enable;
Mike Fiore 6:390fc83d588d 70 PinName _activity_led_pin;
Mike Fiore 5:0bfe6a650513 71 bool _activity_led_external;
jreiss 9:ec2fffe31793 72 uint8_t _linkFailCount;
Mike Fiore 7:683dba5d576f 73 uint8_t _class;
Mike Fiore 7:683dba5d576f 74 InterruptIn* _wakeup;
Mike Fiore 7:683dba5d576f 75 PinName _wakeup_pin;
mfiore 0:c62615f15125 76
mfiore 0:c62615f15125 77 typedef enum {
Jason Reiss 10:27dafba9fe19 78 OFF,
Jason Reiss 10:27dafba9fe19 79 ON,
Jason Reiss 10:27dafba9fe19 80 BLINK,
mfiore 0:c62615f15125 81 } state;
mfiore 0:c62615f15125 82
mfiore 0:c62615f15125 83 public:
mfiore 0:c62615f15125 84
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 85 #if defined(TARGET_MTS_MDOT_F411RE)
mfiore 0:c62615f15125 86 typedef enum {
Mike Fiore 7:683dba5d576f 87 FM_APPEND = (1 << 0),
Mike Fiore 7:683dba5d576f 88 FM_TRUNC = (1 << 1),
Mike Fiore 7:683dba5d576f 89 FM_CREAT = (1 << 2),
Mike Fiore 7:683dba5d576f 90 FM_RDONLY = (1 << 3),
Mike Fiore 7:683dba5d576f 91 FM_WRONLY = (1 << 4),
Mike Fiore 7:683dba5d576f 92 FM_RDWR = (FM_RDONLY | FM_WRONLY),
Mike Fiore 7:683dba5d576f 93 FM_DIRECT = (1 << 5)
Mike Fiore 7:683dba5d576f 94 } FileMode;
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 95 #endif /* TARGET_MTS_MDOT_F411RE */
Mike Fiore 7:683dba5d576f 96
Mike Fiore 7:683dba5d576f 97 typedef enum {
mfiore 0:c62615f15125 98 MDOT_OK = 0,
mfiore 0:c62615f15125 99 MDOT_INVALID_PARAM = -1,
mfiore 0:c62615f15125 100 MDOT_TX_ERROR = -2,
mfiore 0:c62615f15125 101 MDOT_RX_ERROR = -3,
mfiore 0:c62615f15125 102 MDOT_JOIN_ERROR = -4,
mfiore 0:c62615f15125 103 MDOT_TIMEOUT = -5,
mfiore 0:c62615f15125 104 MDOT_NOT_JOINED = -6,
mfiore 0:c62615f15125 105 MDOT_ENCRYPTION_DISABLED = -7,
mfiore 0:c62615f15125 106 MDOT_NO_FREE_CHAN = -8,
Mike Fiore 12:54f9cac9d690 107 MDOT_TEST_MODE = -9,
Mike Fiore 12:54f9cac9d690 108 MDOT_NO_ENABLED_CHAN = -10,
Mike Fiore 12:54f9cac9d690 109 MDOT_AGGREGATED_DUTY_CYCLE = -11,
Jenkins@KEILDM1.dc.multitech.prv 43:ba29a595814e 110 MDOT_MAX_PAYLOAD_EXCEEDED = -12,
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 111 MDOT_LBT_CHANNEL_BUSY = -13,
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 112 MDOT_NOT_IDLE = -14,
mfiore 0:c62615f15125 113 MDOT_ERROR = -1024,
mfiore 0:c62615f15125 114 } mdot_ret_code;
mfiore 0:c62615f15125 115
mfiore 0:c62615f15125 116 enum JoinMode {
Mike Fiore 16:b630e18103e5 117 MANUAL = 0,
Jason Reiss 10:27dafba9fe19 118 OTA,
Mike Fiore 12:54f9cac9d690 119 AUTO_OTA,
Mike Fiore 12:54f9cac9d690 120 PEER_TO_PEER
mfiore 0:c62615f15125 121 };
mfiore 0:c62615f15125 122
mfiore 0:c62615f15125 123 enum Mode {
Jason Reiss 10:27dafba9fe19 124 COMMAND_MODE,
Jason Reiss 10:27dafba9fe19 125 SERIAL_MODE
mfiore 0:c62615f15125 126 };
mfiore 0:c62615f15125 127
mfiore 0:c62615f15125 128 enum RX_Output {
Jason Reiss 10:27dafba9fe19 129 HEXADECIMAL,
Jason Reiss 10:27dafba9fe19 130 BINARY
mfiore 0:c62615f15125 131 };
mfiore 0:c62615f15125 132
mfiore 0:c62615f15125 133 enum DataRates {
Mike Fiore 12:54f9cac9d690 134 DR0,
Mike Fiore 12:54f9cac9d690 135 DR1,
Mike Fiore 12:54f9cac9d690 136 DR2,
Mike Fiore 12:54f9cac9d690 137 DR3,
Mike Fiore 12:54f9cac9d690 138 DR4,
Mike Fiore 12:54f9cac9d690 139 DR5,
Mike Fiore 12:54f9cac9d690 140 DR6,
Mike Fiore 12:54f9cac9d690 141 DR7,
Mike Fiore 12:54f9cac9d690 142 DR8,
Mike Fiore 12:54f9cac9d690 143 DR9,
Mike Fiore 12:54f9cac9d690 144 DR10,
Mike Fiore 12:54f9cac9d690 145 DR11,
Mike Fiore 12:54f9cac9d690 146 DR12,
Mike Fiore 12:54f9cac9d690 147 DR13,
Mike Fiore 12:54f9cac9d690 148 DR14,
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 149 DR15
mfiore 0:c62615f15125 150 };
mfiore 0:c62615f15125 151
mfiore 0:c62615f15125 152 enum FrequencySubBands {
Jason Reiss 10:27dafba9fe19 153 FSB_ALL,
Jason Reiss 10:27dafba9fe19 154 FSB_1,
Jason Reiss 10:27dafba9fe19 155 FSB_2,
Jason Reiss 10:27dafba9fe19 156 FSB_3,
Jason Reiss 10:27dafba9fe19 157 FSB_4,
Jason Reiss 10:27dafba9fe19 158 FSB_5,
Jason Reiss 10:27dafba9fe19 159 FSB_6,
Jason Reiss 10:27dafba9fe19 160 FSB_7,
Jason Reiss 10:27dafba9fe19 161 FSB_8
mfiore 0:c62615f15125 162 };
mfiore 0:c62615f15125 163
Mike Fiore 6:390fc83d588d 164 enum JoinByteOrder {
Jason Reiss 10:27dafba9fe19 165 LSB,
Jason Reiss 10:27dafba9fe19 166 MSB
Mike Fiore 6:390fc83d588d 167 };
Mike Fiore 6:390fc83d588d 168
Mike Fiore 7:683dba5d576f 169 enum wakeup_mode {
Jason Reiss 10:27dafba9fe19 170 RTC_ALARM,
Jason Reiss 10:27dafba9fe19 171 INTERRUPT,
Jason Reiss 10:27dafba9fe19 172 RTC_ALARM_OR_INTERRUPT
Mike Fiore 7:683dba5d576f 173 };
Mike Fiore 7:683dba5d576f 174
jreiss 9:ec2fffe31793 175 enum UserBackupRegs {
Jason Reiss 10:27dafba9fe19 176 UBR0,
Jason Reiss 10:27dafba9fe19 177 UBR1,
Jason Reiss 10:27dafba9fe19 178 UBR2,
Jason Reiss 10:27dafba9fe19 179 UBR3,
Jason Reiss 10:27dafba9fe19 180 UBR4,
Jason Reiss 10:27dafba9fe19 181 UBR5,
Jason Reiss 10:27dafba9fe19 182 UBR6,
Jason Reiss 10:27dafba9fe19 183 UBR7,
Jason Reiss 10:27dafba9fe19 184 UBR8,
Jason Reiss 10:27dafba9fe19 185 UBR9
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 186 #if defined (TARGET_XDOT_L151CC)
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 187 ,UBR10,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 188 UBR11,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 189 UBR12,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 190 UBR13,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 191 UBR14,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 192 UBR15,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 193 UBR16,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 194 UBR17,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 195 UBR18,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 196 UBR19,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 197 UBR20,
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 198 UBR21
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 199 #endif /* TARGET_XDOT_L151CC */
jreiss 9:ec2fffe31793 200 };
jreiss 9:ec2fffe31793 201
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 202 #if defined(TARGET_MTS_MDOT_F411RE)
Mike Fiore 7:683dba5d576f 203 typedef struct {
Mike Fiore 7:683dba5d576f 204 int16_t fd;
Mike Fiore 16:b630e18103e5 205 char name[33];
Mike Fiore 7:683dba5d576f 206 uint32_t size;
Mike Fiore 7:683dba5d576f 207 } mdot_file;
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 208 #endif /* TARGET_MTS_MDOT_F411RE */
Mike Fiore 7:683dba5d576f 209
mfiore 0:c62615f15125 210 typedef struct {
mfiore 0:c62615f15125 211 uint32_t Up;
mfiore 0:c62615f15125 212 uint32_t Down;
mfiore 0:c62615f15125 213 uint32_t Joins;
mfiore 0:c62615f15125 214 uint32_t JoinFails;
mfiore 0:c62615f15125 215 uint32_t MissedAcks;
Mike Fiore 16:b630e18103e5 216 uint32_t CRCErrors;
mfiore 0:c62615f15125 217 } mdot_stats;
mfiore 0:c62615f15125 218
mfiore 0:c62615f15125 219 typedef struct {
mfiore 0:c62615f15125 220 int16_t last;
mfiore 0:c62615f15125 221 int16_t min;
mfiore 0:c62615f15125 222 int16_t max;
mfiore 0:c62615f15125 223 int16_t avg;
mfiore 0:c62615f15125 224 } rssi_stats;
mfiore 0:c62615f15125 225
mfiore 0:c62615f15125 226 typedef struct {
Mike Fiore 11:d8464345e1f1 227 int16_t last;
Mike Fiore 11:d8464345e1f1 228 int16_t min;
Mike Fiore 11:d8464345e1f1 229 int16_t max;
Mike Fiore 11:d8464345e1f1 230 int16_t avg;
mfiore 0:c62615f15125 231 } snr_stats;
mfiore 0:c62615f15125 232
mfiore 0:c62615f15125 233 typedef struct {
mfiore 0:c62615f15125 234 bool status;
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 235 uint8_t dBm;
mfiore 0:c62615f15125 236 uint32_t gateways;
mfiore 0:c62615f15125 237 std::vector<uint8_t> payload;
mfiore 0:c62615f15125 238 } link_check;
mfiore 0:c62615f15125 239
mfiore 0:c62615f15125 240 typedef struct {
mfiore 0:c62615f15125 241 int32_t status;
mfiore 0:c62615f15125 242 int16_t rssi;
mfiore 0:c62615f15125 243 int16_t snr;
mfiore 0:c62615f15125 244 } ping_response;
mfiore 0:c62615f15125 245
mfiore 0:c62615f15125 246 static std::string JoinModeStr(uint8_t mode);
mfiore 0:c62615f15125 247 static std::string ModeStr(uint8_t mode);
mfiore 0:c62615f15125 248 static std::string RxOutputStr(uint8_t format);
mfiore 0:c62615f15125 249 static std::string DataRateStr(uint8_t rate);
mfiore 0:c62615f15125 250 static std::string FrequencyBandStr(uint8_t band);
mfiore 0:c62615f15125 251 static std::string FrequencySubBandStr(uint8_t band);
mfiore 0:c62615f15125 252
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 253 #if defined(TARGET_MTS_MDOT_F411RE)
jreiss 9:ec2fffe31793 254 uint32_t UserRegisters[10];
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 255 #else
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 256 uint32_t UserRegisters[22];
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 257 #endif /* TARGET_MTS_MDOT_F411RE */
jreiss 9:ec2fffe31793 258
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 259 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 260 * Get a handle to the singleton object
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 261 * @param plan the channel plan to use
mfiore 0:c62615f15125 262 * @returns pointer to mDot object
mfiore 0:c62615f15125 263 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 264 static mDot* getInstance(lora::ChannelPlan* plan);
mfiore 0:c62615f15125 265
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 266 /**
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 267 * Can only be used after a dot has
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 268 * configured with a plan
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 269 * @returns pointer to mDot object
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 270 */
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 271 static mDot* getInstance();
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 272
Mike Fiore 12:54f9cac9d690 273 void setEvents(mDotEvent* events);
Mike Fiore 12:54f9cac9d690 274
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 275 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 276 *
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 277 * Get library version information
mfiore 0:c62615f15125 278 * @returns string containing library version information
mfiore 0:c62615f15125 279 */
mfiore 0:c62615f15125 280 std::string getId();
mfiore 0:c62615f15125 281
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 282 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 283 * Get MTS LoRa version information
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 284 * @returns string containing MTS LoRa version information
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 285 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 286 std::string getMtsLoraId();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 287
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 288 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 289 * Perform a soft reset of the system
mfiore 0:c62615f15125 290 */
mfiore 0:c62615f15125 291 void resetCpu();
mfiore 0:c62615f15125 292
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 293 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 294 * Reset config to factory default
mfiore 0:c62615f15125 295 */
mfiore 0:c62615f15125 296 void resetConfig();
mfiore 0:c62615f15125 297
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 298 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 299 * Save config data to non volatile memory
mfiore 0:c62615f15125 300 * @returns true if success, false if failure
mfiore 0:c62615f15125 301 */
mfiore 0:c62615f15125 302 bool saveConfig();
mfiore 0:c62615f15125 303
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 304 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 305 * Set the log level for the library
mfiore 0:c62615f15125 306 * options are:
mfiore 0:c62615f15125 307 * NONE_LEVEL - logging is off at this level
mfiore 0:c62615f15125 308 * FATAL_LEVEL - only critical errors will be reported
mfiore 0:c62615f15125 309 * ERROR_LEVEL
mfiore 0:c62615f15125 310 * WARNING_LEVEL
mfiore 0:c62615f15125 311 * INFO_LEVEL
mfiore 0:c62615f15125 312 * DEBUG_LEVEL
mfiore 0:c62615f15125 313 * TRACE_LEVEL - every detail will be reported
mfiore 0:c62615f15125 314 * @param level the level to log at
mfiore 0:c62615f15125 315 * @returns MDOT_OK if success
mfiore 0:c62615f15125 316 */
mfiore 0:c62615f15125 317 int32_t setLogLevel(const uint8_t& level);
mfiore 0:c62615f15125 318
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 319 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 320 * Get the current log level for the library
mfiore 0:c62615f15125 321 * @returns current log level
mfiore 0:c62615f15125 322 */
Mike Fiore 6:390fc83d588d 323 uint8_t getLogLevel();
Mike Fiore 6:390fc83d588d 324
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 325 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 326 * Seed pseudo RNG in LoRaMac layer, uses random value from radio RSSI reading by default
Mike Fiore 12:54f9cac9d690 327 * @param seed for RNG
Mike Fiore 12:54f9cac9d690 328 */
Mike Fiore 12:54f9cac9d690 329 void seedRandom(uint32_t seed);
Mike Fiore 12:54f9cac9d690 330
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 331
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 332 uint8_t setChannelPlan(lora::ChannelPlan* plan);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 333
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 334 lora::Settings* getSettings();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 335
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 336 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 337 * Enable or disable the activity LED.
Mike Fiore 6:390fc83d588d 338 * @param enable true to enable the LED, false to disable
Mike Fiore 6:390fc83d588d 339 */
Mike Fiore 6:390fc83d588d 340 void setActivityLedEnable(const bool& enable);
Mike Fiore 4:94969e981dcc 341
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 342 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 343 * Find out if the activity LED is enabled
Mike Fiore 6:390fc83d588d 344 * @returns true if activity LED is enabled, false if disabled
Mike Fiore 6:390fc83d588d 345 */
Mike Fiore 6:390fc83d588d 346 bool getActivityLedEnable();
Mike Fiore 6:390fc83d588d 347
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 348 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 349 * Use a different pin for the activity LED.
Mike Fiore 6:390fc83d588d 350 * The default is XBEE_RSSI.
Mike Fiore 6:390fc83d588d 351 * @param pin the new pin to use
Mike Fiore 6:390fc83d588d 352 */
Mike Fiore 6:390fc83d588d 353 void setActivityLedPin(const PinName& pin);
Mike Fiore 6:390fc83d588d 354
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 355 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 356 * Use an external DigitalOut object for the activity LED.
Mike Fiore 5:0bfe6a650513 357 * The pointer must stay valid!
Mike Fiore 5:0bfe6a650513 358 * @param pin the DigitalOut object to use
Mike Fiore 5:0bfe6a650513 359 */
Mike Fiore 5:0bfe6a650513 360 void setActivityLedPin(DigitalOut* pin);
Mike Fiore 6:390fc83d588d 361
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 362 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 363 * Find out what pin the activity LED is on
Mike Fiore 6:390fc83d588d 364 * @returns the pin the activity LED is using
Mike Fiore 6:390fc83d588d 365 */
Mike Fiore 6:390fc83d588d 366 PinName getActivityLedPin();
mfiore 0:c62615f15125 367
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 368 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 369 * Returns boolean indicative of start-up from standby mode
Mike Fiore 12:54f9cac9d690 370 * @returns true if dot woke from standby
Mike Fiore 12:54f9cac9d690 371 */
Mike Fiore 12:54f9cac9d690 372 bool getStandbyFlag();
Mike Fiore 12:54f9cac9d690 373
Mike Fiore 16:b630e18103e5 374 std::vector<uint16_t> getChannelMask();
Mike Fiore 16:b630e18103e5 375
Mike Fiore 16:b630e18103e5 376 int32_t setChannelMask(uint8_t offset, uint16_t mask);
Mike Fiore 16:b630e18103e5 377
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 378 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 379 * Add a channel
Mike Fiore 12:54f9cac9d690 380 * @returns MDOT_OK
Mike Fiore 12:54f9cac9d690 381 */
Mike Fiore 12:54f9cac9d690 382 int32_t addChannel(uint8_t index, uint32_t frequency, uint8_t datarateRange);
Mike Fiore 12:54f9cac9d690 383
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 384 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 385 * Add a downlink channel
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 386 * @returns MDOT_OK
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 387 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 388 int32_t addDownlinkChannel(uint8_t index, uint32_t frequency);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 389
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 390 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 391 * Get list of channel frequencies currently in use
mfiore 0:c62615f15125 392 * @returns vector of channels currently in use
mfiore 0:c62615f15125 393 */
mfiore 0:c62615f15125 394 std::vector<uint32_t> getChannels();
mfiore 0:c62615f15125 395
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 396 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 397 * Get list of downlink channel frequencies currently in use
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 398 * @returns vector of channels currently in use
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 399 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 400 std::vector<uint32_t> getDownlinkChannels();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 401
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 402 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 403 * Get list of channel datarate ranges currently in use
Mike Fiore 12:54f9cac9d690 404 * @returns vector of datarate ranges currently in use
Mike Fiore 12:54f9cac9d690 405 */
Mike Fiore 12:54f9cac9d690 406 std::vector<uint8_t> getChannelRanges();
Mike Fiore 12:54f9cac9d690 407
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 408 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 409 * Get list of channel frequencies in config file to be used as session defaults
Mike Fiore 12:54f9cac9d690 410 * @returns vector of channels in config file
Mike Fiore 12:54f9cac9d690 411 */
Mike Fiore 12:54f9cac9d690 412 std::vector<uint32_t> getConfigChannels();
Mike Fiore 12:54f9cac9d690 413
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 414 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 415 * Get list of channel datarate ranges in config file to be used as session defaults
Mike Fiore 12:54f9cac9d690 416 * @returns vector of datarate ranges in config file
Mike Fiore 12:54f9cac9d690 417 */
Mike Fiore 12:54f9cac9d690 418 std::vector<uint8_t> getConfigChannelRanges();
Mike Fiore 12:54f9cac9d690 419
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 420 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 421 * Get default frequency band
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 422 * @returns frequency band the device was manufactured for
mfiore 0:c62615f15125 423 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 424 uint8_t getDefaultFrequencyBand();
mfiore 0:c62615f15125 425
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 426 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 427 * Set frequency sub band
mfiore 0:c62615f15125 428 * only applicable if frequency band is set for United States (FB_915)
Jason Reiss 10:27dafba9fe19 429 * sub band 0 will allow the radio to use all 64 channels
mfiore 0:c62615f15125 430 * sub band 1 - 8 will allow the radio to use the 8 channels in that sub band
mfiore 0:c62615f15125 431 * for use with Conduit gateway and MTAC_LORA, use sub bands 1 - 8, not sub band 0
mfiore 0:c62615f15125 432 * @param band the sub band to use (0 - 8)
mfiore 0:c62615f15125 433 * @returns MDOT_OK if success
mfiore 0:c62615f15125 434 */
mfiore 0:c62615f15125 435 int32_t setFrequencySubBand(const uint8_t& band);
mfiore 0:c62615f15125 436
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 437 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 438 * Get frequency sub band
mfiore 0:c62615f15125 439 * @returns frequency sub band currently in use
mfiore 0:c62615f15125 440 */
mfiore 0:c62615f15125 441 uint8_t getFrequencySubBand();
mfiore 0:c62615f15125 442
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 443 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 444 * Get frequency band
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 445 * @returns frequency band (channel plan) currently in use
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 446 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 447 uint8_t getFrequencyBand();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 448
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 449 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 450 * Get channel plan name
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 451 * @returns name of channel plan currently in use
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 452 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 453 std::string getChannelPlanName();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 454
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 455 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 456 * Get the datarate currently in use within the MAC layer
Mike Fiore 12:54f9cac9d690 457 * returns 0-15
Mike Fiore 12:54f9cac9d690 458 */
Mike Fiore 12:54f9cac9d690 459 uint8_t getSessionDataRate();
Mike Fiore 12:54f9cac9d690 460
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 461
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 462 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 463 * Get the current max EIRP used in the channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 464 * May be changed by the network server
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 465 * returns 0-36
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 466 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 467 uint8_t getSessionMaxEIRP();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 468
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 469 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 470 * Set the current max EIRP used in the channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 471 * May be changed by the network server
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 472 * accepts 0-36
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 473 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 474 void setSessionMaxEIRP(uint8_t max);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 475
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 476 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 477 * Get the current downlink dwell time used in the channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 478 * May be changed by the network server
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 479 * returns 0-1
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 480 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 481 uint8_t getSessionDownlinkDwelltime();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 482
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 483 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 484 * Set the current downlink dwell time used in the channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 485 * May be changed by the network server
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 486 * accepts 0-1
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 487 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 488 void setSessionDownlinkDwelltime(uint8_t dwell);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 489
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 490 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 491 * Get the current uplink dwell time used in the channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 492 * May be changed by the network server
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 493 * returns 0-1
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 494 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 495 uint8_t getSessionUplinkDwelltime();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 496
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 497 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 498 * Set the current uplink dwell time used in the channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 499 * May be changed by the network server
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 500 * accepts 0-1
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 501 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 502 void setSessionUplinkDwelltime(uint8_t dwell);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 503
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 504 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 505 * Set the current downlink dwell time used in the channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 506 * May be changed by the network server
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 507 * accepts 0-1
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 508 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 509 uint32_t getListenBeforeTalkTime(uint8_t ms);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 510
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 511 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 512 * Set the current downlink dwell time used in the channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 513 * May be changed by the network server
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 514 * accepts 0-1
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 515 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 516 void setListenBeforeTalkTime(uint32_t ms);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 517
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 518 /**
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 519 * Set public network mode
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 520 * 0:PRIVATE_MTS, 1:PUBLIC_LORAWAN, 2:PRIVATE_LORAWAN
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 521 * PRIVATE_MTS - Sync Word 0x12, US/AU Downlink frequencies per Frequency Sub Band
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 522 * PUBLIC_LORAWAN - Sync Word 0x34
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 523 * PRIVATE_LORAWAN - Sync Word 0x12
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 524 *
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 525 * The default Join Delay is 5 seconds
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 526 * The default Join Delay for PRIVATE_MTS was 1 second in the previous release
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 527 * The Join Delay must be changed independently of Public Network setting
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 528 *
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 529 * @see lora::NetworkType
mfiore 0:c62615f15125 530 * @returns MDOT_OK if success
mfiore 0:c62615f15125 531 */
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 532 int32_t setPublicNetwork(const uint8_t& val);
mfiore 0:c62615f15125 533
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 534 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 535 * Get public network mode
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 536 *
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 537 * The default Join Delay is 5 seconds
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 538 * The default Join Delay for PRIVATE_MTS was 1 second in the previous release
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 539 * The Join Delay must be changed independently of Public Network setting
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 540 *
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 541 * @see lora:NetworkType
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 542 * @returns 0:PRIVATE_MTS, 1:PUBLIC_LORAWAN, 2:PRIVATE_LORAWAN
mfiore 0:c62615f15125 543 */
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 544 uint8_t getPublicNetwork();
mfiore 0:c62615f15125 545
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 546 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 547 * Get the device ID
mfiore 0:c62615f15125 548 * @returns vector containing the device ID (size 8)
mfiore 0:c62615f15125 549 */
mfiore 0:c62615f15125 550 std::vector<uint8_t> getDeviceId();
mfiore 0:c62615f15125 551
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 552 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 553 * Get the device port to be used for lora application data (1-223)
Jason Reiss 10:27dafba9fe19 554 * @returns port
Jason Reiss 10:27dafba9fe19 555 */
Jason Reiss 10:27dafba9fe19 556 uint8_t getAppPort();
Jason Reiss 10:27dafba9fe19 557
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 558 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 559 * Set the device port to be used for lora application data (1-223)
Jason Reiss 10:27dafba9fe19 560 * @returns MDOT_OK if success
Jason Reiss 10:27dafba9fe19 561 */
Jason Reiss 10:27dafba9fe19 562 int32_t setAppPort(uint8_t port);
Jason Reiss 10:27dafba9fe19 563
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 564 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 565 * Set the device class A, B or C
Jason Reiss 10:27dafba9fe19 566 * @returns MDOT_OK if success
Jason Reiss 10:27dafba9fe19 567 */
Jason Reiss 10:27dafba9fe19 568 int32_t setClass(std::string newClass);
Jason Reiss 10:27dafba9fe19 569
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 570 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 571 * Get the device class A, B or C
Jason Reiss 10:27dafba9fe19 572 * @returns MDOT_OK if success
Jason Reiss 10:27dafba9fe19 573 */
Jason Reiss 10:27dafba9fe19 574 std::string getClass();
Jason Reiss 10:27dafba9fe19 575
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 576 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 577 * Get the max packet length with current settings
Jason Reiss 10:27dafba9fe19 578 * @returns max packet length
Jason Reiss 10:27dafba9fe19 579 */
Jason Reiss 10:27dafba9fe19 580 uint8_t getMaxPacketLength();
Jason Reiss 10:27dafba9fe19 581
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 582 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 583 * Set network address
mfiore 0:c62615f15125 584 * for use with MANUAL network join mode, will be assigned in OTA & AUTO_OTA modes
mfiore 0:c62615f15125 585 * @param addr a vector of 4 bytes
mfiore 0:c62615f15125 586 * @returns MDOT_OK if success
mfiore 0:c62615f15125 587 */
mfiore 0:c62615f15125 588 int32_t setNetworkAddress(const std::vector<uint8_t>& addr);
mfiore 0:c62615f15125 589
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 590 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 591 * Get network address
mfiore 0:c62615f15125 592 * @returns vector containing network address (size 4)
mfiore 0:c62615f15125 593 */
mfiore 0:c62615f15125 594 std::vector<uint8_t> getNetworkAddress();
mfiore 0:c62615f15125 595
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 596 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 597 * Set network session key
mfiore 0:c62615f15125 598 * for use with MANUAL network join mode, will be assigned in OTA & AUTO_OTA modes
mfiore 0:c62615f15125 599 * @param key a vector of 16 bytes
mfiore 0:c62615f15125 600 * @returns MDOT_OK if success
mfiore 0:c62615f15125 601 */
mfiore 0:c62615f15125 602 int32_t setNetworkSessionKey(const std::vector<uint8_t>& key);
mfiore 0:c62615f15125 603
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 604 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 605 * Get network session key
mfiore 0:c62615f15125 606 * @returns vector containing network session key (size 16)
mfiore 0:c62615f15125 607 */
mfiore 0:c62615f15125 608 std::vector<uint8_t> getNetworkSessionKey();
mfiore 0:c62615f15125 609
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 610 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 611 * Set data session key
mfiore 0:c62615f15125 612 * for use with MANUAL network join mode, will be assigned in OTA & AUTO_OTA modes
mfiore 0:c62615f15125 613 * @param key a vector of 16 bytes
mfiore 0:c62615f15125 614 * @returns MDOT_OK if success
mfiore 0:c62615f15125 615 */
mfiore 0:c62615f15125 616 int32_t setDataSessionKey(const std::vector<uint8_t>& key);
mfiore 0:c62615f15125 617
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 618 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 619 * Get data session key
mfiore 0:c62615f15125 620 * @returns vector containing data session key (size 16)
mfiore 0:c62615f15125 621 */
mfiore 0:c62615f15125 622 std::vector<uint8_t> getDataSessionKey();
mfiore 0:c62615f15125 623
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 624 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 625 * Set network name
mfiore 0:c62615f15125 626 * for use with OTA & AUTO_OTA network join modes
mfiore 0:c62615f15125 627 * generates network ID (crc64 of name) automatically
mfiore 0:c62615f15125 628 * @param name a string of of at least 8 bytes and no more than 128 bytes
mfiore 0:c62615f15125 629 * @return MDOT_OK if success
mfiore 0:c62615f15125 630 */
mfiore 0:c62615f15125 631 int32_t setNetworkName(const std::string& name);
mfiore 0:c62615f15125 632
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 633 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 634 * Get network name
mfiore 0:c62615f15125 635 * @return string containing network name (size 8 to 128)
mfiore 0:c62615f15125 636 */
mfiore 0:c62615f15125 637 std::string getNetworkName();
mfiore 0:c62615f15125 638
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 639 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 640 * Set network ID
mfiore 0:c62615f15125 641 * for use with OTA & AUTO_OTA network join modes
mfiore 0:c62615f15125 642 * setting network ID via this function sets network name to empty
mfiore 0:c62615f15125 643 * @param id a vector of 8 bytes
mfiore 0:c62615f15125 644 * @returns MDOT_OK if success
mfiore 0:c62615f15125 645 */
mfiore 0:c62615f15125 646 int32_t setNetworkId(const std::vector<uint8_t>& id);
mfiore 0:c62615f15125 647
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 648 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 649 * Get network ID
mfiore 0:c62615f15125 650 * @returns vector containing network ID (size 8)
mfiore 0:c62615f15125 651 */
mfiore 0:c62615f15125 652 std::vector<uint8_t> getNetworkId();
mfiore 0:c62615f15125 653
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 654 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 655 * Set network passphrase
mfiore 0:c62615f15125 656 * for use with OTA & AUTO_OTA network join modes
mfiore 0:c62615f15125 657 * generates network key (cmac of passphrase) automatically
mfiore 0:c62615f15125 658 * @param name a string of of at least 8 bytes and no more than 128 bytes
mfiore 0:c62615f15125 659 * @return MDOT_OK if success
mfiore 0:c62615f15125 660 */
mfiore 0:c62615f15125 661 int32_t setNetworkPassphrase(const std::string& passphrase);
mfiore 0:c62615f15125 662
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 663 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 664 * Get network passphrase
mfiore 0:c62615f15125 665 * @return string containing network passphrase (size 8 to 128)
mfiore 0:c62615f15125 666 */
mfiore 0:c62615f15125 667 std::string getNetworkPassphrase();
mfiore 0:c62615f15125 668
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 669 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 670 * Set network key
mfiore 0:c62615f15125 671 * for use with OTA & AUTO_OTA network join modes
mfiore 0:c62615f15125 672 * setting network key via this function sets network passphrase to empty
mfiore 0:c62615f15125 673 * @param id a vector of 16 bytes
mfiore 0:c62615f15125 674 * @returns MDOT_OK if success
mfiore 0:c62615f15125 675 */
mfiore 0:c62615f15125 676 int32_t setNetworkKey(const std::vector<uint8_t>& id);
mfiore 0:c62615f15125 677
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 678 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 679 * Get network key
mfiore 0:c62615f15125 680 * @returns a vector containing network key (size 16)
mfiore 0:c62615f15125 681 */
mfiore 0:c62615f15125 682 std::vector<uint8_t> getNetworkKey();
mfiore 0:c62615f15125 683
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 684 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 685 * Set lorawan application EUI
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 686 * equivalent to setNetworkId
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 687 * @param eui application EUI (size 8)
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 688 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 689 int32_t setAppEUI(const uint8_t* eui);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 690
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 691 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 692 * Get lorawan application EUI
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 693 * equivalent to getNetworkId
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 694 * @returns vector containing application EUI (size 8)
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 695 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 696 const uint8_t* getAppEUI();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 697
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 698 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 699 * Set lorawan application key
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 700 * equivalent to setNetworkKey
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 701 * @param eui application key (size 16)
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 702 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 703 int32_t setAppKey(const uint8_t* key);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 704
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 705 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 706 * Set lorawan application key
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 707 * equivalent to getNetworkKey
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 708 * @returns eui application key (size 16)
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 709 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 710 const uint8_t* getAppKey();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 711
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 712 /**
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 713 * Add a multicast session address and keys
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 714 * Downlink counter is set to 0
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 715 * Up to 3 MULTICAST_SESSIONS can be set
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 716 */
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 717 int32_t setMulticastSession(uint8_t index, uint32_t addr, const uint8_t* nsk, const uint8_t* dsk);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 718
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 719 /**
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 720 * Set a multicast session counter
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 721 * Up to 3 MULTICAST_SESSIONS can be set
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 722 */
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 723 int32_t setMulticastDownlinkCounter(uint8_t index, uint32_t count);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 724
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 725 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 726 * Set join byte order
Mike Fiore 6:390fc83d588d 727 * @param order 0:LSB 1:MSB
Mike Fiore 6:390fc83d588d 728 */
Mike Fiore 6:390fc83d588d 729 uint32_t setJoinByteOrder(uint8_t order);
Mike Fiore 6:390fc83d588d 730
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 731 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 732 * Get join byte order
Mike Fiore 6:390fc83d588d 733 * @returns byte order to use in joins 0:LSB 1:MSB
Mike Fiore 6:390fc83d588d 734 */
Mike Fiore 6:390fc83d588d 735 uint8_t getJoinByteOrder();
Mike Fiore 6:390fc83d588d 736
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 737 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 738 * Attempt to join network
Mike Fiore 12:54f9cac9d690 739 * each attempt will be made with a random datarate up to the configured datarate
Mike Fiore 12:54f9cac9d690 740 * JoinRequest backoff between tries is enforced to 1% for 1st hour, 0.1% for 1-10 hours and 0.01% after 10 hours
Mike Fiore 12:54f9cac9d690 741 * Check getNextTxMs() for time until next join attempt can be made
mfiore 0:c62615f15125 742 * @returns MDOT_OK if success
mfiore 0:c62615f15125 743 */
mfiore 0:c62615f15125 744 int32_t joinNetwork();
mfiore 0:c62615f15125 745
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 746 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 747 * Attempts to join network once
mfiore 0:c62615f15125 748 * @returns MDOT_OK if success
mfiore 0:c62615f15125 749 */
mfiore 0:c62615f15125 750 int32_t joinNetworkOnce();
mfiore 0:c62615f15125 751
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 752 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 753 * Resets current network session, essentially disconnecting from the network
mfiore 0:c62615f15125 754 * has no effect for MANUAL network join mode
mfiore 0:c62615f15125 755 */
mfiore 0:c62615f15125 756 void resetNetworkSession();
mfiore 0:c62615f15125 757
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 758 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 759 * Restore saved network session from flash
Mike Fiore 12:54f9cac9d690 760 * has no effect for MANUAL network join mode
Mike Fiore 12:54f9cac9d690 761 */
Mike Fiore 12:54f9cac9d690 762 void restoreNetworkSession();
Mike Fiore 12:54f9cac9d690 763
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 764 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 765 * Save current network session to flash
Mike Fiore 12:54f9cac9d690 766 * has no effect for MANUAL network join mode
Mike Fiore 12:54f9cac9d690 767 */
Mike Fiore 12:54f9cac9d690 768 void saveNetworkSession();
Mike Fiore 12:54f9cac9d690 769
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 770 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 771 * Set number of times joining will retry each sub-band before changing
jreiss 17:306ffaa5d79b 772 * to the next subband in US915 and AU915
mfiore 0:c62615f15125 773 * @param retries must be between 0 - 255
mfiore 0:c62615f15125 774 * @returns MDOT_OK if success
mfiore 0:c62615f15125 775 */
mfiore 0:c62615f15125 776 int32_t setJoinRetries(const uint8_t& retries);
mfiore 0:c62615f15125 777
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 778 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 779 * Get number of times joining will retry each sub-band
mfiore 0:c62615f15125 780 * @returns join retries (0 - 255)
mfiore 0:c62615f15125 781 */
mfiore 0:c62615f15125 782 uint8_t getJoinRetries();
mfiore 0:c62615f15125 783
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 784 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 785 * Set network join mode
mfiore 0:c62615f15125 786 * MANUAL: set network address and session keys manually
mfiore 0:c62615f15125 787 * OTA: User sets network name and passphrase, then attempts to join
mfiore 0:c62615f15125 788 * AUTO_OTA: same as OTA, but network sessions can be saved and restored
mfiore 0:c62615f15125 789 * @param mode MANUAL, OTA, or AUTO_OTA
mfiore 0:c62615f15125 790 * @returns MDOT_OK if success
mfiore 0:c62615f15125 791 */
mfiore 0:c62615f15125 792 int32_t setJoinMode(const uint8_t& mode);
mfiore 0:c62615f15125 793
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 794 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 795 * Get network join mode
mfiore 0:c62615f15125 796 * @returns MANUAL, OTA, or AUTO_OTA
mfiore 0:c62615f15125 797 */
mfiore 0:c62615f15125 798 uint8_t getJoinMode();
mfiore 0:c62615f15125 799
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 800 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 801 * Get network join status
mfiore 0:c62615f15125 802 * @returns true if currently joined to network
mfiore 0:c62615f15125 803 */
mfiore 0:c62615f15125 804 bool getNetworkJoinStatus();
mfiore 0:c62615f15125 805
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 806 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 807 * Do a network link check
mfiore 0:c62615f15125 808 * application data may be returned in response to a network link check command
mfiore 0:c62615f15125 809 * @returns link_check structure containing success, dBm above noise floor, gateways in range, and packet payload
mfiore 0:c62615f15125 810 */
mfiore 0:c62615f15125 811 link_check networkLinkCheck();
mfiore 0:c62615f15125 812
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 813 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 814 * Set network link check count to perform automatic link checks every count packets
mfiore 0:c62615f15125 815 * only applicable if ACKs are disabled
mfiore 0:c62615f15125 816 * @param count must be between 0 - 255
mfiore 0:c62615f15125 817 * @returns MDOT_OK if success
mfiore 0:c62615f15125 818 */
mfiore 0:c62615f15125 819 int32_t setLinkCheckCount(const uint8_t& count);
mfiore 0:c62615f15125 820
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 821 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 822 * Get network link check count
mfiore 0:c62615f15125 823 * @returns count (0 - 255)
mfiore 0:c62615f15125 824 */
mfiore 0:c62615f15125 825 uint8_t getLinkCheckCount();
mfiore 0:c62615f15125 826
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 827 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 828 * Set network link check threshold, number of link check failures or missed acks to tolerate
mfiore 0:c62615f15125 829 * before considering network connection lost
mfiore 0:c62615f15125 830 * @pararm count must be between 0 - 255
mfiore 0:c62615f15125 831 * @returns MDOT_OK if success
mfiore 0:c62615f15125 832 */
mfiore 0:c62615f15125 833 int32_t setLinkCheckThreshold(const uint8_t& count);
mfiore 0:c62615f15125 834
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 835 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 836 * Get network link check threshold
mfiore 0:c62615f15125 837 * @returns threshold (0 - 255)
mfiore 0:c62615f15125 838 */
mfiore 0:c62615f15125 839 uint8_t getLinkCheckThreshold();
mfiore 0:c62615f15125 840
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 841 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 842 * Get/set number of failed link checks in the current session
Mike Fiore 12:54f9cac9d690 843 * @returns count (0 - 255)
Mike Fiore 12:54f9cac9d690 844 */
Mike Fiore 12:54f9cac9d690 845 uint8_t getLinkFailCount();
Mike Fiore 12:54f9cac9d690 846 int32_t setLinkFailCount(uint8_t count);
Mike Fiore 12:54f9cac9d690 847
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 848 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 849 * Set UpLinkCounter number of packets sent to the gateway during this network session (sequence number)
Mike Fiore 12:54f9cac9d690 850 * @returns MDOT_OK
Mike Fiore 12:54f9cac9d690 851 */
Mike Fiore 12:54f9cac9d690 852 int32_t setUpLinkCounter(uint32_t count);
Mike Fiore 12:54f9cac9d690 853
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 854 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 855 * Get UpLinkCounter
mfiore 0:c62615f15125 856 * @returns number of packets sent to the gateway during this network session (sequence number)
mfiore 0:c62615f15125 857 */
mfiore 0:c62615f15125 858 uint32_t getUpLinkCounter();
mfiore 0:c62615f15125 859
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 860 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 861 * Set UpLinkCounter number of packets sent by the gateway during this network session (sequence number)
Mike Fiore 12:54f9cac9d690 862 * @returns MDOT_OK
Mike Fiore 12:54f9cac9d690 863 */
Mike Fiore 12:54f9cac9d690 864 int32_t setDownLinkCounter(uint32_t count);
Mike Fiore 12:54f9cac9d690 865
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 866 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 867 * Get DownLinkCounter
Mike Fiore 12:54f9cac9d690 868 * @returns number of packets sent by the gateway during this network session (sequence number)
Mike Fiore 12:54f9cac9d690 869 */
Mike Fiore 12:54f9cac9d690 870 uint32_t getDownLinkCounter();
Mike Fiore 12:54f9cac9d690 871
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 872 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 873 * Enable/disable AES encryption
mfiore 0:c62615f15125 874 * AES encryption must be enabled for use with Conduit gateway and MTAC_LORA card
mfiore 0:c62615f15125 875 * @param on true for AES encryption to be enabled
mfiore 0:c62615f15125 876 * @returns MDOT_OK if success
mfiore 0:c62615f15125 877 */
mfiore 0:c62615f15125 878 int32_t setAesEncryption(const bool& on);
mfiore 0:c62615f15125 879
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 880 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 881 * Get AES encryption
mfiore 0:c62615f15125 882 * @returns true if AES encryption is enabled
mfiore 0:c62615f15125 883 */
mfiore 0:c62615f15125 884 bool getAesEncryption();
mfiore 0:c62615f15125 885
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 886 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 887 * Get RSSI stats
Mike Fiore 11:d8464345e1f1 888 * @returns rssi_stats struct containing last, min, max, and avg RSSI in dB
mfiore 0:c62615f15125 889 */
mfiore 0:c62615f15125 890 rssi_stats getRssiStats();
mfiore 0:c62615f15125 891
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 892 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 893 * Get SNR stats
Mike Fiore 11:d8464345e1f1 894 * @returns snr_stats struct containing last, min, max, and avg SNR in cB
mfiore 0:c62615f15125 895 */
mfiore 0:c62615f15125 896 snr_stats getSnrStats();
mfiore 0:c62615f15125 897
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 898 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 899 * Get ms until next free channel
mfiore 0:c62615f15125 900 * only applicable for European models, US models return 0
mfiore 0:c62615f15125 901 * @returns time (ms) until a channel is free to use for transmitting
mfiore 0:c62615f15125 902 */
mfiore 0:c62615f15125 903 uint32_t getNextTxMs();
mfiore 0:c62615f15125 904
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 905 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 906 * Get join delay in seconds
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 907 * Defaults to 5 seconds
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 908 * Must match join delay setting of the network server
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 909 *
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 910 * The default Join Delay is 5 seconds
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 911 * The default Join Delay for PRIVATE_MTS was 1 second in the previous release
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 912 *
Jason Reiss 10:27dafba9fe19 913 * @returns number of seconds before join accept message is expected
Jason Reiss 10:27dafba9fe19 914 */
Jason Reiss 10:27dafba9fe19 915 uint8_t getJoinDelay();
Jason Reiss 10:27dafba9fe19 916
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 917 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 918 * Set join delay in seconds
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 919 * Defaults to 5 seconds
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 920 * Must match join delay setting of the network server
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 921 *
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 922 * The default Join Delay is 5 seconds
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 923 * The default Join Delay for PRIVATE_MTS was 1 second in the previous release
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 924 *
Jason Reiss 10:27dafba9fe19 925 * @param delay number of seconds before join accept message is expected
Jason Reiss 10:27dafba9fe19 926 * @return MDOT_OK if success
Jason Reiss 10:27dafba9fe19 927 */
Jason Reiss 10:27dafba9fe19 928 uint32_t setJoinDelay(uint8_t delay);
Jason Reiss 10:27dafba9fe19 929
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 930 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 931 * Get join Rx1 datarate offset
Mike Fiore 16:b630e18103e5 932 * defaults to 0
Mike Fiore 16:b630e18103e5 933 * @returns offset
Mike Fiore 16:b630e18103e5 934 */
Mike Fiore 16:b630e18103e5 935 uint8_t getJoinRx1DataRateOffset();
Mike Fiore 16:b630e18103e5 936
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 937 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 938 * Set join Rx1 datarate offset
Mike Fiore 16:b630e18103e5 939 * @param offset for datarate
Mike Fiore 16:b630e18103e5 940 * @return MDOT_OK if success
Mike Fiore 16:b630e18103e5 941 */
Mike Fiore 16:b630e18103e5 942 uint32_t setJoinRx1DataRateOffset(uint8_t offset);
Mike Fiore 16:b630e18103e5 943
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 944 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 945 * Get join Rx2 datarate
Mike Fiore 16:b630e18103e5 946 * defaults to US:DR8, AU:DR8, EU:DR0
Mike Fiore 16:b630e18103e5 947 * @returns datarate
Mike Fiore 16:b630e18103e5 948 */
Mike Fiore 16:b630e18103e5 949 uint8_t getJoinRx2DataRate();
Mike Fiore 16:b630e18103e5 950
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 951 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 952 * Set join Rx2 datarate
Mike Fiore 16:b630e18103e5 953 * @param datarate
Mike Fiore 16:b630e18103e5 954 * @return MDOT_OK if success
Mike Fiore 16:b630e18103e5 955 */
Mike Fiore 16:b630e18103e5 956 uint32_t setJoinRx2DataRate(uint8_t datarate);
Mike Fiore 16:b630e18103e5 957
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 958 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 959 * Get join Rx2 frequency
Mike Fiore 16:b630e18103e5 960 * defaults US:923.3, AU:923.3, EU:869.525
Mike Fiore 16:b630e18103e5 961 * @returns frequency
Mike Fiore 16:b630e18103e5 962 */
Mike Fiore 16:b630e18103e5 963 uint32_t getJoinRx2Frequency();
Mike Fiore 16:b630e18103e5 964
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 965 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 966 * Set join Rx2 frequency
Mike Fiore 16:b630e18103e5 967 * @param frequency
Mike Fiore 16:b630e18103e5 968 * @return MDOT_OK if success
Mike Fiore 16:b630e18103e5 969 */
Mike Fiore 16:b630e18103e5 970 uint32_t setJoinRx2Frequency(uint32_t frequency);
Mike Fiore 16:b630e18103e5 971
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 972 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 973 * Get rx delay in seconds
Jason Reiss 10:27dafba9fe19 974 * Defaults to 1 second
Jason Reiss 10:27dafba9fe19 975 * @returns number of seconds before response message is expected
Jason Reiss 10:27dafba9fe19 976 */
Jason Reiss 10:27dafba9fe19 977 uint8_t getRxDelay();
Jason Reiss 10:27dafba9fe19 978
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 979 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 980 * Set rx delay in seconds
Jason Reiss 10:27dafba9fe19 981 * Defaults to 1 second
Jason Reiss 10:27dafba9fe19 982 * @param delay number of seconds before response message is expected
Jason Reiss 10:27dafba9fe19 983 * @return MDOT_OK if success
Jason Reiss 10:27dafba9fe19 984 */
Jason Reiss 10:27dafba9fe19 985 uint32_t setRxDelay(uint8_t delay);
Jason Reiss 10:27dafba9fe19 986
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 987 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 988 * Get preserve session to save network session info through reset or power down in AUTO_OTA mode
Jason Reiss 10:27dafba9fe19 989 * Defaults to off
Jason Reiss 10:27dafba9fe19 990 * @returns true if enabled
Jason Reiss 10:27dafba9fe19 991 */
Jason Reiss 10:27dafba9fe19 992 bool getPreserveSession();
Jason Reiss 10:27dafba9fe19 993
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 994 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 995 * Set preserve session to save network session info through reset or power down in AUTO_OTA mode
Jason Reiss 10:27dafba9fe19 996 * Defaults to off
Jason Reiss 10:27dafba9fe19 997 * @param enable
Jason Reiss 10:27dafba9fe19 998 * @return MDOT_OK if success
Jason Reiss 10:27dafba9fe19 999 */
Jason Reiss 10:27dafba9fe19 1000 uint32_t setPreserveSession(bool enable);
Jason Reiss 10:27dafba9fe19 1001
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1002 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1003 * Get data pending
mfiore 0:c62615f15125 1004 * only valid after sending data to the gateway
mfiore 0:c62615f15125 1005 * @returns true if server has available packet(s)
mfiore 0:c62615f15125 1006 */
mfiore 0:c62615f15125 1007 bool getDataPending();
mfiore 0:c62615f15125 1008
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1009 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1010 * Get ack requested
Mike Fiore 16:b630e18103e5 1011 * only valid after sending data to the gateway
Mike Fiore 16:b630e18103e5 1012 * @returns true if server has requested ack
Mike Fiore 16:b630e18103e5 1013 */
Mike Fiore 16:b630e18103e5 1014 bool getAckRequested();
Mike Fiore 16:b630e18103e5 1015
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1016 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1017 * Get is transmitting indicator
mfiore 0:c62615f15125 1018 * @returns true if currently transmitting
mfiore 0:c62615f15125 1019 */
mfiore 0:c62615f15125 1020 bool getIsTransmitting();
mfiore 0:c62615f15125 1021
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1022 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1023 * Get is idle indicator
Mike Fiore 16:b630e18103e5 1024 * @returns true if not currently transmitting, waiting or receiving
Mike Fiore 16:b630e18103e5 1025 */
Mike Fiore 16:b630e18103e5 1026 bool getIsIdle();
Mike Fiore 16:b630e18103e5 1027
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1028 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1029 * Set TX data rate
mfiore 0:c62615f15125 1030 * data rates affect maximum payload size
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1031 * @param dr DR0-DR7 for Europe, DR0-DR4 for United States
mfiore 0:c62615f15125 1032 * @returns MDOT_OK if success
mfiore 0:c62615f15125 1033 */
mfiore 0:c62615f15125 1034 int32_t setTxDataRate(const uint8_t& dr);
mfiore 0:c62615f15125 1035
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1036 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1037 * Get TX data rate
Mike Fiore 11:d8464345e1f1 1038 * @returns current TX data rate (DR0-DR15)
mfiore 0:c62615f15125 1039 */
mfiore 0:c62615f15125 1040 uint8_t getTxDataRate();
mfiore 0:c62615f15125 1041
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1042 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1043 * Get a random value from the radio based on RSSI
Mike Fiore 12:54f9cac9d690 1044 * @returns randome value
Mike Fiore 12:54f9cac9d690 1045 */
Mike Fiore 12:54f9cac9d690 1046 uint32_t getRadioRandom();
Mike Fiore 12:54f9cac9d690 1047
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1048 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1049 * Get data rate spreading factor and bandwidth
Mike Fiore 11:d8464345e1f1 1050 * EU868 Datarates
Mike Fiore 11:d8464345e1f1 1051 * ---------------
Mike Fiore 11:d8464345e1f1 1052 * DR0 - SF12BW125
Mike Fiore 11:d8464345e1f1 1053 * DR1 - SF11BW125
Mike Fiore 11:d8464345e1f1 1054 * DR2 - SF10BW125
Mike Fiore 11:d8464345e1f1 1055 * DR3 - SF9BW125
Mike Fiore 11:d8464345e1f1 1056 * DR4 - SF8BW125
Mike Fiore 11:d8464345e1f1 1057 * DR5 - SF7BW125
Mike Fiore 11:d8464345e1f1 1058 * DR6 - SF7BW250
Mike Fiore 11:d8464345e1f1 1059 * DR7 - FSK
Mike Fiore 11:d8464345e1f1 1060 *
Mike Fiore 11:d8464345e1f1 1061 * US915 Datarates
Mike Fiore 11:d8464345e1f1 1062 * ---------------
Mike Fiore 11:d8464345e1f1 1063 * DR0 - SF10BW125
Mike Fiore 11:d8464345e1f1 1064 * DR1 - SF9BW125
Mike Fiore 11:d8464345e1f1 1065 * DR2 - SF8BW125
Mike Fiore 11:d8464345e1f1 1066 * DR3 - SF7BW125
Mike Fiore 11:d8464345e1f1 1067 * DR4 - SF8BW500
Mike Fiore 11:d8464345e1f1 1068 *
jreiss 17:306ffaa5d79b 1069 * AU915 Datarates
jreiss 17:306ffaa5d79b 1070 * ---------------
jreiss 17:306ffaa5d79b 1071 * DR0 - SF10BW125
jreiss 17:306ffaa5d79b 1072 * DR1 - SF9BW125
jreiss 17:306ffaa5d79b 1073 * DR2 - SF8BW125
jreiss 17:306ffaa5d79b 1074 * DR3 - SF7BW125
jreiss 17:306ffaa5d79b 1075 * DR4 - SF8BW500
jreiss 17:306ffaa5d79b 1076 *
Mike Fiore 11:d8464345e1f1 1077 * @returns spreading factor and bandwidth
Mike Fiore 11:d8464345e1f1 1078 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1079 std::string getDataRateDetails(uint8_t rate);
Mike Fiore 11:d8464345e1f1 1080 std::string getDateRateDetails(uint8_t rate);
Mike Fiore 11:d8464345e1f1 1081
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1082
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1083 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1084 * Set TX power output of radio before antenna gain, default: 14 dBm
Mike Fiore 12:54f9cac9d690 1085 * actual output power may be limited by local regulations for the chosen frequency
mfiore 0:c62615f15125 1086 * power affects maximum range
mfiore 0:c62615f15125 1087 * @param power 2 dBm - 20 dBm
mfiore 0:c62615f15125 1088 * @returns MDOT_OK if success
mfiore 0:c62615f15125 1089 */
mfiore 0:c62615f15125 1090 int32_t setTxPower(const uint32_t& power);
mfiore 0:c62615f15125 1091
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1092 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1093 * Get TX power
mfiore 0:c62615f15125 1094 * @returns TX power (2 dBm - 20 dBm)
mfiore 0:c62615f15125 1095 */
mfiore 0:c62615f15125 1096 uint32_t getTxPower();
mfiore 0:c62615f15125 1097
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1098 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1099 * Get configured gain of installed antenna, default: +3 dBi
Mike Fiore 11:d8464345e1f1 1100 * @returns gain of antenna in dBi
Mike Fiore 11:d8464345e1f1 1101 */
Mike Fiore 11:d8464345e1f1 1102 int8_t getAntennaGain();
Mike Fiore 11:d8464345e1f1 1103
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1104 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1105 * Set configured gain of installed antenna, default: +3 dBi
Mike Fiore 11:d8464345e1f1 1106 * @param gain -127 dBi - 128 dBi
Mike Fiore 11:d8464345e1f1 1107 * @returns MDOT_OK if success
Mike Fiore 11:d8464345e1f1 1108 */
Mike Fiore 11:d8464345e1f1 1109 int32_t setAntennaGain(int8_t gain);
Mike Fiore 11:d8464345e1f1 1110
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1111 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1112 * Enable/disable TX waiting for rx windows
mfiore 0:c62615f15125 1113 * when enabled, send calls will block until a packet is received or RX timeout
mfiore 0:c62615f15125 1114 * @param enable set to true if expecting responses to transmitted packets
mfiore 0:c62615f15125 1115 * @returns MDOT_OK if success
mfiore 0:c62615f15125 1116 */
mfiore 0:c62615f15125 1117 int32_t setTxWait(const bool& enable);
mfiore 0:c62615f15125 1118
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1119 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1120 * Get TX wait
mfiore 0:c62615f15125 1121 * @returns true if TX wait is enabled
mfiore 0:c62615f15125 1122 */
mfiore 0:c62615f15125 1123 bool getTxWait();
mfiore 0:c62615f15125 1124
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1125 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1126 * Cancel pending rx windows
Mike Fiore 16:b630e18103e5 1127 */
Mike Fiore 16:b630e18103e5 1128 void cancelRxWindow();
Mike Fiore 16:b630e18103e5 1129
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1130 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1131 * Get time on air
mfiore 0:c62615f15125 1132 * @returns the amount of time (in ms) it would take to send bytes bytes based on current configuration
mfiore 0:c62615f15125 1133 */
mfiore 0:c62615f15125 1134 uint32_t getTimeOnAir(uint8_t bytes);
mfiore 0:c62615f15125 1135
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1136 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1137 * Get min frequency
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1138 * @returns minimum frequency based on current channel plan
mfiore 0:c62615f15125 1139 */
mfiore 0:c62615f15125 1140 uint32_t getMinFrequency();
mfiore 0:c62615f15125 1141
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1142 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1143 * Get max frequency
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1144 * @returns maximum frequency based on current channel plan
mfiore 0:c62615f15125 1145 */
mfiore 0:c62615f15125 1146 uint32_t getMaxFrequency();
mfiore 0:c62615f15125 1147
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1148 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1149 * Get min datarate
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1150 * @returns minimum datarate based on current channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1151 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1152 uint8_t getMinDatarate();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1153
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1154 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1155 * Get max datarate
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1156 * @returns maximum datarate based on current channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1157 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1158 uint8_t getMaxDatarate();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1159
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1160 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1161 * Get min datarate offset
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1162 * @returns minimum datarate offset based on current channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1163 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1164 uint8_t getMinDatarateOffset();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1165
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1166 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1167 * Get max datarate offset
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1168 * @returns maximum datarate based on current channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1169 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1170 uint8_t getMaxDatarateOffset();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1171
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1172 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1173 * Get min datarate
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1174 * @returns minimum datarate based on current channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1175 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1176 uint8_t getMinRx2Datarate();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1177
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1178 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1179 * Get max rx2 datarate
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1180 * @returns maximum rx2 datarate based on current channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1181 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1182 uint8_t getMaxRx2Datarate();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1183
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1184 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1185 * Get max tx power
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1186 * @returns maximum tx power based on current channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1187 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1188 uint8_t getMaxTxPower();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1189
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1190 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1191 * Get min tx power
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1192 * @returns minimum tx power based on current channel plan
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1193 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1194 uint8_t getMinTxPower();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1195
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1196 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1197 *
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1198 * get/set adaptive data rate
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1199 * configure data rates and power levels based on signal to noise of packets received at gateway
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1200 * true == adaptive data rate is on
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1201 * set function returns MDOT_OK if success
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1202 */
Mike Fiore 12:54f9cac9d690 1203 int32_t setAdr(const bool& on);
Mike Fiore 12:54f9cac9d690 1204 bool getAdr();
Mike Fiore 12:54f9cac9d690 1205
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1206 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1207 * Set forward error correction bytes
mfiore 0:c62615f15125 1208 * @param bytes 1 - 4 bytes
mfiore 0:c62615f15125 1209 * @returns MDOT_OK if success
mfiore 0:c62615f15125 1210 */
mfiore 0:c62615f15125 1211 int32_t setFec(const uint8_t& bytes);
mfiore 0:c62615f15125 1212
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1213 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1214 * Get forward error correction bytes
mfiore 0:c62615f15125 1215 * @returns bytes (1 - 4)
mfiore 0:c62615f15125 1216 */
mfiore 0:c62615f15125 1217 uint8_t getFec();
mfiore 0:c62615f15125 1218
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1219 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1220 * Enable/disable CRC checking of packets
mfiore 0:c62615f15125 1221 * CRC checking must be enabled for use with Conduit gateway and MTAC_LORA card
mfiore 0:c62615f15125 1222 * @param on set to true to enable CRC checking
mfiore 0:c62615f15125 1223 * @returns MDOT_OK if success
mfiore 0:c62615f15125 1224 */
mfiore 0:c62615f15125 1225 int32_t setCrc(const bool& on);
mfiore 0:c62615f15125 1226
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1227 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1228 * Get CRC checking
mfiore 0:c62615f15125 1229 * @returns true if CRC checking is enabled
mfiore 0:c62615f15125 1230 */
mfiore 0:c62615f15125 1231 bool getCrc();
mfiore 0:c62615f15125 1232
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1233 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1234 * Set ack
mfiore 0:c62615f15125 1235 * @param retries 0 to disable acks, otherwise 1 - 8
mfiore 0:c62615f15125 1236 * @returns MDOT_OK if success
mfiore 0:c62615f15125 1237 */
mfiore 0:c62615f15125 1238 int32_t setAck(const uint8_t& retries);
mfiore 0:c62615f15125 1239
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1240 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1241 * Get ack
mfiore 0:c62615f15125 1242 * @returns 0 if acks are disabled, otherwise retries (1 - 8)
mfiore 0:c62615f15125 1243 */
mfiore 0:c62615f15125 1244 uint8_t getAck();
mfiore 0:c62615f15125 1245
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1246 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1247 * Set number of packet repeats for unconfirmed frames
Mike Fiore 12:54f9cac9d690 1248 * @param repeat 0 or 1 for no repeats, otherwise 2-15
Mike Fiore 12:54f9cac9d690 1249 * @returns MDOT_OK if success
Mike Fiore 12:54f9cac9d690 1250 */
Mike Fiore 12:54f9cac9d690 1251 int32_t setRepeat(const uint8_t& repeat);
Mike Fiore 12:54f9cac9d690 1252
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1253 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1254 * Get number of packet repeats for unconfirmed frames
Mike Fiore 12:54f9cac9d690 1255 * @returns 0 or 1 if no repeats, otherwise 2-15
Mike Fiore 12:54f9cac9d690 1256 */
Mike Fiore 12:54f9cac9d690 1257 uint8_t getRepeat();
Mike Fiore 12:54f9cac9d690 1258
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1259 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1260 * Send data to the gateway
mfiore 0:c62615f15125 1261 * validates data size (based on spreading factor)
mfiore 0:c62615f15125 1262 * @param data a vector of up to 242 bytes (may be less based on spreading factor)
mfiore 0:c62615f15125 1263 * @returns MDOT_OK if packet was sent successfully (ACKs disabled), or if an ACK was received (ACKs enabled)
mfiore 0:c62615f15125 1264 */
mfiore 0:c62615f15125 1265 int32_t send(const std::vector<uint8_t>& data, const bool& blocking = true, const bool& highBw = false);
mfiore 0:c62615f15125 1266
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1267 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1268 * Inject mac command
Mike Fiore 16:b630e18103e5 1269 * @param data a vector containing mac commands
Mike Fiore 16:b630e18103e5 1270 * @returns MDOT_OK
Mike Fiore 16:b630e18103e5 1271 */
Mike Fiore 16:b630e18103e5 1272 int32_t injectMacCommand(const std::vector<uint8_t>& data);
Mike Fiore 16:b630e18103e5 1273
Mike Fiore 16:b630e18103e5 1274 /**
Mike Fiore 16:b630e18103e5 1275 * Clear MAC command buffer to be sent in next uplink
Mike Fiore 16:b630e18103e5 1276 * @returns MDOT_OK
Mike Fiore 16:b630e18103e5 1277 */
Mike Fiore 16:b630e18103e5 1278 int32_t clearMacCommands();
Mike Fiore 16:b630e18103e5 1279
Mike Fiore 16:b630e18103e5 1280 /**
Mike Fiore 16:b630e18103e5 1281 * Get MAC command buffer to be sent in next uplink
Mike Fiore 16:b630e18103e5 1282 * @returns command bytes
Mike Fiore 16:b630e18103e5 1283 */
Mike Fiore 16:b630e18103e5 1284 std::vector<uint8_t> getMacCommands();
Mike Fiore 16:b630e18103e5 1285
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1286 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1287 * Fetch data received from the gateway
mfiore 0:c62615f15125 1288 * this function only checks to see if a packet has been received - it does not open a receive window
mfiore 0:c62615f15125 1289 * send() must be called before recv()
mfiore 0:c62615f15125 1290 * @param data a vector to put the received data into
mfiore 0:c62615f15125 1291 * @returns MDOT_OK if packet was successfully received
mfiore 0:c62615f15125 1292 */
mfiore 0:c62615f15125 1293 int32_t recv(std::vector<uint8_t>& data);
mfiore 0:c62615f15125 1294
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1295 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1296 * Ping
mfiore 0:c62615f15125 1297 * status will be MDOT_OK if ping succeeded
mfiore 0:c62615f15125 1298 * @returns ping_response struct containing status, RSSI, and SNR
mfiore 0:c62615f15125 1299 */
mfiore 0:c62615f15125 1300 ping_response ping();
mfiore 0:c62615f15125 1301
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1302 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1303 * Get return code string
mfiore 0:c62615f15125 1304 * @returns string containing a description of the given error code
mfiore 0:c62615f15125 1305 */
mfiore 0:c62615f15125 1306 static std::string getReturnCodeString(const int32_t& code);
mfiore 0:c62615f15125 1307
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1308 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1309 * Get last error
mfiore 0:c62615f15125 1310 * @returns string explaining the last error that occured
mfiore 0:c62615f15125 1311 */
mfiore 0:c62615f15125 1312 std::string getLastError();
mfiore 0:c62615f15125 1313
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1314 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1315 * Go to sleep
Jason Reiss 10:27dafba9fe19 1316 * @param interval the number of seconds to sleep before waking up if wakeup_mode == RTC_ALARM or RTC_ALARM_OR_INTERRUPT, else ignored
Jason Reiss 10:27dafba9fe19 1317 * @param wakeup_mode RTC_ALARM, INTERRUPT, RTC_ALARM_OR_INTERRUPT
Mike Fiore 7:683dba5d576f 1318 * if RTC_ALARM the real time clock is configured to wake the device up after the specified interval
Mike Fiore 7:683dba5d576f 1319 * if INTERRUPT the device will wake up on the rising edge of the interrupt pin
Jason Reiss 10:27dafba9fe19 1320 * if RTC_ALARM_OR_INTERRUPT the device will wake on the first event to occur
Mike Fiore 7:683dba5d576f 1321 * @param deepsleep if true go into deep sleep mode (lowest power, all memory and registers are lost, peripherals turned off)
Mike Fiore 7:683dba5d576f 1322 * else go into sleep mode (low power, memory and registers are maintained, peripherals stay on)
Mike Fiore 7:683dba5d576f 1323 *
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1324 * For the MDOT
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1325 * in sleep mode, the device can be woken up on an XBEE_DI (2-8) pin or by the RTC alarm
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1326 * in deepsleep mode, the device can only be woken up using the WKUP pin (PA0, XBEE_DIO7) or by the RTC alarm
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1327 * For the XDOT
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1328 * in sleep mode, the device can be woken up on GPIO (0-3), UART1_RX, WAKE or by the RTC alarm
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1329 * in deepsleep mode, the device can only be woken up using the WKUP pin (PA0, WAKE) or by the RTC alarm
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1330 * @returns MDOT_OK on success
Mike Fiore 7:683dba5d576f 1331 */
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1332 int32_t sleep(const uint32_t& interval, const uint8_t& wakeup_mode = RTC_ALARM, const bool& deepsleep = true);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1333
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1334 /**
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1335 * Set auto sleep mode
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1336 * Auto sleep mode will automatically put the MCU to sleep after tx and in between receive windows
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1337 * Note: The MCU will go into a stop mode sleep in between rx windows. This means that
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1338 * peripherals such as timers will not function during the sleep intervals.
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1339 * @param enable - Flag to enable auto sleep mode
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1340 */
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1341 void setAutoSleep(bool enable);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1342
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1343 /**
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1344 * Get auto sleep mode
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1345 * @returns 0 if sleep mode is disabled, 1 if it is enabled
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1346 */
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1347 uint8_t getAutoSleep();
Mike Fiore 7:683dba5d576f 1348
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1349 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1350 * Set wake pin
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1351 * @param pin the pin to use to wake the device from sleep mode
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1352 * For MDOT, XBEE_DI (2-8)
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1353 * For XDOT, GPIO (0-3), UART1_RX, or WAKE
Mike Fiore 7:683dba5d576f 1354 */
Mike Fiore 7:683dba5d576f 1355 void setWakePin(const PinName& pin);
Mike Fiore 7:683dba5d576f 1356
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1357 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1358 * Get wake pin
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1359 * @returns the pin to use to wake the device from sleep mode
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1360 * For MDOT, XBEE_DI (2-8)
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1361 * For XDOT, GPIO (0-3), UART1_RX, or WAKE
Mike Fiore 7:683dba5d576f 1362 */
Mike Fiore 7:683dba5d576f 1363 PinName getWakePin();
Mike Fiore 7:683dba5d576f 1364
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1365 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1366 * Write data in a user backup register
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1367 * @param register one of UBR0 through UBR9 for MDOT, one of UBR0 through UBR21 for XDOT
jreiss 9:ec2fffe31793 1368 * @param data user data to back up
jreiss 9:ec2fffe31793 1369 * @returns true if success
jreiss 9:ec2fffe31793 1370 */
jreiss 9:ec2fffe31793 1371 bool writeUserBackupRegister(uint32_t reg, uint32_t data);
jreiss 9:ec2fffe31793 1372
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1373 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1374 * Read data in a user backup register
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1375 * @param register one of UBR0 through UBR9 for MDOT, one of UBR0 through UBR21 for XDOT
jreiss 9:ec2fffe31793 1376 * @param data gets set to content of register
jreiss 9:ec2fffe31793 1377 * @returns true if success
jreiss 9:ec2fffe31793 1378 */
jreiss 9:ec2fffe31793 1379 bool readUserBackupRegister(uint32_t reg, uint32_t& data);
jreiss 9:ec2fffe31793 1380
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1381 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1382 * Set LBT time in us
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1383 * @param ms time in us
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1384 * @returns true if success
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1385 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1386 bool setLbtTimeUs(uint16_t us);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1387
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1388 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1389 * Get LBT time in us
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1390 * @returns LBT time in us
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1391 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1392 uint16_t getLbtTimeUs();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1393
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1394 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1395 * Set LBT threshold in dBm
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1396 * @param rssi threshold in dBm
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1397 * @returns true if success
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1398 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1399 bool setLbtThreshold(int8_t rssi);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1400
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1401 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1402 * Get LBT threshold in dBm
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1403 * @returns LBT threshold in dBm
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1404 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1405 int8_t getLbtThreshold();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1406
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1407 #if defined(TARGET_MTS_MDOT_F411RE)
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1408 ///////////////////////////////////////////////////////////////////
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1409 // Filesystem (Non Volatile Memory) Operation Functions for mDot //
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1410 ///////////////////////////////////////////////////////////////////
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1411
Mike Fiore 11:d8464345e1f1 1412 // Save user file data to flash
Mike Fiore 11:d8464345e1f1 1413 // file - name of file max 30 chars
Mike Fiore 11:d8464345e1f1 1414 // data - data of file
Mike Fiore 11:d8464345e1f1 1415 // size - size of file
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1416 // returns true if successful
Mike Fiore 11:d8464345e1f1 1417 bool saveUserFile(const char* file, void* data, uint32_t size);
Mike Fiore 11:d8464345e1f1 1418
Mike Fiore 11:d8464345e1f1 1419 // Append user file data to flash
Mike Fiore 11:d8464345e1f1 1420 // file - name of file max 30 chars
Mike Fiore 11:d8464345e1f1 1421 // data - data of file
Mike Fiore 11:d8464345e1f1 1422 // size - size of file
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1423 // returns true if successful
Mike Fiore 11:d8464345e1f1 1424 bool appendUserFile(const char* file, void* data, uint32_t size);
Mike Fiore 11:d8464345e1f1 1425
Mike Fiore 11:d8464345e1f1 1426 // Read user file data from flash
Mike Fiore 11:d8464345e1f1 1427 // file - name of file max 30 chars
Mike Fiore 11:d8464345e1f1 1428 // data - data of file
Mike Fiore 11:d8464345e1f1 1429 // size - size of file
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1430 // returns true if successful
Mike Fiore 11:d8464345e1f1 1431 bool readUserFile(const char* file, void* data, uint32_t size);
Mike Fiore 11:d8464345e1f1 1432
Mike Fiore 11:d8464345e1f1 1433 // Move a user file in flash
Mike Fiore 11:d8464345e1f1 1434 // file - name of file
Mike Fiore 11:d8464345e1f1 1435 // new_name - new name of file
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1436 // returns true if successful
Mike Fiore 11:d8464345e1f1 1437 bool moveUserFile(const char* file, const char* new_name);
Mike Fiore 11:d8464345e1f1 1438
Mike Fiore 11:d8464345e1f1 1439 // Delete user file data from flash
Mike Fiore 11:d8464345e1f1 1440 // file - name of file max 30 chars
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1441 // returns true if successful
Mike Fiore 11:d8464345e1f1 1442 bool deleteUserFile(const char* file);
Mike Fiore 11:d8464345e1f1 1443
Mike Fiore 11:d8464345e1f1 1444 // Open user file in flash, max of 4 files open concurrently
Mike Fiore 11:d8464345e1f1 1445 // file - name of file max 30 chars
Mike Fiore 11:d8464345e1f1 1446 // mode - combination of FM_APPEND | FM_TRUNC | FM_CREAT |
Mike Fiore 11:d8464345e1f1 1447 // FM_RDONLY | FM_WRONLY | FM_RDWR | FM_DIRECT
Mike Fiore 11:d8464345e1f1 1448 // returns - mdot_file struct, fd field will be a negative value if file could not be opened
Mike Fiore 11:d8464345e1f1 1449 mDot::mdot_file openUserFile(const char* file, int mode);
Mike Fiore 11:d8464345e1f1 1450
Mike Fiore 11:d8464345e1f1 1451 // Seek an open file
Mike Fiore 11:d8464345e1f1 1452 // file - mdot file struct
Mike Fiore 11:d8464345e1f1 1453 // offset - offset in bytes
Mike Fiore 11:d8464345e1f1 1454 // whence - where offset is based SEEK_SET, SEEK_CUR, SEEK_END
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1455 // returns true if successful
Mike Fiore 11:d8464345e1f1 1456 bool seekUserFile(mDot::mdot_file& file, size_t offset, int whence);
Mike Fiore 11:d8464345e1f1 1457
Mike Fiore 11:d8464345e1f1 1458 // Read bytes from open file
Mike Fiore 11:d8464345e1f1 1459 // file - mdot file struct
Mike Fiore 11:d8464345e1f1 1460 // data - mem location to store data
Mike Fiore 11:d8464345e1f1 1461 // length - number of bytes to read
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1462 // returns - number of bytes read, negative if error
Mike Fiore 11:d8464345e1f1 1463 int readUserFile(mDot::mdot_file& file, void* data, size_t length);
Mike Fiore 11:d8464345e1f1 1464
Mike Fiore 11:d8464345e1f1 1465 // Write bytes to open file
Mike Fiore 11:d8464345e1f1 1466 // file - mdot file struct
Mike Fiore 11:d8464345e1f1 1467 // data - data to write
Mike Fiore 11:d8464345e1f1 1468 // length - number of bytes to write
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1469 // returns - number of bytes written, negative if error
Mike Fiore 11:d8464345e1f1 1470 int writeUserFile(mDot::mdot_file& file, void* data, size_t length);
Mike Fiore 11:d8464345e1f1 1471
Mike Fiore 11:d8464345e1f1 1472 // Close open file
Mike Fiore 11:d8464345e1f1 1473 // file - mdot file struct
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1474 // returns true if successful
Mike Fiore 11:d8464345e1f1 1475 bool closeUserFile(mDot::mdot_file& file);
Mike Fiore 11:d8464345e1f1 1476
Mike Fiore 11:d8464345e1f1 1477 // List user files stored in flash
Mike Fiore 11:d8464345e1f1 1478 std::vector<mDot::mdot_file> listUserFiles();
Mike Fiore 11:d8464345e1f1 1479
Mike Fiore 11:d8464345e1f1 1480 // Move file into the firmware upgrade path to be flashed on next boot
Mike Fiore 11:d8464345e1f1 1481 // file - name of file
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1482 // returns true if successful
Mike Fiore 11:d8464345e1f1 1483 bool moveUserFileToFirmwareUpgrade(const char* file);
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1484 #else
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1485 ///////////////////////////////////////////////////////////////
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1486 // EEPROM (Non Volatile Memory) Operation Functions for xDot //
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1487 ///////////////////////////////////////////////////////////////
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1488
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1489 // Write to EEPROM
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1490 // addr - address to write to (0 - 0x17FF)
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1491 // data - data to write
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1492 // size - size of data
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1493 // returns true if successful
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1494 bool nvmWrite(uint16_t addr, void* data, uint16_t size);
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1495
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1496 // Read from EEPROM
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1497 // addr - address to read from (0 - 0x17FF)
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1498 // data - buffer for data
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1499 // size - size of buffer
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1500 // returns true if successful
Jenkins@KEILDM1.dc.multitech.prv 31:7fdee197d415 1501 bool nvmRead(uint16_t addr, void* data, uint16_t size);
Jenkins@KEILDM1.dc.multitech.prv 19:f3a46d2bb9b3 1502 #endif /* TARGET_MTS_MDOT_F411RE */
Mike Fiore 11:d8464345e1f1 1503
Mike Fiore 11:d8464345e1f1 1504 // get current statistics
Mike Fiore 11:d8464345e1f1 1505 // Join Attempts, Join Fails, Up Packets, Down Packets, Missed Acks
Mike Fiore 11:d8464345e1f1 1506 mdot_stats getStats();
Mike Fiore 11:d8464345e1f1 1507
Mike Fiore 11:d8464345e1f1 1508 // reset statistics
Mike Fiore 11:d8464345e1f1 1509 // Join Attempts, Join Fails, Up Packets, Down Packets, Missed Acks
Mike Fiore 11:d8464345e1f1 1510 void resetStats();
Mike Fiore 11:d8464345e1f1 1511
Mike Fiore 11:d8464345e1f1 1512 // Convert pin number 2-8 to pin name DIO2-DI8
Mike Fiore 11:d8464345e1f1 1513 static PinName pinNum2Name(uint8_t num);
Mike Fiore 11:d8464345e1f1 1514
Mike Fiore 11:d8464345e1f1 1515 // Convert pin name DIO2-DI8 to pin number 2-8
Mike Fiore 11:d8464345e1f1 1516 static uint8_t pinName2Num(PinName name);
Mike Fiore 11:d8464345e1f1 1517
Mike Fiore 11:d8464345e1f1 1518 // Convert pin name DIO2-DI8 to string
Mike Fiore 11:d8464345e1f1 1519 static std::string pinName2Str(PinName name);
Mike Fiore 11:d8464345e1f1 1520
Mike Fiore 11:d8464345e1f1 1521 uint64_t crc64(uint64_t crc, const unsigned char *s, uint64_t l);
mfiore 0:c62615f15125 1522
mfiore 0:c62615f15125 1523 /*************************************************************************
mfiore 0:c62615f15125 1524 * The following functions are only used by the AT command application and
mfiore 0:c62615f15125 1525 * should not be used by standard applications consuming the mDot library
mfiore 0:c62615f15125 1526 ************************************************************************/
Mike Fiore 7:683dba5d576f 1527
mfiore 0:c62615f15125 1528 // set/get configured baud rate for command port
mfiore 0:c62615f15125 1529 // only for use in conjunction with AT interface
mfiore 0:c62615f15125 1530 // set function returns MDOT_OK if success
mfiore 0:c62615f15125 1531 int32_t setBaud(const uint32_t& baud);
mfiore 0:c62615f15125 1532 uint32_t getBaud();
mfiore 0:c62615f15125 1533
mfiore 0:c62615f15125 1534 // set/get baud rate for debug port
mfiore 0:c62615f15125 1535 // set function returns MDOT_OK if success
mfiore 0:c62615f15125 1536 int32_t setDebugBaud(const uint32_t& baud);
mfiore 0:c62615f15125 1537 uint32_t getDebugBaud();
mfiore 0:c62615f15125 1538
mfiore 0:c62615f15125 1539 // set/get command terminal echo
mfiore 0:c62615f15125 1540 // set function returns MDOT_OK if success
mfiore 0:c62615f15125 1541 int32_t setEcho(const bool& on);
mfiore 0:c62615f15125 1542 bool getEcho();
mfiore 0:c62615f15125 1543
mfiore 0:c62615f15125 1544 // set/get command terminal verbose mode
mfiore 0:c62615f15125 1545 // set function returns MDOT_OK if success
mfiore 0:c62615f15125 1546 int32_t setVerbose(const bool& on);
mfiore 0:c62615f15125 1547 bool getVerbose();
mfiore 0:c62615f15125 1548
mfiore 0:c62615f15125 1549 // set/get startup mode
mfiore 0:c62615f15125 1550 // COMMAND_MODE (default), starts up ready to accept AT commands
mfiore 0:c62615f15125 1551 // SERIAL_MODE, read serial data and send it as LoRa packets
mfiore 0:c62615f15125 1552 // set function returns MDOT_OK if success
mfiore 0:c62615f15125 1553 int32_t setStartUpMode(const uint8_t& mode);
mfiore 0:c62615f15125 1554 uint8_t getStartUpMode();
mfiore 0:c62615f15125 1555
mfiore 0:c62615f15125 1556 int32_t setRxDataRate(const uint8_t& dr);
mfiore 0:c62615f15125 1557 uint8_t getRxDataRate();
mfiore 0:c62615f15125 1558
mfiore 0:c62615f15125 1559 // get/set TX/RX frequency
mfiore 0:c62615f15125 1560 // if frequency band == FB_868 (Europe), must be between 863000000 - 870000000
mfiore 0:c62615f15125 1561 // if frequency band == FB_915 (United States), must be between 902000000-928000000
mfiore 0:c62615f15125 1562 // if set to 0, device will hop frequencies
mfiore 0:c62615f15125 1563 // set function returns MDOT_OK if success
mfiore 0:c62615f15125 1564 int32_t setTxFrequency(const uint32_t& freq);
mfiore 0:c62615f15125 1565 uint32_t getTxFrequency();
mfiore 0:c62615f15125 1566 int32_t setRxFrequency(const uint32_t& freq);
mfiore 0:c62615f15125 1567 uint32_t getRxFrequency();
mfiore 0:c62615f15125 1568
mfiore 0:c62615f15125 1569 // get/set TX/RX inverted
mfiore 0:c62615f15125 1570 // true == signal is inverted
mfiore 0:c62615f15125 1571 // set function returns MDOT_OK if success
mfiore 0:c62615f15125 1572 int32_t setTxInverted(const bool& on);
mfiore 0:c62615f15125 1573 bool getTxInverted();
mfiore 0:c62615f15125 1574 int32_t setRxInverted(const bool& on);
mfiore 0:c62615f15125 1575 bool getRxInverted();
mfiore 0:c62615f15125 1576
mfiore 0:c62615f15125 1577 // get/set RX output mode
mfiore 0:c62615f15125 1578 // valid options are HEXADECIMAL and BINARY
mfiore 0:c62615f15125 1579 // set function returns MDOT_OK if success
mfiore 0:c62615f15125 1580 int32_t setRxOutput(const uint8_t& mode);
mfiore 0:c62615f15125 1581 uint8_t getRxOutput();
mfiore 0:c62615f15125 1582
mfiore 0:c62615f15125 1583 // get/set serial wake interval
mfiore 0:c62615f15125 1584 // valid values are 2 s - INT_MAX (2147483647) s
mfiore 0:c62615f15125 1585 // set function returns MDOT_OK if success
Mike Fiore 7:683dba5d576f 1586 int32_t setWakeInterval(const uint32_t& interval);
Mike Fiore 7:683dba5d576f 1587 uint32_t getWakeInterval();
mfiore 0:c62615f15125 1588
mfiore 0:c62615f15125 1589 // get/set serial wake delay
mfiore 0:c62615f15125 1590 // valid values are 2 ms - INT_MAX (2147483647) ms
mfiore 0:c62615f15125 1591 // set function returns MDOT_OK if success
Mike Fiore 7:683dba5d576f 1592 int32_t setWakeDelay(const uint32_t& delay);
Mike Fiore 7:683dba5d576f 1593 uint32_t getWakeDelay();
mfiore 0:c62615f15125 1594
mfiore 0:c62615f15125 1595 // get/set serial receive timeout
mfiore 0:c62615f15125 1596 // valid values are 0 ms - 65000 ms
mfiore 0:c62615f15125 1597 // set function returns MDOT_OK if success
Mike Fiore 7:683dba5d576f 1598 int32_t setWakeTimeout(const uint16_t& timeout);
Mike Fiore 7:683dba5d576f 1599 uint16_t getWakeTimeout();
Mike Fiore 7:683dba5d576f 1600
Mike Fiore 7:683dba5d576f 1601 // get/set serial wake mode
Mike Fiore 7:683dba5d576f 1602 // valid values are INTERRUPT or RTC_ALARM
Mike Fiore 7:683dba5d576f 1603 // set function returns MDOT_OK if success
Mike Fiore 7:683dba5d576f 1604 int32_t setWakeMode(const uint8_t& delay);
Mike Fiore 7:683dba5d576f 1605 uint8_t getWakeMode();
Mike Fiore 7:683dba5d576f 1606
Mike Fiore 12:54f9cac9d690 1607 // get/set serial flow control enabled
Mike Fiore 12:54f9cac9d690 1608 // set function returns MDOT_OK if success
Mike Fiore 12:54f9cac9d690 1609 int32_t setFlowControl(const bool& on);
Mike Fiore 12:54f9cac9d690 1610 bool getFlowControl();
Mike Fiore 12:54f9cac9d690 1611
Mike Fiore 12:54f9cac9d690 1612 // get/set serial clear on error
Mike Fiore 12:54f9cac9d690 1613 // if enabled the data read from the serial port will be discarded if it cannot be sent or if the send fails
Mike Fiore 11:d8464345e1f1 1614 // set function returns MDOT_OK if success
Mike Fiore 12:54f9cac9d690 1615 int32_t setSerialClearOnError(const bool& on);
Mike Fiore 12:54f9cac9d690 1616 bool getSerialClearOnError();
mfiore 0:c62615f15125 1617
mfiore 0:c62615f15125 1618 // MTS_RADIO_DEBUG_COMMANDS
Mike Fiore 7:683dba5d576f 1619
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1620 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1621 * Disable Duty cycle
Mike Fiore 16:b630e18103e5 1622 * enables or disables the duty cycle limitations
Mike Fiore 16:b630e18103e5 1623 * **** ONLY TO BE USED FOR TESTINGS PURPOSES ****
Mike Fiore 16:b630e18103e5 1624 * **** ALL DEPLOYABLE CODE MUST ADHERE TO LOCAL REGULATIONS ****
Mike Fiore 16:b630e18103e5 1625 * **** THIS SETTING WILL NOT BE SAVED TO CONFIGURATION *****
Mike Fiore 16:b630e18103e5 1626 * @param val true to disable duty-cycle (default:false)
Mike Fiore 16:b630e18103e5 1627 */
Mike Fiore 16:b630e18103e5 1628 int32_t setDisableDutyCycle(bool val);
Mike Fiore 16:b630e18103e5 1629
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1630 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1631 * Disable Duty cycle
Mike Fiore 16:b630e18103e5 1632 * **** ONLY TO BE USED FOR TESTINGS PURPOSES ****
Mike Fiore 16:b630e18103e5 1633 * **** ALL DEPLOYABLE CODE MUST ADHERE TO LOCAL REGULATIONS ****
Mike Fiore 16:b630e18103e5 1634 * **** THIS SETTING WILL NOT BE SAVED TO CONFIGURATION *****
Mike Fiore 16:b630e18103e5 1635 * @return true if duty-cycle is disabled (default:false)
Mike Fiore 16:b630e18103e5 1636 */
Mike Fiore 16:b630e18103e5 1637 uint8_t getDisableDutyCycle();
Mike Fiore 16:b630e18103e5 1638
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1639 /**
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1640 * LBT RSSI
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1641 * @return the current RSSI on the configured frequency (SetTxFrequency) using configured LBT Time
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1642 */
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1643 int16_t lbtRssi();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1644
Mike Fiore 7:683dba5d576f 1645 void openRxWindow(uint32_t timeout, uint8_t bandwidth = 0);
Mike Fiore 16:b630e18103e5 1646 void closeRxWindow();
Mike Fiore 16:b630e18103e5 1647 void sendContinuous(bool enable=true);
mfiore 0:c62615f15125 1648 int32_t setDeviceId(const std::vector<uint8_t>& id);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1649 int32_t setProtectedAppEUI(const std::vector<uint8_t>& appEUI);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1650 int32_t setProtectedAppKey(const std::vector<uint8_t>& appKey);
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1651 int32_t setDefaultFrequencyBand(const uint8_t& band);
mfiore 0:c62615f15125 1652 bool saveProtectedConfig();
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1653 // resets the radio/mac/link
mfiore 0:c62615f15125 1654 void resetRadio();
mfiore 0:c62615f15125 1655 int32_t setRadioMode(const uint8_t& mode);
mfiore 0:c62615f15125 1656 std::map<uint8_t, uint8_t> dumpRegisters();
mfiore 0:c62615f15125 1657 void eraseFlash();
mfiore 0:c62615f15125 1658
Mike Fiore 7:683dba5d576f 1659 // deprecated - use setWakeInterval
Mike Fiore 7:683dba5d576f 1660 int32_t setSerialWakeInterval(const uint32_t& interval);
Mike Fiore 7:683dba5d576f 1661 // deprecated - use getWakeInterval
Mike Fiore 7:683dba5d576f 1662 uint32_t getSerialWakeInterval();
Mike Fiore 6:390fc83d588d 1663
Mike Fiore 7:683dba5d576f 1664 // deprecated - use setWakeDelay
Mike Fiore 7:683dba5d576f 1665 int32_t setSerialWakeDelay(const uint32_t& delay);
Mike Fiore 7:683dba5d576f 1666 // deprecated - use setWakeDelay
Mike Fiore 7:683dba5d576f 1667 uint32_t getSerialWakeDelay();
Mike Fiore 7:683dba5d576f 1668
Mike Fiore 7:683dba5d576f 1669 // deprecated - use setWakeTimeout
Mike Fiore 7:683dba5d576f 1670 int32_t setSerialReceiveTimeout(const uint16_t& timeout);
Mike Fiore 7:683dba5d576f 1671 // deprecated - use getWakeTimeout
Mike Fiore 7:683dba5d576f 1672 uint16_t getSerialReceiveTimeout();
mfiore 0:c62615f15125 1673
Mike Fiore 11:d8464345e1f1 1674 void setWakeupCallback(void (*function)(void));
Mike Fiore 11:d8464345e1f1 1675
Mike Fiore 11:d8464345e1f1 1676 template<typename T>
Mike Fiore 11:d8464345e1f1 1677 void setWakeupCallback(T *object, void (T::*member)(void)) {
Mike Fiore 11:d8464345e1f1 1678 _wakeup_callback.attach(object, member);
Mike Fiore 11:d8464345e1f1 1679 }
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1680
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1681 lora::ChannelPlan* getChannelPlan(void);
Mike Fiore 11:d8464345e1f1 1682
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1683 uint32_t setRx2DataRate(uint8_t dr);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1684 uint8_t getRx2DataRate();
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1685
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1686 void mcGroupKeys(uint8_t *mcKeyEncrypt, uint32_t addr, uint8_t groupId, uint32_t frame_count);
mfiore 0:c62615f15125 1687 private:
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1688 typedef enum {
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1689 AUTO_SLEEP_EVT_CFG,
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1690 AUTO_SLEEP_EVT_TXDONE,
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1691 AUTO_SLEEP_EVT_RX1_TIMEOUT,
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1692 AUTO_SLEEP_EVT_CLEANUP
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1693 } AutoSleepEvent_t;
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1694
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1695 typedef enum {
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1696 USER_SLEEP,
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1697 AUTO_SLEEP
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1698 } SleepClient_t;
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1699
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1700 void sleep_ms(uint32_t interval,
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1701 uint8_t wakeup_mode = RTC_ALARM,
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1702 bool deepsleep = true,
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1703 SleepClient_t sleep_client = USER_SLEEP);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1704
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1705 void auto_sleep(AutoSleepEvent_t evt);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1706
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1707 void wakeup(SleepClient_t sleep_client);
Jenkins@KEILDM1.dc.multitech.prv 64:64982192a2af 1708
mfiore 0:c62615f15125 1709 mdot_stats _stats;
mfiore 0:c62615f15125 1710
Mike Fiore 11:d8464345e1f1 1711 FunctionPointer _wakeup_callback;
Mike Fiore 11:d8464345e1f1 1712
Mike Fiore 12:54f9cac9d690 1713 bool _standbyFlag;
Mike Fiore 12:54f9cac9d690 1714 bool _testMode;
Mike Fiore 12:54f9cac9d690 1715 uint8_t _savedPort;
Mike Fiore 12:54f9cac9d690 1716 void handleTestModePacket();
Jenkins@KEILDM1.dc.multitech.prv 60:7985b4783af9 1717 lora::ChannelPlan* _plan;
mfiore 0:c62615f15125 1718 };
mfiore 0:c62615f15125 1719
mfiore 0:c62615f15125 1720 #endif