Bleeding edge development version of the mDot 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:   mDot-IKS01A1 mDot-IKS01A1 mDot-Examples mDot-IKS01A1-Explora ... more

Fork of libmDot-dev-mbed2-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.

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.

Files at this revision

API Documentation at this revision

Comitter:
Jenkins@KEILDM1.dc.multitech.prv
Date:
Fri Oct 26 16:14:07 2018 -0500
Parent:
182:b642f4d0c95b
Commit message:
mdot-library revision 3.1.0-49-g926b83a and mbed-os revision mbed-os-5.9.6

Changed in this revision

ChannelPlan.h Show annotated file Show diff for this revision Revisions of this file
libmDot-ARMCC.ar Show annotated file Show diff for this revision Revisions of this file
libmDot-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
plans/ChannelPlan_AS923.cpp Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_EU868.cpp Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_IN865.cpp Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_KR920.cpp Show annotated file Show diff for this revision Revisions of this file
plans/ChannelPlan_RU864.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r b642f4d0c95b -r f205b2eea7c2 ChannelPlan.h
--- a/ChannelPlan.h	Fri Oct 12 10:33:08 2018 -0500
+++ b/ChannelPlan.h	Fri Oct 26 16:14:07 2018 -0500
@@ -586,6 +586,11 @@
              */
             virtual void FrequencyHop(uint32_t time, uint32_t period, uint32_t devAddr) { }
 
+
+            /*
+             * Get default number of channels for a plan
+             */
+            virtual uint8_t GetNumDefaultChans();
         protected:
 
             SxRadio* GetRadio();                //!< Get pointer to the SxRadio object or assert if it is null
@@ -629,7 +634,8 @@
             uint8_t _numChans;                  //!< Number of total channels in plan
             uint8_t _numChans125k;              //!< Number of 125K  channels in plan
             uint8_t _numChans500k;              //!< Number of 500K channels in plan
-
+            uint8_t _numDefaultChans;           //!< Number of default channels in plan
+            
             uint16_t _LBT_TimeUs;               //!< Sample time in us for LBT
             int8_t _LBT_Threshold;              //!< Threshold in dBm for LBT
 
diff -r b642f4d0c95b -r f205b2eea7c2 libmDot-ARMCC.ar
Binary file libmDot-ARMCC.ar has changed
diff -r b642f4d0c95b -r f205b2eea7c2 libmDot-GCC_ARM.a
Binary file libmDot-GCC_ARM.a has changed
diff -r b642f4d0c95b -r f205b2eea7c2 mDot.h
--- a/mDot.h	Fri Oct 12 10:33:08 2018 -0500
+++ b/mDot.h	Fri Oct 26 16:14:07 2018 -0500
@@ -51,6 +51,8 @@
         uint32_t RTC_ReadBackupRegister(uint32_t RTC_BKP_DR);
         void RTC_WriteBackupRegister(uint32_t RTC_BKP_DR, uint32_t Data);
 
+        void wakeup();
+
         void RTC_DisableWakeupTimer();
         void RTC_EnableWakeupTimer();
 
