Stable version of the xDot library for mbed 5. This version of the library is suitable for deployment scenarios.

Dependents:   Dot-Examples XDOT-Devicewise Dot-Examples-delujoc Dot-Examples_receive ... more

Fork of libxDot-dev-mbed5-deprecated by MultiTech

The Dot library provides a LoRaWan certified stack for LoRa communication using MultiTech mDot and xDot devices. The stack is compatible with mbed 5.

The name of the repository can be used to determine which device the stack was compiled for and if it's a development or production-ready build:

A changelog for the Dot library can be found here.

The Dot library version and the version of mbed-os it was compiled against can both be found in the commit message for that revision of the Dot library. Building your application with the same version of mbed-os as what was used to build the Dot library is highly recommended!

The Dot-Examples repository demonstrates how to use the Dot library in a custom application.

The mDot and xDot platform pages have lots of platform specific information and document potential issues, gotchas, etc, and provide instructions for getting started with development. Please take a look at the platform page before starting development as they should answer many questions you will have.

FOTA

Full FOTA support is only available with mDot, xDot does not have the required external flash. xDot can use the FOTA example to dynamically join a multicast session only. After joining the multicast session the received Fragmentation packets could be handed to a host MCU for processing and at completion the firmware can be loaded into the xDot using the bootloader and y-modem. See xDot Developer Guide.

  • Add the following code to allow Fota to use the Dot instance

examples/src/fota_example.cpp

    // Initialize FOTA singleton
    Fota::getInstance(dot);
  • Add fragmentation handling the the PacketRx event

examples/inc/RadioEvent.h

    virtual void PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries, uint32_t address, bool dupRx) {
        mDotEvent::PacketRx(port, payload, size, rssi, snr, ctrl, slot, retries, address, dupRx);

#if ACTIVE_EXAMPLE == FOTA_EXAMPLE
        if(port == 200 || port == 201 || port == 202) {
            Fota::getInstance()->processCmd(payload, port, size);
        }
#endif
    }

The FOTA implementation has a few differences from the LoRaWAN Protocol

  • Fragmentation Indexing starts at 0
  • McKEKey is 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
  • Start Time is a count-down in seconds to start of session

Files at this revision

API Documentation at this revision

Comitter:
Jenkins@KEILDM1.dc.multitech.prv
Date:
Thu Aug 29 08:40:49 2019 -0500
Parent:
17:02ac4868b5a2
Child:
19:aa5b1fcd05be
Commit message:
xdot-library revision 3.2.2-19-g285e497 and mbed-os revision mbed-os-5.13.4

Changed in this revision

ChannelPlan.h Show annotated file Show diff for this revision Revisions of this file
Fota/Fota.h Show annotated file Show diff for this revision Revisions of this file
Fota/MulticastGroup/MulticastGroup.h Show annotated file Show diff for this revision Revisions of this file
Lora.h Show annotated file Show diff for this revision Revisions of this file
MTS-Lora/vendor/multitech/MTS-Utils/MTSCircularBuffer.h Show annotated file Show diff for this revision Revisions of this file
MacEvents.h Show annotated file Show diff for this revision Revisions of this file
Mote.h Show annotated file Show diff for this revision Revisions of this file
SxRadio.h Show annotated file Show diff for this revision Revisions of this file
SxRadioEvents.h Show annotated file Show diff for this revision Revisions of this file
libxDot-GCC_ARM.a Show annotated file Show diff for this revision Revisions of this file
mDot.h Show annotated file Show diff for this revision Revisions of this file
mDotEvent.h Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_AS923.h Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_AU915.h Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_EU868.h Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_IN865.h Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_KR920.h Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_RU864.h Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlans.h Show annotated file Show diff for this revision Revisions of this file
--- a/ChannelPlan.h	Wed May 01 09:39:29 2019 -0500
+++ b/ChannelPlan.h	Thu Aug 29 08:40:49 2019 -0500
@@ -193,6 +193,12 @@
             virtual uint8_t GetMaxPayloadSize();
 
             /**
+             * Get max payload size for a given datarate
+             * @return size in bytes
+             */
+            virtual uint8_t GetMaxPayloadSize(uint8_t dr);
+
+            /**
              * Get rx window settings for requested window
              * RX_1, RX_2, RX_BEACON, RX_SLOT
              * @param window
@@ -287,11 +293,6 @@
             virtual uint8_t GetFrequencySubBand();
 
             /**
-             * Reset the ack counter used to lower datarate if ACK's are missed
-             */
-            virtual void ResetAckCounter();
-
-            /**
              * Callback for radio to request channel change when frequency hopping
              * @param currentChannel
              */
