MultiTech / libmDot-Custom

Fork of libmDot-custom by Jason Reiss

Information

Library has been updated to mbed 5.x

The LoRaWAN Certification test mode implementation is built-in to libmDot code. When a start test mode packet is received the library will not return until test mode has ended.

Warning

This library is currently in BETA release. Unresolved issues may be experienced. Software is provided as is with no expectation of support of bug fixes in the future. Please report issues found through the mbed website or directly to support.multitech.com.

Changing of channel plan parameters may cause the device to no longer respect local RF regulations. Please use caution and respect your local regulations.

In AT Command Firmware remove line 803.

CommandTerminal/CommandTerminal.cpp

        delete[] info->RxBuffer;

Likewise, if your application is handling events from the library asynchronously.

Creating new channel plans

Copy EU868 or US915 custom channel plan as a starting point

Import programmDot_AT_firmware_CUSTOM

AT Firmware with custom channel plan support

EU868 provides a framework for a DYNAMIC channel plan with duty-cycle limitations

US915 provides a framework for a FIXED channel plan

RADIO_POWERS are measured output in dBm for each radio tx power setting.

Additional MAC Commands can be implemented by overriding the HandleMacCommand function.

Steps

  1. Setup datarates, duty-cycle bands and channels in ChannelPlan_* constructor
  2. Modify GetJoinDatarate and CalculateJoinBackoff to change join datarates and backoff
  3. Customize HandleJoinAccept datarates
  4. Use GetRxWindow(int) to define how the device open Rx window 1 and 2
  5. GetNextChannel will pick a channel from the enabled channel at the current datarate before each TX
Revision:
18:aa39c917aa3f
Parent:
16:9bd6cacde447
Child:
21:f77f883a080e
diff -r dd0f69240713 -r aa39c917aa3f ChannelPlan.h
--- a/ChannelPlan.h	Wed Aug 31 11:56:20 2016 -0500
+++ b/ChannelPlan.h	Sat Sep 17 18:00:18 2016 +0000
@@ -25,6 +25,11 @@
     class ChannelPlan {
         public:
 
+            enum PlanType {
+                DYNAMIC,
+                FIXED,
+            };
+
             /**
              * ChannelPlan constructor
              * @param radio SxRadio object used to set Tx/Rx config
@@ -426,6 +431,12 @@
             virtual void DecrementDatarate();
             virtual void IncrementDatarate();
 
+            virtual uint8_t HandleMacCommands(uint8_t* payload, uint8_t index, uint8_t end_index);
+
+            virtual uint8_t GetPlanType();
+            virtual uint32_t GetMinimumFrequency();
+            virtual uint32_t GetMaximumFrequency();
+
         protected:
 
             SxRadio& _radio;                    //!< Injected SxRadio dependency
@@ -497,6 +508,8 @@
             static const uint8_t AU915_RADIO_POWERS[21];                //!< List of calibrated tx powers
             static const uint8_t AU915_MAX_PAYLOAD_SIZE[];              //!< List of max payload sizes for each datarate
             static const uint8_t AU915_MAX_PAYLOAD_SIZE_REPEATER[];     //!< List of repeater compatible max payload sizes for each datarate
+
+            PlanType _type;
     };
 }