diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 486e056df..2ea6209e0 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -21,7 +21,7 @@ paste the debug output here
```
-
+
**To Reproduce**
Minimal Arduino sketch to reproduce the behavior. Please use Markdown to style the code to make it readable (see [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code)).
@@ -34,7 +34,7 @@ paste the sketch here, even if it is an unmodified example code
```
-
+
**Expected behavior**
A clear and concise description of what you expected to happen.
diff --git a/.github/ISSUE_TEMPLATE/module-not-working.md b/.github/ISSUE_TEMPLATE/module-not-working.md
index be93f6709..200eda763 100644
--- a/.github/ISSUE_TEMPLATE/module-not-working.md
+++ b/.github/ISSUE_TEMPLATE/module-not-working.md
@@ -22,7 +22,7 @@ paste the sketch here, even if it is an unmodified example code
```
-
+
**Hardware setup**
Wiring diagram, schematic, pictures etc.
@@ -38,7 +38,7 @@ paste the debug output here
```
-
+
**Additional info (please complete):**
- MCU: [e.g. Arduino Uno, ESP8266 etc.]
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 7ee70772a..586ec800c 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -122,7 +122,7 @@ jobs:
run: |
echo "skip-pattern=(STM32WL|LoRaWAN|LR11x0_Firmware_Update)" >> $GITHUB_OUTPUT
- id: SiliconLabs:silabs:xg24explorerkit
- run: |
+ run: |
echo "index-url=--additional-urls https://siliconlabs.github.io/arduino/package_arduinosilabs_index.json" >> $GITHUB_OUTPUT
runs-on: ubuntu-latest
@@ -184,11 +184,11 @@ jobs:
|
cd $PWD/extras/test/ci
./build_examples.sh ${{ matrix.id }} "${{ steps.prep.outputs.skip-pattern }}" ${{ steps.prep.outputs.options }}
-
+
- name: Extract short commit hash
id: short-hash
run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
-
+
- name: Parse sizes
if: ${{ env.run-build == 'true' }}
run:
@@ -196,7 +196,7 @@ jobs:
cd $PWD/extras/test/ci
./parse_size.sh ${{ matrix.id }}
cat size_${{ steps.short-hash.outputs.short_sha }}_${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}-${{ steps.split.outputs._2 }}.csv
-
+
- name: Upload size report as artifact
uses: actions/upload-artifact@v4
with:
@@ -223,12 +223,12 @@ jobs:
cd artifacts
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
-
+
- name: Download size artifacts
uses: actions/download-artifact@v4
with:
path: aggregated-sizes
-
+
- name: Push size files
run:
|
@@ -246,7 +246,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
-
+
- name: Install dependencies
run: |
sudo apt-get update
@@ -257,12 +257,12 @@ jobs:
mkdir -p ~/esp
cd ~/esp
git clone --recursive https://github.com/espressif/esp-idf.git
-
+
- name: Install ESP-IDF
run: |
cd ~/esp/esp-idf
./install.sh esp32
-
+
- name: Build the example
run: |
cd $PWD/examples/NonArduino/ESP-IDF
@@ -298,7 +298,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
-
+
- name: Install dependencies
run: |
sudo apt-get update
@@ -310,7 +310,7 @@ jobs:
sudo make install
cd ..
sudo rm -rf lg
-
+
- name: Install the library
run: |
cd $PWD
@@ -318,7 +318,7 @@ jobs:
cd build
cmake ..
sudo make install
-
+
- name: Build the example
run: |
cd $PWD/examples/NonArduino/Raspberry
@@ -341,19 +341,19 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
-
+
- name: Install dependencies
run: |
sudo apt update
sudo apt install git cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
-
+
- name: Clone the SDK
run: |
mkdir -p ~/rpi-pico
cd ~/rpi-pico
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk && git checkout 1.5.1
-
+
- name: Build the example
run: |
export PICO_SDK_PATH=~/rpi-pico/pico-sdk
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index c8ce82d0e..bf37311a5 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -12,25 +12,25 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
-
+
- name: Checkout latest tag
run: git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
-
+
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
-
+
- name: Install PlatformIO and ESP-IDF
- run: |
+ run: |
pip install --upgrade platformio
pip install --upgrade idf-component-manager
-
+
- name: PlatformIO publish
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
run: pio pkg publish --no-interactive
-
+
- name: ESP-IDF publish
env:
IDF_COMPONENT_API_TOKEN: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
index b46a5160f..08ea2d6b5 100644
--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -30,7 +30,7 @@ jobs:
run: |
cd extras/test/unit
./coverage.sh
-
+
- name: Upload coverage report as artifact
uses: actions/upload-artifact@v4
with:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 000000000..64448c253
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,10 @@
+repos:
+- repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v5.0.0
+ hooks:
+ - id: check-yaml
+ - id: check-illegal-windows-names
+ - id: end-of-file-fixer
+ - id: trailing-whitespace
+ - id: mixed-line-ending
+ args: ['-f=lf']
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b208f79d3..f3741bdff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,7 +15,7 @@ if(ESP_PLATFORM)
idf_component_register(
SRCS ${RADIOLIB_SOURCES}
- INCLUDE_DIRS . src
+ INCLUDE_DIRS . src
)
return()
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4bf96194b..51615d121 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,20 +7,20 @@ To keep this library organized, please follow these rules.
The following rules guide submission of new issues. These rules are in place mainly so that the issue author can get help as quickly as possible.
-1. **Questions are welcome, spam is not.**
+1. **Questions are welcome, spam is not.**
Any issues without description will be considered spam and as such will be **CLOSED** and **LOCKED** immediately!
-2. **This repository has issue templates.**
+2. **This repository has issue templates.**
To report bugs or suggest new features, use the provided issue templates. Use the default issue only if the templates do not fit your issue type.
-3. **Be as clear as possible when creating issues.**
+3. **Be as clear as possible when creating issues.**
Issues with generic titles (e.g. "not working", "lora", etc.) will be **CLOSED** until the title is fixed, since the title is supposed to categorize the issue. The same applies for issues with very little information and extensive grammatical or formatting errors that make it difficult to find out what is the actual issue.
-4. **Issues deserve some attention too.**
+4. **Issues deserve some attention too.**
Issues that are left for 2 weeks without response by the original author when asked for further information will be closed due to inactivity. This is to keep track of important issues, the author is encouraged to reopen the issue at a later date.
## Code style guidelines
I like pretty code! Or at least, I like *consistent* code style. When creating pull requests, please follow these style guidelines, they're in place to keep high code readability.
-1. **Bracket style**
+1. **Bracket style**
This library uses the following style of bracket indentation (1TBS, or "javascript" style):
```c++
@@ -31,10 +31,10 @@ if (foo) {
}
```
-2. **Tabs**
+2. **Tabs**
Use 2 space characters for tabs.
-3. **Single-line comments**
+3. **Single-line comments**
Comments can be very useful - and they can become the bane of readability. Every single-line comment should start at new line, have one space between comment delimiter `//` and the start of the comment itself. The comment should also start with a lower-case letter.
```c++
@@ -45,7 +45,7 @@ foo("bar");
foo(12345);
```
-4. **Split code into blocks**
+4. **Split code into blocks**
It is very easy to write code that machine can read. It is much harder to write one that humans can read. That's why it's a great idea to split code into blocks - even if the block is just a single line!
```c++
@@ -62,13 +62,13 @@ state = readData(data, len);
data[len] = 0;
```
-5. **Doxygen**
+5. **Doxygen**
If you're adding a new method, make sure to add appropriate Doxygen comments, so that the documentation is always complete.
-6. **Keywords**
+6. **Keywords**
This is an Arduino library, so it needs to comply with the Arduino library specification. To add a new keyword to the Arduino IDE syntax highlighting, add it to the keywords.txt file. **Use true tabs in keywords.txt! No spaces there!**
-7. **Dynamic memory**
+7. **Dynamic memory**
Sometimes, RadioLib might be used in critical applications where dynamic memory allocation using `new` or `malloc` might cause issues. For such cases, RadioLib provides the option to compile using only static arrays. This means that every dynamically allocated array must have a sufficiently large static counterpart. Naturally, all dynamically allocated memory must be properly de-allocated using `delete` or `free`.
```c++
@@ -91,7 +91,7 @@ readData(data, length);
#endif
```
-8. **God Mode**
+8. **God Mode**
During development, it can be useful to have access to the low level drivers, such as the SPI commands. These are incredibly powerful, since they will basically let user do anything he wants with the module, outside of the normal level of sanity checks. As such, they are normally protected using C++ access modifiers `private` or `protected`. God mode disables this protection, and so any newly implemented `class` must contain the appropriate macro check:
```c++
@@ -106,5 +106,9 @@ class Module {
};
```
-9. **No Arduino Strings**
+9. **No Arduino Strings**
Arduino `String` class should never be used internally in the library. The only allowed occurence of Arduino `String` is in public API methods, and only at the top-most layer.
+
+## Pre-commit
+
+It is recommend that you use [pre-commit](https://pre-commit.com/) to automatically check your code before committing. Pre-commit can be installed following [these instructions](https://pre-commit.com/#installation), after which simply run `pre-commit install` at the root of this project. This will install all of the hooks specified in this project's [config file](./.pre-commit-config.yaml).
diff --git a/README.md b/README.md
index 281178043..138b62462 100644
--- a/README.md
+++ b/README.md
@@ -34,30 +34,30 @@ RadioLib was originally created as a driver for [__RadioShield__](https://github
* __SX123x__ FSK/OOK radio modules (SX1231, SX1233)
### Supported protocols and digital modes:
-* [__AX.25__](https://www.sigidwiki.com/wiki/PACKET) using 2-FSK or AFSK for modules:
+* [__AX.25__](https://www.sigidwiki.com/wiki/PACKET) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, RFM2x, Si443x, LR11x0 and SX128x
-* [__RTTY__](https://www.sigidwiki.com/wiki/RTTY) using 2-FSK or AFSK for modules:
+* [__RTTY__](https://www.sigidwiki.com/wiki/RTTY) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x, LR11x0 and SX128x
-* [__Morse Code__](https://www.sigidwiki.com/wiki/Morse_Code_(CW)) using 2-FSK or AFSK for modules:
+* [__Morse Code__](https://www.sigidwiki.com/wiki/Morse_Code_(CW)) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x, LR11x0 and SX128x
-* [__SSTV__](https://www.sigidwiki.com/wiki/SSTV) using 2-FSK or AFSK for modules:
+* [__SSTV__](https://www.sigidwiki.com/wiki/SSTV) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, RFM2x and Si443x
-* [__Hellschreiber__](https://www.sigidwiki.com/wiki/Hellschreiber) using 2-FSK or AFSK for modules:
+* [__Hellschreiber__](https://www.sigidwiki.com/wiki/Hellschreiber) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x, LR11x0 and SX128x
-* [__APRS__](https://www.sigidwiki.com/wiki/APRS) using AFSK for modules:
+* [__APRS__](https://www.sigidwiki.com/wiki/APRS) using AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x and SX128x
-* [__POCSAG__](https://www.sigidwiki.com/wiki/POCSAG) using 2-FSK for modules:
+* [__POCSAG__](https://www.sigidwiki.com/wiki/POCSAG) using 2-FSK for modules:
SX127x, RFM9x, RF69, SX1231, CC1101, nRF24L01, RFM2x and Si443x
-* [__LoRaWAN__](https://lora-alliance.org/) using LoRa and FSK for modules:
+* [__LoRaWAN__](https://lora-alliance.org/) using LoRa and FSK for modules:
SX127x, RFM9x, SX126x, LR11x0 and SX128x
* Supports Class A and C (and Multicast over C)
* Pre-certified for Class A on dynamic channelplans (EU868-style)
* See the [wiki](https://github.com/jgromes/RadioLib/wiki/LoRaWAN) and [notes](https://github.com/jgromes/RadioLib/blob/master/examples/LoRaWAN/LoRaWAN_Starter/notes.md) for more information.
### Supported Arduino platforms:
-* __Arduino__
+* __Arduino__
* [__AVR__](https://github.com/arduino/ArduinoCore-avr) - Arduino Uno, Mega, Leonardo, Pro Mini, Nano etc.
- * NOTE: Arduino boards based on ATmega328 (Uno, Pro Mini, Nano etc.) and smaller are NOT recommended. This is because the ATmega328 MCU is very constrained in terms of program and memory size, so the library will end up taking most of the space available.
+ * NOTE: Arduino boards based on ATmega328 (Uno, Pro Mini, Nano etc.) and smaller are NOT recommended. This is because the ATmega328 MCU is very constrained in terms of program and memory size, so the library will end up taking most of the space available.
* [__mbed__](https://github.com/arduino/ArduinoCore-mbed) - Arduino Nano 33 BLE and Arduino Portenta H7
* [__megaAVR__](https://github.com/arduino/ArduinoCore-megaavr) - Arduino Uno WiFi Rev.2 and Nano Every
* [__SAM__](https://github.com/arduino/ArduinoCore-sam) - Arduino Due
diff --git a/examples/AFSK/AFSK_External_Radio/AFSK_External_Radio.ino b/examples/AFSK/AFSK_External_Radio/AFSK_External_Radio.ino
index 012d1e20f..eafae8f85 100644
--- a/examples/AFSK/AFSK_External_Radio/AFSK_External_Radio.ino
+++ b/examples/AFSK/AFSK_External_Radio/AFSK_External_Radio.ino
@@ -3,7 +3,7 @@
This example shows how to use your Arduino
as modulator for an external analogue FM radio.
-
+
The example sends APRS position reports with
audio modulated as AFSK at 1200 baud using
Bell 202 tones. However, any other AFSK
@@ -64,19 +64,19 @@ void setup() {
void loop() {
Serial.print(F("[APRS] Sending position ... "));
-
+
// send a location without message or timestamp
char destination[] = "N0CALL";
char latitude[] = "4911.67N";
char longitude[] = "01635.96E";
int state = aprs.sendPosition(destination, 0, latitude, longitude);
delay(500);
-
+
// send a location with message and without timestamp
char message[] = "I'm here!";
state |= aprs.sendPosition(destination, 0, latitude, longitude, message);
delay(500);
-
+
// send a location with message and timestamp
char timestamp[] = "093045z";
state |= aprs.sendPosition(destination, 0, latitude, longitude, message, timestamp);
diff --git a/examples/AFSK/AFSK_Tone/AFSK_Tone.ino b/examples/AFSK/AFSK_Tone/AFSK_Tone.ino
index ace105017..5d82a5279 100644
--- a/examples/AFSK/AFSK_Tone/AFSK_Tone.ino
+++ b/examples/AFSK/AFSK_Tone/AFSK_Tone.ino
@@ -74,7 +74,7 @@ void setup() {
void loop() {
// AFSKClient can be used to transmit tones,
// same as Arduino tone() function
-
+
// 400 Hz tone
Serial.print(F("[AFSK] 400 Hz tone ... "));
audio.tone(400);
diff --git a/examples/APRS/APRS_Position/APRS_Position.ino b/examples/APRS/APRS_Position/APRS_Position.ino
index cf7f6977e..12d7e91ab 100644
--- a/examples/APRS/APRS_Position/APRS_Position.ino
+++ b/examples/APRS/APRS_Position/APRS_Position.ino
@@ -1,9 +1,9 @@
/*
RadioLib APRS Position Example
- This example sends APRS position reports
+ This example sends APRS position reports
using SX1278's FSK modem. The data is
- modulated as AFSK at 1200 baud using Bell
+ modulated as AFSK at 1200 baud using Bell
202 tones.
DO NOT transmit in APRS bands unless
@@ -110,7 +110,7 @@ void setup() {
void loop() {
Serial.println(F("[APRS] Sending location reports"));
-
+
// send a location without message or timestamp
char destination[] = "N0CALL";
char latitude[] = "4911.67N";
@@ -121,7 +121,7 @@ void loop() {
Serial.println(state);
}
delay(500);
-
+
// send a location with message and without timestamp
char message[] = "I'm here!";
state = aprs.sendPosition(destination, 0, latitude, longitude, message);
@@ -137,7 +137,7 @@ void loop() {
char* repeaterCallsigns[] = { "WIDE2" };
uint8_t repeaterSSIDs[] = { 2 };
aprs.useRepeaters(repeaterCallsigns, repeaterSSIDs, 1);
-
+
// send a location with message and timestamp
char timestamp[] = "093045z";
state = aprs.sendPosition(destination, 0, latitude, longitude, message, timestamp);
@@ -154,4 +154,3 @@ void loop() {
Serial.println(F("[APRS] All done!"));
delay(60000);
}
-
diff --git a/examples/APRS/APRS_Position_LoRa/APRS_Position_LoRa.ino b/examples/APRS/APRS_Position_LoRa/APRS_Position_LoRa.ino
index b1cf8ad77..397e8405f 100644
--- a/examples/APRS/APRS_Position_LoRa/APRS_Position_LoRa.ino
+++ b/examples/APRS/APRS_Position_LoRa/APRS_Position_LoRa.ino
@@ -1,7 +1,7 @@
/*
RadioLib APRS Position over LoRa Example
- This example sends APRS position reports
+ This example sends APRS position reports
using SX1278's LoRa modem.
Other modules that can be used for APRS:
@@ -79,7 +79,7 @@ void setup() {
void loop() {
Serial.print(F("[APRS] Sending position ... "));
-
+
// send a location with message and timestamp
// SSID is set to 1, as APRS over LoRa uses WIDE1-1 path by default
char destination[] = "GPS";
diff --git a/examples/LR11x0/LR11x0_Channel_Activity_Detection_Blocking/LR11x0_Channel_Activity_Detection_Blocking.ino b/examples/LR11x0/LR11x0_Channel_Activity_Detection_Blocking/LR11x0_Channel_Activity_Detection_Blocking.ino
index 0a6c13ca0..bbd2b6622 100644
--- a/examples/LR11x0/LR11x0_Channel_Activity_Detection_Blocking/LR11x0_Channel_Activity_Detection_Blocking.ino
+++ b/examples/LR11x0/LR11x0_Channel_Activity_Detection_Blocking/LR11x0_Channel_Activity_Detection_Blocking.ino
@@ -7,7 +7,7 @@
of LoRa transmission, not just the preamble.
Other modules from LR11x0 family can also be used.
-
+
This example assumes Seeed Studio Wio WM1110 is used.
For other LR11x0 modules, some configuration such as
RF switch control may have to be adjusted.
@@ -45,13 +45,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
diff --git a/examples/LR11x0/LR11x0_Channel_Activity_Detection_Interrupt/LR11x0_Channel_Activity_Detection_Interrupt.ino b/examples/LR11x0/LR11x0_Channel_Activity_Detection_Interrupt/LR11x0_Channel_Activity_Detection_Interrupt.ino
index 7de03b216..adb5699d8 100644
--- a/examples/LR11x0/LR11x0_Channel_Activity_Detection_Interrupt/LR11x0_Channel_Activity_Detection_Interrupt.ino
+++ b/examples/LR11x0/LR11x0_Channel_Activity_Detection_Interrupt/LR11x0_Channel_Activity_Detection_Interrupt.ino
@@ -7,7 +7,7 @@
of LoRa transmission, not just the preamble.
Other modules from LR11x0 family can also be used.
-
+
This example assumes Seeed Studio Wio WM1110 is used.
For other LR11x0 modules, some configuration such as
RF switch control may have to be adjusted.
@@ -40,13 +40,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
diff --git a/examples/LR11x0/LR11x0_Firmware_Update/LR11x0_Firmware_Update.ino b/examples/LR11x0/LR11x0_Firmware_Update/LR11x0_Firmware_Update.ino
index 03296fb48..fbf44b089 100644
--- a/examples/LR11x0/LR11x0_Firmware_Update/LR11x0_Firmware_Update.ino
+++ b/examples/LR11x0/LR11x0_Firmware_Update/LR11x0_Firmware_Update.ino
@@ -94,7 +94,7 @@ void setup() {
// print the firmware versions after the update
printVersions();
-
+
}
void printVersions() {
@@ -126,11 +126,11 @@ void printVersions() {
Serial.print(F("failed, code "));
Serial.println(state);
while (true) { delay(10); }
-
+
}
}
void loop() {
-
+
}
diff --git a/examples/LR11x0/LR11x0_GNSS_Almanac_Update/LR11x0_GNSS_Almanac_Update.ino b/examples/LR11x0/LR11x0_GNSS_Almanac_Update/LR11x0_GNSS_Almanac_Update.ino
index 0f02a2536..f6550bf66 100644
--- a/examples/LR11x0/LR11x0_GNSS_Almanac_Update/LR11x0_GNSS_Almanac_Update.ino
+++ b/examples/LR11x0/LR11x0_GNSS_Almanac_Update/LR11x0_GNSS_Almanac_Update.ino
@@ -2,11 +2,11 @@
RadioLib LR11x0 GNSS Almanac Update Example
This example updates the LR11x0 GNSS almanac.
- Almanac is a database of orbital predictions of
+ Almanac is a database of orbital predictions of
GNSS satellites, which allows the module to predict
when different satellites will appear in the sky,
and frequency of their signal.
-
+
Up-to-date almanac is necessary for operation!
After an update, data will remain valid for 30 days.
All GNSS examples require at least limited
@@ -44,13 +44,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
@@ -118,16 +118,16 @@ void setup() {
// we have the status, check if we have demodulated time
if(almStatus.gps.status < RADIOLIB_LR11X0_GNSS_ALMANAC_STATUS_UP_TO_DATE) {
Serial.println(F("time unknown, another scan needed."));
-
+
} else if(almStatus.gps.numUpdateNeeded > 0) {
Serial.print(almStatus.gps.numUpdateNeeded);
Serial.println(F(" satellites out-of-date."));
break;
-
+
} else {
Serial.println(F("no update needed!"));
while (true) { delay(10); }
-
+
}
}
}
@@ -142,7 +142,7 @@ void loop() {
// wait until the next update window
delay(2000);
-
+
} else {
Serial.println(F("done!"));
@@ -155,7 +155,7 @@ void loop() {
} else {
Serial.println(F("done!"));
}
-
+
}
// check whether another update is needed
@@ -175,8 +175,8 @@ void loop() {
Serial.print(almStatus.gps.numUpdateNeeded);
Serial.println(F(" satellites out-of-date."));
}
-
+
// wait a bit before the next update attempt
delay(1000);
-
+
}
diff --git a/examples/LR11x0/LR11x0_GNSS_Autonomous_Position/LR11x0_GNSS_Autonomous_Position.ino b/examples/LR11x0/LR11x0_GNSS_Autonomous_Position/LR11x0_GNSS_Autonomous_Position.ino
index 994b749da..655986d7c 100644
--- a/examples/LR11x0/LR11x0_GNSS_Autonomous_Position/LR11x0_GNSS_Autonomous_Position.ino
+++ b/examples/LR11x0/LR11x0_GNSS_Autonomous_Position/LR11x0_GNSS_Autonomous_Position.ino
@@ -40,13 +40,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
@@ -89,7 +89,7 @@ void setup() {
Serial.println(F("check failed, firmware update needed."));
while (true) { delay(10); }
}
-
+
Serial.println(F("Scan result\t| Latitude\t| Longitude\t| Accuracy\t| Number of satellites"));
}
@@ -111,7 +111,7 @@ void loop() {
Serial.print(gnssPosition.accuracy);
Serial.print("\t\t| ");
Serial.println(gnssPosition.numSatsUsed);
-
+
} else {
Serial.print(F("Failed to read result, code "));
Serial.print(state);
@@ -119,16 +119,16 @@ void loop() {
Serial.print(RADIOLIB_GET_GNSS_SOLVER_ERROR(state));
Serial.println(F(")"));
}
-
+
} else {
Serial.print(F("Scan failed, code "));
Serial.print(state);
Serial.print(F(" (demodulator error "));
Serial.print(RADIOLIB_GET_GNSS_DEMOD_ERROR(state));
Serial.println(F(")"));
-
+
}
-
+
// wait a bit before the next scan
delay(1000);
}
diff --git a/examples/LR11x0/LR11x0_GNSS_Satellites/LR11x0_GNSS_Satellites.ino b/examples/LR11x0/LR11x0_GNSS_Satellites/LR11x0_GNSS_Satellites.ino
index ad0457c92..0d6f2e8e7 100644
--- a/examples/LR11x0/LR11x0_GNSS_Satellites/LR11x0_GNSS_Satellites.ino
+++ b/examples/LR11x0/LR11x0_GNSS_Satellites/LR11x0_GNSS_Satellites.ino
@@ -40,13 +40,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
@@ -98,7 +98,7 @@ void loop() {
Serial.print(F(" (demodulator error "));
Serial.print(RADIOLIB_GET_GNSS_DEMOD_ERROR(state));
Serial.println(F(")"));
-
+
} else {
Serial.println(F("success!"));
@@ -123,9 +123,9 @@ void loop() {
Serial.println(satellites[i].doppler);
}
-
+
}
-
+
}
// wait for a second before scanning again
diff --git a/examples/LR11x0/LR11x0_PingPong/LR11x0_PingPong.ino b/examples/LR11x0/LR11x0_PingPong/LR11x0_PingPong.ino
index a2a62f961..5d3b2102f 100644
--- a/examples/LR11x0/LR11x0_PingPong/LR11x0_PingPong.ino
+++ b/examples/LR11x0/LR11x0_PingPong/LR11x0_PingPong.ino
@@ -33,13 +33,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
@@ -168,6 +168,6 @@ void loop() {
transmissionState = radio.startTransmit("Hello World!");
transmitFlag = true;
}
-
+
}
}
diff --git a/examples/LR11x0/LR11x0_Receive_Blocking/LR11x0_Receive_Blocking.ino b/examples/LR11x0/LR11x0_Receive_Blocking/LR11x0_Receive_Blocking.ino
index 341b1a74d..feb51c739 100644
--- a/examples/LR11x0/LR11x0_Receive_Blocking/LR11x0_Receive_Blocking.ino
+++ b/examples/LR11x0/LR11x0_Receive_Blocking/LR11x0_Receive_Blocking.ino
@@ -12,7 +12,7 @@
- preamble length
Other modules from LR11x0 family can also be used.
-
+
This example assumes Seeed Studio Wio WM1110 is used.
For other LR11x0 modules, some configuration such as
RF switch control may have to be adjusted.
@@ -50,13 +50,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
diff --git a/examples/LR11x0/LR11x0_Receive_Interrupt/LR11x0_Receive_Interrupt.ino b/examples/LR11x0/LR11x0_Receive_Interrupt/LR11x0_Receive_Interrupt.ino
index 3b1d60743..e7dbc81fe 100644
--- a/examples/LR11x0/LR11x0_Receive_Interrupt/LR11x0_Receive_Interrupt.ino
+++ b/examples/LR11x0/LR11x0_Receive_Interrupt/LR11x0_Receive_Interrupt.ino
@@ -13,7 +13,7 @@
- sync word
Other modules from LR11x0 family can also be used.
-
+
This example assumes Seeed Studio Wio WM1110 is used.
For other LR11x0 modules, some configuration such as
RF switch control may have to be adjusted.
@@ -46,13 +46,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
diff --git a/examples/LR11x0/LR11x0_Transmit_Blocking/LR11x0_Transmit_Blocking.ino b/examples/LR11x0/LR11x0_Transmit_Blocking/LR11x0_Transmit_Blocking.ino
index 66a9058df..6e434b309 100644
--- a/examples/LR11x0/LR11x0_Transmit_Blocking/LR11x0_Transmit_Blocking.ino
+++ b/examples/LR11x0/LR11x0_Transmit_Blocking/LR11x0_Transmit_Blocking.ino
@@ -8,7 +8,7 @@
- arbitrary binary data (byte array)
Other modules from LR11x0 family can also be used.
-
+
This example assumes Seeed Studio Wio WM1110 is used.
For other LR11x0 modules, some configuration such as
RF switch control may have to be adjusted.
@@ -41,13 +41,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
diff --git a/examples/LR11x0/LR11x0_Transmit_Interrupt/LR11x0_Transmit_Interrupt.ino b/examples/LR11x0/LR11x0_Transmit_Interrupt/LR11x0_Transmit_Interrupt.ino
index 3086a9a6b..9971f3482 100644
--- a/examples/LR11x0/LR11x0_Transmit_Interrupt/LR11x0_Transmit_Interrupt.ino
+++ b/examples/LR11x0/LR11x0_Transmit_Interrupt/LR11x0_Transmit_Interrupt.ino
@@ -9,7 +9,7 @@
- arbitrary binary data (byte array)
Other modules from LR11x0 family can also be used.
-
+
This example assumes Seeed Studio Wio WM1110 is used.
For other LR11x0 modules, some configuration such as
RF switch control may have to be adjusted.
@@ -42,13 +42,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
diff --git a/examples/LR11x0/LR11x0_WiFi_Scan_Blocking/LR11x0_WiFi_Scan_Blocking.ino b/examples/LR11x0/LR11x0_WiFi_Scan_Blocking/LR11x0_WiFi_Scan_Blocking.ino
index 6da1b356e..fb8617ada 100644
--- a/examples/LR11x0/LR11x0_WiFi_Scan_Blocking/LR11x0_WiFi_Scan_Blocking.ino
+++ b/examples/LR11x0/LR11x0_WiFi_Scan_Blocking/LR11x0_WiFi_Scan_Blocking.ino
@@ -6,7 +6,7 @@
such as the frequency, country code and SSID.
Other modules from LR11x0 family can also be used.
-
+
This example assumes Seeed Studio Wio WM1110 is used.
For other LR11x0 modules, some configuration such as
RF switch control may have to be adjusted.
@@ -43,13 +43,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
@@ -125,10 +125,10 @@ void loop() {
// print the RSSI
Serial.print(result.rssi);
Serial.print("\t| ");
-
+
// print the network SSID
Serial.println((char*)result.ssid);
-
+
}
} else {
diff --git a/examples/LR11x0/LR11x0_WiFi_Scan_Interrupt/LR11x0_WiFi_Scan_Interrupt.ino b/examples/LR11x0/LR11x0_WiFi_Scan_Interrupt/LR11x0_WiFi_Scan_Interrupt.ino
index 21d90f2c3..9942fea8d 100644
--- a/examples/LR11x0/LR11x0_WiFi_Scan_Interrupt/LR11x0_WiFi_Scan_Interrupt.ino
+++ b/examples/LR11x0/LR11x0_WiFi_Scan_Interrupt/LR11x0_WiFi_Scan_Interrupt.ino
@@ -6,7 +6,7 @@
such as the frequency, country code and SSID.
Other modules from LR11x0 family can also be used.
-
+
This example assumes Seeed Studio Wio WM1110 is used.
For other LR11x0 modules, some configuration such as
RF switch control may have to be adjusted.
@@ -43,13 +43,13 @@ Radio radio = new RadioModule();
// set RF switch configuration for Wio WM1110
// Wio WM1110 uses DIO5 and DIO6 for RF switching
// NOTE: other boards may be different!
-static const uint32_t rfswitch_dio_pins[] = {
+static const uint32_t rfswitch_dio_pins[] = {
RADIOLIB_LR11X0_DIO5, RADIOLIB_LR11X0_DIO6,
RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC
};
static const Module::RfSwitchMode_t rfswitch_table[] = {
- // mode DIO5 DIO6
+ // mode DIO5 DIO6
{ LR11x0::MODE_STBY, { LOW, LOW } },
{ LR11x0::MODE_RX, { HIGH, LOW } },
{ LR11x0::MODE_TX, { HIGH, HIGH } },
@@ -157,17 +157,17 @@ void loop() {
// print the RSSI
Serial.print(result.rssi);
Serial.print("\t| ");
-
+
// print the network SSID
Serial.println((char*)result.ssid);
}
-
+
} else {
// some other error occurred
Serial.print(F("failed, code "));
Serial.println(state);
}
-
+
// start scanning again
Serial.print(F("[LR1110] Starting passive WiFi scan ... "));
state = radio.startWifiScan('*');
diff --git a/examples/LoRaWAN/LoRaWAN_ABP/LoRaWAN_ABP.ino b/examples/LoRaWAN/LoRaWAN_ABP/LoRaWAN_ABP.ino
index 1442e0d4b..560069cf8 100644
--- a/examples/LoRaWAN/LoRaWAN_ABP/LoRaWAN_ABP.ino
+++ b/examples/LoRaWAN/LoRaWAN_ABP/LoRaWAN_ABP.ino
@@ -4,16 +4,16 @@
ABP = Activation by Personalisation, an alternative
to OTAA (Over the Air Activation). OTAA is preferable.
- This example will send uplink packets to a LoRaWAN network.
- Before you start, you will have to register your device at
+ This example will send uplink packets to a LoRaWAN network.
+ Before you start, you will have to register your device at
https://www.thethingsnetwork.org/
After your device is registered, you can run this example.
The device will join the network and start uploading data.
LoRaWAN v1.0.4/v1.1 requires the use of persistent storage.
- As this example does not use persistent storage, running this
+ As this example does not use persistent storage, running this
examples REQUIRES you to check "Resets frame counters"
- on your LoRaWAN dashboard. Refer to the notes or the
+ on your LoRaWAN dashboard. Refer to the notes or the
network's documentation on how to do this.
To comply with LoRaWAN's persistent storage, refer to
https://github.com/radiolib-org/radiolib-persistence
@@ -40,7 +40,7 @@ void setup() {
Serial.println(F("Initialise the radio"));
int state = radio.begin();
debug(state != RADIOLIB_ERR_NONE, F("Initialise radio failed"), state, true);
-
+
Serial.println(F("Initialise LoRaWAN Network credentials"));
node.beginABP(devAddr, fNwkSIntKey, sNwkSIntKey, nwkSEncKey, appSKey);
@@ -63,12 +63,12 @@ void loop() {
uplinkPayload[0] = value1;
uplinkPayload[1] = highByte(value2); // See notes for high/lowByte functions
uplinkPayload[2] = lowByte(value2);
-
+
// Perform an uplink
- int state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload));
+ int state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload));
debug(state < RADIOLIB_ERR_NONE, F("Error in sendReceive"), state, false);
-
- // Check if a downlink was received
+
+ // Check if a downlink was received
// (state 0 = no downlink, state 1/2 = downlink in window Rx1/Rx2)
if(state > 0) {
Serial.println(F("Received a downlink"));
@@ -79,7 +79,7 @@ void loop() {
Serial.print(F("Next uplink in "));
Serial.print(uplinkIntervalSeconds);
Serial.println(F(" seconds\n"));
-
+
// Wait until next uplink - observing legal & TTN FUP constraints
delay(uplinkIntervalSeconds * 1000UL); // delay needs milli-seconds
}
diff --git a/examples/LoRaWAN/LoRaWAN_ABP/configABP.h b/examples/LoRaWAN/LoRaWAN_ABP/configABP.h
index a19a1dc62..11c911e07 100644
--- a/examples/LoRaWAN/LoRaWAN_ABP/configABP.h
+++ b/examples/LoRaWAN/LoRaWAN_ABP/configABP.h
@@ -25,17 +25,17 @@ const uint32_t uplinkIntervalSeconds = 5UL * 60UL; // minutes x seconds
#define RADIOLIB_LORAWAN_DEV_ADDR 0x------
#endif
-#ifndef RADIOLIB_LORAWAN_FNWKSINT_KEY // Replace with your FNwkSInt Key
-#define RADIOLIB_LORAWAN_FNWKSINT_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#ifndef RADIOLIB_LORAWAN_FNWKSINT_KEY // Replace with your FNwkSInt Key
+#define RADIOLIB_LORAWAN_FNWKSINT_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
-#ifndef RADIOLIB_LORAWAN_SNWKSINT_KEY // Replace with your SNwkSInt Key
-#define RADIOLIB_LORAWAN_SNWKSINT_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#ifndef RADIOLIB_LORAWAN_SNWKSINT_KEY // Replace with your SNwkSInt Key
+#define RADIOLIB_LORAWAN_SNWKSINT_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
-#ifndef RADIOLIB_LORAWAN_NWKSENC_KEY // Replace with your NwkSEnc Key
-#define RADIOLIB_LORAWAN_NWKSENC_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#ifndef RADIOLIB_LORAWAN_NWKSENC_KEY // Replace with your NwkSEnc Key
+#define RADIOLIB_LORAWAN_NWKSENC_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
-#ifndef RADIOLIB_LORAWAN_APPS_KEY // Replace with your AppS Key
-#define RADIOLIB_LORAWAN_APPS_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#ifndef RADIOLIB_LORAWAN_APPS_KEY // Replace with your AppS Key
+#define RADIOLIB_LORAWAN_APPS_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
// for the curious, the #ifndef blocks allow for automated testing &/or you can
diff --git a/examples/LoRaWAN/LoRaWAN_Class_C/LoRaWAN_Class_C.ino b/examples/LoRaWAN/LoRaWAN_Class_C/LoRaWAN_Class_C.ino
index db2a5e791..100257554 100644
--- a/examples/LoRaWAN/LoRaWAN_Class_C/LoRaWAN_Class_C.ino
+++ b/examples/LoRaWAN/LoRaWAN_Class_C/LoRaWAN_Class_C.ino
@@ -9,7 +9,7 @@
is worse.
Running this examples REQUIRES you to check "Resets DevNonces"
- on your LoRaWAN dashboard. Refer to the network's
+ on your LoRaWAN dashboard. Refer to the network's
documentation on how to do this.
For default module settings, see the wiki page
@@ -63,11 +63,11 @@ void loop() {
LoRaWANEvent_t downlinkEvent;
// check if a Class C downlink is ready for processing
- // tip: internally, this just checks a boolean;
+ // tip: internally, this just checks a boolean;
// it does not poll the radio over SPI.
// tip: you are not required to continuously call
// this function; you can do other stuff in between.
- // however, a downlink may be overwritten if you
+ // however, a downlink may be overwritten if you
// don't call this function in time for the previous one.
int16_t state = node.getDownlinkClassC(downlinkPayload, &downlinkLen, &downlinkEvent);
if(state > 0) {
@@ -114,12 +114,12 @@ void loop() {
uplinkPayload[0] = value1;
uplinkPayload[1] = highByte(value2); // See notes for high/lowByte functions
uplinkPayload[2] = lowByte(value2);
-
+
// Perform an uplink
- state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload));
+ state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload));
debug(state < RADIOLIB_ERR_NONE, F("Error in sendReceive"), state, false);
- // Check if a downlink was received
+ // Check if a downlink was received
// (state 0 = no downlink, state 1/2/3 = downlink in window Rx1/Rx2/RxC)
if(state > 0) {
Serial.println(F("Received a downlink"));
diff --git a/examples/LoRaWAN/LoRaWAN_Class_C/config.h b/examples/LoRaWAN/LoRaWAN_Class_C/config.h
index dd853274f..50d84b797 100644
--- a/examples/LoRaWAN/LoRaWAN_Class_C/config.h
+++ b/examples/LoRaWAN/LoRaWAN_Class_C/config.h
@@ -23,15 +23,15 @@ const uint32_t uplinkIntervalSeconds = 1UL * 60UL; // minutes x seconds
// for development purposes you can use all zeros - see wiki for details
#define RADIOLIB_LORAWAN_JOIN_EUI 0x0000000000000000
-// the Device EUI & two keys can be generated on the TTN console
+// the Device EUI & two keys can be generated on the TTN console
#ifndef RADIOLIB_LORAWAN_DEV_EUI // Replace with your Device EUI
#define RADIOLIB_LORAWAN_DEV_EUI 0x---------------
#endif
-#ifndef RADIOLIB_LORAWAN_APP_KEY // Replace with your App Key
-#define RADIOLIB_LORAWAN_APP_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#ifndef RADIOLIB_LORAWAN_APP_KEY // Replace with your App Key
+#define RADIOLIB_LORAWAN_APP_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
#ifndef RADIOLIB_LORAWAN_NWK_KEY // Put your Nwk Key here
-#define RADIOLIB_LORAWAN_NWK_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#define RADIOLIB_LORAWAN_NWK_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
// for the curious, the #ifndef blocks allow for automated testing &/or you can
diff --git a/examples/LoRaWAN/LoRaWAN_Multicast/LoRaWAN_Multicast.ino b/examples/LoRaWAN/LoRaWAN_Multicast/LoRaWAN_Multicast.ino
index 7e5be0b0f..9e774ea86 100644
--- a/examples/LoRaWAN/LoRaWAN_Multicast/LoRaWAN_Multicast.ino
+++ b/examples/LoRaWAN/LoRaWAN_Multicast/LoRaWAN_Multicast.ino
@@ -7,11 +7,11 @@
to create a Multicast group (or device).
Note that you can switch the device to Class C as well
to receive Unicast downlinks. In this case, you must
- use the downlink event details to discern whether a
+ use the downlink event details to discern whether a
downlink belongs to the Unicast or Multicast session.
Running this examples REQUIRES you to check "Resets DevNonces"
- on your LoRaWAN dashboard. Refer to the network's
+ on your LoRaWAN dashboard. Refer to the network's
documentation on how to do this.
For default module settings, see the wiki page
@@ -45,7 +45,7 @@ void setup() {
state = node.activateOTAA();
debug(state != RADIOLIB_LORAWAN_NEW_SESSION, F("Join failed"), state, true);
- // Start a Multicast session over Class C
+ // Start a Multicast session over Class C
// (this will automatically perform a switch to Class C for Multicast)
node.startMulticastSession(RADIOLIB_LORAWAN_CLASS_C, mcDevAddr, mcAppSKey, mcNwkSKey);
@@ -60,11 +60,11 @@ void loop() {
LoRaWANEvent_t downlinkEvent;
// check if a Class C downlink is ready for processing
- // tip: internally, this just checks a boolean;
+ // tip: internally, this just checks a boolean;
// it does not poll the radio over SPI.
// tip: you are not required to continuously call
// this function; you can do other stuff in between.
- // however, a downlink may be overwritten if you
+ // however, a downlink may be overwritten if you
// don't call this function in time for the previous one.
int16_t state = node.getDownlinkClassC(downlinkPayload, &downlinkLen, &downlinkEvent);
if(state > 0) {
@@ -111,12 +111,12 @@ void loop() {
uplinkPayload[0] = value1;
uplinkPayload[1] = highByte(value2); // See notes for high/lowByte functions
uplinkPayload[2] = lowByte(value2);
-
+
// Perform an uplink
- state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload));
+ state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload));
debug(state < RADIOLIB_ERR_NONE, F("Error in sendReceive"), state, false);
- // Check if a downlink was received
+ // Check if a downlink was received
// (state 0 = no downlink, state 1/2/3 = downlink in window Rx1/Rx2/RxC)
if(state > 0) {
Serial.println(F("Received a downlink"));
diff --git a/examples/LoRaWAN/LoRaWAN_Multicast/config.h b/examples/LoRaWAN/LoRaWAN_Multicast/config.h
index bbe12e715..e038cde39 100644
--- a/examples/LoRaWAN/LoRaWAN_Multicast/config.h
+++ b/examples/LoRaWAN/LoRaWAN_Multicast/config.h
@@ -23,25 +23,25 @@ const uint32_t uplinkIntervalSeconds = 1UL * 60UL; // minutes x seconds
// for development purposes you can use all zeros - see wiki for details
#define RADIOLIB_LORAWAN_JOIN_EUI 0x0000000000000000
-// the Device EUI & two keys can be generated on the TTN console
+// the Device EUI & two keys can be generated on the TTN console
#ifndef RADIOLIB_LORAWAN_DEV_EUI // Replace with your Device EUI
#define RADIOLIB_LORAWAN_DEV_EUI 0x---------------
#endif
-#ifndef RADIOLIB_LORAWAN_APP_KEY // Replace with your App Key
-#define RADIOLIB_LORAWAN_APP_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#ifndef RADIOLIB_LORAWAN_APP_KEY // Replace with your App Key
+#define RADIOLIB_LORAWAN_APP_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
#ifndef RADIOLIB_LORAWAN_NWK_KEY // Put your Nwk Key here
-#define RADIOLIB_LORAWAN_NWK_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#define RADIOLIB_LORAWAN_NWK_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
#ifndef RADIOLIB_LORAWAN_MC_DEV_ADDR // Replace with your Multicast Device Address
#define RADIOLIB_LORAWAN_MC_DEV_ADDR 0x---------------
#endif
-#ifndef RADIOLIB_LORAWAN_MC_APP_SKEY // Replace with your Multicast App SKey
-#define RADIOLIB_LORAWAN_MC_APP_SKEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#ifndef RADIOLIB_LORAWAN_MC_APP_SKEY // Replace with your Multicast App SKey
+#define RADIOLIB_LORAWAN_MC_APP_SKEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
#ifndef RADIOLIB_LORAWAN_MC_NWK_SKEY // Put your Multicast Nwk SKey here
-#define RADIOLIB_LORAWAN_MC_NWK_SKEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#define RADIOLIB_LORAWAN_MC_NWK_SKEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
// for the curious, the #ifndef blocks allow for automated testing &/or you can
diff --git a/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino b/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino
index 884df6757..0ceddf4ae 100644
--- a/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino
+++ b/examples/LoRaWAN/LoRaWAN_Reference/LoRaWAN_Reference.ino
@@ -12,7 +12,7 @@
LoRaWAN v1.0.4/v1.1 requires the use of EEPROM (persistent storage).
Running this examples REQUIRES you to check "Resets DevNonces"
- on your LoRaWAN dashboard. Refer to the notes or the
+ on your LoRaWAN dashboard. Refer to the notes or the
network's documentation on how to do this.
To comply with LoRaWAN's persistent storage, refer to
https://github.com/radiolib-org/radiolib-persistence
@@ -103,11 +103,11 @@ void loop() {
uint8_t downlinkPayload[10]; // Make sure this fits your plans!
size_t downlinkSize; // To hold the actual payload size received
- // you can also retrieve additional information about an uplink or
+ // you can also retrieve additional information about an uplink or
// downlink by passing a reference to LoRaWANEvent_t structure
LoRaWANEvent_t uplinkDetails;
LoRaWANEvent_t downlinkDetails;
-
+
uint8_t fPort = 10;
// Retrieve the last uplink frame counter
@@ -120,13 +120,13 @@ void loop() {
Serial.println(F("and requesting LinkCheck and DeviceTime"));
node.sendMacCommandReq(RADIOLIB_LORAWAN_MAC_LINK_CHECK);
node.sendMacCommandReq(RADIOLIB_LORAWAN_MAC_DEVICE_TIME);
- state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload), fPort, downlinkPayload, &downlinkSize, true, &uplinkDetails, &downlinkDetails);
+ state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload), fPort, downlinkPayload, &downlinkSize, true, &uplinkDetails, &downlinkDetails);
} else {
- state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload), fPort, downlinkPayload, &downlinkSize, false, &uplinkDetails, &downlinkDetails);
+ state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload), fPort, downlinkPayload, &downlinkSize, false, &uplinkDetails, &downlinkDetails);
}
debug(state < RADIOLIB_ERR_NONE, F("Error in sendReceive"), state, false);
- // Check if a downlink was received
+ // Check if a downlink was received
// (state 0 = no downlink, state 1/2 = downlink in window Rx1/Rx2)
if(state > 0) {
Serial.println(F("Received a downlink"));
@@ -186,7 +186,7 @@ void loop() {
Serial.print(F("[LoRaWAN] DeviceTime second:\t1/"));
Serial.println(fracSecond);
}
-
+
} else {
Serial.println(F("[LoRaWAN] No downlink received"));
}
diff --git a/examples/LoRaWAN/LoRaWAN_Reference/config.h b/examples/LoRaWAN/LoRaWAN_Reference/config.h
index 5de9cc98a..79094bb7b 100644
--- a/examples/LoRaWAN/LoRaWAN_Reference/config.h
+++ b/examples/LoRaWAN/LoRaWAN_Reference/config.h
@@ -23,15 +23,15 @@ const uint32_t uplinkIntervalSeconds = 5UL * 60UL; // minutes x seconds
// for development purposes you can use all zeros - see wiki for details
#define RADIOLIB_LORAWAN_JOIN_EUI 0x0000000000000000
-// the Device EUI & two keys can be generated on the TTN console
+// the Device EUI & two keys can be generated on the TTN console
#ifndef RADIOLIB_LORAWAN_DEV_EUI // Replace with your Device EUI
#define RADIOLIB_LORAWAN_DEV_EUI 0x---------------
#endif
-#ifndef RADIOLIB_LORAWAN_APP_KEY // Replace with your App Key
-#define RADIOLIB_LORAWAN_APP_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#ifndef RADIOLIB_LORAWAN_APP_KEY // Replace with your App Key
+#define RADIOLIB_LORAWAN_APP_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
#ifndef RADIOLIB_LORAWAN_NWK_KEY // Put your Nwk Key here
-#define RADIOLIB_LORAWAN_NWK_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#define RADIOLIB_LORAWAN_NWK_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
// for the curious, the #ifndef blocks allow for automated testing &/or you can
diff --git a/examples/LoRaWAN/LoRaWAN_Starter/LoRaWAN_Starter.ino b/examples/LoRaWAN/LoRaWAN_Starter/LoRaWAN_Starter.ino
index 30b1e217c..42d8f0aac 100644
--- a/examples/LoRaWAN/LoRaWAN_Starter/LoRaWAN_Starter.ino
+++ b/examples/LoRaWAN/LoRaWAN_Starter/LoRaWAN_Starter.ino
@@ -10,7 +10,7 @@
The device will join the network and start uploading data.
Running this examples REQUIRES you to check "Resets DevNonces"
- on your LoRaWAN dashboard. Refer to the network's
+ on your LoRaWAN dashboard. Refer to the network's
documentation on how to do this.
For default module settings, see the wiki page
@@ -60,12 +60,12 @@ void loop() {
uplinkPayload[0] = value1;
uplinkPayload[1] = highByte(value2); // See notes for high/lowByte functions
uplinkPayload[2] = lowByte(value2);
-
+
// Perform an uplink
- int16_t state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload));
+ int16_t state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload));
debug(state < RADIOLIB_ERR_NONE, F("Error in sendReceive"), state, false);
- // Check if a downlink was received
+ // Check if a downlink was received
// (state 0 = no downlink, state 1/2 = downlink in window Rx1/Rx2)
if(state > 0) {
Serial.println(F("Received a downlink"));
@@ -76,7 +76,7 @@ void loop() {
Serial.print(F("Next uplink in "));
Serial.print(uplinkIntervalSeconds);
Serial.println(F(" seconds\n"));
-
+
// Wait until next uplink - observing legal & TTN FUP constraints
delay(uplinkIntervalSeconds * 1000UL); // delay needs milli-seconds
}
diff --git a/examples/LoRaWAN/LoRaWAN_Starter/config.h b/examples/LoRaWAN/LoRaWAN_Starter/config.h
index 7d025abc2..96e3ea35a 100644
--- a/examples/LoRaWAN/LoRaWAN_Starter/config.h
+++ b/examples/LoRaWAN/LoRaWAN_Starter/config.h
@@ -23,15 +23,15 @@ const uint32_t uplinkIntervalSeconds = 5UL * 60UL; // minutes x seconds
// for development purposes you can use all zeros - see wiki for details
#define RADIOLIB_LORAWAN_JOIN_EUI 0x0000000000000000
-// the Device EUI & two keys can be generated on the TTN console
+// the Device EUI & two keys can be generated on the TTN console
#ifndef RADIOLIB_LORAWAN_DEV_EUI // Replace with your Device EUI
#define RADIOLIB_LORAWAN_DEV_EUI 0x---------------
#endif
-#ifndef RADIOLIB_LORAWAN_APP_KEY // Replace with your App Key
-#define RADIOLIB_LORAWAN_APP_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#ifndef RADIOLIB_LORAWAN_APP_KEY // Replace with your App Key
+#define RADIOLIB_LORAWAN_APP_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
#ifndef RADIOLIB_LORAWAN_NWK_KEY // Put your Nwk Key here
-#define RADIOLIB_LORAWAN_NWK_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
+#define RADIOLIB_LORAWAN_NWK_KEY 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--
#endif
// for the curious, the #ifndef blocks allow for automated testing &/or you can
diff --git a/examples/LoRaWAN/LoRaWAN_Starter/notes.md b/examples/LoRaWAN/LoRaWAN_Starter/notes.md
index 9305968ef..842dfa593 100644
--- a/examples/LoRaWAN/LoRaWAN_Starter/notes.md
+++ b/examples/LoRaWAN/LoRaWAN_Starter/notes.md
@@ -58,7 +58,7 @@ Your End device ID can be changed to make the device more identifiable. Somethin
When retail sensors are being deployed, a device is registered, batteries put in, it joins and gets on with sending data for the next few years. For development purposes however we need to turn off one of the security settings so that you can join & uplink out of the normal sequence that a device in the field would do.
-Click on General Settings, scroll down to Join settings, click the Expand button, scroll down and click the 'Resets join nonces' option. You will see a warning about replay attacks which is entirely proper & correct. If anyone eavesdropping in your area on your LoRa transmissions could fake a join and send uplinks from their device but only if they happened to find out your AppKey & NwkKey which is kept securely on the TTN servers and is never transmitted over the air, so they'd also have to login to your account, which is protected by your password.
+Click on General Settings, scroll down to Join settings, click the Expand button, scroll down and click the 'Resets join nonces' option. You will see a warning about replay attacks which is entirely proper & correct. If anyone eavesdropping in your area on your LoRa transmissions could fake a join and send uplinks from their device but only if they happened to find out your AppKey & NwkKey which is kept securely on the TTN servers and is never transmitted over the air, so they'd also have to login to your account, which is protected by your password.
You then need to copy over the device details in to the config file for RadioLib. There are buttons to copy items to the clipboard so you don't have to hand type them.
@@ -133,7 +133,7 @@ A key will end up something like 0x31, 0x16, 0x6A, 0x22, 0x97, 0x52, 0xB6, 0x34,
### Region
-The region value you use MUST match the one you selected on the console.
+The region value you use MUST match the one you selected on the console.
If you are using US915 or AU915 then you should change the subBand const to 2.
diff --git a/examples/Morse/Morse_Receive_AM/Morse_Receive_AM.ino b/examples/Morse/Morse_Receive_AM/Morse_Receive_AM.ino
index e4fb4037a..cf1b58f23 100644
--- a/examples/Morse/Morse_Receive_AM/Morse_Receive_AM.ino
+++ b/examples/Morse/Morse_Receive_AM/Morse_Receive_AM.ino
@@ -113,7 +113,7 @@ void loop() {
// inter-word space, interpret that as a new line
Serial.println();
}
-
+
}
}
diff --git a/examples/NonArduino/ESP-IDF/main/EspHal.h b/examples/NonArduino/ESP-IDF/main/EspHal.h
index 3f7cd1255..37b13cf27 100644
--- a/examples/NonArduino/ESP-IDF/main/EspHal.h
+++ b/examples/NonArduino/ESP-IDF/main/EspHal.h
@@ -263,7 +263,7 @@ class EspHal : public RadioLibHal {
// set SPI mode 0
this->spi->pin.ck_idle_edge = 0;
this->spi->user.ck_out_edge = 0;
-
+
// set bit order to MSB first
this->spi->ctrl.wr_bit_order = 0;
this->spi->ctrl.rd_bit_order = 0;
diff --git a/examples/NonArduino/Pico/.gitignore b/examples/NonArduino/Pico/.gitignore
index d16386367..567609b12 100644
--- a/examples/NonArduino/Pico/.gitignore
+++ b/examples/NonArduino/Pico/.gitignore
@@ -1 +1 @@
-build/
\ No newline at end of file
+build/
diff --git a/examples/NonArduino/Pico/CMakeLists.txt b/examples/NonArduino/Pico/CMakeLists.txt
index 84729dbe5..354eb0e49 100644
--- a/examples/NonArduino/Pico/CMakeLists.txt
+++ b/examples/NonArduino/Pico/CMakeLists.txt
@@ -12,7 +12,7 @@ pico_sdk_init()
add_compile_options(
-Wall
- -Wno-format
+ -Wno-format
-Wno-unused-function
)
diff --git a/examples/STM32WLx/STM32WLx_Receive_Blocking/STM32WLx_Receive_Blocking.ino b/examples/STM32WLx/STM32WLx_Receive_Blocking/STM32WLx_Receive_Blocking.ino
index 44163df24..77f572551 100644
--- a/examples/STM32WLx/STM32WLx_Receive_Blocking/STM32WLx_Receive_Blocking.ino
+++ b/examples/STM32WLx/STM32WLx_Receive_Blocking/STM32WLx_Receive_Blocking.ino
@@ -12,7 +12,7 @@
- coding rate
- sync word
- preamble length
-
+
This example assumes Nucleo WL55JC1 is used. For other Nucleo boards
or standalone STM32WL, some configuration such as TCXO voltage and
RF switch control may have to be adjusted.
diff --git a/examples/STM32WLx/STM32WLx_Receive_Interrupt/STM32WLx_Receive_Interrupt.ino b/examples/STM32WLx/STM32WLx_Receive_Interrupt/STM32WLx_Receive_Interrupt.ino
index dc62255dc..0cf4ac11a 100644
--- a/examples/STM32WLx/STM32WLx_Receive_Interrupt/STM32WLx_Receive_Interrupt.ino
+++ b/examples/STM32WLx/STM32WLx_Receive_Interrupt/STM32WLx_Receive_Interrupt.ino
@@ -11,7 +11,7 @@
- spreading factor
- coding rate
- sync word
-
+
This example assumes Nucleo WL55JC1 is used. For other Nucleo boards
or standalone STM32WL, some configuration such as TCXO voltage and
RF switch control may have to be adjusted.
diff --git a/examples/STM32WLx/STM32WLx_Transmit_Blocking/STM32WLx_Transmit_Blocking.ino b/examples/STM32WLx/STM32WLx_Transmit_Blocking/STM32WLx_Transmit_Blocking.ino
index 5a7d7b088..e17db4876 100644
--- a/examples/STM32WLx/STM32WLx_Transmit_Blocking/STM32WLx_Transmit_Blocking.ino
+++ b/examples/STM32WLx/STM32WLx_Transmit_Blocking/STM32WLx_Transmit_Blocking.ino
@@ -8,7 +8,7 @@
- Arduino String
- null-terminated char array (C-string)
- arbitrary binary data (byte array)
-
+
This example assumes Nucleo WL55JC1 is used. For other Nucleo boards
or standalone STM32WL, some configuration such as TCXO voltage and
RF switch control may have to be adjusted.
diff --git a/examples/SX126x/SX126x_Channel_Activity_Detection_Receive/SX126x_Channel_Activity_Detection_Receive.ino b/examples/SX126x/SX126x_Channel_Activity_Detection_Receive/SX126x_Channel_Activity_Detection_Receive.ino
index 85b204d57..406baa7fb 100644
--- a/examples/SX126x/SX126x_Channel_Activity_Detection_Receive/SX126x_Channel_Activity_Detection_Receive.ino
+++ b/examples/SX126x/SX126x_Channel_Activity_Detection_Receive/SX126x_Channel_Activity_Detection_Receive.ino
@@ -98,46 +98,46 @@ void loop() {
// you can read received data as an Arduino String
String str;
state = radio.readData(str);
-
+
// you can also read received data as byte array
/*
byte byteArr[8];
state = radio.readData(byteArr, 8);
*/
-
+
if (state == RADIOLIB_ERR_NONE) {
// packet was successfully received
Serial.println(F("[SX1262] Received packet!"));
-
+
// print data of the packet
Serial.print(F("[SX1262] Data:\t\t"));
Serial.println(str);
-
+
// print RSSI (Received Signal Strength Indicator)
Serial.print(F("[SX1262] RSSI:\t\t"));
Serial.print(radio.getRSSI());
Serial.println(F(" dBm"));
-
+
// print SNR (Signal-to-Noise Ratio)
Serial.print(F("[SX1262] SNR:\t\t"));
Serial.print(radio.getSNR());
Serial.println(F(" dB"));
-
+
// print frequency error
Serial.print(F("[SX1262] Frequency error:\t"));
Serial.print(radio.getFrequencyError());
Serial.println(F(" Hz"));
-
+
} else {
// some other error occurred
Serial.print(F("[SX1262] Failed, code "));
Serial.println(state);
-
+
}
// reception is done now
receiving = false;
-
+
} else {
// check CAD result
state = radio.getChannelScanResult();
@@ -179,9 +179,9 @@ void loop() {
Serial.print(F("failed, code "));
Serial.println(state);
}
-
+
}
}
-
+
}
diff --git a/examples/SX126x/SX126x_LR_FHSS_Transmit_Interrupt/SX126x_LR_FHSS_Transmit_Interrupt.ino b/examples/SX126x/SX126x_LR_FHSS_Transmit_Interrupt/SX126x_LR_FHSS_Transmit_Interrupt.ino
index 1a2207983..e97fef0bc 100644
--- a/examples/SX126x/SX126x_LR_FHSS_Transmit_Interrupt/SX126x_LR_FHSS_Transmit_Interrupt.ino
+++ b/examples/SX126x/SX126x_LR_FHSS_Transmit_Interrupt/SX126x_LR_FHSS_Transmit_Interrupt.ino
@@ -103,48 +103,48 @@ void loop() {
// check if this was caused by hopping or transmission finished
if(radio.getIrqFlags() & RADIOLIB_SX126X_IRQ_LR_FHSS_HOP) {
radio.hopLRFHSS();
-
+
} else {
if (transmissionState == RADIOLIB_ERR_NONE) {
// packet was successfully sent
Serial.println(F("transmission finished!"));
-
+
// NOTE: when using interrupt-driven transmit method,
// it is not possible to automatically measure
// transmission data rate using getDataRate()
-
+
} else {
Serial.print(F("failed, code "));
Serial.println(transmissionState);
-
+
}
-
+
// clean up after transmission is finished
// this will ensure transmitter is disabled,
// RF switch is powered down etc.
radio.finishTransmit();
-
+
// wait a second before transmitting again
delay(1000);
-
+
// send another one
Serial.print(F("[SX1262] Sending another packet ... "));
-
+
// you can transmit C-string or Arduino string up to
// 256 characters long
String str = "Hello World! #" + String(count++);
transmissionState = radio.startTransmit(str);
-
+
// you can also transmit byte array up to 256 bytes long
/*
byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
0x89, 0xAB, 0xCD, 0xEF};
transmissionState = radio.startTransmit(byteArr, 8);
*/
-
+
}
-
+
}
diff --git a/examples/SX126x/SX126x_PingPong/SX126x_PingPong.ino b/examples/SX126x/SX126x_PingPong/SX126x_PingPong.ino
index ff409f34c..68e0d8f75 100644
--- a/examples/SX126x/SX126x_PingPong/SX126x_PingPong.ino
+++ b/examples/SX126x/SX126x_PingPong/SX126x_PingPong.ino
@@ -148,6 +148,6 @@ void loop() {
transmissionState = radio.startTransmit("Hello World!");
transmitFlag = true;
}
-
+
}
}
diff --git a/examples/SX126x/SX126x_Spectrum_Scan/SX126x_Spectrum_Scan.ino b/examples/SX126x/SX126x_Spectrum_Scan/SX126x_Spectrum_Scan.ino
index bf28f36a4..19f991864 100644
--- a/examples/SX126x/SX126x_Spectrum_Scan/SX126x_Spectrum_Scan.ino
+++ b/examples/SX126x/SX126x_Spectrum_Scan/SX126x_Spectrum_Scan.ino
@@ -118,4 +118,4 @@ void loop() {
// wait a little bit before the next scan
delay(5);
-}
\ No newline at end of file
+}
diff --git a/examples/SX126x/SX126x_Spectrum_Scan_Frequency/SX126x_Spectrum_Scan_Frequency.ino b/examples/SX126x/SX126x_Spectrum_Scan_Frequency/SX126x_Spectrum_Scan_Frequency.ino
index 71d3445ab..481469c01 100644
--- a/examples/SX126x/SX126x_Spectrum_Scan_Frequency/SX126x_Spectrum_Scan_Frequency.ino
+++ b/examples/SX126x/SX126x_Spectrum_Scan_Frequency/SX126x_Spectrum_Scan_Frequency.ino
@@ -133,5 +133,5 @@ void loop() {
freq += 0.2;
radio.setFrequency(freq);
}
-
+
}
diff --git a/examples/SX127x/SX127x_Channel_Activity_Detection_Interrupt/SX127x_Channel_Activity_Detection_Interrupt.ino b/examples/SX127x/SX127x_Channel_Activity_Detection_Interrupt/SX127x_Channel_Activity_Detection_Interrupt.ino
index 4efbf4a2a..905534809 100644
--- a/examples/SX127x/SX127x_Channel_Activity_Detection_Interrupt/SX127x_Channel_Activity_Detection_Interrupt.ino
+++ b/examples/SX127x/SX127x_Channel_Activity_Detection_Interrupt/SX127x_Channel_Activity_Detection_Interrupt.ino
@@ -109,7 +109,7 @@ void loop() {
// nothing was detected
Serial.println(F("[SX1278] Channel free!"));
}
-
+
// start scanning the channel
Serial.print(F("[SX1278] Starting scan for LoRa preamble ... "));
diff --git a/examples/SX127x/SX127x_Channel_Activity_Detection_Receive/SX127x_Channel_Activity_Detection_Receive.ino b/examples/SX127x/SX127x_Channel_Activity_Detection_Receive/SX127x_Channel_Activity_Detection_Receive.ino
index 0e5670e84..a34654610 100644
--- a/examples/SX127x/SX127x_Channel_Activity_Detection_Receive/SX127x_Channel_Activity_Detection_Receive.ino
+++ b/examples/SX127x/SX127x_Channel_Activity_Detection_Receive/SX127x_Channel_Activity_Detection_Receive.ino
@@ -7,7 +7,7 @@
if the LoRa channel is free, or if you should start
receiving a message. If a preamble is detected,
the module will switch to receive mode and receive the packet.
-
+
For most use-cases, it should be enough to just use the
interrupt-driven reception described in the example
"SX127x_Receive_Interrupt".
@@ -124,50 +124,50 @@ void loop() {
// you can read received data as an Arduino String
String str;
state = radio.readData(str);
-
+
// you can also read received data as byte array
/*
byte byteArr[8];
state = radio.readData(byteArr, 8);
*/
-
+
if (state == RADIOLIB_ERR_NONE) {
// packet was successfully received
Serial.println(F("[SX1278] Received packet!"));
-
+
// print data of the packet
Serial.print(F("[SX1278] Data:\t\t"));
Serial.println(str);
-
+
// print RSSI (Received Signal Strength Indicator)
Serial.print(F("[SX1278] RSSI:\t\t"));
Serial.print(radio.getRSSI());
Serial.println(F(" dBm"));
-
+
// print SNR (Signal-to-Noise Ratio)
Serial.print(F("[SX1278] SNR:\t\t"));
Serial.print(radio.getSNR());
Serial.println(F(" dB"));
-
+
// print frequency error
Serial.print(F("[SX1278] Frequency error:\t"));
Serial.print(radio.getFrequencyError());
Serial.println(F(" Hz"));
-
+
} else if (state == RADIOLIB_ERR_CRC_MISMATCH) {
// packet was received, but is malformed
Serial.println(F("[SX1278] CRC error!"));
-
+
} else {
// some other error occurred
Serial.print(F("[SX1278] Failed, code "));
Serial.println(state);
-
+
}
// reception is done now
receiving = false;
-
+
}
// check if we got a preamble
@@ -184,11 +184,11 @@ void loop() {
// set the flag for ongoing reception
receiving = true;
-
+
} else if(!receiving) {
// nothing was detected
// do not print anything, it just spams the console
-
+
}
// if we're not receiving, start scanning again
@@ -198,7 +198,7 @@ void loop() {
Serial.print(F("[SX1278] Starting new scan failed, code "));
Serial.println(state);
}
-
+
}
// reset flags
diff --git a/examples/SX127x/SX127x_Receive_Direct/SX127x_Receive_Direct.ino b/examples/SX127x/SX127x_Receive_Direct/SX127x_Receive_Direct.ino
index ff9c443c2..e4192a315 100644
--- a/examples/SX127x/SX127x_Receive_Direct/SX127x_Receive_Direct.ino
+++ b/examples/SX127x/SX127x_Receive_Direct/SX127x_Receive_Direct.ino
@@ -73,7 +73,7 @@ void loop() {
while(radio.available()) {
// read a byte
byte b = radio.read();
-
+
// print it
Serial.print(b, HEX);
Serial.print('\t');
diff --git a/examples/Stream/Stream_Receive/Stream_Receive.ino b/examples/Stream/Stream_Receive/Stream_Receive.ino
index 0abffd175..a21626cbd 100644
--- a/examples/Stream/Stream_Receive/Stream_Receive.ino
+++ b/examples/Stream/Stream_Receive/Stream_Receive.ino
@@ -45,11 +45,11 @@ void setup() {
// initialize SX1278 with default settings
Serial.print(F("[SX1278] Initializing ... "));
int state = radio.beginFSK();
-
+
// when using one of the non-LoRa modules for Stream transmit
// (RF69, CC1101, Si4432 etc.), use the basic begin() method
// int state = radio.begin();
-
+
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("success!"));
} else {
@@ -120,11 +120,11 @@ void loop() {
// print data of the packet
Serial.print(F("[SX1278] Data:\t\t"));
Serial.println((char*)rxBuffer);
-
+
// reset flag
receivedFlag = false;
receivedLength = 0;
-
+
// put module back to listen mode
radio.startReceive();
}
diff --git a/extras/SSTV_Image_Converter/ImageConverter.py b/extras/SSTV_Image_Converter/ImageConverter.py
index 844446572..15b8a95cc 100755
--- a/extras/SSTV_Image_Converter/ImageConverter.py
+++ b/extras/SSTV_Image_Converter/ImageConverter.py
@@ -43,7 +43,7 @@ def main():
print(hex(rgb), end=', ', file=f)
print(' },', file=f)
print('};', file=f)
-
+
print('Done!')
if __name__ == "__main__":
diff --git a/extras/SX126x_Spectrum_Scan/SpectrumScan.py b/extras/SX126x_Spectrum_Scan/SpectrumScan.py
index 435a27a81..6703fb272 100644
--- a/extras/SX126x_Spectrum_Scan/SpectrumScan.py
+++ b/extras/SX126x_Spectrum_Scan/SpectrumScan.py
@@ -47,14 +47,14 @@ def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1,
filledLength = int(length * iteration // total)
bar = fill * filledLength + '-' * (length - filledLength)
print(f'\r{prefix} |{bar}| {percent}% {suffix}', end = printEnd)
- if iteration == total:
+ if iteration == total:
print()
def main():
parser = argparse.ArgumentParser(formatter_class=RawTextHelpFormatter, description='''
RadioLib SX126x_Spectrum_Scan plotter script. Displays output from SX126x_Spectrum_Scan example
- as grayscale and
+ as grayscale and
Depends on pyserial and matplotlib, install by:
'python3 -m pip install pyserial matplotlib'
@@ -132,14 +132,14 @@ def main():
scanline = line[len(SCAN_MARK_START):-len(SCAN_MARK_END)].split(',')
for col in range(SCAN_WIDTH):
arr[col][row] = int(scanline[col])
-
+
# increment the row counter
row = row + 1
# check if we're done
if (not freq_mode) and (row >= scan_len):
break
-
+
# scale to the number of scans (sum of any given scanline)
num_samples = arr.sum(axis=0)[0]
arr *= (num_samples/arr.max())
@@ -158,7 +158,7 @@ def main():
im = ax.imshow(arr[:,:scan_len], cmap=args.map, extent=extent)
fig.colorbar(im)
- # set some properites and show
+ # set some properites and show
timestamp = datetime.now().strftime('%y-%m-%d %H-%M-%S')
title = f'RadioLib SX126x Spectral Scan {timestamp}'
if freq_mode:
diff --git a/extras/test/SX126x/PiHal.h b/extras/test/SX126x/PiHal.h
index 40bb5aee5..0754cf9ad 100644
--- a/extras/test/SX126x/PiHal.h
+++ b/extras/test/SX126x/PiHal.h
@@ -15,7 +15,7 @@ class PiHal : public RadioLibHal {
public:
// default constructor - initializes the base HAL and any needed private members
PiHal(uint8_t spiChannel, uint32_t spiSpeed = 2000000)
- : RadioLibHal(PI_INPUT, PI_OUTPUT, PI_LOW, PI_HIGH, RISING_EDGE, FALLING_EDGE),
+ : RadioLibHal(PI_INPUT, PI_OUTPUT, PI_LOW, PI_HIGH, RISING_EDGE, FALLING_EDGE),
_spiChannel(spiChannel),
_spiSpeed(spiSpeed) {
}
@@ -127,7 +127,7 @@ class PiHal : public RadioLibHal {
}
void spiBeginTransaction() {}
-
+
void spiTransfer(uint8_t* out, size_t len, uint8_t* in) {
spiXfer(_spiHandle, (char*)out, (char*)in, len);
}
diff --git a/extras/test/ci/parse_size.sh b/extras/test/ci/parse_size.sh
index 679a3f9c7..b054703e4 100755
--- a/extras/test/ci/parse_size.sh
+++ b/extras/test/ci/parse_size.sh
@@ -21,4 +21,3 @@ awk 'NR > 1 {
# remove input file
rm -f $in_file
-
diff --git a/extras/test/unit/include/HardwareEmulation.hpp b/extras/test/unit/include/HardwareEmulation.hpp
index c2b324a84..ef25c288e 100644
--- a/extras/test/unit/include/HardwareEmulation.hpp
+++ b/extras/test/unit/include/HardwareEmulation.hpp
@@ -25,7 +25,7 @@ struct EmulatedPin_t {
uint32_t mode;
uint32_t value;
bool event;
- PinFunction_t func;
+ PinFunction_t func;
};
// structure for emulating SPI registers
@@ -58,7 +58,7 @@ class EmulatedRadio {
virtual void HandleGPIO() {
// handle discrete GPIO signals here (e.g. reset state machine on NSS falling edge)
}
-
+
protected:
// pointers to emulated GPIO pins
// this is done via pointers so that the same GPIO entity is shared, like with a real hardware
diff --git a/extras/test/unit/include/TestHal.hpp b/extras/test/unit/include/TestHal.hpp
index ae98745bf..cb62c4f82 100644
--- a/extras/test/unit/include/TestHal.hpp
+++ b/extras/test/unit/include/TestHal.hpp
@@ -58,7 +58,7 @@ class TestHal : public RadioLibHal {
void pinMode(uint32_t pin, uint32_t mode) override {
HAL_LOG("TestHal::pinMode(pin=" << pin << ", mode=" << mode << " [" << ((mode == TEST_HAL_INPUT) ? "INPUT" : "OUTPUT") << "])");
-
+
// check the range
BOOST_ASSERT_MSG(pin < TEST_HAL_NUM_GPIO_PINS, "Pin number out of range");
@@ -188,7 +188,7 @@ class TestHal : public RadioLibHal {
void spiTransfer(uint8_t* out, size_t len, uint8_t* in) {
HAL_LOG("TestHal::spiTransfer(len=" << len << ")");
-
+
for(size_t i = 0; i < len; i++) {
// append to log
(*this->spiLogPtr++) = out[i];
diff --git a/extras/test/unit/tests/TestModule.cpp b/extras/test/unit/tests/TestModule.cpp
index 6bd145930..fa671a78d 100644
--- a/extras/test/unit/tests/TestModule.cpp
+++ b/extras/test/unit/tests/TestModule.cpp
@@ -10,8 +10,8 @@ struct ModuleFixture {
Module* mod = nullptr;
EmulatedRadio* radioHardware = nullptr;
- ModuleFixture() {
- BOOST_TEST_MESSAGE("--- Module fixture setup ---");
+ ModuleFixture() {
+ BOOST_TEST_MESSAGE("--- Module fixture setup ---");
hal = new TestHal();
radioHardware = new EmulatedRadio();
hal->connectRadio(radioHardware);
@@ -20,7 +20,7 @@ struct ModuleFixture {
mod->init();
}
- ~ModuleFixture() {
+ ~ModuleFixture() {
BOOST_TEST_MESSAGE("--- Module fixture teardown ---");
mod->term();
delete[] mod;
@@ -174,7 +174,7 @@ BOOST_FIXTURE_TEST_SUITE(suite_Module, ModuleFixture)
// basic register write with default config
const uint8_t address = 0x12;
const uint8_t value = 0xAB;
- const uint8_t spiTxn[] = {
+ const uint8_t spiTxn[] = {
RADIOLIB_SX126X_CMD_READ_REGISTER, 0x00, address, 0x00, 0x00,
RADIOLIB_SX126X_CMD_WRITE_REGISTER, 0x00, address, value,
};
@@ -189,7 +189,7 @@ BOOST_FIXTURE_TEST_SUITE(suite_Module, ModuleFixture)
const uint8_t msb = 5;
const uint8_t lsb = 1;
const uint8_t maskedValue = 0xEB;
- const uint8_t spiTxn2[] = {
+ const uint8_t spiTxn2[] = {
RADIOLIB_SX126X_CMD_READ_REGISTER, 0x00, address, 0x00, 0x00,
RADIOLIB_SX126X_CMD_WRITE_REGISTER, 0x00, address, maskedValue,
};
diff --git a/extras/test/unit/tests/main.cpp b/extras/test/unit/tests/main.cpp
index be4b6efd8..34353ab33 100644
--- a/extras/test/unit/tests/main.cpp
+++ b/extras/test/unit/tests/main.cpp
@@ -2,4 +2,3 @@
#include
// intentionally left blank, boost.test creates its own entrypoint
-
diff --git a/library.json b/library.json
index 6182a0cfb..9a35e3b51 100644
--- a/library.json
+++ b/library.json
@@ -23,4 +23,4 @@
{
"libLDFMode": "chain+"
}
-}
\ No newline at end of file
+}
diff --git a/src/BuildOpt.h b/src/BuildOpt.h
index 6d6a6a67d..0ee5a25e5 100644
--- a/src/BuildOpt.h
+++ b/src/BuildOpt.h
@@ -220,7 +220,7 @@
// ESP32 boards
#define RADIOLIB_PLATFORM "ESP32"
-
+
// ESP32 doesn't support tone(), but it can be emulated via LED control peripheral
#define RADIOLIB_TONE_UNSUPPORTED
#define RADIOLIB_TONE_ESP32_CHANNEL (1)
@@ -238,7 +238,7 @@
#define RADIOLIB_PLATFORM "Arduino SAMD"
#define RADIOLIB_ARDUINOHAL_PIN_MODE_CAST (PinMode)
#define RADIOLIB_ARDUINOHAL_PIN_STATUS_CAST (PinStatus)
- #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
+ #define RADIOLIB_ARDUINOHAL_INTERRUPT_MODE_CAST (PinStatus)
#elif defined(__SAM3X8E__)
// Arduino Due
diff --git a/src/Hal.h b/src/Hal.h
index 3676fea26..af41950fe 100644
--- a/src/Hal.h
+++ b/src/Hal.h
@@ -28,22 +28,22 @@ class RadioLibHal {
\brief Value to be used as the "output" GPIO direction.
*/
const uint32_t GpioModeOutput;
-
+
/*!
\brief Value to be used as the "low" GPIO level.
*/
const uint32_t GpioLevelLow;
-
+
/*!
\brief Value to be used as the "high" GPIO level.
*/
const uint32_t GpioLevelHigh;
-
+
/*!
\brief Value to be used as the "rising" GPIO level change direction.
*/
const uint32_t GpioInterruptRising;
-
+
/*!
\brief Value to be used as the "falling" GPIO level change direction.
*/
@@ -85,7 +85,7 @@ class RadioLibHal {
\returns Value read on the pin (platform-specific).
*/
virtual uint32_t digitalRead(uint32_t pin) = 0;
-
+
/*!
\brief Method to attach function to an external interrupt.
Must be implemented by the platform-specific hardware abstraction!
@@ -108,28 +108,28 @@ class RadioLibHal {
\param ms Number of milliseconds to wait.
*/
virtual void delay(RadioLibTime_t ms) = 0;
-
+
/*!
\brief Blocking microsecond wait function.
Must be implemented by the platform-specific hardware abstraction!
\param us Number of microseconds to wait.
*/
virtual void delayMicroseconds(RadioLibTime_t us) = 0;
-
+
/*!
\brief Get number of milliseconds since start.
Must be implemented by the platform-specific hardware abstraction!
\returns Number of milliseconds since start.
*/
virtual RadioLibTime_t millis() = 0;
-
+
/*!
\brief Get number of microseconds since start.
Must be implemented by the platform-specific hardware abstraction!
\returns Number of microseconds since start.
*/
virtual RadioLibTime_t micros() = 0;
-
+
/*!
\brief Measure the length of incoming digital pulse in microseconds.
Must be implemented by the platform-specific hardware abstraction!
@@ -198,12 +198,12 @@ class RadioLibHal {
\param pin Pin which is currently producing the tone.
*/
virtual void noTone(uint32_t pin);
-
+
/*!
\brief Yield method, called from long loops in multi-threaded environment (to prevent blocking other threads).
*/
virtual void yield();
-
+
/*!
\brief Function to convert from pin number to interrupt number.
\param pin Pin to convert from.
diff --git a/src/Module.cpp b/src/Module.cpp
index 4ed06b468..c0163cf33 100644
--- a/src/Module.cpp
+++ b/src/Module.cpp
@@ -208,7 +208,7 @@ void Module::SPItransfer(uint16_t cmd, uint32_t reg, const uint8_t* dataOut, uin
this->hal->spiTransfer(buffOut, buffLen, buffIn);
this->hal->digitalWrite(this->csPin, this->hal->GpioLevelHigh);
this->hal->spiEndTransaction();
-
+
// copy the data
if(cmd == spiConfig.cmds[RADIOLIB_MODULE_SPI_COMMAND_READ]) {
memcpy(dataIn, &buffIn[this->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_ADDR]/8], numBytes);
@@ -359,7 +359,7 @@ int16_t Module::SPItransferStream(const uint8_t* cmd, uint8_t cmdLen, bool write
#endif
return(RADIOLIB_ERR_SPI_CMD_TIMEOUT);
}
-
+
}
}
}
@@ -387,7 +387,7 @@ int16_t Module::SPItransferStream(const uint8_t* cmd, uint8_t cmdLen, bool write
RadioLibTime_t start = this->hal->millis();
while(this->hal->digitalRead(this->gpioPin)) {
this->hal->yield();
-
+
// this timeout check triggers a false positive from cppcheck
// cppcheck-suppress unsignedLessThanZero
if(this->hal->millis() - start >= this->spiConfig.timeout) {
@@ -397,7 +397,7 @@ int16_t Module::SPItransferStream(const uint8_t* cmd, uint8_t cmdLen, bool write
state = RADIOLIB_ERR_SPI_CMD_TIMEOUT;
break;
}
-
+
}
}
}
@@ -406,7 +406,7 @@ int16_t Module::SPItransferStream(const uint8_t* cmd, uint8_t cmdLen, bool write
if((state == RADIOLIB_ERR_NONE) && (this->spiConfig.parseStatusCb != nullptr) && (numBytes > 0)) {
state = this->spiConfig.parseStatusCb(buffIn[this->spiConfig.statusPos]);
}
-
+
// copy the data
if(!write) {
// skip the status bytes if present
@@ -490,7 +490,7 @@ void Module::setRfSwitchPins(uint32_t rxEn, uint32_t txEn) {
const uint32_t pins[] = {
rxEn, txEn, RADIOLIB_NC, RADIOLIB_NC, RADIOLIB_NC,
};
-
+
// This must be static, since setRfSwitchTable stores a reference.
static const RfSwitchMode_t table[] = {
{ MODE_IDLE, {this->hal->GpioLevelLow, this->hal->GpioLevelLow} },
diff --git a/src/Module.h b/src/Module.h
index 17386aa76..003a4603e 100644
--- a/src/Module.h
+++ b/src/Module.h
@@ -99,7 +99,7 @@ class Module {
\brief Constants to use in a mode table set be setRfSwitchTable. These
constants work for most radios, but some radios define their own
constants to be used instead.
-
+
See \ref setRfSwitchTable for details.
*/
enum OpMode_t {
@@ -322,7 +322,7 @@ class Module {
\returns \ref status_codes
*/
int16_t SPIcheckStream();
-
+
/*!
\brief Method to perform a read transaction with SPI stream.
\param cmd SPI operation command.
@@ -333,7 +333,7 @@ class Module {
\returns \ref status_codes
*/
int16_t SPIreadStream(uint16_t cmd, uint8_t* data, size_t numBytes, bool waitForGpio = true, bool verify = true);
-
+
/*!
\brief Method to perform a read transaction with SPI stream.
\param cmd SPI operation command.
@@ -345,7 +345,7 @@ class Module {
\returns \ref status_codes
*/
int16_t SPIreadStream(const uint8_t* cmd, uint8_t cmdLen, uint8_t* data, size_t numBytes, bool waitForGpio = true, bool verify = true);
-
+
/*!
\brief Method to perform a write transaction with SPI stream.
\param cmd SPI operation command.
@@ -368,7 +368,7 @@ class Module {
\returns \ref status_codes
*/
int16_t SPIwriteStream(const uint8_t* cmd, uint8_t cmdLen, const uint8_t* data, size_t numBytes, bool waitForGpio = true, bool verify = true);
-
+
/*!
\brief SPI single transfer method for modules with stream-type SPI interface (SX126x, SX128x etc.).
\param cmd SPI operation command.
diff --git a/src/hal/RPiPico/PicoHal.cpp b/src/hal/RPiPico/PicoHal.cpp
index 03e6733f3..9532ddcf8 100644
--- a/src/hal/RPiPico/PicoHal.cpp
+++ b/src/hal/RPiPico/PicoHal.cpp
@@ -12,7 +12,7 @@ static unsigned int toneLoopFrequency;
static unsigned long toneLoopDuration;
// === NOTE ===
-// The tone(...) implementation uses the second core on the RPi Pico. This is to diminish as much
+// The tone(...) implementation uses the second core on the RPi Pico. This is to diminish as much
// jitter in the output tones as possible.
static void toneLoop() {
diff --git a/src/hal/RPiPico/PicoHal.h b/src/hal/RPiPico/PicoHal.h
index dfa06f1c9..ca6f416c4 100644
--- a/src/hal/RPiPico/PicoHal.h
+++ b/src/hal/RPiPico/PicoHal.h
@@ -14,7 +14,7 @@
#include "hardware/clocks.h"
#include "pico/multicore.h"
-// create a new Raspberry Pi Pico hardware abstraction
+// create a new Raspberry Pi Pico hardware abstraction
// layer using the Pico SDK
// the HAL must inherit from the base RadioLibHal class
// and implement all of its virtual methods
diff --git a/src/modules/CC1101/CC1101.cpp b/src/modules/CC1101/CC1101.cpp
index a086fa3ec..ea893a0a8 100644
--- a/src/modules/CC1101/CC1101.cpp
+++ b/src/modules/CC1101/CC1101.cpp
@@ -314,7 +314,7 @@ int16_t CC1101::startTransmit(const uint8_t* data, size_t len, uint8_t addr) {
int16_t CC1101::finishTransmit() {
// set mode to standby to disable transmitter/RF switch
-
+
// Check MARCSTATE for Idle to let anything in the FIFO empty
// Timeout is 2x FIFO transmit time
RadioLibTime_t timeout = (1.0f/(this->bitRate))*(RADIOLIB_CC1101_FIFO_SIZE*2.0f);
@@ -324,7 +324,7 @@ int16_t CC1101::finishTransmit() {
return(RADIOLIB_ERR_TX_TIMEOUT);
}
}
-
+
int16_t state = standby();
RADIOLIB_ASSERT(state);
@@ -501,9 +501,9 @@ int16_t CC1101::autoSetRxBandwidth() {
float uncertainty = ((this->frequency) * 40 * 2);
uncertainty = (uncertainty/1000); //Since bitrate is in kBit
float minbw = ((this->bitRate) + uncertainty);
-
+
const int options[16] = { 58, 68, 81, 102, 116, 135, 162, 203, 232, 270, 325, 406, 464, 541, 650, 812 };
-
+
for(int i = 0; i < 16; i++) {
if(options[i] > minbw) {
return(setRxBandwidth(options[i]));
@@ -536,7 +536,7 @@ int16_t CC1101::setFrequencyDeviation(float freqDev) {
// set frequency deviation value
int16_t state = SPIsetRegValue(RADIOLIB_CC1101_REG_DEVIATN, (e << 4), 6, 4);
state |= SPIsetRegValue(RADIOLIB_CC1101_REG_DEVIATN, m, 2, 0);
-
+
return(state);
}
@@ -654,7 +654,7 @@ int16_t CC1101::checkOutputPower(int8_t power, int8_t* clipped, uint8_t* raw) {
return(RADIOLIB_ERR_NONE);
}
}
-
+
return(RADIOLIB_ERR_INVALID_OUTPUT_POWER);
}
@@ -878,7 +878,7 @@ int16_t CC1101::setPromiscuousMode(bool enable, bool requireCarrierSense) {
RADIOLIB_ASSERT(state);
// disable sync word filtering and insertion
// this also disables preamble
- // Can enable Sync Mode with carriersense when promiscuous is enabled. Default is false: Sync Mode None
+ // Can enable Sync Mode with carriersense when promiscuous is enabled. Default is false: Sync Mode None
state = disableSyncWordFiltering(requireCarrierSense);
RADIOLIB_ASSERT(state);
diff --git a/src/modules/CC1101/CC1101.h b/src/modules/CC1101/CC1101.h
index d85179d2c..505d3b2ee 100644
--- a/src/modules/CC1101/CC1101.h
+++ b/src/modules/CC1101/CC1101.h
@@ -559,7 +559,7 @@ class CC1101: public PhysicalLayer {
float rxBw = RADIOLIB_CC1101_DEFAULT_RXBW,
int8_t pwr = RADIOLIB_CC1101_DEFAULT_POWER,
uint8_t preambleLength = RADIOLIB_CC1101_DEFAULT_PREAMBLELEN);
-
+
/*!
\brief Initialization method for 4-FSK modulation.
\param freq Carrier frequency in MHz. Defaults to 434 MHz.
@@ -620,7 +620,7 @@ class CC1101: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t sleep() override;
-
+
/*!
\brief Starts synchronous direct mode transmission.
\param frf Raw RF frequency value. Defaults to 0, required for quick frequency shifts in RTTY.
@@ -703,8 +703,8 @@ class CC1101: public PhysicalLayer {
/*!
\brief Interrupt-driven binary transmit method for packets less than 64 bytes.
- Method blocks for packets longer than 64 bytes up to a 255 byte limit, until
- the last bytes are placed in the FIFO. Some limitations and issues apply; see discussion:
+ Method blocks for packets longer than 64 bytes up to a 255 byte limit, until
+ the last bytes are placed in the FIFO. Some limitations and issues apply; see discussion:
https://github.com/jgromes/RadioLib/discussions/1138
Overloads for string-based transmissions are implemented in PhysicalLayer.
\param data Binary data to be sent.
@@ -780,7 +780,7 @@ class CC1101: public PhysicalLayer {
/*!
\brief calculates and sets Rx bandwidth based on the freq, baud and freq uncertainty.
- Reimplement of atlas0fd00m's (RfCat) CalculatePktChanBw function.
+ Reimplement of atlas0fd00m's (RfCat) CalculatePktChanBw function.
Modified for worse ppm with the CC1101, and adjusted for the supportted CC1101 bw.
\returns \ref status_codes
*/
@@ -794,7 +794,7 @@ class CC1101: public PhysicalLayer {
int16_t setFrequencyDeviation(float freqDev) override;
/*!
- \brief Gets frequency deviation.
+ \brief Gets frequency deviation.
\param[out] freqDev Pointer to variable where to save the frequency deviation.
\returns \ref status_codes
*/
@@ -940,7 +940,7 @@ class CC1101: public PhysicalLayer {
int16_t setPromiscuousMode(bool enable = true, bool requireCarrierSense = false);
/*!
- \brief Get whether the modem is in promiscuous mode: no packet filtering
+ \brief Get whether the modem is in promiscuous mode: no packet filtering
(e.g., no preamble, sync word, address, CRC).
\returns Whether the modem is in promiscuous mode.
*/
diff --git a/src/modules/LLCC68/LLCC68.cpp b/src/modules/LLCC68/LLCC68.cpp
index 17f19794e..3b143507c 100644
--- a/src/modules/LLCC68/LLCC68.cpp
+++ b/src/modules/LLCC68/LLCC68.cpp
@@ -167,7 +167,7 @@ int16_t LLCC68::checkDataRate(DataRate_t dr) {
return(RADIOLIB_ERR_INVALID_BANDWIDTH);
}
return(RADIOLIB_ERR_NONE);
-
+
}
return(state);
diff --git a/src/modules/LLCC68/LLCC68.h b/src/modules/LLCC68/LLCC68.h
index e548fa573..e8b8afb0b 100644
--- a/src/modules/LLCC68/LLCC68.h
+++ b/src/modules/LLCC68/LLCC68.h
@@ -40,7 +40,7 @@ class LLCC68: public SX1262 {
\returns \ref status_codes
*/
int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = RADIOLIB_SX126X_SYNC_WORD_PRIVATE, int8_t power = 10, uint16_t preambleLength = 8, float tcxoVoltage = 0, bool useRegulatorLDO = false) override;
-
+
/*!
\brief Initialization method for FSK modem.
\param freq Carrier frequency in MHz. Defaults to 434.0 MHz.
@@ -56,7 +56,7 @@ class LLCC68: public SX1262 {
\returns \ref status_codes
*/
int16_t beginFSK(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 156.2, int8_t power = 10, uint16_t preambleLength = 16, float tcxoVoltage = 0, bool useRegulatorLDO = false) override;
-
+
/*!
\brief Initialization method for LR-FHSS modem. This modem only supports transmission!
\param freq Carrier frequency in MHz. Defaults to 434.0 MHz.
@@ -71,7 +71,7 @@ class LLCC68: public SX1262 {
\returns \ref status_codes
*/
int16_t beginLRFHSS(float freq = 434.0, uint8_t bw = RADIOLIB_SX126X_LR_FHSS_BW_722_66, uint8_t cr = RADIOLIB_SX126X_LR_FHSS_CR_2_3, bool narrowGrid = true, int8_t power = 10, float tcxoVoltage = 0, bool useRegulatorLDO = false) override;
-
+
// configuration methods
/*!
@@ -94,14 +94,14 @@ class LLCC68: public SX1262 {
\returns \ref status_codes
*/
int16_t setDataRate(DataRate_t dr) override;
-
+
/*!
\brief Check the data rate can be configured by this module.
\param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa).
\returns \ref status_codes
*/
int16_t checkDataRate(DataRate_t dr) override;
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
diff --git a/src/modules/LR11x0/LR1110.cpp b/src/modules/LR11x0/LR1110.cpp
index 186f8331a..0ae96b540 100644
--- a/src/modules/LR11x0/LR1110.cpp
+++ b/src/modules/LR11x0/LR1110.cpp
@@ -52,7 +52,7 @@ int16_t LR1110::setFrequency(float freq) {
int16_t LR1110::setFrequency(float freq, bool skipCalibration, float band) {
RADIOLIB_CHECK_RANGE(freq, 150.0f, 960.0f, RADIOLIB_ERR_INVALID_FREQUENCY);
-
+
// check if we need to recalibrate image
int16_t state;
if(!skipCalibration && (fabsf(freq - this->freqMHz) >= RADIOLIB_LR11X0_CAL_IMG_FREQ_TRIG_MHZ)) {
@@ -78,7 +78,7 @@ int16_t LR1110::setOutputPower(int8_t power, bool forceHighPower) {
// determine whether to use HP or LP PA and check range accordingly
bool useHp = forceHighPower || (power > 14);
-
+
// TODO how and when to configure OCP?
// update PA config - always use VBAT for high-power PA
@@ -100,13 +100,13 @@ int16_t LR1110::checkOutputPower(int8_t power, int8_t* clipped, bool forceHighPo
*clipped = RADIOLIB_MAX(-9, RADIOLIB_MIN(22, power));
}
RADIOLIB_CHECK_RANGE(power, -9, 22, RADIOLIB_ERR_INVALID_OUTPUT_POWER);
-
+
} else {
if(clipped) {
*clipped = RADIOLIB_MAX(-17, RADIOLIB_MIN(14, power));
}
RADIOLIB_CHECK_RANGE(power, -17, 14, RADIOLIB_ERR_INVALID_OUTPUT_POWER);
-
+
}
return(RADIOLIB_ERR_NONE);
}
@@ -126,4 +126,4 @@ int16_t LR1110::setModem(ModemType_t modem) {
return(RADIOLIB_ERR_WRONG_MODEM);
}
-#endif
\ No newline at end of file
+#endif
diff --git a/src/modules/LR11x0/LR1110.h b/src/modules/LR11x0/LR1110.h
index b20388593..f6bc11005 100644
--- a/src/modules/LR11x0/LR1110.h
+++ b/src/modules/LR11x0/LR1110.h
@@ -52,7 +52,7 @@ class LR1110: public LR11x0 {
\returns \ref status_codes
*/
int16_t beginGFSK(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 156.2, int8_t power = 10, uint16_t preambleLength = 16, float tcxoVoltage = 1.6);
-
+
/*!
\brief Initialization method for LR-FHSS modem.
\param freq Carrier frequency in MHz. Defaults to 434.0 MHz.
@@ -90,7 +90,7 @@ class LR1110: public LR11x0 {
\returns \ref status_codes
*/
int16_t setFrequency(float freq, bool skipCalibration, float band = 4);
-
+
/*!
\brief Sets output power. Allowed values are in range from -9 to 22 dBm (high-power PA) or -17 to 14 dBm (low-power PA).
\param power Output power to be set in dBm, output PA is determined automatically preferring the low-power PA.
diff --git a/src/modules/LR11x0/LR1120.cpp b/src/modules/LR11x0/LR1120.cpp
index 6c6c14e44..449fee0ce 100644
--- a/src/modules/LR11x0/LR1120.cpp
+++ b/src/modules/LR11x0/LR1120.cpp
@@ -92,7 +92,7 @@ int16_t LR1120::setOutputPower(int8_t power, bool forceHighPower) {
paSel = 1;
paSupply = 1;
}
-
+
// TODO how and when to configure OCP?
// update PA config - always use VBAT for high-power PA
@@ -122,13 +122,13 @@ int16_t LR1120::checkOutputPower(int8_t power, int8_t* clipped, bool forceHighPo
*clipped = RADIOLIB_MAX(-9, RADIOLIB_MIN(22, power));
}
RADIOLIB_CHECK_RANGE(power, -9, 22, RADIOLIB_ERR_INVALID_OUTPUT_POWER);
-
+
} else {
if(clipped) {
*clipped = RADIOLIB_MAX(-17, RADIOLIB_MIN(14, power));
}
RADIOLIB_CHECK_RANGE(power, -17, 14, RADIOLIB_ERR_INVALID_OUTPUT_POWER);
-
+
}
return(RADIOLIB_ERR_NONE);
}
diff --git a/src/modules/LR11x0/LR1120.h b/src/modules/LR11x0/LR1120.h
index 3c532ebd1..753dbddb9 100644
--- a/src/modules/LR11x0/LR1120.h
+++ b/src/modules/LR11x0/LR1120.h
@@ -52,7 +52,7 @@ class LR1120: public LR11x0 {
\returns \ref status_codes
*/
int16_t beginGFSK(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 156.2, int8_t power = 10, uint16_t preambleLength = 16, float tcxoVoltage = 1.6);
-
+
/*!
\brief Initialization method for LR-FHSS modem.
\param freq Carrier frequency in MHz. Defaults to 434.0 MHz.
diff --git a/src/modules/LR11x0/LR1121.cpp b/src/modules/LR11x0/LR1121.cpp
index 6292a3bef..21c62b028 100644
--- a/src/modules/LR11x0/LR1121.cpp
+++ b/src/modules/LR11x0/LR1121.cpp
@@ -5,4 +5,4 @@ LR1121::LR1121(Module* mod) : LR1120(mod) {
chipType = RADIOLIB_LR11X0_DEVICE_LR1121;
}
-#endif
\ No newline at end of file
+#endif
diff --git a/src/modules/LR11x0/LR11x0.cpp b/src/modules/LR11x0/LR11x0.cpp
index cd8ecfd85..fc66bbcaf 100644
--- a/src/modules/LR11x0/LR11x0.cpp
+++ b/src/modules/LR11x0/LR11x0.cpp
@@ -159,7 +159,7 @@ int16_t LR11x0::reset() {
// the typical transition duration should be 273 ms
this->mod->hal->delay(300);
-
+
// wait for BUSY to go low
RadioLibTime_t start = this->mod->hal->millis();
while(this->mod->hal->digitalRead(this->mod->getGpio())) {
@@ -238,23 +238,23 @@ int16_t LR11x0::receive(uint8_t* data, size_t len) {
// calculate timeout (100 LoRa symbols, the default for SX127x series)
float symbolLength = (float)(uint32_t(1) << this->spreadingFactor) / (float)this->bandwidthKhz;
timeout = (RadioLibTime_t)(symbolLength * 100.0f);
-
+
} else if(modem == RADIOLIB_LR11X0_PACKET_TYPE_GFSK) {
// calculate timeout (500 % of expected time-one-air)
size_t maxLen = len;
- if(len == 0) {
+ if(len == 0) {
maxLen = 0xFF;
}
float brBps = ((float)(RADIOLIB_LR11X0_CRYSTAL_FREQ) * 1000000.0f * 32.0f) / (float)this->bitRate;
timeout = (RadioLibTime_t)(((maxLen * 8.0f) / brBps) * 1000.0f * 5.0f);
-
+
} else if(modem == RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS) {
// this modem cannot receive
return(RADIOLIB_ERR_WRONG_MODEM);
} else {
return(RADIOLIB_ERR_UNKNOWN);
-
+
}
RADIOLIB_DEBUG_BASIC_PRINTLN("Timeout in %lu ms", timeout);
@@ -372,7 +372,7 @@ int16_t LR11x0::sleep(bool retainConfig, uint32_t sleepTime) {
// set RF switch (if present)
this->mod->setRfSwitchState(Module::MODE_IDLE);
- uint8_t buff[] = {
+ uint8_t buff[] = {
(uint8_t)retainConfig,
(uint8_t)((sleepTime >> 24) & 0xFF), (uint8_t)((sleepTime >> 16) & 0xFF),
(uint8_t)((sleepTime >> 16) & 0xFF), (uint8_t)(sleepTime & 0xFF),
@@ -441,7 +441,7 @@ int16_t LR11x0::readData(uint8_t* data, size_t len) {
uint8_t modem = RADIOLIB_LR11X0_PACKET_TYPE_NONE;
state = getPacketType(&modem);
RADIOLIB_ASSERT(state);
- if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
+ if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK)) {
return(RADIOLIB_ERR_WRONG_MODEM);
}
@@ -572,7 +572,7 @@ int16_t LR11x0::setBandwidth(float bw, bool high) {
}
} else {
RADIOLIB_CHECK_RANGE(bw, 0.0f, 510.0f, RADIOLIB_ERR_INVALID_BANDWIDTH);
-
+
// check allowed bandwidth values
uint8_t bw_div2 = bw / 2 + 0.01f;
switch (bw_div2) {
@@ -636,16 +636,16 @@ int16_t LR11x0::setCodingRate(uint8_t cr, bool longInterleave) {
case 6:
this->codingRate = cr;
break;
- case 8:
+ case 8:
this->codingRate = cr - 1;
break;
default:
return(RADIOLIB_ERR_INVALID_CODING_RATE);
}
-
+
} else {
this->codingRate = cr - 4;
-
+
}
// update modulation parameters
@@ -660,7 +660,7 @@ int16_t LR11x0::setSyncWord(uint8_t syncWord) {
if(type != RADIOLIB_LR11X0_PACKET_TYPE_LORA) {
return(RADIOLIB_ERR_WRONG_MODEM);
}
-
+
return(setLoRaSyncWord(syncWord));
}
@@ -801,7 +801,7 @@ int16_t LR11x0::setSyncWord(uint8_t* syncWord, size_t len) {
uint32_t sync = 0;
memcpy(&sync, syncWord, sizeof(uint32_t));
return(lrFhssSetSyncWord(sync));
-
+
}
return(RADIOLIB_ERR_WRONG_MODEM);
@@ -841,7 +841,7 @@ int16_t LR11x0::setNodeAddress(uint8_t nodeAddr) {
this->addrComp = RADIOLIB_LR11X0_GFSK_ADDR_FILTER_NODE;
state = setPacketParamsGFSK(this->preambleLengthGFSK, this->preambleDetLength, this->syncWordLength, this->addrComp, this->packetType, RADIOLIB_LR11X0_MAX_PACKET_LENGTH, this->crcTypeGFSK, this->whitening);
RADIOLIB_ASSERT(state);
-
+
// set node address
this->node = nodeAddr;
return(setPacketAdrs(this->node, 0));
@@ -860,7 +860,7 @@ int16_t LR11x0::setBroadcastAddress(uint8_t broadAddr) {
this->addrComp = RADIOLIB_LR11X0_GFSK_ADDR_FILTER_NODE_BROADCAST;
state = setPacketParamsGFSK(this->preambleLengthGFSK, this->preambleDetLength, this->syncWordLength, this->addrComp, this->packetType, RADIOLIB_LR11X0_MAX_PACKET_LENGTH, this->crcTypeGFSK, this->whitening);
RADIOLIB_ASSERT(state);
-
+
// set node and broadcast address
return(setPacketAdrs(this->node, broadAddr));
}
@@ -955,7 +955,7 @@ int16_t LR11x0::setDataRate(DataRate_t dr) {
uint8_t type = RADIOLIB_LR11X0_PACKET_TYPE_NONE;
int16_t state = getPacketType(&type);
RADIOLIB_ASSERT(state);
-
+
if(type == RADIOLIB_LR11X0_PACKET_TYPE_GFSK) {
// set the bit rate
state = this->setBitRate(dr.fsk.bitRate);
@@ -975,7 +975,7 @@ int16_t LR11x0::setDataRate(DataRate_t dr) {
// set the coding rate
state = this->setCodingRate(dr.lora.codingRate);
-
+
} else if(type == RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS) {
// set the basic config
state = this->setLrFhssConfig(dr.lrFhss.bw, dr.lrFhss.cr);
@@ -983,7 +983,7 @@ int16_t LR11x0::setDataRate(DataRate_t dr) {
// set hopping grid
this->lrFhssGrid = dr.lrFhss.narrowGrid ? RADIOLIB_LR11X0_LR_FHSS_GRID_STEP_NON_FCC : RADIOLIB_LR11X0_LR_FHSS_GRID_STEP_FCC;
-
+
}
return(state);
@@ -1005,7 +1005,7 @@ int16_t LR11x0::checkDataRate(DataRate_t dr) {
RADIOLIB_CHECK_RANGE(dr.lora.bandwidth, 0.0f, 510.0f, RADIOLIB_ERR_INVALID_BANDWIDTH);
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 5, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
return(RADIOLIB_ERR_NONE);
-
+
}
return(RADIOLIB_ERR_UNKNOWN);
@@ -1082,7 +1082,7 @@ int16_t LR11x0::setTCXO(float voltage, uint32_t delay) {
if(delayValue == 0) {
delayValue = 1;
}
-
+
// enable TCXO control
return(setTcxoMode(tune, delayValue));
}
@@ -1096,7 +1096,7 @@ int16_t LR11x0::setCRC(uint8_t len, uint32_t initial, uint32_t polynomial, bool
// LoRa CRC doesn't allow to set CRC polynomial, initial value, or inversion
this->crcTypeLoRa = len > 0 ? RADIOLIB_LR11X0_LORA_CRC_ENABLED : RADIOLIB_LR11X0_LORA_CRC_DISABLED;
state = setPacketParamsLoRa(this->preambleLengthLoRa, this->headerType, this->implicitLen, this->crcTypeLoRa, (uint8_t)this->invertIQEnabled);
-
+
} else if(type == RADIOLIB_LR11X0_PACKET_TYPE_GFSK) {
// update packet parameters
switch(len) {
@@ -1125,7 +1125,7 @@ int16_t LR11x0::setCRC(uint8_t len, uint32_t initial, uint32_t polynomial, bool
RADIOLIB_ASSERT(state);
state = setGfskCrcParams(initial, polynomial);
-
+
}
return(state);
@@ -1155,7 +1155,7 @@ float LR11x0::getRSSI() {
} else if(type == RADIOLIB_LR11X0_PACKET_TYPE_GFSK) {
(void)getPacketStatusGFSK(NULL, &val, NULL, NULL);
-
+
}
return(val);
@@ -1258,7 +1258,7 @@ RadioLibTime_t LR11x0::getTimeOnAir(size_t len) {
} else if(type == RADIOLIB_LR11X0_PACKET_TYPE_GFSK) {
return(((uint32_t)len * 8 * 1000000UL) / this->bitRate);
-
+
} else if(type == RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS) {
// calculate the number of bits based on coding rate
uint16_t N_bits;
@@ -1289,7 +1289,7 @@ RadioLibTime_t LR11x0::getTimeOnAir(size_t len) {
// add header bits
uint16_t N_totalBits = (RADIOLIB_LR11X0_LR_FHSS_HEADER_BITS * this->lrFhssHdrCount) + N_payBits;
return(((uint32_t)N_totalBits * 8 * 1000000UL) / RADIOLIB_LR11X0_LR_FHSS_BIT_RATE);
-
+
}
return(0);
@@ -1358,7 +1358,7 @@ void LR11x0::setRfSwitchTable(const uint32_t (&pins)[Module::RFSWITCH_MAX_PINS],
if(pins[i] & RFSWITCH_PIN_FLAG) {
enable |= 1UL << RADIOLIB_LR11X0_DIOx_VAL(pins[i]);
}
-
+
}
// now get the configuration
@@ -1439,7 +1439,7 @@ int16_t LR11x0::getVersionInfo(LR11x0VersionInfo_t* info) {
int16_t state = this->getVersion(&info->hardware, &info->device, &info->fwMajor, &info->fwMinor);
RADIOLIB_ASSERT(state);
-
+
// LR1121 does not have GNSS and WiFi scanning
if(this->chipType == RADIOLIB_LR11X0_DEVICE_LR1121) {
info->fwMajorWiFi = 0;
@@ -1530,7 +1530,7 @@ int16_t LR11x0::getModem(ModemType_t* modem) {
*modem = ModemType_t::RADIOLIB_MODEM_LRFHSS;
return(RADIOLIB_ERR_NONE);
}
-
+
return(RADIOLIB_ERR_WRONG_MODEM);
}
@@ -1543,7 +1543,7 @@ int16_t LR11x0::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
uint8_t modem = RADIOLIB_LR11X0_PACKET_TYPE_NONE;
state = getPacketType(&modem);
RADIOLIB_ASSERT(state);
- if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
+ if((modem != RADIOLIB_LR11X0_PACKET_TYPE_LORA) &&
(modem != RADIOLIB_LR11X0_PACKET_TYPE_GFSK)) {
return(RADIOLIB_ERR_WRONG_MODEM);
}
@@ -1571,7 +1571,7 @@ int16_t LR11x0::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
}
this->rxTimeout = cfg->receive.timeout;
} break;
-
+
case(RADIOLIB_RADIO_MODE_TX): {
// check packet length
if(cfg->transmit.len > RADIOLIB_LR11X0_MAX_PACKET_LENGTH) {
@@ -1590,13 +1590,13 @@ int16_t LR11x0::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
RADIOLIB_ASSERT(state);
if(modem == RADIOLIB_LR11X0_PACKET_TYPE_LORA) {
state = setPacketParamsLoRa(this->preambleLengthLoRa, this->headerType, cfg->transmit.len, this->crcTypeLoRa, this->invertIQEnabled);
-
+
} else if(modem == RADIOLIB_LR11X0_PACKET_TYPE_GFSK) {
state = setPacketParamsGFSK(this->preambleLengthGFSK, this->preambleDetLength, this->syncWordLength, this->addrComp, this->packetType, cfg->transmit.len, this->crcTypeGFSK, this->whitening);
-
+
} else if(modem != RADIOLIB_LR11X0_PACKET_TYPE_LR_FHSS) {
return(RADIOLIB_ERR_UNKNOWN);
-
+
}
RADIOLIB_ASSERT(state);
@@ -1621,7 +1621,7 @@ int16_t LR11x0::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
state = clearIrqState(RADIOLIB_LR11X0_IRQ_ALL);
RADIOLIB_ASSERT(state);
} break;
-
+
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
@@ -1637,7 +1637,7 @@ int16_t LR11x0::launchMode() {
this->mod->setRfSwitchState(Module::MODE_RX);
state = setRx(this->rxTimeout);
} break;
-
+
case(RADIOLIB_RADIO_MODE_TX): {
this->mod->setRfSwitchState(Module::MODE_TX);
state = setTx(RADIOLIB_LR11X0_TX_TIMEOUT_NONE);
@@ -1648,7 +1648,7 @@ int16_t LR11x0::launchMode() {
this->mod->hal->yield();
}
} break;
-
+
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
@@ -1710,7 +1710,7 @@ int16_t LR11x0::SPIparseStatus(uint8_t in) {
int16_t LR11x0::SPIcheckStatus(Module* mod) {
// the status check command doesn't return status in the same place as other read commands,
// but only as the first byte (as with any other command), hence LR11x0::SPIcommand can't be used
- // it also seems to ignore the actual command, and just sending in bunch of NOPs will work
+ // it also seems to ignore the actual command, and just sending in bunch of NOPs will work
uint8_t buff[6] = { 0 };
mod->spiConfig.widths[RADIOLIB_MODULE_SPI_WIDTH_STATUS] = Module::BITS_0;
int16_t state = mod->SPItransferStream(NULL, 0, false, NULL, buff, sizeof(buff), true);
@@ -1735,9 +1735,9 @@ int16_t LR11x0::SPIcommand(uint16_t cmd, bool write, uint8_t* data, size_t len,
} else {
// write is just a single transaction
state = this->mod->SPIwriteStream(cmd, data, len, true, true);
-
+
}
-
+
return(state);
}
@@ -1771,7 +1771,7 @@ bool LR11x0::findChip(uint8_t ver) {
i++;
}
}
-
+
return(flagFound);
}
@@ -1796,7 +1796,7 @@ int16_t LR11x0::config(uint8_t modem) {
while(this->mod->hal->digitalRead(this->mod->getGpio())) {
this->mod->hal->yield();
}
-
+
// if something failed, show the device errors
#if RADIOLIB_DEBUG_BASIC
if(state != RADIOLIB_ERR_NONE) {
@@ -1846,7 +1846,7 @@ int16_t LR11x0::startCad(uint8_t symbolNum, uint8_t detPeak, uint8_t detMin, uin
if(num == RADIOLIB_LR11X0_CAD_PARAM_DEFAULT) {
num = 2;
}
-
+
const uint8_t detPeakValues[8] = { 48, 48, 50, 55, 55, 59, 61, 65 };
uint8_t peak = detPeak;
if(peak == RADIOLIB_LR11X0_CAD_PARAM_DEFAULT) {
@@ -1858,7 +1858,7 @@ int16_t LR11x0::startCad(uint8_t symbolNum, uint8_t detPeak, uint8_t detMin, uin
min = 10;
}
- uint8_t mode = exitMode;
+ uint8_t mode = exitMode;
if(mode == RADIOLIB_LR11X0_CAD_PARAM_DEFAULT) {
mode = RADIOLIB_LR11X0_CAD_EXIT_MODE_STBY_RC;
}
diff --git a/src/modules/LR11x0/LR11x0.h b/src/modules/LR11x0/LR11x0.h
index 6e95bde30..841c405b8 100644
--- a/src/modules/LR11x0/LR11x0.h
+++ b/src/modules/LR11x0/LR11x0.h
@@ -264,7 +264,7 @@
#define RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED (0x01UL << 4) // 31 0 preamble detected
#define RADIOLIB_LR11X0_IRQ_SYNC_WORD_HEADER_VALID (0x01UL << 5) // 31 0 sync word or LoRa header valid
#define RADIOLIB_LR11X0_IRQ_HEADER_ERR (0x01UL << 6) // 31 0 LoRa header CRC error
-#define RADIOLIB_LR11X0_IRQ_CRC_ERR (0x01UL << 7) // 31 0 packet CRC error
+#define RADIOLIB_LR11X0_IRQ_CRC_ERR (0x01UL << 7) // 31 0 packet CRC error
#define RADIOLIB_LR11X0_IRQ_CAD_DONE (0x01UL << 8) // 31 0 CAD completed
#define RADIOLIB_LR11X0_IRQ_CAD_DETECTED (0x01UL << 9) // 31 0 CAD detected
#define RADIOLIB_LR11X0_IRQ_TIMEOUT (0x01UL << 10) // 31 0 Rx or Tx timeout
@@ -760,22 +760,22 @@ struct LR11x0VersionInfo_t {
/*! \brief Which device this is - one of RADIOLIB_LR11X0_DEVICE_* macros. */
uint8_t device;
-
+
/*! \brief Major revision of the base firmware. */
uint8_t fwMajor;
-
+
/*! \brief Minor revision of the base firmware. */
uint8_t fwMinor;
/*! \brief Major revision of the WiFi firmware. */
uint8_t fwMajorWiFi;
-
+
/*! \brief Minor revision of the WiFi firmware. */
uint8_t fwMinorWiFi;
/*! \brief Revision of the GNSS firmware. */
uint8_t fwGNSS;
-
+
/*! \brief Almanac revision of the GNSS firmware. */
uint8_t almanacGNSS;
};
@@ -787,7 +787,7 @@ struct LR11x0VersionInfo_t {
struct LR11x0GnssResult_t {
/*! \brief Demodulator status. One of RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_* */
int8_t demodStat;
-
+
/*! \brief Number of satellites detected during the scan. */
uint8_t numSatsDet;
@@ -913,7 +913,7 @@ class LR11x0: public PhysicalLayer {
\brief Whether the module has an XTAL (true) or TCXO (false). Defaults to false.
*/
bool XTAL;
-
+
/*!
\brief Initialization method for LoRa modem.
\param bw LoRa bandwidth in kHz.
@@ -1038,7 +1038,7 @@ class LR11x0: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t sleep(bool retainConfig, uint32_t sleepTime);
-
+
// interrupt methods
/*!
@@ -1103,7 +1103,7 @@ class LR11x0: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t readData(uint8_t* data, size_t len) override;
-
+
/*!
\brief Interrupt-driven channel activity detection method. IRQ1 will be activated
when LoRa preamble is detected, or upon timeout. Defaults to CAD parameter values recommended by AN1200.48.
@@ -1180,7 +1180,7 @@ class LR11x0: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t setRxBandwidth(float rxBw);
-
+
/*!
\brief Sets GFSK sync word in the form of array of up to 8 bytes.
\param syncWord GFSK sync word to be set.
@@ -1443,7 +1443,7 @@ class LR11x0: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t setLrFhssConfig(uint8_t bw, uint8_t cr, uint8_t hdrCount = 3, uint16_t hopSeed = 0x13A);
-
+
/*!
\brief Start passive WiFi scan. BUSY pin will be de-activated when the scan is finished.
\param wifiType Type of WiFi (802.11) signals to scan, 'b', 'n', 'g' or '*' for all signals.
@@ -1488,7 +1488,7 @@ class LR11x0: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t getWifiScanResult(LR11x0WifiResult_t* result, uint8_t index, bool brief = false);
-
+
/*!
\brief Blocking WiFi scan method. Performs a full passive WiFi scan.
This method may block for several seconds!
@@ -1506,14 +1506,14 @@ class LR11x0: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t wifiScan(uint8_t wifiType, uint8_t* count, uint8_t mode = RADIOLIB_LR11X0_WIFI_ACQ_MODE_FULL_BEACON, uint16_t chanMask = RADIOLIB_LR11X0_WIFI_ALL_CHANNELS, uint8_t numScans = 16, uint16_t timeout = 100);
-
+
/*!
\brief Retrieve LR11x0 hardware, device and firmware version information.
\param info Pointer to LR11x0VersionInfo_t structure to populate.
\returns \ref status_codes
*/
int16_t getVersionInfo(LR11x0VersionInfo_t* info);
-
+
/*!
\brief Method to upload new firmware image to the device.
The device will be automatically erased, a new firmware will be uploaded,
@@ -1525,7 +1525,7 @@ class LR11x0: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t updateFirmware(const uint32_t* image, size_t size, bool nonvolatile = true);
-
+
/*!
\brief Method to check whether the device is capable of performing a GNSS scan.
\returns \ref status_codes
@@ -1566,7 +1566,7 @@ class LR11x0: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t updateGnssAlmanac(uint8_t constellation);
-
+
/*!
\brief Get GNSS position. Called after gnssScan to retrieve the position calculated by the internal solver.
\param pos Pointer to LR11x0GnssPosition_t structure to populate.
@@ -1598,13 +1598,13 @@ class LR11x0: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t calibrateImageRejection(float freqMin, float freqMax);
-
+
/*! \copydoc PhysicalLayer::stageMode */
int16_t stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) override;
/*! \copydoc PhysicalLayer::launchMode */
int16_t launchMode() override;
-
+
#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL
protected:
#endif
@@ -1777,9 +1777,9 @@ class LR11x0: public PhysicalLayer {
int16_t bootGetPin(uint8_t* pin);
int16_t bootGetChipEui(uint8_t* eui);
int16_t bootGetJoinEui(uint8_t* eui);
-
+
int16_t SPIcommand(uint16_t cmd, bool write, uint8_t* data, size_t len, const uint8_t* out = NULL, size_t outLen = 0);
-
+
#if !RADIOLIB_GODMODE
protected:
#endif
diff --git a/src/modules/LR11x0/LR11x0_commands.cpp b/src/modules/LR11x0/LR11x0_commands.cpp
index e00232e4a..c0a44b74e 100644
--- a/src/modules/LR11x0/LR11x0_commands.cpp
+++ b/src/modules/LR11x0/LR11x0_commands.cpp
@@ -29,7 +29,7 @@ int16_t LR11x0::readRegMem32(uint32_t addr, uint32_t* data, size_t len) {
(uint8_t)len,
};
- // build buffers - later we need to ensure endians are correct,
+ // build buffers - later we need to ensure endians are correct,
// so there is probably no way to do this without copying buffers and iterating
#if RADIOLIB_STATIC_ONLY
uint8_t rplBuff[RADIOLIB_LR11X0_SPI_MAX_READ_WRITE_LEN];
@@ -49,7 +49,7 @@ int16_t LR11x0::readRegMem32(uint32_t addr, uint32_t* data, size_t len) {
#if !RADIOLIB_STATIC_ONLY
delete[] rplBuff;
#endif
-
+
return(state);
}
@@ -105,7 +105,7 @@ int16_t LR11x0::getStatus(uint8_t* stat1, uint8_t* stat2, uint32_t* irq) {
// the status check command doesn't return status in the same place as other read commands
// but only as the first byte (as with any other command), hence LR11x0::SPIcommand can't be used
- // it also seems to ignore the actual command, and just sending in bunch of NOPs will work
+ // it also seems to ignore the actual command, and just sending in bunch of NOPs will work
int16_t state = this->mod->SPItransferStream(NULL, 0, false, NULL, buff, sizeof(buff), true);
// pass the replies
@@ -249,7 +249,7 @@ int16_t LR11x0::writeInfoPage(uint16_t addr, const uint32_t* data, size_t len) {
return(RADIOLIB_ERR_SPI_CMD_INVALID);
}
- // build buffers - later we need to ensure endians are correct,
+ // build buffers - later we need to ensure endians are correct,
// so there is probably no way to do this without copying buffers and iterating
size_t buffLen = sizeof(uint8_t) + sizeof(uint16_t) + len*sizeof(uint32_t);
#if RADIOLIB_STATIC_ONLY
@@ -291,7 +291,7 @@ int16_t LR11x0::readInfoPage(uint16_t addr, uint32_t* data, size_t len) {
(uint8_t)len,
};
- // build buffers - later we need to ensure endians are correct,
+ // build buffers - later we need to ensure endians are correct,
// so there is probably no way to do this without copying buffers and iterating
#if RADIOLIB_STATIC_ONLY
uint8_t rplBuff[RADIOLIB_LR11X0_SPI_MAX_READ_WRITE_LEN];
@@ -307,11 +307,11 @@ int16_t LR11x0::readInfoPage(uint16_t addr, uint32_t* data, size_t len) {
data[i] = ((uint32_t)rplBuff[2 + i*sizeof(uint32_t)] << 24) | ((uint32_t)rplBuff[3 + i*sizeof(uint32_t)] << 16) | ((uint32_t)rplBuff[4 + i*sizeof(uint32_t)] << 8) | (uint32_t)rplBuff[5 + i*sizeof(uint32_t)];
}
}
-
+
#if !RADIOLIB_STATIC_ONLY
delete[] rplBuff;
#endif
-
+
return(state);
}
@@ -492,7 +492,7 @@ int16_t LR11x0::setModulationParamsLoRa(uint8_t sf, uint8_t bw, uint8_t cr, uint
}
int16_t LR11x0::setModulationParamsGFSK(uint32_t br, uint8_t sh, uint8_t rxBw, uint32_t freqDev) {
- uint8_t buff[10] = {
+ uint8_t buff[10] = {
(uint8_t)((br >> 24) & 0xFF), (uint8_t)((br >> 16) & 0xFF),
(uint8_t)((br >> 8) & 0xFF), (uint8_t)(br & 0xFF), sh, rxBw,
(uint8_t)((freqDev >> 24) & 0xFF), (uint8_t)((freqDev >> 16) & 0xFF),
@@ -502,7 +502,7 @@ int16_t LR11x0::setModulationParamsGFSK(uint32_t br, uint8_t sh, uint8_t rxBw, u
}
int16_t LR11x0::setModulationParamsLrFhss(uint32_t br, uint8_t sh) {
- uint8_t buff[5] = {
+ uint8_t buff[5] = {
(uint8_t)((br >> 24) & 0xFF), (uint8_t)((br >> 16) & 0xFF),
(uint8_t)((br >> 8) & 0xFF), (uint8_t)(br & 0xFF), sh
};
@@ -515,7 +515,7 @@ int16_t LR11x0::setModulationParamsSigfox(uint32_t br, uint8_t sh) {
}
int16_t LR11x0::setPacketParamsLoRa(uint16_t preambleLen, uint8_t hdrType, uint8_t payloadLen, uint8_t crcType, uint8_t invertIQ) {
- uint8_t buff[6] = {
+ uint8_t buff[6] = {
(uint8_t)((preambleLen >> 8) & 0xFF), (uint8_t)(preambleLen & 0xFF),
hdrType, payloadLen, crcType, invertIQ
};
@@ -523,7 +523,7 @@ int16_t LR11x0::setPacketParamsLoRa(uint16_t preambleLen, uint8_t hdrType, uint8
}
int16_t LR11x0::setPacketParamsGFSK(uint16_t preambleLen, uint8_t preambleDetectorLen, uint8_t syncWordLen, uint8_t addrCmp, uint8_t packType, uint8_t payloadLen, uint8_t crcType, uint8_t whiten) {
- uint8_t buff[9] = {
+ uint8_t buff[9] = {
(uint8_t)((preambleLen >> 8) & 0xFF), (uint8_t)(preambleLen & 0xFF),
preambleDetectorLen, syncWordLen, addrCmp, packType, payloadLen, crcType, whiten
};
@@ -531,7 +531,7 @@ int16_t LR11x0::setPacketParamsGFSK(uint16_t preambleLen, uint8_t preambleDetect
}
int16_t LR11x0::setPacketParamsSigfox(uint8_t payloadLen, uint16_t rampUpDelay, uint16_t rampDownDelay, uint16_t bitNum) {
- uint8_t buff[7] = {
+ uint8_t buff[7] = {
payloadLen, (uint8_t)((rampUpDelay >> 8) & 0xFF), (uint8_t)(rampUpDelay & 0xFF),
(uint8_t)((rampDownDelay >> 8) & 0xFF), (uint8_t)(rampDownDelay & 0xFF),
(uint8_t)((bitNum >> 8) & 0xFF), (uint8_t)(bitNum & 0xFF),
@@ -612,7 +612,7 @@ int16_t LR11x0::getRangingResult(uint8_t type, float* res) {
int16_t state = this->SPIcommand(RADIOLIB_LR11X0_CMD_GET_RANGING_RESULT, false, rplBuff, sizeof(rplBuff), reqBuff, sizeof(reqBuff));
RADIOLIB_ASSERT(state);
- if(res) {
+ if(res) {
if(type == RADIOLIB_LR11X0_RANGING_RESULT_DISTANCE) {
uint32_t raw = ((uint32_t)(rplBuff[0]) << 24) | ((uint32_t)(rplBuff[1]) << 16) | ((uint32_t)(rplBuff[2]) << 8) | (uint32_t)rplBuff[3];
*res = ((float)(raw*3e8))/((float)(4096*this->bandwidthKhz*1000));
@@ -640,7 +640,7 @@ int16_t LR11x0::setGfskCrcParams(uint32_t init, uint32_t poly) {
(uint8_t)((poly >> 8) & 0xFF), (uint8_t)(poly & 0xFF)
};
return(this->SPIcommand(RADIOLIB_LR11X0_CMD_SET_GFSK_CRC_PARAMS, true, buff, sizeof(buff)));
-
+
}
int16_t LR11x0::setGfskWhitParams(uint16_t seed) {
@@ -805,7 +805,7 @@ int16_t LR11x0::bootGetJoinEui(uint8_t* eui) {
}
int16_t LR11x0::writeCommon(uint16_t cmd, uint32_t addrOffset, const uint32_t* data, size_t len, bool nonvolatile) {
- // build buffers - later we need to ensure endians are correct,
+ // build buffers - later we need to ensure endians are correct,
// so there is probably no way to do this without copying buffers and iterating
size_t buffLen = sizeof(uint32_t) + len*sizeof(uint32_t);
#if RADIOLIB_STATIC_ONLY
diff --git a/src/modules/LR11x0/LR11x0_crypto.cpp b/src/modules/LR11x0/LR11x0_crypto.cpp
index 6d5866227..193ebabc5 100644
--- a/src/modules/LR11x0/LR11x0_crypto.cpp
+++ b/src/modules/LR11x0/LR11x0_crypto.cpp
@@ -39,7 +39,7 @@ int16_t LR11x0::cryptoProcessJoinAccept(uint8_t decKeyId, uint8_t verKeyId, uint
uint8_t* reqBuff = new uint8_t[reqLen];
uint8_t* rplBuff = new uint8_t[rplLen];
#endif
-
+
// set the request fields
reqBuff[0] = decKeyId;
reqBuff[1] = verKeyId;
@@ -83,7 +83,7 @@ int16_t LR11x0::cryptoComputeAesCmac(uint8_t keyId, const uint8_t* data, size_t
uint8_t* reqBuff = new uint8_t[reqLen];
#endif
uint8_t rplBuff[5] = { 0 };
-
+
reqBuff[0] = keyId;
memcpy(&reqBuff[1], data, len);
@@ -110,7 +110,7 @@ int16_t LR11x0::cryptoVerifyAesCmac(uint8_t keyId, uint32_t micExp, const uint8_
uint8_t* reqBuff = new uint8_t[reqLen];
#endif
uint8_t rplBuff[1] = { 0 };
-
+
reqBuff[0] = keyId;
reqBuff[1] = (uint8_t)((micExp >> 24) & 0xFF);
reqBuff[2] = (uint8_t)((micExp >> 16) & 0xFF);
@@ -185,7 +185,7 @@ int16_t LR11x0::cryptoCheckEncryptedFirmwareImageResult(bool* result) {
// pass the replies
if(result) { *result = (bool)buff[0]; }
-
+
return(state);
}
@@ -198,7 +198,7 @@ int16_t LR11x0::cryptoCommon(uint16_t cmd, uint8_t keyId, const uint8_t* dataIn,
uint8_t* reqBuff = new uint8_t[sizeof(uint8_t) + len];
uint8_t* rplBuff = new uint8_t[sizeof(uint8_t) + len];
#endif
-
+
// set the request fields
reqBuff[0] = keyId;
memcpy(&reqBuff[1], dataIn, len);
diff --git a/src/modules/LR11x0/LR11x0_gnss.cpp b/src/modules/LR11x0/LR11x0_gnss.cpp
index 25028378f..fc448c099 100644
--- a/src/modules/LR11x0/LR11x0_gnss.cpp
+++ b/src/modules/LR11x0/LR11x0_gnss.cpp
@@ -64,7 +64,7 @@ int16_t LR11x0::gnssScan(LR11x0GnssResult_t* res) {
// set scan mode (single vs multiple)
state = this->gnssSetMode(0x03);
RADIOLIB_ASSERT(state);
-
+
// set RF switch
this->mod->setRfSwitchState(LR11x0::MODE_GNSS);
@@ -114,7 +114,7 @@ int16_t LR11x0::gnssScan(LR11x0GnssResult_t* res) {
if(res->demodStat < RADIOLIB_LR11X0_GNSS_DEMOD_STATUS_TOW_FOUND) {
return(RADIOLIB_ERR_GNSS_DEMOD(res->demodStat));
}
-
+
return(state);
}
@@ -176,7 +176,7 @@ int16_t LR11x0::gnssDelayUntilSubframe(LR11x0GnssAlmanacStatus_t *stat, uint8_t
RadioLibTime_t delay = window - now;
RADIOLIB_DEBUG_BASIC_PRINTLN("Time until subframe %lu ms", delay);
- this->mod->hal->delay(delay);
+ this->mod->hal->delay(delay);
return(RADIOLIB_ERR_NONE);
}
@@ -207,7 +207,7 @@ int16_t LR11x0::updateGnssAlmanac(uint8_t constellation) {
if(irq & RADIOLIB_LR11X0_IRQ_GNSS_ABORT) {
state = RADIOLIB_ERR_RX_TIMEOUT;
}
-
+
return(state);
}
@@ -453,7 +453,7 @@ int16_t LR11x0::gnssGetResultSize(uint16_t* size) {
// pass the replies
if(size) { *size = ((uint16_t)(buff[0]) << 8) | (uint16_t)buff[1]; }
-
+
return(state);
}
@@ -466,7 +466,7 @@ int16_t LR11x0::gnssAlmanacFullUpdateHeader(uint16_t date, uint32_t globalCrc) {
uint8_t buff[RADIOLIB_LR11X0_GNSS_ALMANAC_BLOCK_SIZE] = {
RADIOLIB_LR11X0_GNSS_ALMANAC_HEADER_ID,
(uint8_t)((date >> 8) & 0xFF), (uint8_t)(date & 0xFF),
- (uint8_t)((globalCrc >> 24) & 0xFF), (uint8_t)((globalCrc >> 16) & 0xFF),
+ (uint8_t)((globalCrc >> 24) & 0xFF), (uint8_t)((globalCrc >> 16) & 0xFF),
(uint8_t)((globalCrc >> 8) & 0xFF), (uint8_t)(globalCrc & 0xFF),
};
return(this->SPIcommand(RADIOLIB_LR11X0_CMD_GNSS_ALMANAC_FULL_UPDATE, true, buff, sizeof(buff)));
@@ -484,7 +484,7 @@ int16_t LR11x0::gnssAlmanacReadAddrSize(uint32_t* addr, uint16_t* size) {
if(addr) { *addr = ((uint32_t)(buff[0]) << 24) | ((uint32_t)(buff[1]) << 16) | ((uint32_t)(buff[2]) << 8) | (uint32_t)buff[3]; }
if(size) { *size = ((uint16_t)(buff[4]) << 8) | (uint16_t)buff[5]; }
-
+
return(state);
}
@@ -498,7 +498,7 @@ int16_t LR11x0::gnssAlmanacReadSV(uint8_t svId, uint8_t* almanac) {
int16_t LR11x0::gnssGetNbSvVisible(uint32_t time, float lat, float lon, uint8_t constellation, uint8_t* nbSv) {
int16_t latRaw = (lat*2048.0f)/90.0f + 0.5f;
int16_t lonRaw = (lon*2048.0f)/180.0f + 0.5f;
- uint8_t reqBuff[9] = {
+ uint8_t reqBuff[9] = {
(uint8_t)((time >> 24) & 0xFF), (uint8_t)((time >> 16) & 0xFF),
(uint8_t)((time >> 8) & 0xFF), (uint8_t)(time & 0xFF),
(uint8_t)((latRaw >> 8) & 0xFF), (uint8_t)(latRaw & 0xFF),
@@ -521,7 +521,7 @@ int16_t LR11x0::gnssGetSvVisible(uint8_t nbSv, uint8_t** svId, int16_t** doppler
if(doppler && doppler[i]) { *doppler[i] = ((uint16_t)(buff[i*12 + 1]) << 8) | (uint16_t)buff[i*12 + 2]; }
if(dopplerErr && dopplerErr[i]) { *dopplerErr[i] = ((uint16_t)(buff[i*12 + 3]) << 8) | (uint16_t)buff[i*12 + 4]; }
}
-
+
return(state);
}
@@ -537,7 +537,7 @@ int16_t LR11x0::gnssReadLastScanModeLaunched(uint8_t* lastScanMode) {
// pass the replies
if(lastScanMode) { *lastScanMode = buff[0]; }
-
+
return(state);
}
@@ -553,7 +553,7 @@ int16_t LR11x0::gnssReadTime(uint8_t* err, uint32_t* time, uint32_t* nbUs, uint3
// pass the replies
if(err) { *err = buff[0]; }
-
+
if(time) {
*time = ((uint32_t)(buff[1]) << 24) | ((uint32_t)(buff[2]) << 16) | ((uint32_t)(buff[3]) << 8) | (uint32_t)buff[4];
*time += 2UL*1024UL*7UL*24UL*3600UL; // assume WN rollover is at 2, this will fail sometime in 2038
@@ -569,7 +569,7 @@ int16_t LR11x0::gnssReadTime(uint8_t* err, uint32_t* time, uint32_t* nbUs, uint3
*timeAccuracy = ((uint32_t)(buff[8]) << 24) | ((uint32_t)(buff[9]) << 16) | ((uint32_t)(buff[10]) << 8) | (uint32_t)buff[11];
*timeAccuracy /= 16;
}
-
+
return(state);
}
@@ -596,7 +596,7 @@ int16_t LR11x0::gnssReadDemodStatus(int8_t* status, uint8_t* info) {
// pass the replies
if(status) { *status = (int8_t)buff[0]; }
if(info) { *info = buff[1]; }
-
+
return(state);
}
@@ -613,7 +613,7 @@ int16_t LR11x0::gnssReadCumulTiming(uint32_t* timing, uint8_t* constDemod) {
}
if(constDemod) { *constDemod = rplBuff[124]; }
-
+
return(state);
}
@@ -653,7 +653,7 @@ int16_t LR11x0::gnssReadDopplerSolverRes(uint8_t* error, uint8_t* nbSvUsed, floa
}
if(accuracyFilt) { *accuracyFilt = ((uint16_t)(buff[14]) << 8) | (uint16_t)buff[15]; }
if(xtalFilt) { *xtalFilt = ((uint16_t)(buff[16]) << 8) | (uint16_t)buff[17]; }
-
+
return(state);
}
@@ -662,7 +662,7 @@ int16_t LR11x0::gnssReadDelayResetAP(uint32_t* delay) {
int16_t state = this->SPIcommand(RADIOLIB_LR11X0_CMD_GNSS_READ_DELAY_RESET_AP, false, buff, sizeof(buff));
if(delay) { *delay = ((uint32_t)(buff[0]) << 16) | ((uint32_t)(buff[1]) << 8) | (uint32_t)buff[2]; }
-
+
return(state);
}
diff --git a/src/modules/LR11x0/LR11x0_wifi.cpp b/src/modules/LR11x0/LR11x0_wifi.cpp
index 34362a332..b478f27e9 100644
--- a/src/modules/LR11x0/LR11x0_wifi.cpp
+++ b/src/modules/LR11x0/LR11x0_wifi.cpp
@@ -109,9 +109,9 @@ int16_t LR11x0::getWifiScanResult(LR11x0WifiResult_t* result, uint8_t index, boo
memcpy(resultExtended->mac0, &raw[10], RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN);
memcpy(resultExtended->mac, &raw[16], RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN);
memcpy(resultExtended->mac2, &raw[22], RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN);
- resultExtended->timestamp = (((uint64_t)raw[28] << 56) | ((uint64_t)raw[29] << 48)) |
- (((uint64_t)raw[30] << 40) | ((uint64_t)raw[31] << 32)) |
- (((uint64_t)raw[32] << 24) | ((uint64_t)raw[33] << 16)) |
+ resultExtended->timestamp = (((uint64_t)raw[28] << 56) | ((uint64_t)raw[29] << 48)) |
+ (((uint64_t)raw[30] << 40) | ((uint64_t)raw[31] << 32)) |
+ (((uint64_t)raw[32] << 24) | ((uint64_t)raw[33] << 16)) |
(((uint64_t)raw[34] << 8) | (uint64_t)raw[35]);
resultExtended->periodBeacon = (((uint16_t)raw[36] << 8) | ((uint16_t)raw[37])) * 1024UL;
resultExtended->seqCtrl = (((uint16_t)raw[38] << 8) | ((uint16_t)raw[39]));
@@ -132,9 +132,9 @@ int16_t LR11x0::getWifiScanResult(LR11x0WifiResult_t* result, uint8_t index, boo
resultFull->fromDistributionSystem = (raw[3] & 0x80) != 0;
memcpy(resultFull->mac, &raw[4], RADIOLIB_LR11X0_WIFI_RESULT_MAC_LEN);
resultFull->phiOffset = (((uint16_t)raw[10] << 8) | ((uint16_t)raw[11]));
- resultFull->timestamp = (((uint64_t)raw[12] << 56) | ((uint64_t)raw[13] << 48)) |
- (((uint64_t)raw[14] << 40) | ((uint64_t)raw[15] << 32)) |
- (((uint64_t)raw[16] << 24) | ((uint64_t)raw[17] << 16)) |
+ resultFull->timestamp = (((uint64_t)raw[12] << 56) | ((uint64_t)raw[13] << 48)) |
+ (((uint64_t)raw[14] << 40) | ((uint64_t)raw[15] << 32)) |
+ (((uint64_t)raw[16] << 24) | ((uint64_t)raw[17] << 16)) |
(((uint64_t)raw[18] << 8) | (uint64_t)raw[19]);
resultFull->periodBeacon = (((uint16_t)raw[20] << 8) | ((uint16_t)raw[21])) * 1024UL;
}
diff --git a/src/modules/LR11x0/firmware/lr1110_transceiver_0401.h b/src/modules/LR11x0/firmware/lr1110_transceiver_0401.h
index 43f7a832e..05ebb3f68 100644
--- a/src/modules/LR11x0/firmware/lr1110_transceiver_0401.h
+++ b/src/modules/LR11x0/firmware/lr1110_transceiver_0401.h
@@ -13,7 +13,7 @@
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * documentation and/or other materials provided with the distribution.
* * Neither the name of the Semtech corporation nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
diff --git a/src/modules/LR11x0/firmware/lr1120_transceiver_0201.h b/src/modules/LR11x0/firmware/lr1120_transceiver_0201.h
index 3580b7576..b858e9753 100644
--- a/src/modules/LR11x0/firmware/lr1120_transceiver_0201.h
+++ b/src/modules/LR11x0/firmware/lr1120_transceiver_0201.h
@@ -13,7 +13,7 @@
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * documentation and/or other materials provided with the distribution.
* * Neither the name of the Semtech corporation nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
diff --git a/src/modules/LR11x0/firmware/lr1121_transceiver_0103.h b/src/modules/LR11x0/firmware/lr1121_transceiver_0103.h
index 0d2070cd7..da71662a5 100644
--- a/src/modules/LR11x0/firmware/lr1121_transceiver_0103.h
+++ b/src/modules/LR11x0/firmware/lr1121_transceiver_0103.h
@@ -13,7 +13,7 @@
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * documentation and/or other materials provided with the distribution.
* * Neither the name of the Semtech corporation nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
diff --git a/src/modules/RF69/RF69.cpp b/src/modules/RF69/RF69.cpp
index 0b91e5a9a..ff8bdb325 100644
--- a/src/modules/RF69/RF69.cpp
+++ b/src/modules/RF69/RF69.cpp
@@ -118,7 +118,7 @@ int16_t RF69::transmit(const uint8_t* data, size_t len, uint8_t addr) {
return(RADIOLIB_ERR_TX_TIMEOUT);
}
}
-
+
return(finishTransmit());
}
@@ -535,7 +535,7 @@ int16_t RF69::setFrequency(float freq) {
setMode(RADIOLIB_RF69_STANDBY);
//set carrier frequency
- //FRF(23:0) = freq / Fstep = freq * (1 / Fstep) = freq * (2^19 / 32.0) (pag. 17 of datasheet)
+ //FRF(23:0) = freq / Fstep = freq * (1 / Fstep) = freq * (2^19 / 32.0) (pag. 17 of datasheet)
uint32_t FRF = (freq * (uint32_t(1) << RADIOLIB_RF69_DIV_EXPONENT)) / RADIOLIB_RF69_CRYSTAL_FREQ;
this->mod->SPIwriteRegister(RADIOLIB_RF69_REG_FRF_MSB, (FRF & 0xFF0000) >> 16);
this->mod->SPIwriteRegister(RADIOLIB_RF69_REG_FRF_MID, (FRF & 0x00FF00) >> 8);
@@ -553,7 +553,7 @@ int16_t RF69::getFrequency(float *freq) {
FRF |= (((uint32_t)(this->mod->SPIgetRegValue(RADIOLIB_RF69_REG_FRF_MID, 7, 0)) << 8) & 0x0000FF00);
FRF |= (((uint32_t)(this->mod->SPIgetRegValue(RADIOLIB_RF69_REG_FRF_LSB, 7, 0)) << 0) & 0x000000FF);
- //freq = Fstep * FRF(23:0) = (32.0 / 2^19) * FRF(23:0) (pag. 17 of datasheet)
+ //freq = Fstep * FRF(23:0) = (32.0 / 2^19) * FRF(23:0) (pag. 17 of datasheet)
*freq = FRF * ( RADIOLIB_RF69_CRYSTAL_FREQ / (uint32_t(1) << RADIOLIB_RF69_DIV_EXPONENT) );
return(RADIOLIB_ERR_NONE);
@@ -639,7 +639,7 @@ int16_t RF69::getFrequencyDeviation(float *freqDev) {
if(this->ookEnabled) {
*freqDev = 0.0;
-
+
return(RADIOLIB_ERR_NONE);
}
@@ -648,9 +648,9 @@ int16_t RF69::getFrequencyDeviation(float *freqDev) {
fdev |= (uint32_t)((this->mod->SPIgetRegValue(RADIOLIB_RF69_REG_FDEV_MSB, 5, 0) << 8) & 0x0000FF00);
fdev |= (uint32_t)((this->mod->SPIgetRegValue(RADIOLIB_RF69_REG_FDEV_LSB, 7, 0) << 0) & 0x000000FF);
- // calculate frequency deviation from raw value obtained from register
+ // calculate frequency deviation from raw value obtained from register
// Fdev = Fstep * Fdev(13:0) (pag. 20 of datasheet)
- *freqDev = (1000.0f * fdev * RADIOLIB_RF69_CRYSTAL_FREQ) /
+ *freqDev = (1000.0f * fdev * RADIOLIB_RF69_CRYSTAL_FREQ) /
(uint32_t(1) << RADIOLIB_RF69_DIV_EXPONENT);
return(RADIOLIB_ERR_NONE);
@@ -863,7 +863,7 @@ int16_t RF69::setPromiscuousMode(bool enable) {
// disable CRC filtering
state = setCrcFiltering(false);
} else {
- // enable preamble detection and generation
+ // enable preamble detection and generation
state = setPreambleLength(RADIOLIB_RF69_DEFAULT_PREAMBLELEN);
RADIOLIB_ASSERT(state);
diff --git a/src/modules/RF69/RF69.h b/src/modules/RF69/RF69.h
index daaea4338..0781fbd0b 100644
--- a/src/modules/RF69/RF69.h
+++ b/src/modules/RF69/RF69.h
@@ -1011,7 +1011,7 @@ class RF69: public PhysicalLayer {
#endif
float bitRate = RADIOLIB_RF69_DEFAULT_BR;
float rxBandwidth = RADIOLIB_RF69_DEFAULT_RXBW;
-
+
int16_t config();
int16_t setMode(uint8_t mode);
diff --git a/src/modules/SX123x/SX1233.cpp b/src/modules/SX123x/SX1233.cpp
index e414095ef..d92875d3d 100644
--- a/src/modules/SX123x/SX1233.cpp
+++ b/src/modules/SX123x/SX1233.cpp
@@ -102,7 +102,7 @@ int16_t SX1233::setBitRate(float br) {
// datasheet says 1.2 kbps should be the smallest possible, but 0.512 works fine
RADIOLIB_CHECK_RANGE(br, 0.5f, 300.0f, RADIOLIB_ERR_INVALID_BIT_RATE);
}
-
+
// check bitrate-bandwidth ratio
if(!(br < 2000 * this->rxBandwidth)) {
diff --git a/src/modules/SX126x/STM32WLx.cpp b/src/modules/SX126x/STM32WLx.cpp
index d32477a9b..aa476a661 100644
--- a/src/modules/SX126x/STM32WLx.cpp
+++ b/src/modules/SX126x/STM32WLx.cpp
@@ -68,7 +68,7 @@ int16_t STM32WLx::setOutputPower(int8_t power) {
state = SX126x::setPaConfig(0x04, 0x01, 0x00); // LP output up to 14dBm
this->txMode = MODE_TX_LP;
}
-
+
} else if(!hp_supported && lp_supported) {
// only LP supported
RADIOLIB_CHECK_RANGE(power, -17, 14, RADIOLIB_ERR_INVALID_OUTPUT_POWER);
diff --git a/src/modules/SX126x/STM32WLx.h b/src/modules/SX126x/STM32WLx.h
index 317922cf0..057b13983 100644
--- a/src/modules/SX126x/STM32WLx.h
+++ b/src/modules/SX126x/STM32WLx.h
@@ -43,7 +43,7 @@ class STM32WLx : public SX1262 {
/*!
\brief Custom operation modes for STMWLx.
-
+
This splits the TX mode into two modes: Low-power and high-power.
These constants can be used with the setRfSwitchTable() method,
instead of the Module::OpMode_t constants.
diff --git a/src/modules/SX126x/SX1262.h b/src/modules/SX126x/SX1262.h
index 08ac1b6b2..0316809e9 100644
--- a/src/modules/SX126x/SX1262.h
+++ b/src/modules/SX126x/SX1262.h
@@ -61,7 +61,7 @@ class SX1262: public SX126x {
\returns \ref status_codes
*/
virtual int16_t beginFSK(float freq = 434.0, float br = 4.8, float freqDev = 5.0, float rxBw = 156.2, int8_t power = 10, uint16_t preambleLength = 16, float tcxoVoltage = 1.6, bool useRegulatorLDO = false);
-
+
/*!
\brief Initialization method for LR-FHSS modem. This modem only supports transmission!
\param freq Carrier frequency in MHz. Defaults to 434.0 MHz.
@@ -76,7 +76,7 @@ class SX1262: public SX126x {
\returns \ref status_codes
*/
virtual int16_t beginLRFHSS(float freq = 434.0, uint8_t bw = RADIOLIB_SX126X_LR_FHSS_BW_722_66, uint8_t cr = RADIOLIB_SX126X_LR_FHSS_CR_2_3, bool narrowGrid = true, int8_t power = 10, float tcxoVoltage = 1.6, bool useRegulatorLDO = false);
-
+
// configuration methods
/*!
@@ -113,7 +113,7 @@ class SX1262: public SX126x {
\returns \ref status_codes
*/
int16_t checkOutputPower(int8_t power, int8_t* clipped) override;
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
diff --git a/src/modules/SX126x/SX1268.h b/src/modules/SX126x/SX1268.h
index c34bec8dd..fda9e06be 100644
--- a/src/modules/SX126x/SX1268.h
+++ b/src/modules/SX126x/SX1268.h
@@ -75,7 +75,7 @@ class SX1268: public SX126x {
\returns \ref status_codes
*/
int16_t beginLRFHSS(float freq = 434.0, uint8_t bw = RADIOLIB_SX126X_LR_FHSS_BW_722_66, uint8_t cr = RADIOLIB_SX126X_LR_FHSS_CR_2_3, bool narrowGrid = true, int8_t power = 10, float tcxoVoltage = 1.6, bool useRegulatorLDO = false);
-
+
// configuration methods
/*!
@@ -111,7 +111,7 @@ class SX1268: public SX126x {
\returns \ref status_codes
*/
int16_t checkOutputPower(int8_t power, int8_t* clipped) override;
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp
index 4753c0ce9..457642f0b 100644
--- a/src/modules/SX126x/SX126x.cpp
+++ b/src/modules/SX126x/SX126x.cpp
@@ -122,7 +122,7 @@ int16_t SX126x::beginFSK(float br, float freqDev, float rxBw, uint16_t preambleL
int16_t SX126x::beginLRFHSS(uint8_t bw, uint8_t cr, bool narrowGrid, float tcxoVoltage, bool useRegulatorLDO) {
this->lrFhssGridNonFcc = narrowGrid;
-
+
// set module properties and perform initial setup
int16_t state = this->modSetup(tcxoVoltage, useRegulatorLDO, RADIOLIB_SX126X_PACKET_TYPE_LR_FHSS);
RADIOLIB_ASSERT(state);
@@ -262,7 +262,7 @@ int16_t SX126x::receive(uint8_t* data, size_t len) {
// calculate timeout (100 LoRa symbols, the default for SX127x series)
float symbolLength = (float)(uint32_t(1) << this->spreadingFactor) / (float)this->bandwidthKhz;
timeout = (RadioLibTime_t)(symbolLength * 100.0f);
-
+
} else if(modem == RADIOLIB_SX126X_PACKET_TYPE_GFSK) {
// calculate timeout (500 % of expected time-one-air)
size_t maxLen = len;
@@ -274,7 +274,7 @@ int16_t SX126x::receive(uint8_t* data, size_t len) {
} else {
return(RADIOLIB_ERR_UNKNOWN);
-
+
}
RADIOLIB_DEBUG_BASIC_PRINTLN("Timeout in %lu ms", timeout);
@@ -648,7 +648,7 @@ int16_t SX126x::readData(uint8_t* data, size_t len) {
if((irq & RADIOLIB_SX126X_IRQ_CRC_ERR) || ((irq & RADIOLIB_SX126X_IRQ_HEADER_ERR) && !(irq & RADIOLIB_SX126X_IRQ_HEADER_VALID))) {
crcState = RADIOLIB_ERR_CRC_MISMATCH;
}
-
+
// get packet length and Rx buffer offset
uint8_t offset = 0;
size_t length = getPacketLength(true, &offset);
@@ -930,7 +930,7 @@ int16_t SX126x::setDataRate(DataRate_t dr) {
// set the coding rate
state = this->setCodingRate(dr.lora.codingRate);
-
+
} else if(modem == RADIOLIB_SX126X_PACKET_TYPE_LR_FHSS) {
// set the basic config
state = this->setLrFhssConfig(dr.lrFhss.bw, dr.lrFhss.cr);
@@ -959,7 +959,7 @@ int16_t SX126x::checkDataRate(DataRate_t dr) {
RADIOLIB_CHECK_RANGE(dr.lora.bandwidth, 0.0f, 510.0f, RADIOLIB_ERR_INVALID_BANDWIDTH);
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 5, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
return(RADIOLIB_ERR_NONE);
-
+
}
return(state);
@@ -1091,7 +1091,7 @@ int16_t SX126x::setSyncWord(uint8_t* syncWord, size_t len) {
// update packet parameters
this->syncWordLength = len * 8;
-
+
// maximum preamble detector length is limited by sync word length
// for details, see the note in SX1261 datasheet, Rev 2.1, section 6.2.2.1, page 45
uint8_t maxDetLen = RADIOLIB_MIN(this->syncWordLength, this->preambleLengthFSK);
@@ -1103,7 +1103,7 @@ int16_t SX126x::setSyncWord(uint8_t* syncWord, size_t len) {
state = setPacketParamsFSK(this->preambleLengthFSK, this->preambleDetLength, this->crcTypeFSK, this->syncWordLength, RADIOLIB_SX126X_GFSK_ADDRESS_FILT_OFF, this->whitening, this->packetType);
return(state);
-
+
} else if(modem == RADIOLIB_SX126X_PACKET_TYPE_LORA) {
// with length set to 1 and LoRa modem active, assume it is the LoRa sync word
if(len > 1) {
@@ -1117,7 +1117,7 @@ int16_t SX126x::setSyncWord(uint8_t* syncWord, size_t len) {
return(RADIOLIB_ERR_INVALID_SYNC_WORD);
}
memcpy(this->lrFhssSyncWord, syncWord, sizeof(uint32_t));
-
+
}
return(RADIOLIB_ERR_WRONG_MODEM);
@@ -1247,7 +1247,7 @@ float SX126x::getRSSI() {
}
float SX126x::getRSSI(bool packet) {
- if(packet) {
+ if(packet) {
// get last packet RSSI from packet status
uint32_t packetStatus = getPacketStatus();
uint8_t rssiPkt = packetStatus & 0xFF;
@@ -1368,10 +1368,10 @@ RadioLibTime_t SX126x::getTimeOnAir(size_t len) {
uint32_t nSymbol_x4 = (this->preambleLengthLoRa + 8) * 4 + sfCoeff1_x4 + nPreCodedSymbols * (this->codingRate + 4) * 4;
return((symbolLength_us * nSymbol_x4) / 4);
-
+
} else if(modem == RADIOLIB_SX126X_PACKET_TYPE_GFSK) {
return(((uint32_t)len * 8 * this->bitRate) / (RADIOLIB_SX126X_CRYSTAL_FREQ * 32));
-
+
} else if(modem == RADIOLIB_SX126X_PACKET_TYPE_LR_FHSS) {
// calculate the number of bits based on coding rate
uint16_t N_bits;
@@ -1402,7 +1402,7 @@ RadioLibTime_t SX126x::getTimeOnAir(size_t len) {
// add header bits
uint16_t N_totalBits = (RADIOLIB_SX126X_LR_FHSS_HEADER_BITS * this->lrFhssHdrCount) + N_payBits;
return(((uint32_t)N_totalBits * 8 * 1000000UL) / 488.28215f);
-
+
}
return(RADIOLIB_ERR_UNKNOWN);
@@ -1536,7 +1536,7 @@ int16_t SX126x::getModem(ModemType_t* modem) {
*modem = ModemType_t::RADIOLIB_MODEM_LRFHSS;
return(RADIOLIB_ERR_NONE);
}
-
+
return(RADIOLIB_ERR_WRONG_MODEM);
}
@@ -1560,7 +1560,7 @@ int16_t SX126x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
}
this->rxTimeout = cfg->receive.timeout;
} break;
-
+
case(RADIOLIB_RADIO_MODE_TX): {
// check packet length
if(cfg->transmit.len > RADIOLIB_SX126X_MAX_PACKET_LENGTH) {
@@ -1568,7 +1568,7 @@ int16_t SX126x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
}
// maximum packet length is decreased by 1 when address filtering is active
- if((RADIOLIB_SX126X_GFSK_ADDRESS_FILT_OFF != RADIOLIB_SX126X_GFSK_ADDRESS_FILT_OFF) &&
+ if((RADIOLIB_SX126X_GFSK_ADDRESS_FILT_OFF != RADIOLIB_SX126X_GFSK_ADDRESS_FILT_OFF) &&
(cfg->transmit.len > RADIOLIB_SX126X_MAX_PACKET_LENGTH - 1)) {
return(RADIOLIB_ERR_PACKET_TOO_LONG);
}
@@ -1578,13 +1578,13 @@ int16_t SX126x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
uint8_t modem = getPacketType();
if(modem == RADIOLIB_SX126X_PACKET_TYPE_LORA) {
state = setPacketParams(this->preambleLengthLoRa, this->crcTypeLoRa, cfg->transmit.len, this->headerType, this->invertIQEnabled);
-
+
} else if(modem == RADIOLIB_SX126X_PACKET_TYPE_GFSK) {
state = setPacketParamsFSK(this->preambleLengthFSK, this->preambleDetLength, this->crcTypeFSK, this->syncWordLength, RADIOLIB_SX126X_GFSK_ADDRESS_FILT_OFF, this->whitening, this->packetType, cfg->transmit.len);
} else if(modem != RADIOLIB_SX126X_PACKET_TYPE_LR_FHSS) {
return(RADIOLIB_ERR_UNKNOWN);
-
+
}
RADIOLIB_ASSERT(state);
@@ -1603,7 +1603,7 @@ int16_t SX126x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
// write packet to buffer
if(modem != RADIOLIB_SX126X_PACKET_TYPE_LR_FHSS) {
state = writeBuffer(cfg->transmit.data, cfg->transmit.len);
-
+
} else {
// first, reset the LR-FHSS state machine
state = resetLRFHSS();
@@ -1642,7 +1642,7 @@ int16_t SX126x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
state = this->setLRFHSSHop(i);
RADIOLIB_ASSERT(state);
}
-
+
}
RADIOLIB_ASSERT(state);
@@ -1654,7 +1654,7 @@ int16_t SX126x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
state = fixSensitivity();
RADIOLIB_ASSERT(state);
} break;
-
+
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
@@ -1670,7 +1670,7 @@ int16_t SX126x::launchMode() {
this->mod->setRfSwitchState(Module::MODE_RX);
state = setRx(this->rxTimeout);
} break;
-
+
case(RADIOLIB_RADIO_MODE_TX): {
this->mod->setRfSwitchState(this->txMode);
state = setTx(RADIOLIB_SX126X_TX_TIMEOUT_NONE);
@@ -1681,7 +1681,7 @@ int16_t SX126x::launchMode() {
this->mod->hal->yield();
}
} break;
-
+
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
@@ -1714,7 +1714,7 @@ int16_t SX126x::uploadPatch(const uint32_t* patch, size_t len, bool nonvolatile)
// enable patch update
this->mod->SPIwriteRegister(RADIOLIB_SX126X_REG_PATCH_UPDATE_ENABLE, RADIOLIB_SX126X_PATCH_UPDATE_ENABLED);
-
+
// upload the patch
uint8_t data[4];
for(uint32_t i = 0; i < len / sizeof(uint32_t); i++) {
@@ -1985,14 +1985,14 @@ int16_t SX126x::calibrateImage(float freq) {
if(data[0]) {
// matched with predefined ranges, do the calibration
state = SX126x::calibrateImage(data);
-
+
} else {
// if nothing matched, try custom calibration - the may or may not work
RADIOLIB_DEBUG_BASIC_PRINTLN("Failed to match predefined frequency range, trying custom");
state = SX126x::calibrateImageRejection(freq - 4.0f, freq + 4.0f);
-
+
}
-
+
return(state);
}
@@ -2248,7 +2248,7 @@ int16_t SX126x::modSetup(float tcxoVoltage, bool useRegulatorLDO, uint8_t modem)
this->mod->spiConfig.cmds[RADIOLIB_MODULE_SPI_COMMAND_STATUS] = RADIOLIB_SX126X_CMD_GET_STATUS;
this->mod->spiConfig.stream = true;
this->mod->spiConfig.parseStatusCb = SPIparseStatus;
-
+
// try to find the SX126x chip
if(!SX126x::findChip(this->chipType)) {
RADIOLIB_DEBUG_BASIC_PRINTLN("No SX126x found!");
diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h
index d06d37e59..a8d4c7ea2 100644
--- a/src/modules/SX126x/SX126x.h
+++ b/src/modules/SX126x/SX126x.h
@@ -604,8 +604,8 @@ class SX126x: public PhysicalLayer {
Overload with warm start enabled for PhysicalLayer compatibility.
\returns \ref status_codes
*/
- int16_t sleep() override;
-
+ int16_t sleep() override;
+
/*!
\brief Sets the module to sleep mode. To wake the device up, call standby().
\param retainConfig Set to true to retain configuration of the currently active modem ("warm start")
@@ -630,7 +630,7 @@ class SX126x: public PhysicalLayer {
int16_t standby(uint8_t mode, bool wakeup = true);
/*!
- \brief Handle LR-FHSS hop.
+ \brief Handle LR-FHSS hop.
When using LR-FHSS in interrupt-driven mode, this method MUST be called each time an interrupt is triggered!
\returns \ref status_codes
*/
@@ -687,7 +687,7 @@ class SX126x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t finishTransmit() override;
-
+
/*!
\brief Interrupt-driven receive method with default parameters.
Implemented for compatibility with PhysicalLayer.
@@ -704,7 +704,7 @@ class SX126x: public PhysicalLayer {
\param rxPeriod The duration the receiver will be in Rx mode, in microseconds.
\param sleepPeriod The duration the receiver will not be in Rx mode, in microseconds.
- \param irqFlags Sets the IRQ flags, defaults to RX done, RX timeout, CRC error and header error.
+ \param irqFlags Sets the IRQ flags, defaults to RX done, RX timeout, CRC error and header error.
\param irqMask Sets the mask of IRQ flags that will trigger DIO1, defaults to RX done.
\returns \ref status_codes
*/
@@ -735,7 +735,7 @@ class SX126x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t readData(uint8_t* data, size_t len) override;
-
+
/*!
\brief Interrupt-driven channel activity detection method. DIO1 will be activated
when LoRa preamble is detected, or upon timeout. Defaults to CAD parameter values recommended by AN1200.48.
@@ -1098,7 +1098,7 @@ class SX126x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t getModem(ModemType_t* modem) override;
-
+
/*! \copydoc PhysicalLayer::stageMode */
int16_t stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) override;
@@ -1138,7 +1138,7 @@ class SX126x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t spectralScanStart(uint16_t numSamples, uint8_t window = RADIOLIB_SX126X_SPECTRAL_SCAN_WINDOW_DEFAULT, uint8_t interval = RADIOLIB_SX126X_SCAN_INTERVAL_8_20_US);
-
+
/*!
\brief Abort an ongoing spectral scan.
*/
@@ -1198,7 +1198,7 @@ class SX126x: public PhysicalLayer {
protected:
#endif
Module* getMod() override;
-
+
// SX126x SPI command implementations
int16_t setFs();
int16_t setTx(uint32_t timeout = 0);
@@ -1231,7 +1231,7 @@ class SX126x: public PhysicalLayer {
const char* chipType = NULL;
uint8_t bandwidth = 0;
float freqMHz = 0;
-
+
// Allow subclasses to define different TX modes
uint8_t txMode = Module::MODE_TX;
diff --git a/src/modules/SX126x/SX126x_LR_FHSS.cpp b/src/modules/SX126x/SX126x_LR_FHSS.cpp
index 42c071afa..2275c971d 100644
--- a/src/modules/SX126x/SX126x_LR_FHSS.cpp
+++ b/src/modules/SX126x/SX126x_LR_FHSS.cpp
@@ -146,7 +146,7 @@ int16_t SX126x::buildLRFHSSPacket(const uint8_t* in, size_t in_len, uint8_t* out
// guard bits
CLEAR_BIT_IN_ARRAY_LSB(out, out_row_index);
CLEAR_BIT_IN_ARRAY_LSB(out, out_row_index + 1);
-
+
for(int16_t j = 0; j < in_row_width; j++) {
// guard bit
if(TEST_BIT_IN_ARRAY_LSB(tmp, pos)) {
@@ -267,7 +267,7 @@ int16_t SX126x::buildLRFHSSPacket(const uint8_t* in, size_t in_len, uint8_t* out
int16_t SX126x::resetLRFHSS() {
// initialize hopping configuration
const uint16_t numChan[] = { 80, 176, 280, 376, 688, 792, 1480, 1584, 3120, 3224 };
-
+
// LFSR polynomials for different ranges of lrFhssNgrid
const uint8_t lfsrPoly1[] = { 33, 45, 48, 51, 54, 57 };
const uint8_t lfsrPoly2[] = { 65, 68, 71, 72 };
@@ -289,7 +289,7 @@ int16_t SX126x::resetLRFHSS() {
return(RADIOLIB_ERR_INVALID_DATA_SHAPING);
}
break;
-
+
case 60:
case 62:
this->lrFhssLfsrState = 56;
@@ -299,25 +299,25 @@ int16_t SX126x::resetLRFHSS() {
return(RADIOLIB_ERR_INVALID_DATA_SHAPING);
}
break;
-
+
case 86:
case 99:
this->lrFhssPoly = lfsrPoly2[this->lrFhssHopSeqId >> 7];
this->lrFhssSeed = this->lrFhssHopSeqId & 0x7F;
break;
-
+
case 185:
case 198:
this->lrFhssPoly = lfsrPoly3[this->lrFhssHopSeqId >> 8];
this->lrFhssSeed = this->lrFhssHopSeqId & 0xFF;
break;
-
+
case 390:
case 403:
this->lrFhssPoly = 264;
this->lrFhssSeed = this->lrFhssHopSeqId;
break;
-
+
default:
return(RADIOLIB_ERR_INVALID_DATA_SHAPING);
}
diff --git a/src/modules/SX127x/SX1272.cpp b/src/modules/SX127x/SX1272.cpp
index e6e4406d6..9475f0438 100644
--- a/src/modules/SX127x/SX1272.cpp
+++ b/src/modules/SX127x/SX1272.cpp
@@ -269,7 +269,7 @@ int16_t SX1272::checkDataRate(DataRate_t dr) {
RADIOLIB_CHECK_RANGE(dr.lora.bandwidth, 100.0f, 510.0f, RADIOLIB_ERR_INVALID_BANDWIDTH);
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 5, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
return(RADIOLIB_ERR_NONE);
-
+
}
return(state);
diff --git a/src/modules/SX127x/SX1272.h b/src/modules/SX127x/SX1272.h
index f3d835459..12388d4c6 100644
--- a/src/modules/SX127x/SX1272.h
+++ b/src/modules/SX127x/SX1272.h
@@ -175,14 +175,14 @@ class SX1272: public SX127x {
\returns \ref status_codes
*/
int16_t setBitRate(float br) override;
-
+
/*!
\brief Set data.
\param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa).
\returns \ref status_codes
*/
int16_t setDataRate(DataRate_t dr) override;
-
+
/*!
\brief Check the data rate can be configured by this module.
\param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa).
@@ -302,7 +302,7 @@ class SX1272: public SX127x {
\returns \ref status_codes
*/
int16_t explicitHeader();
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
diff --git a/src/modules/SX127x/SX1273.cpp b/src/modules/SX127x/SX1273.cpp
index 11aace90d..23a16b93d 100644
--- a/src/modules/SX127x/SX1273.cpp
+++ b/src/modules/SX127x/SX1273.cpp
@@ -109,7 +109,7 @@ int16_t SX1273::checkDataRate(DataRate_t dr) {
RADIOLIB_CHECK_RANGE(dr.lora.bandwidth, 100.0f, 510.0f, RADIOLIB_ERR_INVALID_BANDWIDTH);
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 5, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
return(RADIOLIB_ERR_NONE);
-
+
}
return(state);
diff --git a/src/modules/SX127x/SX1273.h b/src/modules/SX127x/SX1273.h
index 2a2e3b5ef..9f481b5d7 100644
--- a/src/modules/SX127x/SX1273.h
+++ b/src/modules/SX127x/SX1273.h
@@ -55,14 +55,14 @@ class SX1273: public SX1272 {
\returns \ref status_codes
*/
int16_t setDataRate(DataRate_t dr) override;
-
+
/*!
\brief Check the data rate can be configured by this module.
\param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa).
\returns \ref status_codes
*/
int16_t checkDataRate(DataRate_t dr) override;
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
diff --git a/src/modules/SX127x/SX1276.h b/src/modules/SX127x/SX1276.h
index 006e682ed..dabb69f56 100644
--- a/src/modules/SX127x/SX1276.h
+++ b/src/modules/SX127x/SX1276.h
@@ -62,7 +62,7 @@ class SX1276: public SX1278 {
\returns \ref status_codes
*/
int16_t setFrequency(float freq) override;
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
diff --git a/src/modules/SX127x/SX1277.cpp b/src/modules/SX127x/SX1277.cpp
index 155a6f3d3..543407bb5 100644
--- a/src/modules/SX127x/SX1277.cpp
+++ b/src/modules/SX127x/SX1277.cpp
@@ -151,7 +151,7 @@ int16_t SX1277::checkDataRate(DataRate_t dr) {
RADIOLIB_CHECK_RANGE(dr.lora.bandwidth, 0.0f, 510.0f, RADIOLIB_ERR_INVALID_BANDWIDTH);
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 5, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
return(RADIOLIB_ERR_NONE);
-
+
}
return(state);
diff --git a/src/modules/SX127x/SX1277.h b/src/modules/SX127x/SX1277.h
index 0df03daca..7a82ff07b 100644
--- a/src/modules/SX127x/SX1277.h
+++ b/src/modules/SX127x/SX1277.h
@@ -69,21 +69,21 @@ class SX1277: public SX1278 {
\returns \ref status_codes
*/
int16_t setSpreadingFactor(uint8_t sf) override;
-
+
/*!
\brief Set data.
\param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa).
\returns \ref status_codes
*/
int16_t setDataRate(DataRate_t dr) override;
-
+
/*!
\brief Check the data rate can be configured by this module.
\param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa).
\returns \ref status_codes
*/
int16_t checkDataRate(DataRate_t dr) override;
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
diff --git a/src/modules/SX127x/SX1278.cpp b/src/modules/SX127x/SX1278.cpp
index 308ad5c3b..c2617b07c 100644
--- a/src/modules/SX127x/SX1278.cpp
+++ b/src/modules/SX127x/SX1278.cpp
@@ -283,7 +283,7 @@ int16_t SX1278::checkDataRate(DataRate_t dr) {
RADIOLIB_CHECK_RANGE(dr.lora.bandwidth, 0.0f, 510.0f, RADIOLIB_ERR_INVALID_BANDWIDTH);
RADIOLIB_CHECK_RANGE(dr.lora.codingRate, 5, 8, RADIOLIB_ERR_INVALID_CODING_RATE);
return(RADIOLIB_ERR_NONE);
-
+
}
return(state);
diff --git a/src/modules/SX127x/SX1278.h b/src/modules/SX127x/SX1278.h
index dc606885c..c68135c2d 100644
--- a/src/modules/SX127x/SX1278.h
+++ b/src/modules/SX127x/SX1278.h
@@ -68,7 +68,7 @@
// SX127X_REG_VERSION
#define RADIOLIB_SX1278_CHIP_VERSION 0x12 // this is the "official" version listed in datasheet
-#define RADIOLIB_SX1278_CHIP_VERSION_ALT 0x13 // appears sometimes
+#define RADIOLIB_SX1278_CHIP_VERSION_ALT 0x13 // appears sometimes
#define RADIOLIB_SX1278_CHIP_VERSION_RFM9X 0x11 // this value is used for the RFM9x
// SX1278 FSK modem settings
@@ -186,14 +186,14 @@ class SX1278: public SX127x {
\returns \ref status_codes
*/
int16_t setBitRate(float br) override;
-
+
/*!
\brief Set data.
\param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa).
\returns \ref status_codes
*/
int16_t setDataRate(DataRate_t dr) override;
-
+
/*!
\brief Check the data rate can be configured by this module.
\param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa).
@@ -314,7 +314,7 @@ class SX1278: public SX127x {
\returns \ref status_codes
*/
int16_t explicitHeader();
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
diff --git a/src/modules/SX127x/SX1279.h b/src/modules/SX127x/SX1279.h
index 7d304ecc0..7d5cbaa88 100644
--- a/src/modules/SX127x/SX1279.h
+++ b/src/modules/SX127x/SX1279.h
@@ -62,7 +62,7 @@ class SX1279: public SX1278 {
\returns \ref status_codes
*/
int16_t setFrequency(float freq) override;
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
diff --git a/src/modules/SX127x/SX127x.cpp b/src/modules/SX127x/SX127x.cpp
index 068fcad47..4f67a8e28 100644
--- a/src/modules/SX127x/SX127x.cpp
+++ b/src/modules/SX127x/SX127x.cpp
@@ -186,7 +186,7 @@ int16_t SX127x::transmit(const uint8_t* data, size_t len, uint8_t addr) {
} else {
return(RADIOLIB_ERR_UNKNOWN);
-
+
}
// start transmission
@@ -546,7 +546,7 @@ int16_t SX127x::readData(uint8_t* data, size_t len) {
// CRC is disabled according to packet header and enabled according to user
// most likely damaged packet header
state = RADIOLIB_ERR_LORA_HEADER_DAMAGED;
- }
+ }
// set FIFO read pointer to the start of the current packet
int16_t addr = this->mod->SPIgetRegValue(RADIOLIB_SX127X_REG_FIFO_RX_CURRENT_ADDR);
if (addr >= 0) {
@@ -936,7 +936,7 @@ int16_t SX127x::setSyncWord(uint8_t* syncWord, size_t len) {
// set sync word
this->mod->SPIwriteRegisterBurst(RADIOLIB_SX127X_REG_SYNC_VALUE_1, syncWord, len);
return(RADIOLIB_ERR_NONE);
-
+
} else if(modem == RADIOLIB_SX127X_LORA) {
// with length set to 1 and LoRa modem active, assume it is the LoRa sync word
if(len > 1) {
@@ -1124,7 +1124,7 @@ float SX127x::getNumSymbols(size_t len) {
// get explicit/implicit header enabled flag
float ih = (float) this->mod->SPIgetRegValue(RADIOLIB_SX127X_REG_MODEM_CONFIG_1, 0, 0);
-
+
// get CRC enabled flag
float crc = (float) (this->mod->SPIgetRegValue(RADIOLIB_SX127X_REG_MODEM_CONFIG_2, 2, 2) >> 2);
@@ -1170,7 +1170,7 @@ RadioLibTime_t SX127x::getTimeOnAir(size_t len) {
// calculate time-on-air in us {[(length in bytes) * (8 bits / 1 byte)] / [(Bit Rate in kbps) * (1000 bps / 1 kbps)]} * (1000000 us in 1 sec)
return((uint32_t) (((crc + n_syncWord + n_pre + (float) (len * 8)) / (this->bitRate * 1000.0f)) * 1000000.0f));
}
-
+
return(RADIOLIB_ERR_UNKNOWN);
}
@@ -1182,11 +1182,11 @@ RadioLibTime_t SX127x::calculateRxTimeout(RadioLibTime_t timeoutUs) {
// the order of operators is swapped here to decrease the effects of this truncation error
float symbolLength = (float) (uint32_t(1) << this->spreadingFactor) / (float) this->bandwidth;
timeout = (timeoutUs / symbolLength) / 1000;
-
+
} else {
// for FSK, the timeout is in units of 16x bit time
timeout = ((float)timeoutUs / ((16.0f * 1000.0f) / this->bitRate));
-
+
}
return(timeout);
@@ -1246,7 +1246,7 @@ int16_t SX127x::setIrqFlags(uint32_t irq) {
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
-
+
} else if(modem == RADIOLIB_SX127X_FSK_OOK) {
switch(irqBit) {
case(RADIOLIB_SX127X_FLAG_PACKET_SENT << 8):
@@ -1303,7 +1303,7 @@ int16_t SX127x::clearIrqFlags(uint32_t irq) {
if(modem == RADIOLIB_SX127X_LORA) {
this->mod->SPIwriteRegister(RADIOLIB_SX127X_REG_IRQ_FLAGS, (uint8_t)irq);
return(RADIOLIB_ERR_NONE);
-
+
} else if(modem == RADIOLIB_SX127X_FSK_OOK) {
this->mod->SPIwriteRegister(RADIOLIB_SX127X_REG_IRQ_FLAGS_1, (uint8_t)irq);
this->mod->SPIwriteRegister(RADIOLIB_SX127X_REG_IRQ_FLAGS_2, (uint8_t)(irq >> 8));
@@ -1576,7 +1576,7 @@ bool SX127x::findChip(const uint8_t* vers, uint8_t num) {
this->mod->hal->delay(10);
i++;
}
-
+
}
return(flagFound);
@@ -1601,7 +1601,7 @@ int16_t SX127x::setActiveModem(uint8_t modem) {
// set modem
// low frequency access (bit 3) automatically resets when switching modem
- // so we exclude it from the check
+ // so we exclude it from the check
state |= this->mod->SPIsetRegValue(RADIOLIB_SX127X_REG_OP_MODE, modem, 7, 7, 5, 0xF7);
// set mode to STANDBY
@@ -1650,7 +1650,7 @@ int16_t SX127x::getModem(ModemType_t* modem) {
*modem = ModemType_t::RADIOLIB_MODEM_FSK;
return(RADIOLIB_ERR_NONE);
}
-
+
return(RADIOLIB_ERR_WRONG_MODEM);
}
@@ -1721,7 +1721,7 @@ int16_t SX127x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
this->rxMode = RADIOLIB_SX127X_RX;
}
} break;
-
+
case(RADIOLIB_RADIO_MODE_TX): {
// set mode to standby
state = setMode(RADIOLIB_SX127X_STANDBY);
@@ -1773,9 +1773,9 @@ int16_t SX127x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
} else {
this->mod->SPIwriteRegister(RADIOLIB_SX127X_REG_FIFO, cfg->transmit.len);
}
-
+
}
-
+
}
// write packet to FIFO
@@ -1786,7 +1786,7 @@ int16_t SX127x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
}
this->mod->SPIwriteRegisterBurst(RADIOLIB_SX127X_REG_FIFO, cfg->transmit.data, packetLen);
} break;
-
+
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
@@ -1803,13 +1803,13 @@ int16_t SX127x::launchMode() {
state = setMode(this->rxMode);
RADIOLIB_ASSERT(state);
} break;
-
+
case(RADIOLIB_RADIO_MODE_TX): {
this->mod->setRfSwitchState(Module::MODE_TX);
state = setMode(RADIOLIB_SX127X_TX);
RADIOLIB_ASSERT(state);
} break;
-
+
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
@@ -1882,7 +1882,7 @@ float SX127x::getRSSI(bool packet, bool skipReceive, int16_t offset) {
float currentRSSI = offset + this->mod->SPIgetRegValue(RADIOLIB_SX127X_REG_RSSI_VALUE);
return(currentRSSI);
}
-
+
} else {
// for FSK, there is no packet RSSI
diff --git a/src/modules/SX127x/SX127x.h b/src/modules/SX127x/SX127x.h
index 59d5cb2cf..d9418d3d6 100644
--- a/src/modules/SX127x/SX127x.h
+++ b/src/modules/SX127x/SX127x.h
@@ -804,7 +804,7 @@ class SX127x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t finishTransmit() override;
-
+
/*!
\brief Interrupt-driven receive method with default parameters.
Implemented for compatibility with PhysicalLayer.
@@ -1142,7 +1142,7 @@ class SX127x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t getModem(ModemType_t* modem) override;
-
+
/*! \copydoc PhysicalLayer::stageMode */
int16_t stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) override;
diff --git a/src/modules/SX128x/SX128x.cpp b/src/modules/SX128x/SX128x.cpp
index 4c6d17b7c..a219f2046 100644
--- a/src/modules/SX128x/SX128x.cpp
+++ b/src/modules/SX128x/SX128x.cpp
@@ -553,7 +553,7 @@ int16_t SX128x::readData(uint8_t* data, size_t len) {
length = len;
}
- // read packet data starting at offset
+ // read packet data starting at offset
state = readBuffer(data, length, offset);
RADIOLIB_ASSERT(state);
@@ -780,7 +780,7 @@ int16_t SX128x::getModem(ModemType_t* modem) {
*modem = ModemType_t::RADIOLIB_MODEM_FSK;
return(RADIOLIB_ERR_NONE);
}
-
+
return(RADIOLIB_ERR_WRONG_MODEM);
}
@@ -1399,7 +1399,7 @@ int16_t SX128x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
if((this->headerType == RADIOLIB_SX128X_LORA_HEADER_IMPLICIT) && (cfg->receive.len != 0)) {
this->payloadLen = cfg->receive.len;
}
-
+
// check active modem
if(getPacketType() == RADIOLIB_SX128X_PACKET_TYPE_RANGING) {
return(RADIOLIB_ERR_WRONG_MODEM);
@@ -1432,7 +1432,7 @@ int16_t SX128x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
}
this->rxTimeout = cfg->receive.timeout;
} break;
-
+
case(RADIOLIB_RADIO_MODE_TX): {
// check packet length
if(cfg->transmit.len > RADIOLIB_SX128X_MAX_PACKET_LENGTH) {
@@ -1478,7 +1478,7 @@ int16_t SX128x::stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) {
state = clearIrqStatus();
RADIOLIB_ASSERT(state);
} break;
-
+
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
@@ -1495,7 +1495,7 @@ int16_t SX128x::launchMode() {
state = setRx(this->rxTimeout);
RADIOLIB_ASSERT(state);
} break;
-
+
case(RADIOLIB_RADIO_MODE_TX): {
this->mod->setRfSwitchState(Module::MODE_TX);
state = setTx(RADIOLIB_SX128X_TX_TIMEOUT_NONE);
@@ -1506,7 +1506,7 @@ int16_t SX128x::launchMode() {
this->mod->hal->yield();
}
} break;
-
+
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
diff --git a/src/modules/SX128x/SX128x.h b/src/modules/SX128x/SX128x.h
index 0fe91a4b1..b4da15400 100644
--- a/src/modules/SX128x/SX128x.h
+++ b/src/modules/SX128x/SX128x.h
@@ -536,7 +536,7 @@ class SX128x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t finishTransmit() override;
-
+
/*!
\brief Interrupt-driven receive method with default parameters.
Implemented for compatibility with PhysicalLayer.
@@ -560,7 +560,7 @@ class SX128x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t readData(uint8_t* data, size_t len) override;
-
+
/*!
\brief Read currently active IRQ flags.
\returns IRQ flags.
@@ -648,7 +648,7 @@ class SX128x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t checkOutputPower(int8_t pwr, int8_t* clipped) override;
-
+
/*!
\brief Set modem for the radio to use. Will perform full reset and reconfigure the radio
using its default parameters.
@@ -854,7 +854,7 @@ class SX128x: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t invertIQ(bool enable) override;
-
+
/*! \copydoc PhysicalLayer::stageMode */
int16_t stageMode(RadioModeType_t mode, RadioModeConfig_t* cfg) override;
diff --git a/src/modules/nRF24/nRF24.cpp b/src/modules/nRF24/nRF24.cpp
index c46404ee4..067ded49a 100644
--- a/src/modules/nRF24/nRF24.cpp
+++ b/src/modules/nRF24/nRF24.cpp
@@ -313,7 +313,7 @@ int16_t nRF24::setBitRate(float br) {
} else {
return(RADIOLIB_ERR_INVALID_DATA_RATE);
}
-
+
if(state == RADIOLIB_ERR_NONE) {
this->dataRate = bitRate;
}
diff --git a/src/modules/nRF24/nRF24.h b/src/modules/nRF24/nRF24.h
index 48d21fe7a..f44bbb613 100644
--- a/src/modules/nRF24/nRF24.h
+++ b/src/modules/nRF24/nRF24.h
@@ -466,7 +466,7 @@ class nRF24: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t setEncoding(uint8_t encoding) override;
-
+
/*!
\brief Enable or disable the low-noise amplifier.
Improves receive performance at the cost of increased power consumption.
diff --git a/src/protocols/APRS/APRS.cpp b/src/protocols/APRS/APRS.cpp
index a2f9078d4..160983e0f 100644
--- a/src/protocols/APRS/APRS.cpp
+++ b/src/protocols/APRS/APRS.cpp
@@ -32,7 +32,7 @@ int16_t APRSClient::begin(char sym, const char* callsign, uint8_t ssid, bool alt
if(strlen(callsign) > RADIOLIB_AX25_MAX_CALLSIGN_LEN) {
return(RADIOLIB_ERR_INVALID_CALLSIGN);
}
-
+
memcpy(this->src, callsign, strlen(callsign));
this->id = ssid;
@@ -62,7 +62,7 @@ int16_t APRSClient::sendPosition(char* destCallsign, uint8_t destSSID, const cha
// message, no timestamp
sprintf(info, RADIOLIB_APRS_DATA_TYPE_POSITION_NO_TIME_MSG "%s%c%s%c%s", lat, table, lon, symbol, msg);
}
-
+
} else {
if(time != NULL) {
// timestamp, no message
@@ -267,7 +267,7 @@ int16_t APRSClient::sendFrame(char* destCallsign, uint8_t destSSID, char* info)
}
return(axClient->sendFrame(&frameUI));
-
+
} else if(this->phyLayer != nullptr) {
// non-AX.25/LoRa mode
size_t len = RADIOLIB_APRS_LORA_HEADER_LEN + strlen(this->src) + 4 + strlen(destCallsign) + 11 + strlen(info);
@@ -277,8 +277,8 @@ int16_t APRSClient::sendFrame(char* destCallsign, uint8_t destSSID, char* info)
int16_t res = this->phyLayer->transmit(reinterpret_cast(buff), strlen(buff));
delete[] buff;
return(res);
- }
-
+ }
+
return(RADIOLIB_ERR_WRONG_MODEM);
}
diff --git a/src/protocols/APRS/APRS.h b/src/protocols/APRS/APRS.h
index f496f3b17..2a30fc468 100644
--- a/src/protocols/APRS/APRS.h
+++ b/src/protocols/APRS/APRS.h
@@ -173,7 +173,7 @@ class APRSClient {
char** repCalls = NULL;
uint8_t* repSSIDs = NULL;
uint8_t numReps = 0;
-
+
// source callsign when using APRS over LoRa
char src[RADIOLIB_AX25_MAX_CALLSIGN_LEN + 1] = { 0 };
uint8_t id = 0;
diff --git a/src/protocols/AX25/AX25.cpp b/src/protocols/AX25/AX25.cpp
index ad0e99169..4f0caa2a3 100644
--- a/src/protocols/AX25/AX25.cpp
+++ b/src/protocols/AX25/AX25.cpp
@@ -54,7 +54,7 @@ AX25Frame::AX25Frame(const char* destCallsign, uint8_t destSSID, const char* src
AX25Frame::AX25Frame(const AX25Frame& frame)
: destSSID(frame.destSSID),
- srcSSID(frame.srcSSID),
+ srcSSID(frame.srcSSID),
numRepeaters(frame.numRepeaters),
control(frame.control),
protocolID(frame.protocolID),
diff --git a/src/protocols/AX25/AX25.h b/src/protocols/AX25/AX25.h
index 134995461..bc2fa7a55 100644
--- a/src/protocols/AX25/AX25.h
+++ b/src/protocols/AX25/AX25.h
@@ -250,7 +250,7 @@ class AX25Client {
\param ax25 AX25Client instance to copy.
*/
AX25Client(const AX25Client& ax25);
-
+
/*!
\brief Overload for assignment operator.
\param ax25 rvalue AX25Client.
diff --git a/src/protocols/BellModem/BellModem.cpp b/src/protocols/BellModem/BellModem.cpp
index a68339377..e6bea8091 100644
--- a/src/protocols/BellModem/BellModem.cpp
+++ b/src/protocols/BellModem/BellModem.cpp
@@ -78,7 +78,7 @@ size_t BellClient::write(uint8_t b) {
}
mod->waitForMicroseconds(start, this->toneLen);
}
-
+
if(this->autoStart) {
phyLayer->standby();
}
diff --git a/src/protocols/BellModem/BellModem.h b/src/protocols/BellModem/BellModem.h
index e65f41179..b31cf4004 100644
--- a/src/protocols/BellModem/BellModem.h
+++ b/src/protocols/BellModem/BellModem.h
@@ -52,9 +52,9 @@ extern const struct BellModem_t Bell202;
\brief Client for Bell modem communication. The public interface is the same as Arduino Serial.
*/
class BellClient: public AFSKClient, public RadioLibPrint {
-
+
public:
-
+
/*!
\brief Whether the modem is replying.
On some modems, the replying station has different tone frequencies.
diff --git a/src/protocols/ExternalRadio/ExternalRadio.cpp b/src/protocols/ExternalRadio/ExternalRadio.cpp
index b597f6f1a..3ad92f510 100644
--- a/src/protocols/ExternalRadio/ExternalRadio.cpp
+++ b/src/protocols/ExternalRadio/ExternalRadio.cpp
@@ -66,6 +66,6 @@ int16_t ExternalRadio::transmitDirect(uint32_t frf) {
this->prevFrf = frf;
this->mod->hal->digitalWrite(this->mod->getGpio(), val);
}
-
+
return(RADIOLIB_ERR_NONE);
-}
\ No newline at end of file
+}
diff --git a/src/protocols/ExternalRadio/ExternalRadio.h b/src/protocols/ExternalRadio/ExternalRadio.h
index 86befabcb..1d6acadab 100644
--- a/src/protocols/ExternalRadio/ExternalRadio.h
+++ b/src/protocols/ExternalRadio/ExternalRadio.h
@@ -19,7 +19,7 @@ class ExternalRadio: public PhysicalLayer {
*/
ExternalRadio(uint32_t pin = RADIOLIB_NC); // cppcheck-suppress noExplicitConstructor
#endif
-
+
/*!
\brief Default constructor.
\param hal Pointer to the hardware abstraction layer to use.
@@ -32,7 +32,7 @@ class ExternalRadio: public PhysicalLayer {
\param ext ExternalRadio instance to copy.
*/
ExternalRadio(const ExternalRadio& ext);
-
+
/*!
\brief Overload for assignment operator.
\param ext rvalue ExternalRadio.
@@ -78,10 +78,10 @@ class ExternalRadio: public PhysicalLayer {
\returns \ref status_codes
*/
int16_t transmitDirect(uint32_t frf = 0) override;
-
+
private:
Module* mod;
uint32_t prevFrf;
};
-#endif
\ No newline at end of file
+#endif
diff --git a/src/protocols/LoRaWAN/LoRaWAN.cpp b/src/protocols/LoRaWAN/LoRaWAN.cpp
index e2cf3ee0d..ec8247ac9 100644
--- a/src/protocols/LoRaWAN/LoRaWAN.cpp
+++ b/src/protocols/LoRaWAN/LoRaWAN.cpp
@@ -19,7 +19,7 @@ LoRaWANNode::LoRaWANNode(PhysicalLayer* phy, const LoRaWANBand_t* band, uint8_t
#if defined(RADIOLIB_BUILD_ARDUINO)
int16_t LoRaWANNode::sendReceive(const String& strUp, uint8_t fPort, String& strDown, bool isConfirmed, LoRaWANEvent_t* eventUp, LoRaWANEvent_t* eventDown) {
int16_t state = RADIOLIB_ERR_UNKNOWN;
-
+
const char* dataUp = strUp.c_str();
// build a temporary buffer
@@ -46,7 +46,7 @@ int16_t LoRaWANNode::sendReceive(const char* strUp, uint8_t fPort, bool isConfir
// LoRaWAN downlinks can have 250 bytes at most with 1 extra byte for NULL
size_t lenDown = 0;
uint8_t dataDown[RADIOLIB_LORAWAN_MAX_DOWNLINK_SIZE + 1];
-
+
return(this->sendReceive(reinterpret_cast(const_cast(strUp)), strlen(strUp), fPort, dataDown, &lenDown, isConfirmed, eventUp, eventDown));
}
@@ -68,7 +68,7 @@ int16_t LoRaWANNode::sendReceive(const uint8_t* dataUp, size_t lenUp, uint8_t fP
return(RADIOLIB_ERR_NULL_POINTER);
}
int16_t state = RADIOLIB_ERR_UNKNOWN;
-
+
// if after (at) ADR_ACK_LIMIT frames no RekeyConf was received, revert to Join state
if(this->fCntUp == (1UL << this->adrLimitExp)) {
state = this->getMacPayload(RADIOLIB_LORAWAN_MAC_REKEY, this->fOptsUp, this->fOptsUpLen, NULL, RADIOLIB_LORAWAN_UPLINK);
@@ -117,7 +117,7 @@ int16_t LoRaWANNode::sendReceive(const uint8_t* dataUp, size_t lenUp, uint8_t fP
memcpy(frmPayload, dataUp, lenUp);
frmLen = lenUp;
}
-
+
// build the encrypted uplink message
this->composeUplink(frmPayload, frmLen, uplinkMsg, fPort, isConfirmed);
@@ -146,10 +146,10 @@ int16_t LoRaWANNode::sendReceive(const uint8_t* dataUp, size_t lenUp, uint8_t fP
// if CSMA is enabled, repeat channel selection & encryption up to numHops times
} while(this->csmaEnabled && numHops-- > 0 && !this->csmaChannelClear(this->difsSlots, numBackoff));
-
+
// send it (without the MIC calculation blocks)
state = this->transmitUplink(&this->channels[RADIOLIB_LORAWAN_UPLINK],
- &uplinkMsg[RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS],
+ &uplinkMsg[RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS],
(uint8_t)(uplinkMsgLen - RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS),
trans > 0);
if(state != RADIOLIB_ERR_NONE) {
@@ -170,7 +170,7 @@ int16_t LoRaWANNode::sendReceive(const uint8_t* dataUp, size_t lenUp, uint8_t fP
// RETRANSMIT_TIMEOUT is 2s +/- 1s (RP v1.0.4)
// must be present after any confirmed frame, so we force this here
if(isConfirmed) {
- this->sleepDelay(this->phyLayer->random(RADIOLIB_LORAWAN_RETRANSMIT_TIMEOUT_MIN_MS,
+ this->sleepDelay(this->phyLayer->random(RADIOLIB_LORAWAN_RETRANSMIT_TIMEOUT_MIN_MS,
RADIOLIB_LORAWAN_RETRANSMIT_TIMEOUT_MAX_MS));
}
@@ -232,7 +232,7 @@ int16_t LoRaWANNode::sendReceive(const uint8_t* dataUp, size_t lenUp, uint8_t fP
// a downlink was received, so we can clear the whole MAC uplink buffer
memset(this->fOptsUp, 0, RADIOLIB_LORAWAN_FHDR_FOPTS_MAX_LEN);
this->fOptsUpLen = 0;
-
+
state = this->parseDownlink(dataDown, lenDown, rxWindow, eventDown);
RADIOLIB_ASSERT(state);
@@ -240,7 +240,7 @@ int16_t LoRaWANNode::sendReceive(const uint8_t* dataUp, size_t lenUp, uint8_t fP
if(this->lwClass == RADIOLIB_LORAWAN_CLASS_C) {
this->receiveClassC();
}
-
+
// return Rx window (which is > 0)
return(rxWindow);
}
@@ -359,7 +359,7 @@ void LoRaWANNode::createSession(uint16_t lwMode, uint8_t initialDr) {
// on dynamic bands, the first OTAA uplink (JoinRequest) can be any available datarate
// this is also true for ABP on both dynamic and fixed bands, as there is no JoinRequest
if(initialDr != RADIOLIB_LORAWAN_DATA_RATE_UNUSED) {
- uint8_t i = 0;
+ uint8_t i = 0;
for(; i < RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS; i++) {
if(this->channelPlan[RADIOLIB_LORAWAN_UPLINK][i].enabled) {
if(initialDr >= this->channelPlan[RADIOLIB_LORAWAN_UPLINK][i].drMin
@@ -375,7 +375,7 @@ void LoRaWANNode::createSession(uint16_t lwMode, uint8_t initialDr) {
initialDr = RADIOLIB_LORAWAN_DATA_RATE_UNUSED;
}
}
-
+
// if there is no (channel that allowed the) user-specified datarate, use a default datarate
if(initialDr == RADIOLIB_LORAWAN_DATA_RATE_UNUSED) {
// use the specified datarate from the first channel (this is always defined)
@@ -486,7 +486,7 @@ uint8_t* LoRaWANNode::getBufferSession() {
// generate the signature of the Session buffer, and store it in the last two bytes of the Session buffer
uint16_t signature = LoRaWANNode::checkSum16(this->bufferSession, RADIOLIB_LORAWAN_SESSION_BUF_SIZE - 2);
LoRaWANNode::hton(&this->bufferSession[RADIOLIB_LORAWAN_SESSION_SIGNATURE], signature);
-
+
return(this->bufferSession);
}
@@ -534,7 +534,7 @@ int16_t LoRaWANNode::setBufferSession(const uint8_t* persistentBuffer) {
this->confFCntDown = LoRaWANNode::ntoh(&this->bufferSession[RADIOLIB_LORAWAN_SESSION_CONF_FCNT_DOWN]);
this->adrFCnt = LoRaWANNode::ntoh(&this->bufferSession[RADIOLIB_LORAWAN_SESSION_ADR_FCNT]);
this->fCntUp = LoRaWANNode::ntoh(&this->bufferSession[RADIOLIB_LORAWAN_SESSION_FCNT_UP]);
-
+
// restore the complete MAC state
uint8_t cOcts[14] = { 0 }; // TODO explain
@@ -584,7 +584,7 @@ int16_t LoRaWANNode::setBufferSession(const uint8_t* persistentBuffer) {
(void)execMacCommand(cid, cOcts, cLen);
const uint8_t cids[6] = {
- RADIOLIB_LORAWAN_MAC_DUTY_CYCLE, RADIOLIB_LORAWAN_MAC_RX_PARAM_SETUP,
+ RADIOLIB_LORAWAN_MAC_DUTY_CYCLE, RADIOLIB_LORAWAN_MAC_RX_PARAM_SETUP,
RADIOLIB_LORAWAN_MAC_RX_TIMING_SETUP, RADIOLIB_LORAWAN_MAC_TX_PARAM_SETUP,
RADIOLIB_LORAWAN_MAC_ADR_PARAM_SETUP, RADIOLIB_LORAWAN_MAC_REJOIN_PARAM_SETUP
};
@@ -681,7 +681,7 @@ int16_t LoRaWANNode::beginABP(uint32_t addr, const uint8_t* fNwkSIntKey, const u
void LoRaWANNode::composeJoinRequest(uint8_t* out) {
// copy devNonce currently in use
uint16_t devNonceUsed = this->devNonce;
-
+
// set the packet fields
out[0] = RADIOLIB_LORAWAN_MHDR_MTYPE_JOIN_REQUEST | RADIOLIB_LORAWAN_MHDR_MAJOR_R1;
LoRaWANNode::hton(&out[RADIOLIB_LORAWAN_JOIN_REQUEST_JOIN_EUI_POS], this->joinEUI);
@@ -741,7 +741,7 @@ int16_t LoRaWANNode::processJoinAccept(LoRaWANJoinEvent_t *joinEvent) {
// get current joinNonce from downlink
uint32_t joinNonceNew = LoRaWANNode::ntoh(&joinAcceptMsg[RADIOLIB_LORAWAN_JOIN_ACCEPT_JOIN_NONCE_POS], 3);
-
+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("JoinAccept (JoinNonce = %lu, previously %lu):", (unsigned long)joinNonceNew, (unsigned long)this->joinNonce);
RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(joinAcceptMsg, lenRx);
@@ -781,11 +781,11 @@ int16_t LoRaWANNode::processJoinAccept(LoRaWANJoinEvent_t *joinEvent) {
LoRaWANNode::hton(&micBuff[1], this->joinEUI);
LoRaWANNode::hton(&micBuff[9], this->devNonce - 1);
memcpy(&micBuff[11], joinAcceptMsg, lenRx);
-
+
if(!verifyMIC(micBuff, lenRx + 11, this->jSIntKey)) {
return(RADIOLIB_ERR_MIC_MISMATCH);
}
-
+
} else {
// 1.0 version
if(!verifyMIC(joinAcceptMsg, lenRx, this->appKey)) {
@@ -793,7 +793,7 @@ int16_t LoRaWANNode::processJoinAccept(LoRaWANJoinEvent_t *joinEvent) {
}
}
-
+
// in case of dynamic band, reset the channels to clear JoinRequest-specific channels
if(this->band->bandType == RADIOLIB_LORAWAN_BAND_DYNAMIC) {
this->selectChannelPlanDyn();
@@ -815,7 +815,7 @@ int16_t LoRaWANNode::processJoinAccept(LoRaWANJoinEvent_t *joinEvent) {
// process CFlist if present (and if CFListType matches used band type)
if(lenRx == RADIOLIB_LORAWAN_JOIN_ACCEPT_MAX_LEN && joinAcceptMsg[RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_TYPE_POS] == this->band->bandType) {
this->processCFList(&joinAcceptMsg[RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_POS]);
- }
+ }
// if no (valid) CFList was received, default or subband are already setup so don't need to do anything else
uint8_t keyDerivationBuff[RADIOLIB_AES128_BLOCK_SIZE] = { 0 };
@@ -857,7 +857,7 @@ int16_t LoRaWANNode::processJoinAccept(LoRaWANJoinEvent_t *joinEvent) {
memcpy(this->sNwkSIntKey, this->fNwkSIntKey, RADIOLIB_AES128_KEY_SIZE);
memcpy(this->nwkSEncKey, this->fNwkSIntKey, RADIOLIB_AES128_KEY_SIZE);
-
+
}
// for LW v1.1, send the RekeyInd MAC command
@@ -930,12 +930,12 @@ int16_t LoRaWANNode::activateOTAA(uint8_t joinDr, LoRaWANJoinEvent_t *joinEvent)
// select a random pair of Tx/Rx channels
int16_t state = this->selectChannels();
RADIOLIB_ASSERT(state);
-
+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("JoinRequest (DevNonce = %d):", this->devNonce);
RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(joinRequestMsg, RADIOLIB_LORAWAN_JOIN_REQUEST_LEN);
- state = this->transmitUplink(&this->channels[RADIOLIB_LORAWAN_UPLINK],
- joinRequestMsg,
+ state = this->transmitUplink(&this->channels[RADIOLIB_LORAWAN_UPLINK],
+ joinRequestMsg,
RADIOLIB_LORAWAN_JOIN_REQUEST_LEN);
RADIOLIB_ASSERT(state);
@@ -992,7 +992,7 @@ int16_t LoRaWANNode::activateABP(uint8_t initialDr) {
memcpy(&this->bufferSession[RADIOLIB_LORAWAN_SESSION_NWK_SENC_KEY], this->nwkSEncKey, RADIOLIB_AES128_BLOCK_SIZE);
memcpy(&this->bufferSession[RADIOLIB_LORAWAN_SESSION_FNWK_SINT_KEY], this->fNwkSIntKey, RADIOLIB_AES128_BLOCK_SIZE);
memcpy(&this->bufferSession[RADIOLIB_LORAWAN_SESSION_SNWK_SINT_KEY], this->sNwkSIntKey, RADIOLIB_AES128_BLOCK_SIZE);
-
+
// store network parameters
LoRaWANNode::hton(&this->bufferSession[RADIOLIB_LORAWAN_SESSION_HOMENET_ID], this->homeNetId);
LoRaWANNode::hton(&this->bufferSession[RADIOLIB_LORAWAN_SESSION_VERSION], this->rev);
@@ -1004,7 +1004,7 @@ int16_t LoRaWANNode::activateABP(uint8_t initialDr) {
void LoRaWANNode::processCFList(const uint8_t* cfList) {
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Processing CFList");
-
+
uint8_t cOcts[14] = { 0 }; // TODO explain
uint8_t cid;
uint8_t cLen = 0;
@@ -1209,7 +1209,7 @@ void LoRaWANNode::adrBackoff() {
return;
}
- // if we hit the Limit + Delay, try one of three, in order:
+ // if we hit the Limit + Delay, try one of three, in order:
// set TxPower to max, set DR to min, enable all default channels
// if the TxPower field has some offset, remove it and switch to maximum power
@@ -1230,7 +1230,7 @@ void LoRaWANNode::adrBackoff() {
return;
}
// if there is a dwell time limit, check if this datarate allows an empty uplink
- if(this->phyLayer->getTimeOnAir(13) / 1000 <= this->dwellTimeUp) {
+ if(this->phyLayer->getTimeOnAir(13) / 1000 <= this->dwellTimeUp) {
return;
}
// if the Time on Air of an empty uplink exceeded the dwell time, revert
@@ -1248,7 +1248,7 @@ void LoRaWANNode::adrBackoff() {
}
} else {
// in a fixed band, all channels must be enabled
- // officially, this should be subband = 0, but so far,
+ // officially, this should be subband = 0, but so far,
// reverting to the used subband seems a sensible solution
this->selectChannelPlanFix();
}
@@ -1264,7 +1264,7 @@ void LoRaWANNode::adrBackoff() {
return;
}
// if there is a dwell time limit, check if this datarate allows an empty uplink
- if(this->phyLayer->getTimeOnAir(13) / 1000 <= this->dwellTimeUp) {
+ if(this->phyLayer->getTimeOnAir(13) / 1000 <= this->dwellTimeUp) {
return;
}
// if the Time on Air of an empty uplink exceeded the dwell time, revert
@@ -1294,11 +1294,11 @@ void LoRaWANNode::composeUplink(const uint8_t* in, uint8_t lenIn, uint8_t* out,
out[RADIOLIB_LORAWAN_FHDR_FCTRL_POS] = 0x00;
if(this->adrEnabled) {
out[RADIOLIB_LORAWAN_FHDR_FCTRL_POS] |= RADIOLIB_LORAWAN_FCTRL_ADR_ENABLED;
-
+
// AdrAckReq is set if no downlink has been received for >=Limit uplinks
uint32_t adrLimit = 0x01 << this->adrLimitExp;
if(this->rev == 1) {
- // AdrAckReq is unset once backoff has been completed
+ // AdrAckReq is unset once backoff has been completed
// (which is internally denoted by adrFCnt == FCNT_NONE)
if(this->adrFCnt != RADIOLIB_LORAWAN_FCNT_NONE && (this->fCntUp - this->adrFCnt) >= adrLimit) {
out[RADIOLIB_LORAWAN_FHDR_FCTRL_POS] |= RADIOLIB_LORAWAN_FCTRL_ADR_ACK_REQ;
@@ -1310,7 +1310,7 @@ void LoRaWANNode::composeUplink(const uint8_t* in, uint8_t lenIn, uint8_t* out,
}
}
}
-
+
// check if we have some MAC commands to append
out[RADIOLIB_LORAWAN_FHDR_FCTRL_POS] |= this->fOptsUpLen;
@@ -1332,7 +1332,7 @@ void LoRaWANNode::composeUplink(const uint8_t* in, uint8_t lenIn, uint8_t* out,
// in LoRaWAN v1.0.x, the FOpts are unencrypted
memcpy(&out[RADIOLIB_LORAWAN_FHDR_FOPTS_POS], this->fOptsUp, this->fOptsUpLen);
}
-
+
}
// set the fPort
@@ -1364,7 +1364,7 @@ void LoRaWANNode::micUplink(uint8_t* inOut, size_t lenInOut) {
}
block1[RADIOLIB_LORAWAN_MIC_DATA_RATE_POS] = this->channels[RADIOLIB_LORAWAN_UPLINK].dr;
block1[RADIOLIB_LORAWAN_MIC_CH_INDEX_POS] = this->channels[RADIOLIB_LORAWAN_UPLINK].idx;
-
+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Uplink (FCntUp = %lu) decoded:", (unsigned long)this->fCntUp);
RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(inOut, lenInOut);
@@ -1403,7 +1403,7 @@ int16_t LoRaWANNode::transmitUplink(const LoRaWANChannel_t* chnl, uint8_t* in, u
// set the physical layer configuration for uplink
state = this->setPhyProperties(chnl,
- RADIOLIB_LORAWAN_UPLINK,
+ RADIOLIB_LORAWAN_UPLINK,
this->txPowerMax - 2*this->txPowerSteps);
RADIOLIB_ASSERT(state);
@@ -1423,7 +1423,7 @@ int16_t LoRaWANNode::transmitUplink(const LoRaWANChannel_t* chnl, uint8_t* in, u
modeCfg.transmit.addr = 0;
state = this->phyLayer->stageMode(RADIOLIB_RADIO_MODE_TX, &modeCfg);
RADIOLIB_ASSERT(state);
-
+
// if requested, wait until transmitting uplink
tNow = mod->hal->millis();
if(this->tUplink > tNow + this->launchDuration) {
@@ -1534,10 +1534,10 @@ int16_t LoRaWANNode::receiveClassA(uint8_t dir, const LoRaWANChannel_t* dlChanne
RadioLibTime_t tOpen = mod->hal->millis();
RADIOLIB_ASSERT(state);
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Opened Rx%d window (%d ms timeout)... <-- Rx Delay end ", window, (int)(timeoutHost / 1000 + 2));
-
+
// sleep for the duration of the padded Rx window
this->sleepDelay(timeoutHost / 1000);
-
+
// wait for the DIO interrupt to fire (RxDone or RxTimeout)
// use a small additional delay in case the RxTimeout interrupt is slow to fire
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Closing Rx%d window", window);
@@ -1557,8 +1557,8 @@ int16_t LoRaWANNode::receiveClassA(uint8_t dir, const LoRaWANChannel_t* dlChanne
this->phyLayer->standby();
return(0); // no downlink
}
-
- // if the IRQ bit for RxTimeout is not set, something is being received,
+
+ // if the IRQ bit for RxTimeout is not set, something is being received,
// so keep listening for maximum ToA waiting for the DIO to fire
while(!downlinkAction && mod->hal->millis() - tOpen < tMax + this->scanGuard) {
mod->hal->yield();
@@ -1580,8 +1580,8 @@ int16_t LoRaWANNode::receiveClassA(uint8_t dir, const LoRaWANChannel_t* dlChanne
}
downlinkAction = false;
- // Any frame received by an end-device containing a MACPayload greater than
- // the specified maximum length M over the data rate used to receive the frame
+ // Any frame received by an end-device containing a MACPayload greater than
+ // the specified maximum length M over the data rate used to receive the frame
// SHALL be silently discarded.
if(this->phyLayer->getPacketLength() > (size_t)(maxPayLen + 13)) { // mandatory FHDR is 12/13 bytes
return(0); // act as if no downlink was received
@@ -1597,7 +1597,7 @@ int16_t LoRaWANNode::receiveClassC(RadioLibTime_t timeout) {
return(RADIOLIB_ERR_NONE);
}
Module* mod = this->phyLayer->getMod();
-
+
RadioLibTime_t tStart = mod->hal->millis();
// set the physical layer configuration for Class C window
@@ -1607,7 +1607,7 @@ int16_t LoRaWANNode::receiveClassC(RadioLibTime_t timeout) {
// setup interrupt
this->phyLayer->setPacketReceivedAction(LoRaWANNodeOnDownlinkAction);
downlinkAction = false;
-
+
// configure radio
RadioModeConfig_t modeCfg;
if(timeout) {
@@ -1665,8 +1665,8 @@ int16_t LoRaWANNode::receiveClassC(RadioLibTime_t timeout) {
}
downlinkAction = false;
- // Any frame received by an end-device containing a MACPayload greater than
- // the specified maximum length M over the data rate used to receive the frame
+ // Any frame received by an end-device containing a MACPayload greater than
+ // the specified maximum length M over the data rate used to receive the frame
// SHALL be silently discarded.
uint8_t maxPayLen = this->band->payloadLenMax[this->channels[RADIOLIB_LORAWAN_RX_BC].dr];
if(this->TS011) {
@@ -1693,13 +1693,13 @@ int16_t LoRaWANNode::receiveDownlink() {
RADIOLIB_ASSERT(state);
// open Rx1 window
- state = this->receiveClassA(RADIOLIB_LORAWAN_DOWNLINK,
- &this->channels[RADIOLIB_LORAWAN_RX1],
- RADIOLIB_LORAWAN_RX1,
- this->rxDelays[RADIOLIB_LORAWAN_RX1],
+ state = this->receiveClassA(RADIOLIB_LORAWAN_DOWNLINK,
+ &this->channels[RADIOLIB_LORAWAN_RX1],
+ RADIOLIB_LORAWAN_RX1,
+ this->rxDelays[RADIOLIB_LORAWAN_RX1],
this->rxDelayStart);
RADIOLIB_ASSERT(state);
-
+
// for LoRaWAN v1.1 Class C, there is no Rx2 window: it keeps RxC open uninterrupted
if(this->lwClass == RADIOLIB_LORAWAN_CLASS_C && this->rev == 1) {
state = this->receiveClassC();
@@ -1713,10 +1713,10 @@ int16_t LoRaWANNode::receiveDownlink() {
RADIOLIB_ASSERT(state);
// open Rx2 window
- state = this->receiveClassA(RADIOLIB_LORAWAN_DOWNLINK,
- &this->channels[RADIOLIB_LORAWAN_RX2],
- RADIOLIB_LORAWAN_RX2,
- this->rxDelays[RADIOLIB_LORAWAN_RX2],
+ state = this->receiveClassA(RADIOLIB_LORAWAN_DOWNLINK,
+ &this->channels[RADIOLIB_LORAWAN_RX2],
+ RADIOLIB_LORAWAN_RX2,
+ this->rxDelays[RADIOLIB_LORAWAN_RX2],
this->rxDelayStart);
RADIOLIB_ASSERT(state);
@@ -1726,7 +1726,7 @@ int16_t LoRaWANNode::receiveDownlink() {
int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, LoRaWANEvent_t* event) {
int16_t state = RADIOLIB_ERR_UNKNOWN;
-
+
// set user-data length to 0 to prevent undefined behaviour in case of bad use
// if there is user-data, this will be handled at the appropriate place
*len = 0;
@@ -1756,7 +1756,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
if(state == RADIOLIB_ERR_LORA_HEADER_DAMAGED) {
state = RADIOLIB_ERR_NONE;
}
-
+
if(state != RADIOLIB_ERR_NONE) {
#if !RADIOLIB_STATIC_ONLY
delete[] downlinkMsg;
@@ -1771,7 +1771,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
expectedAddr = this->mcAddr;
}
if(addr != expectedAddr) {
- RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Device address mismatch, expected 0x%08lX, got 0x%08lX",
+ RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Device address mismatch, expected 0x%08lX, got 0x%08lX",
(unsigned long)expectedAddr, (unsigned long)addr);
#if !RADIOLIB_STATIC_ONLY
delete[] downlinkMsg;
@@ -1802,7 +1802,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
case RADIOLIB_LORAWAN_FPORT_MAC_COMMAND: {
// payload consists of all MAC commands (or is empty)
- // LoRaWAN v1.0.4 only: A Class B/C downlink SHALL NOT transport any MAC command.
+ // LoRaWAN v1.0.4 only: A Class B/C downlink SHALL NOT transport any MAC command.
// (...) it SHALL silently discard the entire frame.
// However, we also enforce this for LoRaWAN v1.1 (TTS does not allow this anyway).
if(window == RADIOLIB_LORAWAN_RX_BC) {
@@ -1850,7 +1850,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
}
- // MAC commands SHALL NOT be present in the payload field and the frame options field simultaneously.
+ // MAC commands SHALL NOT be present in the payload field and the frame options field simultaneously.
// Should this occur, the end-device SHALL silently discard the frame.
if(fOptsPbLen > 0 && payLen > 0 && fPort == RADIOLIB_LORAWAN_FPORT_MAC_COMMAND) {
#if !RADIOLIB_STATIC_ONLY
@@ -1859,7 +1859,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
return(RADIOLIB_ERR_DOWNLINK_MALFORMED);
}
- // LoRaWAN v1.0.4 only: A Class B/C downlink SHALL NOT transport any MAC command.
+ // LoRaWAN v1.0.4 only: A Class B/C downlink SHALL NOT transport any MAC command.
// (...) it SHALL silently discard the entire frame.
// However, we also enforce this for LoRaWAN v1.1 (TTS does not allow this anyway).
if(fOptsPbLen > 0 && window == RADIOLIB_LORAWAN_RX_BC) {
@@ -1868,7 +1868,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
#endif
return(RADIOLIB_ERR_DOWNLINK_MALFORMED);
}
-
+
// get the frame counter
uint16_t payFCnt16 = LoRaWANNode::ntoh(&downlinkMsg[RADIOLIB_LORAWAN_FHDR_FCNT_POS]);
@@ -1892,7 +1892,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("FCnt rejected: %d -> %d", devFCnt16, payFCnt16);
return(RADIOLIB_ERR_DOWNLINK_FCNT_INVALID);
}
-
+
// assume a rollover if the FCnt16 in the payload is smaller than the previous FCnt16 known by device
// (MAX_FCNT_GAP is deprecated for 1.0.4 / 1.1, TTS and CS both apply a 16-bit rollover)
if(payFCnt16 < devFCnt16) {
@@ -1943,7 +1943,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
#endif
return(RADIOLIB_ERR_MIC_MISMATCH);
}
-
+
// save current FCnt to respective frame counter
if(this->multicast && window == RADIOLIB_LORAWAN_RX_BC) {
// multicast: McApp downlink
@@ -1957,9 +1957,9 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
}
}
- RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Downlink (%sFCntDown = %lu) encoded:",
+ RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Downlink (%sFCntDown = %lu) encoded:",
(this->multicast && window == RADIOLIB_LORAWAN_RX_BC) ? "M" :
- (isAppDownlink ? "A" : "N"),
+ (isAppDownlink ? "A" : "N"),
(unsigned long)devFCnt32);
RADIOLIB_DEBUG_PROTOCOL_HEXDUMP(downlinkMsg, RADIOLIB_AES128_BLOCK_SIZE + downlinkMsgLen);
@@ -1969,7 +1969,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
this->confFCntDown = this->aFCntDown;
isConfirmedDown = true;
}
-
+
// if this downlink is on FPort 0, the FOptsLen is the length of the payload
// in any other case, the payload (length) is user accessible
uint8_t fOptsLen = fOptsPbLen;
@@ -2004,7 +2004,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
// decrypt the frame payload
processAES(&downlinkMsg[RADIOLIB_LORAWAN_FRAME_PAYLOAD_POS(fOptsPbLen)], payLen, encKey, dest, addr, devFCnt32, RADIOLIB_LORAWAN_DOWNLINK, 0x00, true);
-
+
// pass the event info if requested
if(event) {
event->dir = RADIOLIB_LORAWAN_DOWNLINK;
@@ -2113,7 +2113,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
if(this->rev == 0) {
LoRaWANNode::postprocessMacLinkAdr(&fOptsRe[fOptsReLen], fLen);
- // in LoRaWAN v1.1, just provide one ACK, so no post-processing but cut off reply length
+ // in LoRaWAN v1.1, just provide one ACK, so no post-processing but cut off reply length
} else {
fLenRe = 2;
}
@@ -2141,7 +2141,7 @@ int16_t LoRaWANNode::parseDownlink(uint8_t* data, size_t* len, uint8_t window, L
memcpy(this->fOptsDown, fOpts, fOptsLen);
}
this->fOptsDownLen = fOptsLen;
-
+
// if fOptsLen for the next uplink is larger than can be piggybacked onto an uplink, send separate uplink
if(fOptsReLen > RADIOLIB_LORAWAN_FHDR_FOPTS_MAX_LEN) {
@@ -2241,7 +2241,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
// get the ADR configuration
uint8_t macDrUp = (optIn[0] & 0xF0) >> 4;
uint8_t macTxSteps = optIn[0] & 0x0F;
-
+
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("LinkAdrReq: dataRate = %d, txSteps = %d, nbTrans = %d", macDrUp, macTxSteps, lenIn > 1 ? optIn[13] : 0);
uint8_t chMaskAck = 0;
@@ -2265,7 +2265,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
} else {
chMaskAck = true;
}
-
+
this->setAvailableChannels(0xFFFF);
int16_t state;
@@ -2295,7 +2295,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
} else {
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("ADR: hardware failure configurating datarate %d, code %d", macDrUp, state);
}
-
+
}
// try to apply the power configuration
@@ -2324,7 +2324,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
// if ACK not completely successful, revert and stop
if(optOut[0] != 0x07) {
- // according to paragraph 4.3.1.1, if ADR is disabled,
+ // according to paragraph 4.3.1.1, if ADR is disabled,
// the ADR channel mask must be accepted even if drAck/pwrAck fails.
// therefore, only revert the channel mask if ADR is enabled.
if(this->adrEnabled) {
@@ -2354,7 +2354,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
// for LoRaWAN v1.1, if NbTrans == 0, the end-device SHALL keep the current NbTrans value unchanged
// so, don't do anything
}
-
+
}
// restore original active channels
@@ -2391,14 +2391,14 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
uint8_t macRx1DrOffset = (optIn[0] & 0x70) >> 4;
uint8_t macRx2Dr = optIn[0] & 0x0F;
uint32_t macRx2Freq = LoRaWANNode::ntoh(&optIn[1], 3);
-
+
uint8_t rx1DrOsAck = 0;
uint8_t rx2DrAck = 0;
uint8_t rx2FreqAck = 0;
- RADIOLIB_DEBUG_PROTOCOL_PRINTLN("RXParamSetupReq: Rx1DrOffset = %d, rx2DataRate = %d, freq = %7.3f",
+ RADIOLIB_DEBUG_PROTOCOL_PRINTLN("RXParamSetupReq: Rx1DrOffset = %d, rx2DataRate = %d, freq = %7.3f",
macRx1DrOffset, macRx2Dr, macRx2Freq / 10000.0);
-
+
// check the requested configuration
uint8_t uplinkDr = this->channels[RADIOLIB_LORAWAN_UPLINK].dr;
DataRate_t dr;
@@ -2458,7 +2458,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
uint32_t macFreq = LoRaWANNode::ntoh(&optIn[1], 3);
uint8_t macDrMax = (optIn[4] & 0xF0) >> 4;
uint8_t macDrMin = optIn[4] & 0x0F;
-
+
uint8_t drAck = 0;
uint8_t freqAck = 0;
@@ -2511,7 +2511,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
}
- RADIOLIB_DEBUG_PROTOCOL_PRINTLN("UL: %3d %d %7.3f (%d - %d) | DL: %3d %d %7.3f (%d - %d)",
+ RADIOLIB_DEBUG_PROTOCOL_PRINTLN("UL: %3d %d %7.3f (%d - %d) | DL: %3d %d %7.3f (%d - %d)",
this->channelPlan[RADIOLIB_LORAWAN_UPLINK][macChIndex].idx,
this->channelPlan[RADIOLIB_LORAWAN_UPLINK][macChIndex].enabled,
this->channelPlan[RADIOLIB_LORAWAN_UPLINK][macChIndex].freq / 10000.0,
@@ -2542,14 +2542,14 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("DlChannelReq: index = %d, freq = %7.3f MHz", macChIndex, macFreq / 10000.0);
uint8_t freqDlAck = 0;
uint8_t freqUlAck = 0;
-
+
// check if the frequency is allowed possible
- if(macFreq >= this->band->freqMin && macFreq <= this->band->freqMax) {
+ if(macFreq >= this->band->freqMin && macFreq <= this->band->freqMax) {
if(this->phyLayer->setFrequency(macFreq / 10000.0) == RADIOLIB_ERR_NONE) {
freqDlAck = 1;
}
}
-
+
// check if the corresponding uplink frequency is actually set
if(this->channelPlan[RADIOLIB_LORAWAN_UPLINK][macChIndex].freq > 0) {
freqUlAck = 1;
@@ -2575,7 +2575,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
// get the configuration
uint8_t delay = optIn[0] & 0x0F;
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("RXTimingSetupReq: delay = %d sec", delay);
-
+
// apply the configuration
if(delay == 0) {
delay = 1;
@@ -2621,7 +2621,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("ERROR! Please disable your device and consult supported LoRaWAN versions");
(void)LoRaWANNode::pushMacCommand(cid, &this->rev, this->fOptsUp, &this->fOptsUpLen, RADIOLIB_LORAWAN_UPLINK);
}
-
+
return(false);
} break;
@@ -2683,7 +2683,7 @@ bool LoRaWANNode::execMacCommand(uint8_t cid, uint8_t* optIn, uint8_t lenIn, uin
}
// retrieve pending class from MAC uplink queue
- RADIOLIB_DEBUG_PROTOCOL_PRINTLN("DeviceMode: Switching to LoRaWAN Class %s",
+ RADIOLIB_DEBUG_PROTOCOL_PRINTLN("DeviceMode: Switching to LoRaWAN Class %s",
optIn[0] == RADIOLIB_LORAWAN_CLASS_A ? "A" :
optIn[0] == RADIOLIB_LORAWAN_CLASS_B ? "B" : "C");
@@ -2790,7 +2790,7 @@ void LoRaWANNode::preprocessMacLinkAdr(uint8_t* mPtr, uint8_t cLen, uint8_t* mAd
void LoRaWANNode::postprocessMacLinkAdr(uint8_t* ack, uint8_t cLen) {
uint8_t fLen = 5; // single ADR command is 5 bytes
uint8_t numOpts = cLen / fLen;
-
+
// duplicate the ACK bits of the atomic block response 'numOpts' times
// skip one, as the first response is already there
for(int opt = 1; opt < numOpts; opt++) {
@@ -2857,8 +2857,8 @@ int16_t LoRaWANNode::getMacDeviceTimeAns(uint32_t* gpsEpoch, uint8_t* fraction,
int16_t state = this->getMacPayload(RADIOLIB_LORAWAN_MAC_DEVICE_TIME, this->fOptsDown, fOptsDownLen, payload, RADIOLIB_LORAWAN_DOWNLINK);
RADIOLIB_ASSERT(state);
- if(gpsEpoch) {
- *gpsEpoch = LoRaWANNode::ntoh(&payload[0]);
+ if(gpsEpoch) {
+ *gpsEpoch = LoRaWANNode::ntoh(&payload[0]);
if(returnUnix) {
uint32_t unixOffset = 315964800UL - 18UL; // 18 leap seconds since GPS epoch (Jan. 6th 1980)
*gpsEpoch += unixOffset;
@@ -2876,7 +2876,7 @@ int16_t LoRaWANNode::getMacLen(uint8_t cid, uint8_t* len, uint8_t dir, bool incl
if(inclusive) {
*len += 1; // add one byte for CID
}
-
+
LoRaWANMacCommand_t cmd = RADIOLIB_LORAWAN_MAC_COMMAND_NONE;
int16_t state = this->getMacCommand(cid, &cmd);
RADIOLIB_ASSERT(state);
@@ -2892,7 +2892,7 @@ bool LoRaWANNode::isPersistentMacCommand(uint8_t cid, uint8_t dir) {
// if this MAC command doesn't exist, it wouldn't even get into the queue, so don't care about outcome
LoRaWANMacCommand_t cmd = RADIOLIB_LORAWAN_MAC_COMMAND_NONE;
(void)this->getMacCommand(cid, &cmd);
-
+
// in the uplink direction, MAC payload should persist per spec
if(dir == RADIOLIB_LORAWAN_UPLINK) {
return(cmd.persist);
@@ -2961,7 +2961,7 @@ int16_t LoRaWANNode::deleteMacCommand(uint8_t cid, uint8_t* inOut, uint8_t* lenI
return(RADIOLIB_ERR_INVALID_CID);
}
- // if this is the requested MAC id,
+ // if this is the requested MAC id,
if(id == cid) {
// remove it by moving the rest of the payload forward
memmove(&inOut[i], &inOut[i + fLen], *lenInOut - i - fLen);
@@ -3035,7 +3035,7 @@ int16_t LoRaWANNode::setDatarate(uint8_t drUp) {
if(!(cAck[0] & 0x02)) {
return(RADIOLIB_ERR_INVALID_DATA_RATE);
}
-
+
return(RADIOLIB_ERR_NONE);
}
@@ -3061,7 +3061,7 @@ int16_t LoRaWANNode::setTxPower(int8_t txPower) {
if(!(cAck[0] & 0x04)) {
return(RADIOLIB_ERR_INVALID_OUTPUT_POWER);
}
-
+
return(RADIOLIB_ERR_NONE);
}
@@ -3080,7 +3080,7 @@ int16_t LoRaWANNode::setRx2Dr(uint8_t dr) {
if(this->band->dataRates[dr] == RADIOLIB_LORAWAN_DATA_RATE_UNUSED) {
return(RADIOLIB_ERR_INVALID_DATA_RATE);
}
-
+
// find and check if the datarate is available for this radio module
DataRate_t dataRate;
int16_t state = findDataRate(dr, &dataRate);
@@ -3112,7 +3112,7 @@ void LoRaWANNode::setDutyCycle(bool enable, RadioLibTime_t msPerHour) {
void LoRaWANNode::setDwellTime(bool enable, RadioLibTime_t msPerUplink) {
if(!enable) {
this->dwellTimeUp = 0;
-
+
} else if(msPerUplink > 0) {
this->dwellTimeUp = msPerUplink;
} else { //msPerUplink == 0
@@ -3197,7 +3197,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
}
RADIOLIB_ASSERT(state);
break;
-
+
case(RADIOLIB_LORAWAN_DATA_RATE_FSK):
if(modem != ModemType_t::RADIOLIB_MODEM_FSK) {
state = this->phyLayer->setModem(ModemType_t::RADIOLIB_MODEM_FSK);
@@ -3209,7 +3209,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
state = this->phyLayer->setEncoding(RADIOLIB_ENCODING_WHITENING);
RADIOLIB_ASSERT(state);
break;
-
+
case(RADIOLIB_LORAWAN_DATA_RATE_LR_FHSS):
if(modem != ModemType_t::RADIOLIB_MODEM_LRFHSS) {
state = this->phyLayer->setModem(ModemType_t::RADIOLIB_MODEM_LRFHSS);
@@ -3217,7 +3217,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
}
modem = ModemType_t::RADIOLIB_MODEM_LRFHSS;
break;
-
+
default:
return(RADIOLIB_ERR_UNSUPPORTED);
}
@@ -3226,7 +3226,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("PHY: Frequency = %7.3f MHz, TX = %d dBm", chnl->freq / 10000.0, pwr);
state = this->phyLayer->setFrequency(chnl->freq / 10000.0);
RADIOLIB_ASSERT(state);
-
+
// at this point, assume that Tx power value is already checked, so ignore the return value
// this call is only used to clip a value that is higher than the module supports
(void)this->phyLayer->checkOutputPower(pwr, &pwr);
@@ -3250,7 +3250,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
syncWord[1] = (uint8_t)(RADIOLIB_LORAWAN_GFSK_SYNC_WORD >> 8);
syncWord[2] = (uint8_t)RADIOLIB_LORAWAN_GFSK_SYNC_WORD;
syncWordLen = 3;
- RADIOLIB_DEBUG_PROTOCOL_PRINTLN("FSK: BR = %4.1f, FD = %4.1f kHz",
+ RADIOLIB_DEBUG_PROTOCOL_PRINTLN("FSK: BR = %4.1f, FD = %4.1f kHz",
(double)dr.fsk.bitRate, (double)dr.fsk.freqDev);
} break;
@@ -3258,7 +3258,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
preLen = RADIOLIB_LORAWAN_LORA_PREAMBLE_LEN;
syncWord[0] = RADIOLIB_LORAWAN_LORA_SYNC_WORD;
syncWordLen = 1;
- RADIOLIB_DEBUG_PROTOCOL_PRINTLN("LoRa: SF = %d, BW = %5.1f kHz, CR = 4/%d, IQ: %c",
+ RADIOLIB_DEBUG_PROTOCOL_PRINTLN("LoRa: SF = %d, BW = %5.1f kHz, CR = 4/%d, IQ: %c",
dr.lora.spreadingFactor, (double)dr.lora.bandwidth, dr.lora.codingRate, dir ? 'D' : 'U');
} break;
@@ -3268,7 +3268,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
syncWord[2] = (uint8_t)(RADIOLIB_LORAWAN_LR_FHSS_SYNC_WORD >> 8);
syncWord[3] = (uint8_t)RADIOLIB_LORAWAN_LR_FHSS_SYNC_WORD;
syncWordLen = 4;
- RADIOLIB_DEBUG_PROTOCOL_PRINTLN("LR-FHSS: BW = 0x%02x, CR = 0x%02x kHz, grid = %c",
+ RADIOLIB_DEBUG_PROTOCOL_PRINTLN("LR-FHSS: BW = 0x%02x, CR = 0x%02x kHz, grid = %c",
dr.lrFhss.bw, dr.lrFhss.cr, dr.lrFhss.narrowGrid ? 'N' : 'W');
} break;
@@ -3289,7 +3289,7 @@ int16_t LoRaWANNode::setPhyProperties(const LoRaWANChannel_t* chnl, uint8_t dir,
return(state);
}
-// The following function implements LMAC, a CSMA scheme for LoRa as specified
+// The following function implements LMAC, a CSMA scheme for LoRa as specified
// in the LoRa Alliance Technical Recommendation #13.
bool LoRaWANNode::csmaChannelClear(uint8_t difs, uint8_t numBackoff) {
// DIFS phase: perform #DIFS CAD operations
@@ -3380,7 +3380,7 @@ void LoRaWANNode::getChannelPlanMask(uint64_t* chMaskGrp0123, uint32_t* chMaskGr
void LoRaWANNode::selectChannelPlanDyn() {
RADIOLIB_DEBUG_PROTOCOL_PRINTLN("Setting up dynamic channels");
-
+
size_t num = 0;
// copy the default defined channels into the first slots (where Tx = Rx)
for(; num < 3 && this->band->txFreqs[num].enabled; num++) {
@@ -3426,7 +3426,7 @@ void LoRaWANNode::selectChannelPlanFix() {
// make sure the Rx2 settings are back to this band's default
this->channels[RADIOLIB_LORAWAN_RX2] = this->band->rx2;
this->channels[RADIOLIB_LORAWAN_RX_BC] = this->band->rx2;
-
+
// make all enabled channels available for uplink selection
this->setAvailableChannels(0xFFFF);
}
@@ -3496,11 +3496,11 @@ int16_t LoRaWANNode::selectChannels() {
uint8_t currentDr = this->channels[RADIOLIB_LORAWAN_UPLINK].dr;
this->channels[RADIOLIB_LORAWAN_UPLINK] = this->channelPlan[RADIOLIB_LORAWAN_UPLINK][chIdx];
this->channels[RADIOLIB_LORAWAN_UPLINK].dr = currentDr;
-
+
if(this->band->bandType == RADIOLIB_LORAWAN_BAND_DYNAMIC) {
// for dynamic bands, the downlink channel is the one matched to the uplink channel
this->channels[RADIOLIB_LORAWAN_RX1] = this->channelPlan[RADIOLIB_LORAWAN_DOWNLINK][chIdx];
-
+
} else { // RADIOLIB_LORAWAN_BAND_FIXED
// for fixed bands, the downlink channel is the uplink channel ID `modulo` number of downlink channels
LoRaWANChannel_t channelDn = RADIOLIB_LORAWAN_CHANNEL_NONE;
@@ -3625,7 +3625,7 @@ bool LoRaWANNode::verifyMIC(uint8_t* msg, size_t len, uint8_t* key) {
// calculate the expected value and compare
uint32_t micCalculated = generateMIC(msg, len - sizeof(uint32_t), key);
if(micCalculated != micReceived) {
- RADIOLIB_DEBUG_PROTOCOL_PRINTLN("MIC mismatch, expected %08lx, got %08lx",
+ RADIOLIB_DEBUG_PROTOCOL_PRINTLN("MIC mismatch, expected %08lx, got %08lx",
(unsigned long)micCalculated, (unsigned long)micReceived);
return(false);
}
@@ -3656,7 +3656,7 @@ RadioLibTime_t LoRaWANNode::timeUntilUplink() {
uint8_t LoRaWANNode::getMaxPayloadLen() {
// configure the uplink channel properties
- this->setPhyProperties(&this->channels[RADIOLIB_LORAWAN_UPLINK],
+ this->setPhyProperties(&this->channels[RADIOLIB_LORAWAN_UPLINK],
RADIOLIB_LORAWAN_UPLINK,
this->txPowerMax - 2*this->txPowerSteps);
diff --git a/src/protocols/LoRaWAN/LoRaWAN.h b/src/protocols/LoRaWAN/LoRaWAN.h
index 98ea9d7d7..c8e448eab 100644
--- a/src/protocols/LoRaWAN/LoRaWAN.h
+++ b/src/protocols/LoRaWAN/LoRaWAN.h
@@ -225,16 +225,16 @@
struct LoRaWANMacCommand_t {
/*! \brief Command ID */
const uint8_t cid;
-
+
/*! \brief Uplink message length */
const uint8_t lenDn;
-
+
/*! \brief Downlink message length */
const uint8_t lenUp;
/*! \brief Some commands must be resent until Class A downlink received */
const bool persist;
-
+
/*! \brief Whether this MAC command can be issued by the user or not */
const bool user;
};
@@ -363,7 +363,7 @@ struct LoRaWANChannelSpan_t {
/*! \brief Maximum allowed datarate for all channels in this span (inclusive) */
uint8_t drMax;
-
+
/*! \brief Allowed data rates for a join request message */
uint8_t drJoinRequest;
};
@@ -431,7 +431,7 @@ struct LoRaWANBand_t {
/*! \brief Relay channels for ACK downlink */
LoRaWANChannel_t txAck[2];
-
+
/*! \brief The corresponding datarates, bandwidths and coding rates for DR index */
uint8_t dataRates[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES];
};
@@ -496,10 +496,10 @@ struct LoRaWANJoinEvent_t {
struct LoRaWANEvent_t {
/*! \brief Event direction, one of RADIOLIB_LORAWAN_CHANNEL_DIR_* */
uint8_t dir;
-
+
/*! \brief Whether the event is confirmed or not (e.g., confirmed uplink sent by user application) */
bool confirmed;
-
+
/*! \brief Whether the event is confirming a previous request
(e.g., server downlink reply to confirmed uplink sent by user application)*/
bool confirming;
@@ -509,16 +509,16 @@ struct LoRaWANEvent_t {
/*! \brief Datarate */
uint8_t datarate;
-
+
/*! \brief Frequency in MHz */
float freq;
-
+
/*! \brief Transmit power in dBm for uplink, or RSSI for downlink */
int16_t power;
-
+
/*! \brief The appropriate frame counter - for different events, different frame counters will be reported! */
uint32_t fCnt;
-
+
/*! \brief Port number */
uint8_t fPort;
@@ -590,7 +590,7 @@ class LoRaWANNode {
\param addr Device address.
\param fNwkSIntKey Pointer to the Forwarding network session (LoRaWAN 1.1), NULL for LoRaWAN 1.0.
\param sNwkSIntKey Pointer to the Serving network session (LoRaWAN 1.1), NULL for LoRaWAN 1.0.
- \param nwkSEncKey Pointer to the MAC command network session key [NwkSEncKey] (LoRaWAN 1.1)
+ \param nwkSEncKey Pointer to the MAC command network session key [NwkSEncKey] (LoRaWAN 1.1)
or network session AES-128 key [NwkSKey] (LoRaWAN 1.0).
\param appSKey Pointer to the application session AES-128 key.
\returns \ref status_codes
@@ -599,14 +599,14 @@ class LoRaWANNode {
/*!
\brief Join network by restoring OTAA session or performing over-the-air activation. By this procedure,
- the device will perform an exchange with the network server and set all necessary configuration.
+ the device will perform an exchange with the network server and set all necessary configuration.
\param joinDr The datarate at which to send the join-request and any subsequent uplinks (unless ADR is enabled)
\returns \ref status_codes
*/
virtual int16_t activateOTAA(uint8_t initialDr = RADIOLIB_LORAWAN_DATA_RATE_UNUSED, LoRaWANJoinEvent_t *joinEvent = NULL);
/*!
- \brief Join network by restoring ABP session or performing over-the-air activation.
+ \brief Join network by restoring ABP session or performing over-the-air activation.
In this procedure, all necessary configuration must be provided by the user.
\param initialDr The datarate at which to send the first uplink and any subsequent uplinks (unless ADR is enabled).
\returns \ref status_codes
@@ -722,7 +722,7 @@ class LoRaWANNode {
/*!
\brief Add a MAC command to the uplink queue.
- Only LinkCheck and DeviceTime are available to the user.
+ Only LinkCheck and DeviceTime are available to the user.
Other commands are ignored; duplicate MAC commands are discarded.
\param cid ID of the MAC command
\returns \ref status_codes
@@ -764,7 +764,7 @@ class LoRaWANNode {
*/
int16_t setTxPower(int8_t txPower);
- /*!
+ /*!
\brief Configure the Rx2 datarate for ABP mode.
This should not be needed for LoRaWAN 1.1 as it is configured through the first downlink.
\param dr The datarate to be used for listening for downlinks in Rx2.
@@ -781,7 +781,7 @@ class LoRaWANNode {
/*!
\brief Toggle adherence to dutyCycle limits to on or off.
\param enable Whether to adhere to dutyCycle limits or not (default true).
- \param msPerHour The maximum allowed Time-on-Air per hour in milliseconds
+ \param msPerHour The maximum allowed Time-on-Air per hour in milliseconds
(default 0 = maximum allowed for configured band).
*/
void setDutyCycle(bool enable = true, RadioLibTime_t msPerHour = 0);
@@ -789,7 +789,7 @@ class LoRaWANNode {
/*!
\brief Set or disable uplink dwell time limitation; enabled by default if mandatory.
\param enable Whether to adhere to dwellTime limits or not (default true).
- \param msPerUplink The maximum allowed Time-on-Air per uplink in milliseconds
+ \param msPerUplink The maximum allowed Time-on-Air per uplink in milliseconds
(default 0 = band default value); make sure you follow regulations/law!
*/
void setDwellTime(bool enable, RadioLibTime_t msPerUplink = 0);
@@ -819,25 +819,25 @@ class LoRaWANNode {
*/
void scheduleTransmission(RadioLibTime_t tUplink);
- /*!
- \brief Returns the last uplink's frame counter;
- also 0 if no uplink occured yet.
+ /*!
+ \brief Returns the last uplink's frame counter;
+ also 0 if no uplink occured yet.
*/
uint32_t getFCntUp();
- /*!
- \brief Returns the last network downlink's frame counter;
- also 0 if no network downlink occured yet.
+ /*!
+ \brief Returns the last network downlink's frame counter;
+ also 0 if no network downlink occured yet.
*/
uint32_t getNFCntDown();
- /*!
- \brief Returns the last application downlink's frame counter;
- also 0 if no application downlink occured yet.
+ /*!
+ \brief Returns the last application downlink's frame counter;
+ also 0 if no application downlink occured yet.
*/
uint32_t getAFCntDown();
- /*!
+ /*!
\brief Reset the downlink frame counters (application and network)
This is unsafe and can possibly allow replay attacks using downlinks.
It mainly exists as part of the TS009 Specification Verification protocol.
@@ -868,7 +868,7 @@ class LoRaWANNode {
/*! \brief Returns time in milliseconds until next uplink is available under dutyCycle limits */
RadioLibTime_t timeUntilUplink();
- /*!
+ /*!
\brief Returns the maximum allowed uplink payload size given the current MAC state.
Most importantly, this includes dwell time limitations and ADR.
*/
@@ -877,16 +877,16 @@ class LoRaWANNode {
/*! \brief Callback to a user-provided sleep function. */
typedef void (*SleepCb_t)(RadioLibTime_t ms);
- /*!
+ /*!
\brief Set custom delay/sleep function callback. If set, LoRaWAN node will call
this function to wait for periods of time longer than RADIOLIB_LORAWAN_DELAY_SLEEP_THRESHOLD.
This can be used to lower the power consumption by putting the host microcontroller to sleep.
NOTE: Since this method will call a user-provided function, it is up to the user to ensure
that the time duration spent in that sleep function is accurate to at least 1 ms!
*/
- void setSleepFunction(SleepCb_t cb);
+ void setSleepFunction(SleepCb_t cb);
- /*!
+ /*!
\brief TS009 Protocol Specification Verification switch
(allows FPort 224 and cuts off uplink payload instead of rejecting if maximum length exceeded).
*/
@@ -942,7 +942,7 @@ class LoRaWANNode {
uint8_t jSIntKey[RADIOLIB_AES128_KEY_SIZE] = { 0 };
uint16_t keyCheckSum = 0;
-
+
// device-specific parameters, persistent through sessions
uint16_t devNonce = 0;
uint32_t joinNonce = 0;
@@ -991,9 +991,9 @@ class LoRaWANNode {
// number of backoff slots to be checked after DIFS phase.
// A random BO avoids collisions in the case where two or more nodes start the CSMA
- // process at the same time.
+ // process at the same time.
uint8_t backoffMax = RADIOLIB_LORAWAN_BACKOFF_MAX_DEFAULT;
-
+
// number of CADs to estimate a clear channel
uint8_t difsSlots = RADIOLIB_LORAWAN_DIFS_DEFAULT;
@@ -1054,7 +1054,7 @@ class LoRaWANNode {
// check whether payload length and fport are allowed
int16_t isValidUplink(size_t len, uint8_t fPort);
-
+
// perform ADR backoff
void adrBackoff();
@@ -1134,7 +1134,7 @@ class LoRaWANNode {
// setup uplink/downlink channel data rates and frequencies
// for dynamic channels, there is a small set of predefined channels
- // in case of JoinRequest, add some optional extra frequencies
+ // in case of JoinRequest, add some optional extra frequencies
void selectChannelPlanDyn();
// setup uplink/downlink channel data rates and frequencies
diff --git a/src/protocols/LoRaWAN/LoRaWANBands.cpp b/src/protocols/LoRaWAN/LoRaWANBands.cpp
index 2c3370f2e..527befb75 100644
--- a/src/protocols/LoRaWAN/LoRaWANBands.cpp
+++ b/src/protocols/LoRaWAN/LoRaWANBands.cpp
@@ -127,7 +127,7 @@ const LoRaWANBand_t US915 = {
.freqStep = 6000,
.drMin = 8,
.drMax = 13,
- .drJoinRequest = RADIOLIB_LORAWAN_DATA_RATE_UNUSED
+ .drJoinRequest = RADIOLIB_LORAWAN_DATA_RATE_UNUSED
},
.rx1DrTable = {
{ 10, 9, 8, 8, 0xFF, 0xFF, 0xFF, 0xFF },
@@ -284,7 +284,7 @@ const LoRaWANBand_t AU915 = {
.freqStep = 6000,
.drMin = 8,
.drMax = 13,
- .drJoinRequest = RADIOLIB_LORAWAN_DATA_RATE_UNUSED
+ .drJoinRequest = RADIOLIB_LORAWAN_DATA_RATE_UNUSED
},
.rx1DrTable = {
{ 8, 8, 8, 8, 8, 8, 0xFF, 0xFF },
@@ -366,7 +366,7 @@ const LoRaWANBand_t CN470 = {
.freqStep = 2000,
.drMin = 0,
.drMax = 5,
- .drJoinRequest = RADIOLIB_LORAWAN_DATA_RATE_UNUSED
+ .drJoinRequest = RADIOLIB_LORAWAN_DATA_RATE_UNUSED
},
.rx1DrTable = {
{ 0, 0, 0, 0, 0, 0, 0xFF, 0xFF },
diff --git a/src/protocols/Pager/Pager.cpp b/src/protocols/Pager/Pager.cpp
index e4615a513..98dc63bb2 100644
--- a/src/protocols/Pager/Pager.cpp
+++ b/src/protocols/Pager/Pager.cpp
@@ -479,7 +479,7 @@ bool PagerClient::addressMatched(uint32_t addr) {
if(filterNumAddresses == 0) {
return((addr & filterMask) == (filterAddr & filterMask));
}
-
+
// multiple addresses, check there are some to match
if((filterAddresses == NULL) || (filterMasks == NULL)) {
return(false);
diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.cpp b/src/protocols/PhysicalLayer/PhysicalLayer.cpp
index e698092c1..cedd8d8f4 100644
--- a/src/protocols/PhysicalLayer/PhysicalLayer.cpp
+++ b/src/protocols/PhysicalLayer/PhysicalLayer.cpp
@@ -314,7 +314,7 @@ RadioLibTime_t PhysicalLayer::getTimeOnAir(size_t len) {
RadioLibTime_t PhysicalLayer::calculateRxTimeout(RadioLibTime_t timeoutUs) {
(void)timeoutUs;
- return(0);
+ return(0);
}
uint32_t PhysicalLayer::getIrqMapped(RadioLibIrqFlags_t irq) {
@@ -333,7 +333,7 @@ int16_t PhysicalLayer::checkIrq(RadioLibIrqType_t irq) {
if((irq > RADIOLIB_IRQ_TIMEOUT) || (this->irqMap[irq] == RADIOLIB_IRQ_NOT_SUPPORTED)) {
return(RADIOLIB_ERR_UNSUPPORTED);
}
-
+
return(getIrqFlags() & this->irqMap[irq]);
}
@@ -360,12 +360,12 @@ int16_t PhysicalLayer::clearIrqFlags(uint32_t irq) {
}
int16_t PhysicalLayer::startChannelScan() {
- return(RADIOLIB_ERR_UNSUPPORTED);
+ return(RADIOLIB_ERR_UNSUPPORTED);
}
int16_t PhysicalLayer::startChannelScan(const ChannelScanConfig_t &config) {
(void)config;
- return(RADIOLIB_ERR_UNSUPPORTED);
+ return(RADIOLIB_ERR_UNSUPPORTED);
}
int16_t PhysicalLayer::getChannelScanResult() {
@@ -373,12 +373,12 @@ int16_t PhysicalLayer::getChannelScanResult() {
}
int16_t PhysicalLayer::scanChannel() {
- return(RADIOLIB_ERR_UNSUPPORTED);
+ return(RADIOLIB_ERR_UNSUPPORTED);
}
int16_t PhysicalLayer::scanChannel(const ChannelScanConfig_t &config) {
(void)config;
- return(RADIOLIB_ERR_UNSUPPORTED);
+ return(RADIOLIB_ERR_UNSUPPORTED);
}
int32_t PhysicalLayer::random(int32_t max) {
@@ -518,7 +518,7 @@ void PhysicalLayer::setPacketReceivedAction(void (*func)(void)) {
}
void PhysicalLayer::clearPacketReceivedAction() {
-
+
}
void PhysicalLayer::setPacketSentAction(void (*func)(void)) {
@@ -526,7 +526,7 @@ void PhysicalLayer::setPacketSentAction(void (*func)(void)) {
}
void PhysicalLayer::clearPacketSentAction() {
-
+
}
void PhysicalLayer::setChannelScanAction(void (*func)(void)) {
@@ -534,7 +534,7 @@ void PhysicalLayer::setChannelScanAction(void (*func)(void)) {
}
void PhysicalLayer::clearChannelScanAction() {
-
+
}
int16_t PhysicalLayer::setModem(ModemType_t modem) {
diff --git a/src/protocols/PhysicalLayer/PhysicalLayer.h b/src/protocols/PhysicalLayer/PhysicalLayer.h
index 8cb32a0de..ccaf1748e 100644
--- a/src/protocols/PhysicalLayer/PhysicalLayer.h
+++ b/src/protocols/PhysicalLayer/PhysicalLayer.h
@@ -32,10 +32,10 @@ enum RadioLibIrqType_t {
struct LoRaRate_t {
/*! \brief LoRa spreading factor */
uint8_t spreadingFactor;
-
+
/*! \brief LoRa bandwidth in kHz */
float bandwidth;
-
+
/*! \brief LoRa coding rate */
uint8_t codingRate;
};
@@ -47,7 +47,7 @@ struct LoRaRate_t {
struct FSKRate_t {
/*! \brief FSK bit rate in kbps */
float bitRate;
-
+
/*! \brief FSK frequency deviation in kHz */
float freqDev;
};
@@ -89,16 +89,16 @@ union DataRate_t {
struct CADScanConfig_t {
/*! \brief Number of symbols to consider signal present */
uint8_t symNum;
-
+
/*! \brief Number of peak detection symbols */
uint8_t detPeak;
-
+
/*! \brief Number of minimum detection symbols */
uint8_t detMin;
-
+
/*! \brief Exit mode after signal detection is complete - module-specific value */
uint8_t exitMode;
-
+
/*! \brief Timeout in microseconds */
RadioLibTime_t timeout;
@@ -138,13 +138,13 @@ struct StandbyConfig_t {
struct ReceiveConfig_t {
/*! \brief Raw timeout value. Some modules use this argument to specify operation mode (single vs. continuous receive). */
uint32_t timeout;
-
+
/*! \brief Sets the IRQ flags. */
RadioLibIrqFlags_t irqFlags;
-
+
/*! \brief Sets the mask of IRQ flags that will trigger the radio interrupt pin. */
RadioLibIrqFlags_t irqMask;
-
+
/*! \brief Packet length, needed for some modules under special circumstances (e.g. LoRa implicit header mode). */
size_t len;
};
@@ -301,7 +301,7 @@ class PhysicalLayer {
virtual int16_t startReceive();
/*!
- \brief Interrupt-driven receive method. A DIO pin will be activated when full packet is received.
+ \brief Interrupt-driven receive method. A DIO pin will be activated when full packet is received.
Must be implemented in module class.
\param timeout Raw timeout value. Some modules use this argument to specify operation mode
(single vs. continuous receive).
@@ -359,7 +359,7 @@ class PhysicalLayer {
/*!
\brief Reads data that was received after calling startReceive method.
\param str Address of Arduino String to save the received data.
- \param len Expected number of characters in the message. When set to 0, the packet length will be retrieved
+ \param len Expected number of characters in the message. When set to 0, the packet length will be retrieved
automatically. When more bytes than received are requested, only the number of bytes requested will be returned.
\returns \ref status_codes
*/
@@ -464,7 +464,7 @@ class PhysicalLayer {
\returns \ref status_codes
*/
virtual int16_t setPreambleLength(size_t len);
-
+
/*!
\brief Set data. Must be implemented in module class if the module supports it.
\param dr Data rate struct. Interpretation depends on currently active modem (FSK or LoRa).
@@ -506,7 +506,7 @@ class PhysicalLayer {
virtual RadioLibTime_t getTimeOnAir(size_t len);
/*!
- \brief Calculate the timeout value for this specific module / series
+ \brief Calculate the timeout value for this specific module / series
(in number of symbols or units of time).
\param timeoutUs Timeout in microseconds to listen for.
\returns Timeout value in a unit that is specific for the used module.
@@ -705,7 +705,7 @@ class PhysicalLayer {
\brief Clears interrupt service routine to call when a packet is sent.
*/
virtual void clearPacketSentAction();
-
+
/*!
\brief Sets interrupt service routine to call when a channel scan is finished.
\param func ISR to call.
diff --git a/src/protocols/Print/ITA2String.cpp b/src/protocols/Print/ITA2String.cpp
index 809a1c569..4b390da2e 100644
--- a/src/protocols/Print/ITA2String.cpp
+++ b/src/protocols/Print/ITA2String.cpp
@@ -69,7 +69,7 @@ uint8_t* ITA2String::byteArr() {
// ensure the minimum possible array size is always initialized
temp[0] = 0;
-
+
size_t arrayLen = 0;
bool flagFigure = false;
for(size_t i = 0; i < asciiLen; i++) {
@@ -128,7 +128,7 @@ uint16_t ITA2String::getBits(char c) {
code = (RADIOLIB_ITA2_LTRS << 5) | i;
break;
}
-
+
ptr = const_cast(&ITA2Table[i][1]);
if(RADIOLIB_NONVOLATILE_READ_BYTE(ptr) == c) {
// character is in figures shift
diff --git a/src/protocols/Print/ITA2String.h b/src/protocols/Print/ITA2String.h
index 70e7b4b0f..bdd28332f 100644
--- a/src/protocols/Print/ITA2String.h
+++ b/src/protocols/Print/ITA2String.h
@@ -40,7 +40,7 @@ class ITA2String {
\param ita2 ITA2String instance to copy.
*/
ITA2String(const ITA2String& ita2);
-
+
/*!
\brief Overload for assignment operator.
\param ita2 rvalue ITA2String.
diff --git a/src/protocols/SSTV/SSTV.cpp b/src/protocols/SSTV/SSTV.cpp
index 397dc80b5..67f89fad7 100644
--- a/src/protocols/SSTV/SSTV.cpp
+++ b/src/protocols/SSTV/SSTV.cpp
@@ -317,11 +317,11 @@ void SSTVClient::sendLine(const uint32_t* imgLine) {
color = ((uint32_t)y << 8);
if(txMode.visCode == RADIOLIB_SSTV_ROBOT_36) {
// odd lines carry Cb, even lines carry Cr
- color |= (lineCount % 2) ? cb : cr;
+ color |= (lineCount % 2) ? cb : cr;
} else {
color |= ((uint32_t)cr << 16) | cb;
}
-
+
}
switch(txMode.tones[i].type) {
diff --git a/src/protocols/SSTV/SSTV.h b/src/protocols/SSTV/SSTV.h
index 3ec493a4e..62429d7f5 100644
--- a/src/protocols/SSTV/SSTV.h
+++ b/src/protocols/SSTV/SSTV.h
@@ -139,7 +139,7 @@ class SSTVClient {
/*!
\brief Initialization method for 2-FSK.
\param base Base "0 Hz tone" RF frequency to be used in MHz.
- \param mode SSTV mode to be used. Currently supported modes are Scottie1, Scottie2,
+ \param mode SSTV mode to be used. Currently supported modes are Scottie1, Scottie2,
ScottieDX, Martin1, Martin2, Wrasse, PasokonP3, PasokonP5 and PasokonP7,
Robot36 and Robot37.
\returns \ref status_codes
diff --git a/src/utils/Cryptography.h b/src/utils/Cryptography.h
index 4a5ddca52..52b00798c 100644
--- a/src/utils/Cryptography.h
+++ b/src/utils/Cryptography.h
@@ -116,7 +116,7 @@ class RadioLibAES128 {
\returns The number of bytes saved into the output buffer.
*/
size_t encryptECB(const uint8_t* in, size_t len, uint8_t* out);
-
+
/*!
\brief Perform ECB-type AES decryption.
\param in Input ciphertext data.
@@ -143,7 +143,7 @@ class RadioLibAES128 {
\returns True if valid, false otherwise.
*/
bool verifyCMAC(const uint8_t* in, size_t len, const uint8_t* cmac);
-
+
private:
uint8_t* keyPtr = nullptr;
uint8_t roundKey[RADIOLIB_AES128_KEY_EXP_SIZE] = { 0 };
diff --git a/src/utils/FEC.cpp b/src/utils/FEC.cpp
index 7aadf4ab7..318b220c0 100644
--- a/src/utils/FEC.cpp
+++ b/src/utils/FEC.cpp
@@ -2,7 +2,7 @@
#include
RadioLibBCH::RadioLibBCH() {
-
+
}
RadioLibBCH::~RadioLibBCH() {
@@ -270,7 +270,7 @@ uint32_t RadioLibBCH::encode(uint32_t dataword) {
iEvenParity++;
}
}
-
+
#if !RADIOLIB_STATIC_ONLY
delete[] data;
#endif
@@ -281,7 +281,7 @@ uint32_t RadioLibBCH::encode(uint32_t dataword) {
iEvenParity++;
}
}
-
+
#if !RADIOLIB_STATIC_ONLY
delete[] bb;
#endif
diff --git a/src/utils/FEC.h b/src/utils/FEC.h
index 7e1341248..8eca17634 100644
--- a/src/utils/FEC.h
+++ b/src/utils/FEC.h
@@ -53,7 +53,7 @@ class RadioLibBCH {
uint8_t k = 0;
uint32_t poly = 0;
uint8_t m = 0;
-
+
#if RADIOLIB_STATIC_ONLY
int32_t alphaTo[RADIOLIB_BCH_MAX_N + 1] = { 0 };
int32_t indexOf[RADIOLIB_BCH_MAX_N + 1] = { 0 };
@@ -128,7 +128,7 @@ class RadioLibConvCode {
to ensure the buffer is large enough to fit the encoded data!
\param out_bits Pointer to a variable to save the number of encoded bits.
Ignored if set to NULL.
- \returns \ref status_codes
+ \returns \ref status_codes
*/
int16_t encode(const uint8_t* in, size_t in_bits, uint8_t* out, size_t* out_bits = NULL);
@@ -145,7 +145,7 @@ static const uint32_t ConvCodeTable1_3[16] = {
0x34074370, 0x52612516, 0x25165261, 0x43703407,
};
-static const uint32_t ConvCodeTable1_2[4] = {
+static const uint32_t ConvCodeTable1_2[4] = {
0x03122130, 0x21300312, 0x30211203, 0x12033021,
};
diff --git a/src/utils/Utils.cpp b/src/utils/Utils.cpp
index 7daa7fdf6..9139e5cd8 100644
--- a/src/utils/Utils.cpp
+++ b/src/utils/Utils.cpp
@@ -55,7 +55,7 @@ void rlb_hexdump(const char* level, const uint8_t* data, size_t len, uint32_t of
*strPtr++ = '%';
}
sprintf(strPtr++, "%c", c);
-
+
}
for(size_t j = line_len; j < 16; j++) {
sprintf(strPtr++, " ");