--- a/Fota/Fota.h	Wed May 01 09:39:29 2019 -0500
+++ b/Fota/Fota.h	Thu Aug 29 08:40:49 2019 -0500
@@ -1,3 +1,20 @@
+/**********************************************************************
+* COPYRIGHT 2018 MULTI-TECH SYSTEMS, INC.
+*
+* ALL RIGHTS RESERVED BY AND FOR THE EXCLUSIVE BENEFIT OF
+* MULTI-TECH SYSTEMS, INC.
+*
+* MULTI-TECH SYSTEMS, INC. - CONFIDENTIAL AND PROPRIETARY
+* INFORMATION AND/OR TRADE SECRET.
+*
+* NOTICE: ALL CODE, PROGRAM, INFORMATION, SCRIPT, INSTRUCTION,
+* DATA, AND COMMENT HEREIN IS AND SHALL REMAIN THE CONFIDENTIAL
+* INFORMATION AND PROPERTY OF MULTI-TECH SYSTEMS, INC.
+* USE AND DISCLOSURE THEREOF, EXCEPT AS STRICTLY AUTHORIZED IN A
+* WRITTEN AGREEMENT SIGNED BY MULTI-TECH SYSTEMS, INC. IS PROHIBITED.
+*
+***********************************************************************/
+
 #ifndef FOTA_H
 #define FOTA_H
 #include "mDot.h"
--- a/Fota/MulticastGroup/MulticastGroup.h	Wed May 01 09:39:29 2019 -0500
+++ b/Fota/MulticastGroup/MulticastGroup.h	Thu Aug 29 08:40:49 2019 -0500
@@ -1,3 +1,20 @@
+/**********************************************************************
+* COPYRIGHT 2018 MULTI-TECH SYSTEMS, INC.
+*
+* ALL RIGHTS RESERVED BY AND FOR THE EXCLUSIVE BENEFIT OF
+* MULTI-TECH SYSTEMS, INC.
+*
+* MULTI-TECH SYSTEMS, INC. - CONFIDENTIAL AND PROPRIETARY
+* INFORMATION AND/OR TRADE SECRET.
+*
+* NOTICE: ALL CODE, PROGRAM, INFORMATION, SCRIPT, INSTRUCTION,
+* DATA, AND COMMENT HEREIN IS AND SHALL REMAIN THE CONFIDENTIAL
+* INFORMATION AND PROPERTY OF MULTI-TECH SYSTEMS, INC.
+* USE AND DISCLOSURE THEREOF, EXCEPT AS STRICTLY AUTHORIZED IN A
+* WRITTEN AGREEMENT SIGNED BY MULTI-TECH SYSTEMS, INC. IS PROHIBITED.
+*
+***********************************************************************/
+
 #ifndef MULTICASTGROUP_H
 #define MULTICASTGROUP_H
 #include "mDot.h"
@@ -39,7 +56,7 @@
             int32_t class_c_start;
             time_t time_setup;
         } mcgroup;
-        
+
         bool* _filled;
         uint8_t _groupId;
         uint8_t _ans;
@@ -49,8 +66,8 @@
         uint32_t _freq;
         uint32_t _frame_count;
         time_t _now;
-        
-        mDot* _dot; 
+
+        mDot* _dot;
         Thread _event_thread;
         EventQueue _switch_class_queue;
         mcgroup _mcGroup[MULTICAST_SESSIONS];
--- a/Lora.h	Wed May 01 09:39:29 2019 -0500
+++ b/Lora.h	Thu Aug 29 08:40:49 2019 -0500
@@ -342,15 +342,18 @@
             uint8_t Mode;               //!< PUBLIC, PRIVATE or PEER_TO_PEER network mode
             uint8_t Class;              //!< Operating class of device
             uint8_t EUI[8];             //!< Network ID or AppEUI
+            uint16_t JoinNonce;         //!< Incrementing JoinNonce Counter
             uint8_t Key[16];            //!< Network Key or AppKey
