MultiTech / libxDot-Custom

Fork of libxDot-dev-mbed5-deprecated by MultiTech

The Connect example can be used as a starting point for an xDot application.

Import programmDot_LoRa_Connect_Example_CUSTOM_AS923

Example configuration of frequencies and datarates for AS923 channel plan.

Change the libmDot-Custom library to libxDot-Custom after importing the above example.

Change the platform for the project to xDot in upper right corner of the compiler page.

Ensure the mbed-os version matches the with the library commit.

Currently the AT Firmware cannot be built online for the xDot.

Creating new channel plans

Copy EU868 or US915 custom channel plan as a starting point

Import librarymDot_Channel_Plans

Channel plans to enable libmDot-Custom

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:
24:707857d35a6e
Parent:
23:17a25e16ccf1
--- a/Lora.h	Mon Oct 31 14:51:55 2016 +0000
+++ b/Lora.h	Fri Jan 06 14:48:17 2017 +0000
@@ -261,7 +261,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
     };
 
     /**
@@ -451,6 +452,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 +613,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 +645,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,