Bleeding edge development version of the xDot library for mbed 5. This version of the library is not guaranteed to be stable or well tested and should not be used in production or deployment scenarios.

Dependents:   Dot-Examples Dot-AT-Firmware Dot-Examples TEST_FF1705 ... more

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

Dot Library Version 3 Updates

Dot Library versions 3.x.x require a channel plan to be injected into the stack. Channel plans are included with the 3.x.x Dot Library releases. The following code snippet demonstrates how to create a channel plan and inject it into the stack.

#include "mDot.h"
#include "channel_plans.h"

int main() {
    ChannelPlan* plan = new lora::ChannelPlan_US915();
    assert(plan);
    mDot* dot = mDot::getInstance(plan);
    assert(dot);

    // ...
}

Dot devices must not be deployed with software using a different channel plan than the Dot's default plan! This functionality is for development and testing only!

Multicast Sessions

Multicast sessions and packet rx events in library. When in Class C mode Multicast downlinks can be received. Recieved packets should be filtered on address, counter value will be maintained in the session or can be set explicitly depending on Application support to share Multicast Address, Keys and Counters.

mDot.h

        /**
         * Add a multicast session address and keys
         * Downlink counter is set to 0
         * Up to 3 MULTICAST_SESSIONS can be set
         */
        int32_t setMulticastSession(uint8_t index, uint32_t addr, const uint8_t* nsk, const uint8_t* dsk);
 
        /**
         * Set a multicast session counter
         * Up to 3 MULTICAST_SESSIONS can be set
         */
        int32_t setMulticastDownlinkCounter(uint8_t index, uint32_t count);

mDotEvent.h

The address field was added to PacketRx event.

        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);

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.

Revision:
35:1f130b29595b
Parent:
2:4569491293d7
Child:
52:2cfacf18f01a
--- a/Lora.h	Fri Feb 10 11:11:11 2017 -0600
+++ b/Lora.h	Mon Jun 19 12:51:10 2017 -0500
@@ -209,18 +209,6 @@
     const uint8_t FRAME_OVERHEAD = 13;                          //!< Bytes of network info overhead in a frame
 
     /**
-     * Settings to choose ChannelPlan
-     */
-    enum FrequencyBand {
-        EU868,      //!< EU 863-870 16 channel uplink
-        US915,      //!< US 902-928 64-125k/8-500k uplink and 8-500k downlink channels
-        AU915,      //!< US 915-928 64-125k/8-500k uplink and 8-500k downlink channels
-        CN779,      //!<
-        CN470,      //!<
-        EU433,      //!<
-    };
-
-    /**
      * Settings for type of network
      * PUBLIC - defaults to 5/6 second join windows and 0x34 sync word
      * PRIVATE - defaults to 1/2 second join windows and 0x12 sync word
@@ -261,7 +249,8 @@
         LORA_NO_FREE_CHAN = 15,
         LORA_AGGREGATED_DUTY_CYCLE = 16,
         LORA_MAC_COMMAND_ERROR = 17,
-        LORA_MAX_PAYLOAD_EXCEEDED = 18
+        LORA_MAX_PAYLOAD_EXCEEDED = 18,
+        LORA_LBT_CHANNEL_BUSY = 19
     };
 
     /**
@@ -396,7 +385,7 @@
             uint8_t Key[16];            //!< Network Key or AppKey
             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 ChannelGroup;       //!< ChannelGroup used for US915 hybrid operation 0:72 channels, 1:1-8 channels ...
+            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 Retries;            //!< Number of times to resend a packet without receiving an ACK, redundancy
             uint8_t ADREnabled;         //!< Enable adaptive datarate
@@ -451,6 +440,10 @@
             bool DataPending;                   //!< Indicator of data pending at server
             uint8_t RxTimingSetupReqReceived;   //!< Indicator that RxTimingSetupAns should be included in uplink
             uint8_t RxParamSetupReqAnswer;      //!< Indicator that RxParamSetupAns should be included in uplink
+            uint8_t DlChannelReqAnswer;         //!< Indicator that DlChannelAns should be included in uplink
+            uint8_t DownlinkDwelltime;          //!< On air dwell time for downlink packets 0:NONE,1:400ms
+            uint8_t UplinkDwelltime;            //!< On air dwell time for uplink packets 0:NONE,1:400ms
+            uint8_t Max_EIRP;                   //!< Maximum allowed EIRP for uplink
     } NetworkSession;
 
     /**
@@ -608,13 +601,15 @@
         MOTE_MAC_DEV_STATUS_ANS = 0x06,
         MOTE_MAC_NEW_CHANNEL_ANS = 0x07,
         MOTE_MAC_RX_TIMING_SETUP_ANS = 0x08,
+        MOTE_MAC_TX_PARAM_SETUP_ANS = 0x09,
+        MOTE_MAC_DL_CHANNEL_ANS = 0x0A,
 
         /* Class B */
-        MOTE_MAC_PING_SLOT_INFO_REQ = 0x09,
-        MOTE_MAC_PING_SLOT_FREQ_ANS = 0x0a,
-        MOTE_MAC_PING_SLOT_CHANNEL_ANS = 0x0a,
-        MOTE_MAC_BEACON_TIMING_REQ = 0x0b,
-        MOTE_MAC_BEACON_FREQ_ANS = 0x0c,
+        MOTE_MAC_PING_SLOT_INFO_REQ = 0x0B,
+        MOTE_MAC_PING_SLOT_FREQ_ANS = 0x0C,
+        MOTE_MAC_PING_SLOT_CHANNEL_ANS = 0x0D,
+        MOTE_MAC_BEACON_TIMING_REQ = 0x0E,
+        MOTE_MAC_BEACON_FREQ_ANS = 0x0F,
 
         /* Multitech */
         MOTE_MAC_PING_REQ = 0x80,
@@ -638,13 +633,15 @@
         SRV_MAC_DEV_STATUS_REQ = 0x06,
         SRV_MAC_NEW_CHANNEL_REQ = 0x07,
         SRV_MAC_RX_TIMING_SETUP_REQ = 0x08,
+        SRV_MAC_TX_PARAM_SETUP_REQ = 0x09,
+        SRV_MAC_DL_CHANNEL_REQ = 0x0A,
 
         /* Class B */
-        SRV_MAC_PING_SLOT_INFO_ANS = 0x09,
-        SRV_MAC_PING_SLOT_FREQ_REQ = 0x0a,
-        SRV_MAC_PING_SLOT_CHANNEL_REQ = 0x0a,
-        SRV_MAC_BEACON_TIMING_ANS = 0x0b,
-        SRV_MAC_BEACON_FREQ_REQ = 0x0c,
+        SRV_MAC_PING_SLOT_INFO_ANS = 0x0B,
+        SRV_MAC_PING_SLOT_FREQ_REQ = 0x0C,
+        SRV_MAC_PING_SLOT_CHANNEL_REQ = 0x0D,
+        SRV_MAC_BEACON_TIMING_ANS = 0x0E,
+        SRV_MAC_BEACON_FREQ_REQ = 0x0F,
 
         /* Multitech */
         SRV_MAC_PING_ANS = 0x80,