From 09d9d2c615d2cf3fadb0b00643b4891125f3069a Mon Sep 17 00:00:00 2001 From: Chris Terwilliger Date: Wed, 22 Dec 2021 22:26:05 -0500 Subject: [PATCH 1/8] Update CC1101.h --- src/modules/CC1101/CC1101.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/CC1101/CC1101.h b/src/modules/CC1101/CC1101.h index f58192b4..1f93faaf 100644 --- a/src/modules/CC1101/CC1101.h +++ b/src/modules/CC1101/CC1101.h @@ -869,7 +869,7 @@ class CC1101: public PhysicalLayer { int16_t setDataShaping(uint8_t sh) override; /*! - \brief Sets transmission encoding. Allowed values are RADIOLIB_ENCODING_NRZ and RADIOLIB_ENCODING_WHITENING. + \brief Sets transmission encoding. Allowed values are RADIOLIB_ENCODING_NRZ, RADIOLIB_ENCODING_MANCHESTER, and RADIOLIB_ENCODING_WHITENING. \param encoding Encoding to be used. From 7a1d813dc49e6b6cff7a17cfb96e6422e8bdf1a4 Mon Sep 17 00:00:00 2001 From: Chris Terwilliger Date: Thu, 23 Dec 2021 20:57:25 -0500 Subject: [PATCH 2/8] Update CC1101.h --- src/modules/CC1101/CC1101.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/CC1101/CC1101.h b/src/modules/CC1101/CC1101.h index 1f93faaf..5391203e 100644 --- a/src/modules/CC1101/CC1101.h +++ b/src/modules/CC1101/CC1101.h @@ -870,6 +870,7 @@ class CC1101: public PhysicalLayer { /*! \brief Sets transmission encoding. Allowed values are RADIOLIB_ENCODING_NRZ, RADIOLIB_ENCODING_MANCHESTER, and RADIOLIB_ENCODING_WHITENING. + Note that encoding on CC1101 is applied to the entire stream including preamble, sync word, and CRC. \param encoding Encoding to be used. From 5fb2ce66abd40e2667d15d7476974b48ea582588 Mon Sep 17 00:00:00 2001 From: Chris Terwilliger Date: Thu, 23 Dec 2021 22:03:39 -0500 Subject: [PATCH 3/8] Update SX127x.h --- src/modules/SX127x/SX127x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/SX127x/SX127x.h b/src/modules/SX127x/SX127x.h index 66ab01c8..ea1ecf66 100644 --- a/src/modules/SX127x/SX127x.h +++ b/src/modules/SX127x/SX127x.h @@ -791,7 +791,7 @@ class SX127x: public PhysicalLayer { float getAFCError(); /*! - \brief Gets signal-to-noise ratio of the latest received packet. + \brief Gets signal-to-noise ratio of the latest received packet. Only available in LoRa mode. \returns Last packet signal-to-noise ratio (SNR). */ From b5e5e079c89b4bd7efc6d1724de527a39a5d7887 Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Tue, 25 Jan 2022 12:17:01 -0700 Subject: [PATCH 4/8] Correct typos in explicit/implicitHeader functions. Add a few missing keywords. --- keywords.txt | 3 +++ src/modules/SX126x/SX126x.h | 6 +++--- src/modules/SX127x/SX1272.h | 6 +++--- src/modules/SX127x/SX1278.h | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/keywords.txt b/keywords.txt index 31db163d..a0b8ea6c 100644 --- a/keywords.txt +++ b/keywords.txt @@ -146,6 +146,9 @@ setFHSSHoppingPeriod KEYWORD2 getFHSSHoppingPeriod KEYWORD2 getFHSSChannel KEYWORD2 clearFHSSInt KEYWORD2 +randomByte KEYWORD2 +getPacketLength + # RF69-specific setAESKey KEYWORD2 diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h index 8c9b34a3..73d31b43 100644 --- a/src/modules/SX126x/SX126x.h +++ b/src/modules/SX126x/SX126x.h @@ -827,7 +827,9 @@ class SX126x: public PhysicalLayer { float getRSSIInst(); /*! - \brief Set implicit header mode for future reception/transmission. + \brief Set implicit header mode for future reception/transmission. Required for spreading factor 6. + + \param len Payload length in bytes. \returns \ref status_codes */ @@ -836,8 +838,6 @@ class SX126x: public PhysicalLayer { /*! \brief Set explicit header mode for future reception/transmission. - \param len Payload length in bytes. - \returns \ref status_codes */ int16_t explicitHeader(); diff --git a/src/modules/SX127x/SX1272.h b/src/modules/SX127x/SX1272.h index 7491ef2a..e4343b66 100644 --- a/src/modules/SX127x/SX1272.h +++ b/src/modules/SX127x/SX1272.h @@ -278,7 +278,9 @@ class SX1272: public SX127x { int16_t autoLDRO(); /*! - \brief Set implicit header mode for future reception/transmission. + \brief Set implicit header mode for future reception/transmission. Required for spreading factor 6. + + \param len Payload length in bytes. \returns \ref status_codes */ @@ -287,8 +289,6 @@ class SX1272: public SX127x { /*! \brief Set explicit header mode for future reception/transmission. - \param len Payload length in bytes. - \returns \ref status_codes */ int16_t explicitHeader(); diff --git a/src/modules/SX127x/SX1278.h b/src/modules/SX127x/SX1278.h index 150b97c3..cffedc81 100644 --- a/src/modules/SX127x/SX1278.h +++ b/src/modules/SX127x/SX1278.h @@ -287,7 +287,9 @@ class SX1278: public SX127x { int16_t autoLDRO(); /*! - \brief Set implicit header mode for future reception/transmission. + \brief Set implicit header mode for future reception/transmission. Required for spreading factor 6. + + \param len Payload length in bytes. \returns \ref status_codes */ @@ -296,8 +298,6 @@ class SX1278: public SX127x { /*! \brief Set explicit header mode for future reception/transmission. - \param len Payload length in bytes. - \returns \ref status_codes */ int16_t explicitHeader(); From 1e564730a4df65b57b3ca895ab2e4508e86febdd Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Tue, 25 Jan 2022 12:19:17 -0700 Subject: [PATCH 5/8] Update keywords.txt --- keywords.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keywords.txt b/keywords.txt index a0b8ea6c..a2a656bc 100644 --- a/keywords.txt +++ b/keywords.txt @@ -147,7 +147,7 @@ getFHSSHoppingPeriod KEYWORD2 getFHSSChannel KEYWORD2 clearFHSSInt KEYWORD2 randomByte KEYWORD2 -getPacketLength +getPacketLength KEYWORD2 # RF69-specific From 74feffb4c7e10b4eebedcd55c5adf3cf389eaf4c Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Fri, 28 Jan 2022 15:50:59 -0700 Subject: [PATCH 6/8] Fix >= to allow 255 bytes --- src/modules/SX127x/SX127x.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/SX127x/SX127x.cpp b/src/modules/SX127x/SX127x.cpp index 1db50c20..a0f967da 100644 --- a/src/modules/SX127x/SX127x.cpp +++ b/src/modules/SX127x/SX127x.cpp @@ -448,7 +448,7 @@ int16_t SX127x::startTransmit(uint8_t* data, size_t len, uint8_t addr) { int16_t modem = getActiveModem(); if(modem == RADIOLIB_SX127X_LORA) { // check packet length - if(len >= RADIOLIB_SX127X_MAX_PACKET_LENGTH) { + if(len > RADIOLIB_SX127X_MAX_PACKET_LENGTH) { return(RADIOLIB_ERR_PACKET_TOO_LONG); } From bad3029f4f2a778f1faf10590ebd68859c3224b4 Mon Sep 17 00:00:00 2001 From: Nathan Seidle Date: Fri, 28 Jan 2022 15:54:44 -0700 Subject: [PATCH 7/8] Update SX126x.h --- src/modules/SX126x/SX126x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h index 73d31b43..507fb127 100644 --- a/src/modules/SX126x/SX126x.h +++ b/src/modules/SX126x/SX126x.h @@ -827,7 +827,7 @@ class SX126x: public PhysicalLayer { float getRSSIInst(); /*! - \brief Set implicit header mode for future reception/transmission. Required for spreading factor 6. + \brief Set implicit header mode for future reception/transmission. \param len Payload length in bytes. From 2538af82a908fa144c33201ed954412e8dc28474 Mon Sep 17 00:00:00 2001 From: "Arthur B. Grossi" Date: Mon, 31 Jan 2022 18:10:41 -0300 Subject: [PATCH 8/8] [Si443x] Fixes getPacketLength Fixes getPacketLength function to read the correct register when on fixed packet length mode. --- src/modules/Si443x/Si443x.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/Si443x/Si443x.cpp b/src/modules/Si443x/Si443x.cpp index 90bba72e..f033d0ec 100644 --- a/src/modules/Si443x/Si443x.cpp +++ b/src/modules/Si443x/Si443x.cpp @@ -512,9 +512,12 @@ int16_t Si443x::setPreambleLength(uint8_t preambleLen) { } size_t Si443x::getPacketLength(bool update) { - /// \todo variable length mode if(!_packetLengthQueried && update) { - _packetLength = _mod->SPIreadRegister(RADIOLIB_SI443X_REG_RECEIVED_PACKET_LENGTH); + if (_packetLengthConfig == RADIOLIB_SI443X_FIXED_PACKET_LENGTH_ON) { + _packetLength = _mod->SPIreadRegister(RADIOLIB_SI443X_REG_TRANSMIT_PACKET_LENGTH); + } else { + _packetLength = _mod->SPIreadRegister(RADIOLIB_SI443X_REG_RECEIVED_PACKET_LENGTH); + } _packetLengthQueried = true; }