Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of libmDot-custom by
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
- Setup datarates, duty-cycle bands and channels in ChannelPlan_* constructor
- Modify GetJoinDatarate and CalculateJoinBackoff to change join datarates and backoff
- Customize HandleJoinAccept datarates
- Use GetRxWindow(int) to define how the device open Rx window 1 and 2
- GetNextChannel will pick a channel from the enabled channel at the current datarate before each TX
MTSLog.h
- Committer:
- Mike Fiore
- Date:
- 2015-06-24
- Revision:
- 1:9f30fbe9e9c1
- Child:
- 7:683dba5d576f
File content as of revision 1:9f30fbe9e9c1:
/************************************************
* MultiTech MTDOT Library
* Copyright (c) 2015 MultiTech Systems
*
* See LICENSE file for license information
***********************************************/
#ifndef MTSLOG_H
#define MTSLOG_H
#ifdef MTS_DEBUG
#define logFatal(format, ...) \
MTSLog::printMessage(MTSLog::FATAL_LEVEL, "%s:%s:%s| [%s] " format "\r\n", __FILE__, __func__, __LINE__, MTSLog::FATAL_LABEL, ##__VA_ARGS__)
#define logError(format, ...) \
MTSLog::printMessage(MTSLog::ERROR_LEVEL, "%s:%s:%s| [%s] " format "\r\n", __FILE__, __func__, __LINE__, MTSLog::ERROR_LABEL, ##__VA_ARGS__)
#define logWarning(format, ...) \
MTSLog::printMessage(MTSLog::WARNING_LEVEL, "%s:%s:%s| [%s] " format "\r\n", __FILE__, __func__, __LINE__, MTSLog::WARNING_LABEL, ##__VA_ARGS__)
#define logInfo(format, ...) \
MTSLog::printMessage(MTSLog::INFO_LEVEL, "%s:%s:%s| [%s] " format "\r\n", __FILE__, __func__, __LINE__, MTSLog::INFO_LABEL, ##__VA_ARGS__)
#define logDebug(format, ...) \
MTSLog::printMessage(MTSLog::DEBUG_LEVEL, "%s:%s:%s| [%s] " format "\r\n", __FILE__, __func__, __LINE__, MTSLog::DEBUG_LABEL, ##__VA_ARGS__)
#define logTrace(format, ...) \
MTSLog::printMessage(MTSLog::TRACE_LEVEL, "%s:%s:%s| [%s] " format "\r\n", __FILE__, __func__, __LINE__, MTSLog::TRACE_LABEL, ##__VA_ARGS__)
#else
#define logFatal(format, ...) \
MTSLog::printMessage(MTSLog::FATAL_LEVEL, "[%s] " format "\r\n", MTSLog::FATAL_LABEL, ##__VA_ARGS__)
#define logError(format, ...) \
MTSLog::printMessage(MTSLog::ERROR_LEVEL, "[%s] " format "\r\n", MTSLog::ERROR_LABEL, ##__VA_ARGS__)
#define logWarning(format, ...) \
MTSLog::printMessage(MTSLog::WARNING_LEVEL, "[%s] " format "\r\n", MTSLog::WARNING_LABEL, ##__VA_ARGS__)
#define logInfo(format, ...) \
MTSLog::printMessage(MTSLog::INFO_LEVEL, "[%s] " format "\r\n", MTSLog::INFO_LABEL, ##__VA_ARGS__)
#define logDebug(format, ...) \
MTSLog::printMessage(MTSLog::DEBUG_LEVEL, "[%s] " format "\r\n", MTSLog::DEBUG_LABEL, ##__VA_ARGS__)
#define logTrace(format, ...) \
MTSLog::printMessage(MTSLog::TRACE_LEVEL, "[%s] " format "\r\n", MTSLog::TRACE_LABEL, ##__VA_ARGS__)
#endif
namespace mts {
class MTSLog
{
public:
/** Enum of log levels.
*/
enum logLevel {
NONE_LEVEL = 0,
FATAL_LEVEL = 1,
ERROR_LEVEL = 2,
WARNING_LEVEL = 3,
INFO_LEVEL = 4,
DEBUG_LEVEL = 5,
TRACE_LEVEL = 6
};
/** Print log message.
*/
static void printMessage(int level, const char* format, ...);
/** Determine if the given level is currently printable.
*/
static bool printable(int level);
/** Set log level
* Messages with lower priority than the current level will not be printed.
* If the level is set to NONE, no messages will print.
*/
static void setLogLevel(int level);
/** Get the current log level.
*/
static int getLogLevel();
/** Get string representation of the current log level.
*/
static const char* getLogLevelString();
static const char* NONE_LABEL;
static const char* FATAL_LABEL;
static const char* ERROR_LABEL;
static const char* WARNING_LABEL;
static const char* INFO_LABEL;
static const char* DEBUG_LABEL;
static const char* TRACE_LABEL;
private:
/** Constructor
*/
MTSLog();
static int currentLevel;
};
}
#endif