+            uint8_t GenAppKey[16];      //!< Generic App Key, will be AppKey for LW 1.1.x
+            uint8_t McKEKey[16];        //!< Multicast Key Encryption Key
             uint8_t JoinDelay;          //!< Number of seconds to wait before 1st RX Window
             uint8_t RxDelay;            //!< Number of seconds to wait before 1st RX Window
             uint8_t FrequencySubBand;   //!< FrequencySubBand used for US915 hybrid operation 0:72 channels, 1:1-8 channels ...
-            uint8_t AckAttempts;        //!< Number of attempts to send packet and receive an ACK from server
+            uint8_t AckEnabled;         //!< Enable confirmed messages to be sent with Retries
             uint8_t Retries;            //!< Number of times to resend a packet without receiving an ACK, redundancy
             uint8_t ADREnabled;         //!< Enable adaptive datarate
-            uint16_t AdrAckLimit;       //!< Number of uplinks without a downlink to allow before setting ADRACKReq
-            uint16_t AdrAckDelay;       //!< Number of downlinks to expect ADR ACK Response within
+            uint8_t AdrAckLimit;       //!< Number of uplinks without a downlink to allow before setting ADRACKReq
+            uint8_t AdrAckDelay;       //!< Number of downlinks to expect ADR ACK Response within
             uint8_t CADEnabled;         //!< Enable listen before talk/channel activity detection
             uint8_t RepeaterMode;       //!< Limit payloads to repeater compatible sizes
             uint8_t TxPower;            //!< Default radio output power in dBm
@@ -400,7 +403,6 @@
             uint32_t JoinFirstAttempt;          //!< RTC time of first failed join attempt
             uint32_t AggregatedTimeOffEnd;      //!< Time off air expiration for aggregate duty cycle
             uint16_t AggregateDutyCycle;        //!< Used for enforcing time-on-air
-            uint8_t AckCounter;                 //!< Current number of packets sent without ACK from server
             uint8_t AdrCounter;                 //!< Current number of packets received without downlink from server
             uint8_t RxDelay;                    //!< Number of seconds to wait before 1st RX Window
             uint8_t CommandBuffer[COMMANDS_BUFFER_SIZE]; //!< Buffer to hold Mac Commands and parameters to be sent in next packet
--- a/MTS-Lora/vendor/multitech/MTS-Utils/MTSCircularBuffer.h	Wed May 01 09:39:29 2019 -0500
+++ b/MTS-Lora/vendor/multitech/MTS-Utils/MTSCircularBuffer.h	Thu Aug 29 08:40:49 2019 -0500
@@ -82,7 +82,7 @@
     void attach(T *tptr, void( T::*mptr)(void), int threshold, RelationalOperator op) {
         _threshold = threshold;
         _op = op;
-        notify.attach(tptr, mptr);
+        notify = callback(tptr, mptr);
     }
 
     /** This method is used to setup a callback funtion when the buffer reaches
--- a/MacEvents.h	Wed May 01 09:39:29 2019 -0500
+++ b/MacEvents.h	Thu Aug 29 08:40:49 2019 -0500
@@ -29,17 +29,17 @@
             virtual void TxDone(uint8_t dr) = 0;
             virtual void TxTimeout(void) = 0;
 
-            virtual void JoinAccept(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr) = 0;
-            virtual void JoinFailed(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr) = 0;
-            virtual void PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries=0, uint32_t address=0, bool dupRx=false) = 0;
-            virtual void RxDone(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot) = 0;
+            virtual void JoinAccept(uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr) = 0;
+            virtual void JoinFailed(uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr) = 0;
+            virtual void PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries=0, uint32_t address=0, bool dupRx=false) = 0;
+            virtual void RxDone(uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr, lora::DownlinkControl ctrl, uint8_t slot) = 0;
 
-            virtual void BeaconRx(const BeaconData_t& beacon_data, int16_t rssi, int8_t snr) = 0;
+            virtual void BeaconRx(const BeaconData_t& beacon_data, int16_t rssi, int16_t snr) = 0;
             virtual void BeaconLost() = 0;
             virtual void ServerTime(uint32_t seconds, uint8_t sub_seconds) = 0;
 
-            virtual void Pong(int16_t m_rssi, int8_t m_snr, int16_t s_rssi, int8_t s_snr) = 0;
-            virtual void NetworkLinkCheck(int16_t m_rssi, int8_t m_snr, int8_t s_snr, uint8_t s_gateways) = 0;
+            virtual void Pong(int16_t m_rssi, int16_t m_snr, int16_t s_rssi, int16_t s_snr) = 0;
+            virtual void NetworkLinkCheck(int16_t m_rssi, int16_t m_snr, int16_t s_snr, uint8_t s_gateways) = 0;
 
             virtual void RxTimeout(uint8_t slot) = 0;
             virtual void RxError(uint8_t slot) = 0;
--- a/Mote.h	Wed May 01 09:39:29 2019 -0500
+++ b/Mote.h	Thu Aug 29 08:40:49 2019 -0500
@@ -56,7 +56,7 @@
              * @param rssi of received packet
              * @param snr of received packet
              */
