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
Committer:
Mike Fiore
Date:
Thu Sep 10 13:16:42 2015 -0500
Revision:
9:ebf682e616d0
Parent:
Utils.h@1:9f30fbe9e9c1
Child:
11:9938ba31d428
update README, move files into new directory structure

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Mike Fiore 1:9f30fbe9e9c1 1 /************************************************
Mike Fiore 1:9f30fbe9e9c1 2 * MultiTech MTDOT Library
Mike Fiore 1:9f30fbe9e9c1 3 * Copyright (c) 2015 MultiTech Systems
Mike Fiore 1:9f30fbe9e9c1 4 *
Mike Fiore 1:9f30fbe9e9c1 5 * See LICENSE file for license information
Mike Fiore 1:9f30fbe9e9c1 6 ***********************************************/
Mike Fiore 1:9f30fbe9e9c1 7
Mike Fiore 1:9f30fbe9e9c1 8 #ifndef UTILS_H
Mike Fiore 1:9f30fbe9e9c1 9 #define UTILS_H
Mike Fiore 1:9f30fbe9e9c1 10
Mike Fiore 1:9f30fbe9e9c1 11 #include <string>
Mike Fiore 1:9f30fbe9e9c1 12
Mike Fiore 1:9f30fbe9e9c1 13 //Defines a max function that can be used.
Mike Fiore 1:9f30fbe9e9c1 14 inline int mts_max(int a, int b) { return a > b ? a : b; }
Mike Fiore 1:9f30fbe9e9c1 15
Mike Fiore 1:9f30fbe9e9c1 16 //Defines a min function that can be used.
Mike Fiore 1:9f30fbe9e9c1 17 inline int mts_min(int a, int b) { return a < b ? a : b; }
Mike Fiore 1:9f30fbe9e9c1 18
Mike Fiore 1:9f30fbe9e9c1 19 ///An enumeration for relational operators
Mike Fiore 1:9f30fbe9e9c1 20 enum RelationalOperator {
Mike Fiore 1:9f30fbe9e9c1 21 GREATER, LESS, EQUAL, GREATER_EQUAL, LESS_EQUAL
Mike Fiore 1:9f30fbe9e9c1 22 };
Mike Fiore 1:9f30fbe9e9c1 23
Mike Fiore 1:9f30fbe9e9c1 24 /** A static method for getting a string representation for the RelationalOperator
Mike Fiore 1:9f30fbe9e9c1 25 * enumeration.
Mike Fiore 1:9f30fbe9e9c1 26 *
Mike Fiore 1:9f30fbe9e9c1 27 * @param relationalOperator a RelationalOperator enumeration.
Mike Fiore 1:9f30fbe9e9c1 28 * @returns the enumeration name as a string.
Mike Fiore 1:9f30fbe9e9c1 29 */
Mike Fiore 1:9f30fbe9e9c1 30 static std::string getRelationalOperatorNames(RelationalOperator relationalOperator)
Mike Fiore 1:9f30fbe9e9c1 31 {
Mike Fiore 1:9f30fbe9e9c1 32 switch(relationalOperator) {
Mike Fiore 1:9f30fbe9e9c1 33 case GREATER:
Mike Fiore 1:9f30fbe9e9c1 34 return "GREATER";
Mike Fiore 1:9f30fbe9e9c1 35 case LESS:
Mike Fiore 1:9f30fbe9e9c1 36 return "LESS";
Mike Fiore 1:9f30fbe9e9c1 37 case EQUAL:
Mike Fiore 1:9f30fbe9e9c1 38 return "EQUAL";
Mike Fiore 1:9f30fbe9e9c1 39 case GREATER_EQUAL:
Mike Fiore 1:9f30fbe9e9c1 40 return "GREATER_EQUAL";
Mike Fiore 1:9f30fbe9e9c1 41 case LESS_EQUAL:
Mike Fiore 1:9f30fbe9e9c1 42 return "LESS_EQUAL";
Mike Fiore 1:9f30fbe9e9c1 43 default:
Mike Fiore 1:9f30fbe9e9c1 44 return "UNKNOWN ENUM";
Mike Fiore 1:9f30fbe9e9c1 45 }
Mike Fiore 1:9f30fbe9e9c1 46 }
Mike Fiore 1:9f30fbe9e9c1 47
Mike Fiore 1:9f30fbe9e9c1 48 #endif