diff --git a/keywords.txt b/keywords.txt index 31db163d..a2a656bc 100644 --- a/keywords.txt +++ b/keywords.txt @@ -146,6 +146,9 @@ setFHSSHoppingPeriod KEYWORD2 getFHSSHoppingPeriod KEYWORD2 getFHSSChannel KEYWORD2 clearFHSSInt KEYWORD2 +randomByte KEYWORD2 +getPacketLength KEYWORD2 + # RF69-specific setAESKey KEYWORD2 diff --git a/src/modules/CC1101/CC1101.h b/src/modules/CC1101/CC1101.h index f58192b4..5391203e 100644 --- a/src/modules/CC1101/CC1101.h +++ b/src/modules/CC1101/CC1101.h @@ -869,7 +869,8 @@ 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. + Note that encoding on CC1101 is applied to the entire stream including preamble, sync word, and CRC. \param encoding Encoding to be used. diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h index 8c9b34a3..507fb127 100644 --- a/src/modules/SX126x/SX126x.h +++ b/src/modules/SX126x/SX126x.h @@ -829,6 +829,8 @@ class SX126x: public PhysicalLayer { /*! \brief Set implicit header mode for future reception/transmission. + \param len Payload length in bytes. + \returns \ref status_codes */ int16_t implicitHeader(size_t len); @@ -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(); 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); } diff --git a/src/modules/SX127x/SX127x.h b/src/modules/SX127x/SX127x.h index b0671bac..be3e2d0b 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). */ 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; }