-            virtual void JoinAccept(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr);
+            virtual void JoinAccept(uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr);
 
             /**
              * Fired when JoinAccept message is received and MIC is not valid
@@ -65,7 +65,7 @@
              * @param rssi of received packet
              * @param snr of received packet
              */
-            virtual void JoinFailed(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr);
+            virtual void JoinFailed(uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr);
 
             /**
              * Fired when packet is received and MIC is valid
@@ -80,7 +80,7 @@
              * @param address of the end device
              * @param dupRx set if this packet has already been received
              */
-            virtual void PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries = 0, uint32_t address = 0, bool dupRx=false);
+            virtual void PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries = 0, uint32_t address = 0, bool dupRx=false);
 
             /**
              * Fired when radio has received a packet, packet is not validated
@@ -91,7 +91,7 @@
              * @param ctrl Downlink control field of packet
              * @param slot rx window packet was received
              */
-            virtual void RxDone(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot);
+            virtual void RxDone(uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr, lora::DownlinkControl ctrl, uint8_t slot);
 
             /**
              * Fired when a beacon is received
@@ -99,7 +99,7 @@
              * @param rssi of received beacon
              * @param snr of received beacon
              */
-            virtual void BeaconRx(const BeaconData_t& beacon_data, int16_t rssi, int8_t snr);
+            virtual void BeaconRx(const BeaconData_t& beacon_data, int16_t rssi, int16_t snr);
 
             /**
              * Fired upon losing beacon synchronization (120 minutes elapsed from last beacon reception)
@@ -125,7 +125,7 @@
              * @param s_rssi of received packet at server
              * @param s_snr of received packet at server
              */
-            virtual void Pong(int16_t m_rssi, int8_t m_snr, int16_t s_rssi, int8_t s_snr);
+            virtual void Pong(int16_t m_rssi, int16_t m_snr, int16_t s_rssi, int16_t s_snr);
 
             /**
              * Fired if network link check answer is received
@@ -134,7 +134,7 @@
              * @param s_snr margin of received packet at server
              * @param s_gateways number of gateways reporting the packet
              */
-            virtual void NetworkLinkCheck(int16_t m_rssi, int8_t m_snr, int8_t s_snr, uint8_t s_gateways);
+            virtual void NetworkLinkCheck(int16_t m_rssi, int16_t m_snr, int16_t s_snr, uint8_t s_gateways);
 
             /**
              * Fired upon receiving a server time answer
--- a/SxRadio.h	Wed May 01 09:39:29 2019 -0500
+++ b/SxRadio.h	Thu Aug 29 08:40:49 2019 -0500
@@ -16,7 +16,6 @@
 #define __SXRADIO_H__
 
 #include <stdint.h>
-#include "rtos.h"
 #include "SxRadioEvents.h"
 
 /*!
@@ -43,6 +42,7 @@
         RF_RX_RUNNING,
         RF_TX_RUNNING,
         RF_CAD,
+        RF_LBT
     }RadioState_t;
 
     SxRadio(uint32_t WakeupTime) : WakeupTime(WakeupTime), freq_offset(0), State(RF_IDLE), Modem(MODEM_LORA) { }
@@ -87,7 +87,7 @@
      *
      * \retval isFree         [true: Channel is free, false: Channel is not free]
      */
