Merge branch 'jgromes:master' into master
This commit is contained in:
commit
cb1a2059b7
8 changed files with 83 additions and 44 deletions
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
|
@ -17,7 +17,6 @@ on:
|
||||||
- none
|
- none
|
||||||
- arduino:avr:uno
|
- arduino:avr:uno
|
||||||
- arduino:avr:mega
|
- arduino:avr:mega
|
||||||
- arduino:avr:leonardo
|
|
||||||
- arduino:mbed:nano33ble
|
- arduino:mbed:nano33ble
|
||||||
- arduino:mbed:envie_m4
|
- arduino:mbed:envie_m4
|
||||||
- arduino:megaavr:uno2018
|
- arduino:megaavr:uno2018
|
||||||
|
@ -50,8 +49,6 @@ jobs:
|
||||||
run: echo "skip-pattern=(STM32WL|SSTV|LoRaWAN)" >> $GITHUB_OUTPUT
|
run: echo "skip-pattern=(STM32WL|SSTV|LoRaWAN)" >> $GITHUB_OUTPUT
|
||||||
- id: arduino:avr:mega
|
- id: arduino:avr:mega
|
||||||
run: echo "options=':cpu=atmega2560'" >> $GITHUB_OUTPUT
|
run: echo "options=':cpu=atmega2560'" >> $GITHUB_OUTPUT
|
||||||
- id: arduino:avr:leonardo
|
|
||||||
run: echo "skip-pattern=(STM32WL|SSTV|Pager)" >> $GITHUB_OUTPUT
|
|
||||||
- id: arduino:mbed:nano33ble
|
- id: arduino:mbed:nano33ble
|
||||||
- id: arduino:mbed:envie_m4
|
- id: arduino:mbed:envie_m4
|
||||||
- id: arduino:megaavr:uno2018
|
- id: arduino:megaavr:uno2018
|
||||||
|
|
16
README.md
16
README.md
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
## Universal wireless communication library for embedded devices
|
## Universal wireless communication library for embedded devices
|
||||||
|
|
||||||
## See the [Wiki](https://github.com/jgromes/RadioLib/wiki) for further information. See the [GitHub Pages](https://jgromes.github.io/RadioLib) for detailed and up-to-date API reference.
|
## See the [Wiki](https://github.com/jgromes/RadioLib/wiki) and [FAQ](https://github.com/jgromes/RadioLib/wiki/Frequently-Asked-Questions) for further information. See the [GitHub Pages](https://jgromes.github.io/RadioLib) for detailed and up-to-date API reference.
|
||||||
|
|
||||||
RadioLib allows its users to integrate all sorts of different wireless communication modules, protocols and even digital modes into a single consistent system.
|
RadioLib allows its users to integrate all sorts of different wireless communication modules, protocols and even digital modes into a single consistent system.
|
||||||
Want to add a Bluetooth interface to your LoRa network? Sure thing! Do you just want to go really old-school and play around with radio teletype, slow-scan TV, or even Hellschreiber using nothing but a cheap radio module? Why not!
|
Want to add a Bluetooth interface to your LoRa network? Sure thing! Do you just want to go really old-school and play around with radio teletype, slow-scan TV, or even Hellschreiber using nothing but a cheap radio module? Why not!
|
||||||
|
@ -88,17 +88,3 @@ SX127x, RFM9x, SX126x and SX128x
|
||||||
* [__Teensy__](https://github.com/PaulStoffregen/cores) - Teensy 2.x, 3.x and 4.x boards
|
* [__Teensy__](https://github.com/PaulStoffregen/cores) - Teensy 2.x, 3.x and 4.x boards
|
||||||
|
|
||||||
The list above is by no means exhaustive - RadioLib code is independent of the used platform! Compilation of all examples is tested for all platforms officially supported prior to releasing new version. In addition, RadioLib includes an internal hardware abstraction layer, which allows it to be easily ported even to non-Arduino environments.
|
The list above is by no means exhaustive - RadioLib code is independent of the used platform! Compilation of all examples is tested for all platforms officially supported prior to releasing new version. In addition, RadioLib includes an internal hardware abstraction layer, which allows it to be easily ported even to non-Arduino environments.
|
||||||
|
|
||||||
## Frequently Asked Questions
|
|
||||||
|
|
||||||
### Where should I start?
|
|
||||||
First of all, take a look at the [examples](https://github.com/jgromes/RadioLib/tree/master/examples) and the [Wiki](https://github.com/jgromes/RadioLib/wiki) - especially the [Basics](https://github.com/jgromes/RadioLib/wiki/Basics) page. There's a lot of useful information over there. If something isn't working as expected, try searching the [issues](https://github.com/jgromes/RadioLib/issues/).
|
|
||||||
|
|
||||||
### Does RadioLib require Arduino?
|
|
||||||
While RadioLib was originally written with Arduino in mind, it has since evolved and contains its own lightweight hardware abstraction layer. Thanks to this layer, RadioLib can be used on non-Arduino frameworks as well. See [this Wiki page](https://github.com/jgromes/RadioLib/wiki/Porting-to-non-Arduino-Platforms) for details.
|
|
||||||
|
|
||||||
### Help, my module isn't working!
|
|
||||||
The fastest way to get help is by creating an [issue](https://github.com/jgromes/RadioLib/issues/new/choose) using the appropriate template. It is also highly recommended to try running the examples first - their functionality is tested from time to time and they should work. Finally, RadioLib is still under development, which means that sometimes, backwards-incompatible changes might be introduced. Though these are kept at minimum, sometimes it is unavoidable. You can check the [release changelog](https://github.com/jgromes/RadioLib/releases) to find out if there's been such a major change recently.
|
|
||||||
|
|
||||||
### RadioLib doesn't support my module! What should I do?
|
|
||||||
Start by creating new issue (if it doesn't exist yet). If you have some experience with microcontrollers and C/C++ in general, you can try to add the support yourself! Use the template files in `/extras/` folder to get started. This is by far the fastest way to implement new modules into RadioLib, since I can't be working on everything all the time. If you don't trust your programming skills enough to have a go at it yourself, don't worry. I will try to implement all requested modules, but it will take me a while.
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "RadioLib",
|
"name": "RadioLib",
|
||||||
"version": "6.1.0",
|
"version": "6.2.0",
|
||||||
"description": "Universal wireless communication library. User-friendly library for sub-GHz radio modules (SX1278, RF69, CC1101, SX1268, and many others), as well as ham radio digital modes (RTTY, SSTV, AX.25 etc.).",
|
"description": "Universal wireless communication library. User-friendly library for sub-GHz radio modules (SX1278, RF69, CC1101, SX1268, and many others), as well as ham radio digital modes (RTTY, SSTV, AX.25 etc.) and other protocols (Pagers, LoRaWAN).",
|
||||||
"keywords": "radio, communication, morse, cc1101, aprs, sx1276, sx1278, sx1272, rtty, ax25, afsk, nrf24, rfm96, sx1231, rfm96, rfm98, sstv, sx1278, sx1272, sx1276, sx1280, sx1281, sx1282, sx1261, sx1262, sx1268, si4432, rfm22, llcc68, pager, pocsag",
|
"keywords": "radio, communication, morse, cc1101, aprs, sx1276, sx1278, sx1272, rtty, ax25, afsk, nrf24, rfm96, sx1231, rfm96, rfm98, sstv, sx1278, sx1272, sx1276, sx1280, sx1281, sx1282, sx1261, sx1262, sx1268, si4432, rfm22, llcc68, pager, pocsag, lorawan",
|
||||||
"homepage": "https://github.com/jgromes/RadioLib",
|
"homepage": "https://github.com/jgromes/RadioLib",
|
||||||
"repository":
|
"repository":
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
name=RadioLib
|
name=RadioLib
|
||||||
version=6.1.0
|
version=6.2.0
|
||||||
author=Jan Gromes <gromes.jan@gmail.com>
|
author=Jan Gromes <gromes.jan@gmail.com>
|
||||||
maintainer=Jan Gromes <gromes.jan@gmail.com>
|
maintainer=Jan Gromes <gromes.jan@gmail.com>
|
||||||
sentence=Universal wireless communication library
|
sentence=Universal wireless communication library
|
||||||
paragraph=User-friendly library for sub-GHz radio modules (SX1278, RF69, CC1101, SX1268, and many others), as well as ham radio digital modes (RTTY, SSTV, AX.25 etc.).
|
paragraph=User-friendly library for sub-GHz radio modules (SX1278, RF69, CC1101, SX1268, and many others), as well as ham radio digital modes (RTTY, SSTV, AX.25 etc.) and other protocols (Pagers, LoRaWAN).
|
||||||
category=Communication
|
category=Communication
|
||||||
url=https://github.com/jgromes/RadioLib
|
url=https://github.com/jgromes/RadioLib
|
||||||
architectures=*
|
architectures=*
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#if defined(RADIOLIB_BUILD_ARDUINO)
|
#if defined(RADIOLIB_BUILD_ARDUINO)
|
||||||
|
|
||||||
|
#if !defined(RADIOLIB_EEPROM_UNSUPPORTED)
|
||||||
#include <EEPROM.h>
|
#include <EEPROM.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
ArduinoHal::ArduinoHal(): RadioLibHal(INPUT, OUTPUT, LOW, HIGH, RISING, FALLING), spi(&RADIOLIB_DEFAULT_SPI), initInterface(true) {}
|
ArduinoHal::ArduinoHal(): RadioLibHal(INPUT, OUTPUT, LOW, HIGH, RISING, FALLING), spi(&RADIOLIB_DEFAULT_SPI), initInterface(true) {}
|
||||||
|
|
||||||
|
@ -101,27 +103,31 @@ void inline ArduinoHal::spiEnd() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArduinoHal::readPersistentStorage(uint32_t addr, uint8_t* buff, size_t len) {
|
void ArduinoHal::readPersistentStorage(uint32_t addr, uint8_t* buff, size_t len) {
|
||||||
#if defined(RADIOLIB_ESP32)
|
#if !defined(RADIOLIB_EEPROM_UNSUPPORTED)
|
||||||
EEPROM.begin(RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE);
|
#if defined(RADIOLIB_ESP32)
|
||||||
#endif
|
EEPROM.begin(RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE);
|
||||||
for(size_t i = 0; i < len; i++) {
|
#endif
|
||||||
buff[i] = EEPROM.read(addr + i);
|
for(size_t i = 0; i < len; i++) {
|
||||||
}
|
buff[i] = EEPROM.read(addr + i);
|
||||||
#if defined(RADIOLIB_ESP32)
|
}
|
||||||
EEPROM.end();
|
#if defined(RADIOLIB_ESP32)
|
||||||
|
EEPROM.end();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArduinoHal::writePersistentStorage(uint32_t addr, uint8_t* buff, size_t len) {
|
void ArduinoHal::writePersistentStorage(uint32_t addr, uint8_t* buff, size_t len) {
|
||||||
#if defined(RADIOLIB_ESP32)
|
#if !defined(RADIOLIB_EEPROM_UNSUPPORTED)
|
||||||
EEPROM.begin(RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE);
|
#if defined(RADIOLIB_ESP32)
|
||||||
#endif
|
EEPROM.begin(RADIOLIB_HAL_PERSISTENT_STORAGE_SIZE);
|
||||||
for(size_t i = 0; i < len; i++) {
|
#endif
|
||||||
EEPROM.write(addr + i, buff[i]);
|
for(size_t i = 0; i < len; i++) {
|
||||||
}
|
EEPROM.write(addr + i, buff[i]);
|
||||||
#if defined(RADIOLIB_ESP32)
|
}
|
||||||
EEPROM.commit();
|
#if defined(RADIOLIB_ESP32)
|
||||||
EEPROM.end();
|
EEPROM.commit();
|
||||||
|
EEPROM.end();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,7 @@
|
||||||
#elif defined(SAMD_SERIES)
|
#elif defined(SAMD_SERIES)
|
||||||
// Adafruit SAMD boards (M0 and M4)
|
// Adafruit SAMD boards (M0 and M4)
|
||||||
#define RADIOLIB_PLATFORM "Adafruit SAMD"
|
#define RADIOLIB_PLATFORM "Adafruit SAMD"
|
||||||
|
#define RADIOLIB_EEPROM_UNSUPPORTED
|
||||||
|
|
||||||
#elif defined(ARDUINO_ARCH_SAMD)
|
#elif defined(ARDUINO_ARCH_SAMD)
|
||||||
// Arduino SAMD (Zero, MKR, etc.)
|
// Arduino SAMD (Zero, MKR, etc.)
|
||||||
|
@ -112,15 +113,18 @@
|
||||||
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
|
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
|
||||||
#define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
|
#define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
|
||||||
#define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
|
#define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
|
||||||
|
#define RADIOLIB_EEPROM_UNSUPPORTED
|
||||||
|
|
||||||
#elif defined(__SAM3X8E__)
|
#elif defined(__SAM3X8E__)
|
||||||
// Arduino Due
|
// Arduino Due
|
||||||
#define RADIOLIB_PLATFORM "Arduino Due"
|
#define RADIOLIB_PLATFORM "Arduino Due"
|
||||||
#define RADIOLIB_TONE_UNSUPPORTED
|
#define RADIOLIB_TONE_UNSUPPORTED
|
||||||
|
#define RADIOLIB_EEPROM_UNSUPPORTED
|
||||||
|
|
||||||
#elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
|
#elif (defined(NRF52832_XXAA) || defined(NRF52840_XXAA)) && !defined(ARDUINO_ARDUINO_NANO33BLE)
|
||||||
// Adafruit nRF52 boards
|
// Adafruit nRF52 boards
|
||||||
#define RADIOLIB_PLATFORM "Adafruit nRF52"
|
#define RADIOLIB_PLATFORM "Adafruit nRF52"
|
||||||
|
#define RADIOLIB_EEPROM_UNSUPPORTED
|
||||||
|
|
||||||
#elif defined(ARDUINO_ARC32_TOOLS)
|
#elif defined(ARDUINO_ARC32_TOOLS)
|
||||||
// Intel Curie
|
// Intel Curie
|
||||||
|
@ -143,6 +147,7 @@
|
||||||
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
|
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
|
||||||
#define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
|
#define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
|
||||||
#define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
|
#define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
|
||||||
|
#define RADIOLIB_EEPROM_UNSUPPORTED
|
||||||
|
|
||||||
// Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
|
// Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
|
||||||
#define RADIOLIB_TONE_UNSUPPORTED
|
#define RADIOLIB_TONE_UNSUPPORTED
|
||||||
|
@ -154,6 +159,7 @@
|
||||||
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
|
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
|
||||||
#define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
|
#define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
|
||||||
#define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
|
#define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
|
||||||
|
#define RADIOLIB_EEPROM_UNSUPPORTED
|
||||||
|
|
||||||
// Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
|
// Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
|
||||||
#define RADIOLIB_TONE_UNSUPPORTED
|
#define RADIOLIB_TONE_UNSUPPORTED
|
||||||
|
@ -175,6 +181,7 @@
|
||||||
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
|
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
|
||||||
#define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
|
#define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
|
||||||
#define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
|
#define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
|
||||||
|
#define RADIOLIB_EEPROM_UNSUPPORTED
|
||||||
|
|
||||||
// Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
|
// Arduino mbed OS boards have a really bad tone implementation which will crash after a couple seconds
|
||||||
#define RADIOLIB_TONE_UNSUPPORTED
|
#define RADIOLIB_TONE_UNSUPPORTED
|
||||||
|
@ -499,7 +506,7 @@
|
||||||
|
|
||||||
// version definitions
|
// version definitions
|
||||||
#define RADIOLIB_VERSION_MAJOR (0x06)
|
#define RADIOLIB_VERSION_MAJOR (0x06)
|
||||||
#define RADIOLIB_VERSION_MINOR (0x01)
|
#define RADIOLIB_VERSION_MINOR (0x02)
|
||||||
#define RADIOLIB_VERSION_PATCH (0x00)
|
#define RADIOLIB_VERSION_PATCH (0x00)
|
||||||
#define RADIOLIB_VERSION_EXTRA (0x00)
|
#define RADIOLIB_VERSION_EXTRA (0x00)
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,20 @@
|
||||||
#warning "God mode active, I hope it was intentional. Buckle up, lads."
|
#warning "God mode active, I hope it was intentional. Buckle up, lads."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// print debug info
|
||||||
|
#if defined(RADIOLIB_DEBUG)
|
||||||
|
#define RADIOLIB_VALUE_TO_STRING(x) #x
|
||||||
|
#define RADIOLIB_VALUE(x) RADIOLIB_VALUE_TO_STRING(x)
|
||||||
|
#pragma message("\nRadioLib Debug Info\nVersion " \
|
||||||
|
RADIOLIB_VALUE(RADIOLIB_VERSION_MAJOR) "." \
|
||||||
|
RADIOLIB_VALUE(RADIOLIB_VERSION_MINOR) "." \
|
||||||
|
RADIOLIB_VALUE(RADIOLIB_VERSION_PATCH) "." \
|
||||||
|
RADIOLIB_VALUE(RADIOLIB_VERSION_EXTRA) "\n" \
|
||||||
|
"Platform: " RADIOLIB_VALUE(RADIOLIB_PLATFORM) "\n" \
|
||||||
|
"Compiled: " RADIOLIB_VALUE(__DATE__) " " RADIOLIB_VALUE(__TIME__) \
|
||||||
|
)
|
||||||
|
#endif
|
||||||
|
|
||||||
// check unknown/unsupported platform
|
// check unknown/unsupported platform
|
||||||
#if defined(RADIOLIB_UNKNOWN_PLATFORM)
|
#if defined(RADIOLIB_UNKNOWN_PLATFORM)
|
||||||
#warning "RadioLib might not be compatible with this Arduino board - check supported platforms at https://github.com/jgromes/RadioLib!"
|
#warning "RadioLib might not be compatible with this Arduino board - check supported platforms at https://github.com/jgromes/RadioLib!"
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
// flag to indicate whether we have received a downlink
|
// flag to indicate whether we have received a downlink
|
||||||
static volatile bool downlinkReceived = false;
|
static volatile bool downlinkReceived = false;
|
||||||
|
|
||||||
|
#if defined(RADIOLIB_EEPROM_UNSUPPORTED)
|
||||||
|
#warning "Persistent storage not supported!"
|
||||||
|
#endif
|
||||||
|
|
||||||
// interrupt service routine to handle downlinks automatically
|
// interrupt service routine to handle downlinks automatically
|
||||||
#if defined(ESP8266) || defined(ESP32)
|
#if defined(ESP8266) || defined(ESP32)
|
||||||
IRAM_ATTR
|
IRAM_ATTR
|
||||||
|
@ -1171,6 +1175,8 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
uint8_t margin = cmd->payload[0];
|
uint8_t margin = cmd->payload[0];
|
||||||
uint8_t gwCnt = cmd->payload[1];
|
uint8_t gwCnt = cmd->payload[1];
|
||||||
RADIOLIB_DEBUG_PRINTLN("Link check: margin = %d dB, gwCnt = %d", margin, gwCnt);
|
RADIOLIB_DEBUG_PRINTLN("Link check: margin = %d dB, gwCnt = %d", margin, gwCnt);
|
||||||
|
(void)margin;
|
||||||
|
(void)gwCnt;
|
||||||
return(2);
|
return(2);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -1220,8 +1226,11 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO implement repeated uplinks with nbTrans
|
// TODO implement repeated uplinks with nbTrans
|
||||||
|
(void)nbTrans;
|
||||||
// TODO implement channel mask
|
// TODO implement channel mask
|
||||||
uint8_t chMaskAck = 0;
|
uint8_t chMaskAck = 0;
|
||||||
|
(void)chMask;
|
||||||
|
(void)chMaskCntl;
|
||||||
|
|
||||||
// send the reply
|
// send the reply
|
||||||
cmd->len = 1;
|
cmd->len = 1;
|
||||||
|
@ -1236,7 +1245,7 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
RADIOLIB_DEBUG_PRINTLN("Max duty cycle: 1/2^%d", maxDutyCycle);
|
RADIOLIB_DEBUG_PRINTLN("Max duty cycle: 1/2^%d", maxDutyCycle);
|
||||||
|
|
||||||
// TODO implement this
|
// TODO implement this
|
||||||
|
(void)maxDutyCycle;
|
||||||
return(1);
|
return(1);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -1258,9 +1267,11 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO process the RX2 data rate
|
// TODO process the RX2 data rate
|
||||||
|
(void)rx2DataRate;
|
||||||
uint8_t rx2Ack = 0;
|
uint8_t rx2Ack = 0;
|
||||||
|
|
||||||
// TODO process the data rate offset
|
// TODO process the data rate offset
|
||||||
|
(void)rx1DrOffset;
|
||||||
uint8_t rx1OffsAck = 0;
|
uint8_t rx1OffsAck = 0;
|
||||||
|
|
||||||
// send the reply
|
// send the reply
|
||||||
|
@ -1293,7 +1304,10 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
RADIOLIB_DEBUG_PRINTLN("New channel: index = %d, freq = %f MHz, maxDr = %d, minDr = %d", chIndex, freq, maxDr, minDr);
|
RADIOLIB_DEBUG_PRINTLN("New channel: index = %d, freq = %f MHz, maxDr = %d, minDr = %d", chIndex, freq, maxDr, minDr);
|
||||||
|
|
||||||
// TODO implement this
|
// TODO implement this
|
||||||
|
(void)chIndex;
|
||||||
|
(void)freq;
|
||||||
|
(void)maxDr;
|
||||||
|
(void)minDr;
|
||||||
return(5);
|
return(5);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -1329,6 +1343,9 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
RADIOLIB_DEBUG_PRINTLN("TX timing: dlDwell = %d, dlDwell = %d, maxEirp = %d dBm", dlDwell, ulDwell, maxEirp);
|
RADIOLIB_DEBUG_PRINTLN("TX timing: dlDwell = %d, dlDwell = %d, maxEirp = %d dBm", dlDwell, ulDwell, maxEirp);
|
||||||
|
|
||||||
// TODO implement this
|
// TODO implement this
|
||||||
|
(void)dlDwell;
|
||||||
|
(void)ulDwell;
|
||||||
|
(void)maxEirp;
|
||||||
return(1);
|
return(1);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -1340,6 +1357,8 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
RADIOLIB_DEBUG_PRINTLN("DL channel: index = %d, freq = %f MHz", chIndex, freq);
|
RADIOLIB_DEBUG_PRINTLN("DL channel: index = %d, freq = %f MHz", chIndex, freq);
|
||||||
|
|
||||||
// TODO implement this
|
// TODO implement this
|
||||||
|
(void)chIndex;
|
||||||
|
(void)freq;
|
||||||
return(4);
|
return(4);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -1359,14 +1378,18 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
uint8_t limitExp = (cmd->payload[0] & 0xF0) >> 4;
|
uint8_t limitExp = (cmd->payload[0] & 0xF0) >> 4;
|
||||||
uint8_t delayExp = cmd->payload[0] & 0x0F;
|
uint8_t delayExp = cmd->payload[0] & 0x0F;
|
||||||
RADIOLIB_DEBUG_PRINTLN("ADR param setup: limitExp = %d, delayExp = %d", limitExp, delayExp);
|
RADIOLIB_DEBUG_PRINTLN("ADR param setup: limitExp = %d, delayExp = %d", limitExp, delayExp);
|
||||||
|
(void)limitExp;
|
||||||
|
(void)delayExp;
|
||||||
return(1);
|
return(1);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case(RADIOLIB_LORAWAN_MAC_CMD_DEVICE_TIME): {
|
case(RADIOLIB_LORAWAN_MAC_CMD_DEVICE_TIME): {
|
||||||
// TODO implement this - sent by gateway as reply to node request
|
// TODO implement this - sent by gateway as reply to node request
|
||||||
uint32_t gpsEpoch = LoRaWANNode::ntoh<uint32_t>(&cmd->payload[0]);
|
uint32_t gpsEpoch = LoRaWANNode::ntoh<uint32_t>(&cmd->payload[0]);
|
||||||
uint8_t fraction = cmd->payload[5];
|
uint8_t fraction = cmd->payload[4];
|
||||||
RADIOLIB_DEBUG_PRINTLN("Network time: gpsEpoch = %d s, delayExp = %f", gpsEpoch, (float)fraction/256.0f);
|
RADIOLIB_DEBUG_PRINTLN("Network time: gpsEpoch = %d s, delayExp = %f", gpsEpoch, (float)fraction/256.0f);
|
||||||
|
(void)gpsEpoch;
|
||||||
|
(void)fraction;
|
||||||
return(5);
|
return(5);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -1378,6 +1401,10 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
uint8_t rejoinType = (rejoinReq & 0x0070) >> 4;
|
uint8_t rejoinType = (rejoinReq & 0x0070) >> 4;
|
||||||
uint8_t dr = rejoinReq & 0x000F;
|
uint8_t dr = rejoinReq & 0x000F;
|
||||||
RADIOLIB_DEBUG_PRINTLN("Force rejoin: period = %d, maxRetries = %d, rejoinType = %d, dr = %d", period, maxRetries, rejoinType, dr);
|
RADIOLIB_DEBUG_PRINTLN("Force rejoin: period = %d, maxRetries = %d, rejoinType = %d, dr = %d", period, maxRetries, rejoinType, dr);
|
||||||
|
(void)period;
|
||||||
|
(void)maxRetries;
|
||||||
|
(void)rejoinType;
|
||||||
|
(void)dr;
|
||||||
return(2);
|
return(2);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
@ -1386,6 +1413,8 @@ size_t LoRaWANNode::execMacCommand(LoRaWANMacCommand_t* cmd) {
|
||||||
uint8_t maxTime = (cmd->payload[0] & 0xF0) >> 4;
|
uint8_t maxTime = (cmd->payload[0] & 0xF0) >> 4;
|
||||||
uint8_t maxCount = cmd->payload[0] & 0x0F;
|
uint8_t maxCount = cmd->payload[0] & 0x0F;
|
||||||
RADIOLIB_DEBUG_PRINTLN("Rejoin setup: maxTime = %d, maxCount = %d", maxTime, maxCount);
|
RADIOLIB_DEBUG_PRINTLN("Rejoin setup: maxTime = %d, maxCount = %d", maxTime, maxCount);
|
||||||
|
(void)maxTime;
|
||||||
|
(void)maxCount;
|
||||||
return(0);
|
return(0);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue