Library for LoRa communication using MultiTech MDOT.
Dependents: mDot_test_rx adc_sensor_lora mDotEVBM2X mDot_AT_firmware ... more
Function documentation is in mDot.h
Warning
Using libmDot 2.0.3 and above with an existing application may require a change in the MacEvent handler!
Compile applications with mbed v121 and mbed-rtos v116 libraries.
In AT Command Firmware remove line 803.
CommandTerminal/CommandTerminal.cpp
delete[] info->RxBuffer;
Likewise, if your application is handling events from the library asynchronously.
Utils.h
- Committer:
- Mike Fiore
- Date:
- 2015-06-24
- Revision:
- 1:9f30fbe9e9c1
File content as of revision 1:9f30fbe9e9c1:
/************************************************
* MultiTech MTDOT Library
* Copyright (c) 2015 MultiTech Systems
*
* See LICENSE file for license information
***********************************************/
#ifndef UTILS_H
#define UTILS_H
#include <string>
//Defines a max function that can be used.
inline int mts_max(int a, int b) { return a > b ? a : b; }
//Defines a min function that can be used.
inline int mts_min(int a, int b) { return a < b ? a : b; }
///An enumeration for relational operators
enum RelationalOperator {
GREATER, LESS, EQUAL, GREATER_EQUAL, LESS_EQUAL
};
/** A static method for getting a string representation for the RelationalOperator
* enumeration.
*
* @param relationalOperator a RelationalOperator enumeration.
* @returns the enumeration name as a string.
*/
static std::string getRelationalOperatorNames(RelationalOperator relationalOperator)
{
switch(relationalOperator) {
case GREATER:
return "GREATER";
case LESS:
return "LESS";
case EQUAL:
return "EQUAL";
case GREATER_EQUAL:
return "GREATER_EQUAL";
case LESS_EQUAL:
return "LESS_EQUAL";
default:
return "UNKNOWN ENUM";
}
}
#endif