-    virtual bool IsChannelFree( RadioModems_t modem, uint32_t freq, uint8_t datarate, int16_t rssiThresh, uint8_t bandwidth, uint32_t timeout = 5000, int16_t *rssiVal = NULL ) = 0;
+    virtual bool IsChannelFree( RadioModems_t modem, uint32_t freq, int16_t rssiThresh, uint32_t timeout = 5000, int16_t *rssiVal = NULL ) = 0;
     /*!
      * \brief Generates a 32 bits random value based on the RSSI readings
      *
--- a/SxRadioEvents.h	Wed May 01 09:39:29 2019 -0500
+++ b/SxRadioEvents.h	Thu Aug 29 08:40:49 2019 -0500
@@ -43,7 +43,7 @@
      *                     FSK : N/A ( set to 0 )
      *                     LoRa: SNR value is two's complement in 1/4 dB
      */
-    virtual void RxDone( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ) {}
+    virtual void RxDone( uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr ) {}
     /*!
      * \brief  Rx Timeout callback prototype.
      */
Binary file libxDot-GCC_ARM.a has changed
--- a/mDot.h	Wed May 01 09:39:29 2019 -0500
+++ b/mDot.h	Thu Aug 29 08:40:49 2019 -0500
@@ -61,21 +61,6 @@
         void waitForPacket();
         void waitForLinkCheck();
 
-
-        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
-        void setActivityLedState(const uint8_t& state);
-
-        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
-        uint8_t getActivityLedState();
-
-        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
-        void blinkActivityLed(void) {
-            if (_activity_led) {
-                int val = _activity_led->read();
-                _activity_led->write(!val);
-            }
-        }
-
         mDot(const mDot&);
         mDot& operator=(const mDot&);
 
@@ -97,12 +82,7 @@
 
         std::string _last_error;
         static const uint32_t _baud_rates[];
-        uint8_t _activity_led_state; //deprecated will be removed
-        Ticker _tick;
-        DigitalOut* _activity_led; //deprecated will be removed
-        bool _activity_led_enable; //deprecated will be removed
-        PinName _activity_led_pin;  //deprecated will be removed
-        bool _activity_led_external; //deprecated will be removed
+
         uint8_t _linkFailCount;
         uint8_t _class;
         InterruptIn* _wakeup;