@@ -130,7 +132,8 @@
 
         enum RX_Output {
             HEXADECIMAL,
-            BINARY
+            BINARY,
+            EXTENDED
         };
 
         enum DataRates {
@@ -1595,7 +1598,7 @@
         uint32_t getRxFrequency();
 
         // get/set RX output mode
-        // valid options are HEXADECIMAL and BINARY
+        // valid options are HEXADECIMAL, BINARY, and EXTENDED
         // set function returns MDOT_OK if success
         int32_t setRxOutput(const uint8_t& mode);
         uint8_t getRxOutput();
diff -r b642f4d0c95b -r f205b2eea7c2 plans/ChannelPlan_AS923.cpp
--- a/plans/ChannelPlan_AS923.cpp	Fri Oct 12 10:33:08 2018 -0500
+++ b/plans/ChannelPlan_AS923.cpp	Fri Oct 26 16:14:07 2018 -0500
@@ -89,6 +89,7 @@
 
     _numChans125k = 16;
     _numChans500k = 0;
+    _numDefaultChans = AS923_DEFAULT_NUM_CHANS;
 
     GetSettings()->Session.Rx2Frequency = 923200000;
     GetSettings()->Session.Rx2DatarateIndex = DR_2;
@@ -145,7 +146,7 @@
     chan.Frequency = 923200000;
     SetNumberOfChannels(16);
 
-    for (uint8_t i = 0; i < 2; i++) {
+    for (uint8_t i = 0; i < AS923_DEFAULT_NUM_CHANS; i++) {
         AddChannel(i, chan);
         chan.Index++;
         chan.Frequency += 200000;
@@ -154,7 +155,7 @@
     chan.DrRange.Value = 0;
     chan.Frequency = 0;
 
-    for (uint8_t i = 2; i < 16; i++) {
+    for (uint8_t i = AS923_DEFAULT_NUM_CHANS; i < 16; i++) {
         AddChannel(i, chan);
         chan.Index++;
     }
diff -r b642f4d0c95b -r f205b2eea7c2 plans/ChannelPlan_EU868.cpp
--- a/plans/ChannelPlan_EU868.cpp	Fri Oct 12 10:33:08 2018 -0500
+++ b/plans/ChannelPlan_EU868.cpp	Fri Oct 26 16:14:07 2018 -0500
@@ -89,6 +89,8 @@
     _numChans125k = EU868_125K_NUM_CHANS;
     _numChans500k = 0;
 
+    _numDefaultChans = EU868_DEFAULT_NUM_CHANS;
+
     GetSettings()->Session.Rx2Frequency = EU868_RX2_FREQ;
     GetSettings()->Session.Rx2DatarateIndex = DR_0;
 
diff -r b642f4d0c95b -r f205b2eea7c2 plans/ChannelPlan_IN865.cpp
--- a/plans/ChannelPlan_IN865.cpp	Fri Oct 12 10:33:08 2018 -0500
+++ b/plans/ChannelPlan_IN865.cpp	Fri Oct 26 16:14:07 2018 -0500
@@ -87,6 +87,7 @@
 
     _numChans125k = 16;
     _numChans500k = 0;
+    _numDefaultChans = IN865_DEFAULT_NUM_CHANS; 
 
     GetSettings()->Session.Rx2Frequency = 866550000;
     GetSettings()->Session.Rx2DatarateIndex = DR_2;
@@ -139,7 +140,7 @@
     chan.Frequency = 865062500;
     SetNumberOfChannels(16);
 
-    uint8_t numDefaultChannels = 3;
+    uint8_t numDefaultChannels = IN865_DEFAULT_NUM_CHANS;
 
     AddChannel(0, chan);
 
diff -r b642f4d0c95b -r f205b2eea7c2 plans/ChannelPlan_KR920.cpp
--- a/plans/ChannelPlan_KR920.cpp	Fri Oct 12 10:33:08 2018 -0500
+++ b/plans/ChannelPlan_KR920.cpp	Fri Oct 26 16:14:07 2018 -0500
@@ -90,6 +90,7 @@
 
     _numChans125k = 16;
     _numChans500k = 0;
+    _numDefaultChans = KR920_DEFAULT_NUM_CHANS;
 
     GetSettings()->Session.Rx2Frequency = 921900000;
     GetSettings()->Session.Rx2DatarateIndex = DR_0;
@@ -128,7 +129,7 @@
     chan.Frequency = 922100000;
     SetNumberOfChannels(16);
 
-    uint8_t numDefaultChannels = 3;
+    uint8_t numDefaultChannels = KR920_DEFAULT_NUM_CHANS;
 
     for (uint8_t i = 0; i < numDefaultChannels; i++) {
         AddChannel(i, chan);
diff -r b642f4d0c95b -r f205b2eea7c2 plans/ChannelPlan_RU864.cpp
--- a/plans/ChannelPlan_RU864.cpp	Fri Oct 12 10:33:08 2018 -0500
+++ b/plans/ChannelPlan_RU864.cpp	Fri Oct 26 16:14:07 2018 -0500
@@ -88,6 +88,7 @@
 
     _numChans125k = RU864_125K_NUM_CHANS;
     _numChans500k = 0;
+    _numDefaultChans = RU864_DEFAULT_NUM_CHANS;
 
     GetSettings()->Session.Rx2Frequency = RU864_RX2_FREQ;
     GetSettings()->Session.Rx2DatarateIndex = DR_0;