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.

Revision:
9:ec2fffe31793
Parent:
7:683dba5d576f
Child:
10:27dafba9fe19
--- a/mDot.h	Tue Aug 18 08:57:32 2015 -0500
+++ b/mDot.h	Tue Nov 10 14:44:36 2015 -0600
@@ -1,10 +1,4 @@
-/************************************************
- * MultiTech MTDOT Library
- * Copyright (c) 2015 MultiTech Systems
- *
- * See LICENSE file for license information
- ***********************************************/
-
+// TODO: add license header
 
 #ifndef MDOT_H
 #define MDOT_H
@@ -76,7 +70,7 @@
         bool _activity_led_enable;
         PinName _activity_led_pin;
         bool _activity_led_external;
-        uint16_t _linkFailCount;
+        uint8_t _linkFailCount;
         uint8_t _class;
         InterruptIn* _wakeup;
         PinName _wakeup_pin;
@@ -142,6 +136,10 @@
             RTC_ALARM, INTERRUPT
         };
 
+        enum UserBackupRegs {
+            UBR0, UBR1, UBR2, UBR3, UBR4, UBR5, UBR6, UBR7, UBR8, UBR9
+        };
+
         typedef struct {
                 int16_t fd;
                 char name[30];
@@ -193,6 +191,8 @@
         static std::string FrequencyBandStr(uint8_t band);
         static std::string FrequencySubBandStr(uint8_t band);
 
+        uint32_t UserRegisters[10];
+
         /** Get a handle to the singleton object
          * @returns pointer to mDot object
          */
@@ -288,7 +288,6 @@
         uint8_t getFrequencySubBand();
 
         /** Enable/disable public network mode
-         * for use with Conduit gateway and MTAC_LORA, disable public network mode
          * @param on should be true to enable public network mode
          * @returns MDOT_OK if success
          */
@@ -664,6 +663,20 @@
          */
         PinName getWakePin();
 
+        /** Write data in a user backup register
+         * @param register one of UBR0 through UBR9
+         * @param data user data to back up
+         * @returns true if success
+         */
+        bool writeUserBackupRegister(uint32_t reg, uint32_t data);
+
+        /** Read data in a user backup register
+         * @param register one of UBR0 through UBR9
+         * @param data gets set to content of register
+         * @returns true if success
+         */
+        bool readUserBackupRegister(uint32_t reg, uint32_t& data);
+
         /******************************************
          * THESE FEATURES ARE NOT FULLY IMPLEMENTED
          *****************************************/