@@ -162,7 +142,8 @@
         enum RX_Output {
             HEXADECIMAL,
             BINARY,
-            EXTENDED
+            EXTENDED,
+            EXTENDED_HEX
         };
 
         enum DataRates {
@@ -368,21 +349,6 @@
 
         lora::Settings* getSettings();
 
-        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
-        void setActivityLedEnable(const bool& enable);
-
-        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
-        bool getActivityLedEnable();
-
-        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
-        void setActivityLedPin(const PinName& pin);
-
-        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
-        void setActivityLedPin(DigitalOut* pin);
-
-        MBED_DEPRECATED("Will be removed in dotlib 3.3.0")
-        PinName getActivityLedPin();
-
         /**
          * Returns boolean indicative of start-up from standby mode
          * @returns true if dot woke from standby
@@ -694,6 +660,20 @@
         int32_t setNetworkKey(const std::vector<uint8_t>& id);
 
         /**
+         * Get generic app key
+         * @returns a vector containing key (size 16)
+         */
+        std::vector<uint8_t> getGenAppKey();
+
+        /**
+         * Set generic app key
+         * for use with Multicast key exchange
+         * @param id a vector of 16 bytes
+         * @returns MDOT_OK if success
+         */
+        int32_t setGenAppKey(const std::vector<uint8_t>& id);
+
+        /**
          * Get network key
          * @returns a vector containing network key (size 16)
          */
@@ -728,19 +708,48 @@
         const uint8_t* getAppKey();
 
         /**
+         * Set join nonce counter incremented with each Join Request
+         * @returns MDOT_OK if success
+         */
+        int32_t setJoinNonce(const uint16_t& nonce);
+
+        /**
+         * Get join nonce counter incremented with each Join Request
+         * @returns join nonce
+         */
+        uint16_t getJoinNonce();
+
+        /**
          * Add a multicast session address and keys
          * Downlink counter is set to 0
-         * Up to 3 MULTICAST_SESSIONS can be set
+         * Up to 8 MULTICAST_SESSIONS can be set
          */
-        int32_t setMulticastSession(uint8_t index, uint32_t addr, const uint8_t* nsk, const uint8_t* dsk);
+        int32_t setMulticastSession(uint8_t index, uint32_t addr, const uint8_t* nsk, const uint8_t* ask);
+
+        /**
+         * Set multicast session info
+         * Up to 8 MULTICAST_SESSIONS
+         */
+        int32_t setMulticastAddress(uint8_t index, uint32_t addr);
+        int32_t setMulticastNetworkSessionKey(uint8_t index, const uint8_t* nsk);
+        int32_t setMulticastApplicationSessionKey(uint8_t index, const uint8_t* ask);
 
         /**
          * Set a multicast session counter
-         * Up to 3 MULTICAST_SESSIONS can be set
+         * Up to 8 MULTICAST_SESSIONS
          */
         int32_t setMulticastDownlinkCounter(uint8_t index, uint32_t count);
 
         /**
+         * Get multicast session info
+         * Up to 8 MULTICAST_SESSIONS
+         */
+        uint32_t getMulticastAddress(uint8_t index);
+        int32_t getMulticastNetworkSessionKey(uint8_t index, uint8_t* nsk);
+        int32_t getMulticastApplicationSessionKey(uint8_t index, uint8_t* ask);
+        uint32_t getMulticastDownlinkCounter(uint8_t index);
+
+        /**
          * Attempt to join network
          * each attempt will be made with a random datarate up to the configured datarate
          * JoinRequest backoff between tries is enforced to 1% for 1st hour, 0.1% for 1-10 hours and 0.01% after 10 hours
@@ -1080,18 +1089,17 @@
          *
          * AU915 Datarates
          * ---------------
-         * DR0 - SF10BW125
-         * DR1 - SF9BW125
-         * DR2 - SF8BW125
-         * DR3 - SF7BW125
-         * DR4 - SF8BW500
+         * DR0 - SF12BW125
+         * DR1 - SF11BW125
+         * DR2 - SF10BW125
+         * DR3 - SF9BW125
+         * DR4 - SF8BW125
+         * DR5 - SF7BW125
+         * DR6 - SF8BW500
          *
          * @returns spreading factor and bandwidth
          */
         std::string getDataRateDetails(uint8_t rate);
-        MBED_DEPRECATED("Will be removed in 3.3.0")
-        std::string getDateRateDetails(uint8_t rate);
-
 
         /**
          * Set TX power output of radio before antenna gain, default: 14 dBm
@@ -1234,26 +1242,28 @@
         /**
          * Set the ADR ACK Limit
          * @param limit - ADR ACK limit
+         * @returns MDOT_OK if success
          */
-        void setAdrAckLimit(uint16_t limit);
+        int32_t setAdrAckLimit(uint8_t limit);
 
         /**
          * Get the ADR ACK Limit
          * @returns ADR ACK limit
          */
-        uint16_t getAdrAckLimit();
+        uint8_t getAdrAckLimit();
 
         /**
          * Set the ADR ACK Delay
          * @param delay - ADR ACK delay
+         * @returns MDOT_OK if success
          */
-        void setAdrAckDelay(uint16_t delay);
+        int32_t setAdrAckDelay(uint8_t delay);
 
         /**
          * Get the ADR ACK Delay
          * @returns ADR ACK delay
          */
-        uint16_t getAdrAckDelay();
+        uint8_t getAdrAckDelay();
 
         /**
          * Enable/disable CRC checking of packets
@@ -1544,6 +1554,8 @@
         // Return total size of all files saved in FLASH
         // Does not include SPIFFS overhead
         uint32_t getUsedSpace();
+
+        bool repairFlashFileSystem();
 #else
         ///////////////////////////////////////////////////////////////
         // EEPROM (Non Volatile Memory) Operation Functions for xDot //
@@ -1701,6 +1713,8 @@
         int32_t setDeviceId(const std::vector<uint8_t>& id);
         int32_t setProtectedAppEUI(const std::vector<uint8_t>& appEUI);
         int32_t setProtectedAppKey(const std::vector<uint8_t>& appKey);
+        std::vector<uint8_t> getProtectedAppEUI();
+        std::vector<uint8_t> getProtectedAppKey();
         int32_t setDefaultFrequencyBand(const uint8_t& band);
         bool saveProtectedConfig();
         // resets the radio/mac/link
@@ -1733,7 +1747,7 @@
 
         mdot_stats _stats;
 
-        FunctionPointer _wakeup_callback;
+        Callback<void()> _wakeup_callback;
 
         bool _standbyFlag;
         bool _testMode;
--- a/mDotEvent.h	Wed May 01 09:39:29 2019 -0500
+++ b/mDotEvent.h	Thu Aug 29 08:40:49 2019 -0500
@@ -189,7 +189,7 @@
             Notify();
         }
 
-        virtual void JoinAccept(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr) {
+        virtual void JoinAccept(uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr) {
             logDebug("mDotEvent - JoinAccept");
 
             _flags.Bits.Tx = 0;
@@ -199,7 +199,7 @@
 
         }
 
-        virtual void JoinFailed(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr) {
+        virtual void JoinFailed(uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr) {
             logDebug("mDotEvent - JoinFailed");
 
             _flags.Bits.Tx = 0;
@@ -215,7 +215,7 @@
             _info.TxNbRetries = retries;
         }
 
-        virtual void PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries, uint32_t address, bool dupRx) {
+        virtual void PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries, uint32_t address, bool dupRx) {
             logDebug("mDotEvent - PacketRx ADDR: %08x", address);
             RxPort = port;
             PacketReceived = true;
@@ -250,12 +250,12 @@
             Notify();
         }
 
-        virtual void RxDone(uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot) {
+        virtual void RxDone(uint8_t *payload, uint16_t size, int16_t rssi, int16_t snr, lora::DownlinkControl ctrl, uint8_t slot) {
             logDebug("mDotEvent - RxDone");
 
         }
 
-        virtual void BeaconRx(const lora::BeaconData_t& beacon_data, int16_t rssi, int8_t snr) {
+        virtual void BeaconRx(const lora::BeaconData_t& beacon_data, int16_t rssi, int16_t snr) {
             logDebug("mDotEvent - BeaconRx");
             BeaconLocked = true;
             BeaconData = beacon_data;
@@ -266,7 +266,7 @@
             BeaconLocked = false;
         }
 
-        virtual void Pong(int16_t m_rssi, int8_t m_snr, int16_t s_rssi, int8_t s_snr) {
+        virtual void Pong(int16_t m_rssi, int16_t m_snr, int16_t s_rssi, int16_t s_snr) {
             logDebug("mDotEvent - Pong");
             PongReceived = true;
             PongRssi = s_rssi;
@@ -284,7 +284,7 @@
             ServerTimeMillis = static_cast<uint16_t>(current_server_time_ms % 1000);
         }
 
-        virtual void NetworkLinkCheck(int16_t m_rssi, int8_t m_snr, int8_t s_snr, uint8_t s_gateways) {
+        virtual void NetworkLinkCheck(int16_t m_rssi, int16_t m_snr, int16_t s_snr, uint8_t s_gateways) {
             logDebug("mDotEvent - NetworkLinkCheck");
             LinkCheckAnsReceived = true;
             DemodMargin = s_snr;
--- a/plans/ChannelPlan_AS923.h	Wed May 01 09:39:29 2019 -0500
+++ b/plans/ChannelPlan_AS923.h	Thu Aug 29 08:40:49 2019 -0500
@@ -140,12 +140,6 @@
             virtual uint8_t SetFrequencySubBand(uint8_t sub_band);
 
             /**
-             * Callback for ACK timeout event
-             * @return LORA_OK
-             */
-            virtual uint8_t HandleAckTimeout();
-
-            /**
              * Callback for Join Accept packet to load optional channels
              * @return LORA_OK
              */
@@ -259,6 +253,12 @@
             virtual uint8_t GetMaxPayloadSize();
 
             /**
+             * Get max payload size for given datarate
+             * @return size in bytes
+             */
+            virtual uint8_t GetMaxPayloadSize(uint8_t dr) { return ChannelPlan::GetMaxPayloadSize(dr); }
+
+            /**
              * Decrements the datarate based on TxDwellTime
              */
             virtual void DecrementDatarate();
--- a/plans/ChannelPlan_AU915.h	Wed May 01 09:39:29 2019 -0500
+++ b/plans/ChannelPlan_AU915.h	Thu Aug 29 08:40:49 2019 -0500
@@ -288,6 +288,12 @@
              */
             virtual uint8_t GetMaxPayloadSize();
 
+            /**
+             * Get max payload size for given datarate
+             * @return size in bytes
+             */
+            virtual uint8_t GetMaxPayloadSize(uint8_t dr) { return ChannelPlan::GetMaxPayloadSize(dr); }
+
             virtual uint8_t GetMinDatarate();
 
             virtual uint8_t GetMaxDatarate();
--- a/plans/ChannelPlan_EU868.h	Wed May 01 09:39:29 2019 -0500
+++ b/plans/ChannelPlan_EU868.h	Thu Aug 29 08:40:49 2019 -0500
@@ -153,12 +153,6 @@
             virtual uint8_t SetFrequencySubBand(uint8_t sub_band);
 
             /**
-             * Callback for ACK timeout event
-             * @return LORA_OK
-             */
-            virtual uint8_t HandleAckTimeout();
-
-            /**
              * Callback for Join Accept packet to load optional channels
              * @return LORA_OK
              */
--- a/plans/ChannelPlan_IN865.h	Wed May 01 09:39:29 2019 -0500
+++ b/plans/ChannelPlan_IN865.h	Thu Aug 29 08:40:49 2019 -0500
@@ -122,12 +122,6 @@
             virtual uint8_t SetFrequencySubBand(uint8_t sub_band);
 
             /**
-             * Callback for ACK timeout event
-             * @return LORA_OK
-             */
-            virtual uint8_t HandleAckTimeout();
-
-            /**
              * Callback for Join Accept packet to load optional channels
              * @return LORA_OK
              */
--- a/plans/ChannelPlan_KR920.h	Wed May 01 09:39:29 2019 -0500
+++ b/plans/ChannelPlan_KR920.h	Thu Aug 29 08:40:49 2019 -0500
@@ -120,13 +120,7 @@
              */
             virtual uint8_t SetFrequencySubBand(uint8_t sub_band);
 
-            /**
-             * Callback for ACK timeout event
-             * @return LORA_OK
-             */
-            virtual uint8_t HandleAckTimeout();
-
-            /**
+           /**
              * Callback for Join Accept packet to load optional channels
              * @return LORA_OK
              */
--- a/plans/ChannelPlan_RU864.h	Wed May 01 09:39:29 2019 -0500
+++ b/plans/ChannelPlan_RU864.h	Thu Aug 29 08:40:49 2019 -0500
@@ -138,12 +138,6 @@
             virtual uint8_t SetFrequencySubBand(uint8_t sub_band);
 
             /**
-             * Callback for ACK timeout event
-             * @return LORA_OK
-             */
-            virtual uint8_t HandleAckTimeout();
-
-            /**
              * Callback for Join Accept packet to load optional channels
              * @return LORA_OK
              */
--- a/plans/ChannelPlans.h	Wed May 01 09:39:29 2019 -0500
+++ b/plans/ChannelPlans.h	Thu Aug 29 08:40:49 2019 -0500
@@ -1,3 +1,20 @@
+/**********************************************************************
+* COPYRIGHT 2018 MULTI-TECH SYSTEMS, INC.
+*
+* ALL RIGHTS RESERVED BY AND FOR THE EXCLUSIVE BENEFIT OF
+* MULTI-TECH SYSTEMS, INC.
+*
+* MULTI-TECH SYSTEMS, INC. - CONFIDENTIAL AND PROPRIETARY
+* INFORMATION AND/OR TRADE SECRET.
+*
+* NOTICE: ALL CODE, PROGRAM, INFORMATION, SCRIPT, INSTRUCTION,
+* DATA, AND COMMENT HEREIN IS AND SHALL REMAIN THE CONFIDENTIAL
+* INFORMATION AND PROPERTY OF MULTI-TECH SYSTEMS, INC.
+* USE AND DISCLOSURE THEREOF, EXCEPT AS STRICTLY AUTHORIZED IN A
+* WRITTEN AGREEMENT SIGNED BY MULTI-TECH SYSTEMS, INC. IS PROHIBITED.
+*
+***********************************************************************/
+
 #include "ChannelPlan_AS923.h"
 #include "ChannelPlan_AU915.h"
 #include "ChannelPlan_US915.h"