pass len as param to implicitHeader

This commit is contained in:
Callan Bryant 2020-01-09 16:08:00 +00:00
parent 54f058de02
commit 51ce45220b
No known key found for this signature in database
GPG key ID: C31FA9DF3ACBFFAA
2 changed files with 8 additions and 6 deletions

View file

@ -1170,8 +1170,8 @@ uint32_t SX126x::getTimeOnAir(size_t len) {
} }
} }
int16_t implicitHeader() { int16_t implicitHeader(size_t len) {
return setHeaderType(SX126X_LORA_HEADER_IMPLICIT); return setHeaderType(SX126X_LORA_HEADER_IMPLICIT, len);
} }
int16_t explicitHeader() { int16_t explicitHeader() {
@ -1354,9 +1354,9 @@ int16_t SX126x::setPacketMode(uint8_t mode, uint8_t len) {
return(state); return(state);
} }
int16_t SX126x::setHeaderType(uint8_t headerType) { int16_t SX126x::setHeaderType(uint8_t headerType, size_t len) {
// set requested packet mode // set requested packet mode
int16_t state = setPacketParams(_preambleLength, _crcType, 0xFF, headerType); int16_t state = setPacketParams(_preambleLength, _crcType, len, headerType);
if(state != ERR_NONE) { if(state != ERR_NONE) {
return(state); return(state);

View file

@ -795,11 +795,13 @@ class SX126x: public PhysicalLayer {
\returns \ref status_codes \returns \ref status_codes
*/ */
int16_t implicitHeader(); int16_t implicitHeader(size_t len);
/*! /*!
\brief Set explicit header mode for future reception/transmission. \brief Set explicit header mode for future reception/transmission.
\param len Payload length in bytes. **WILL BE GLOBALLY OVERRIDDEN BY transmit()**
\returns \ref status_codes \returns \ref status_codes
*/ */
int16_t explicitHeader(); int16_t explicitHeader();
@ -836,7 +838,7 @@ class SX126x: public PhysicalLayer {
int16_t setFrequencyRaw(float freq); int16_t setFrequencyRaw(float freq);
int16_t setOptimalHiPowerPaConfig(int8_t* inOutPower); int16_t setOptimalHiPowerPaConfig(int8_t* inOutPower);
int16_t setPacketMode(uint8_t mode, uint8_t len); int16_t setPacketMode(uint8_t mode, uint8_t len);
int16_t setHeaderType(uint8_t headerType) int16_t setHeaderType(uint8_t headerType, size_t len = 0xFF)
// fixes to errata // fixes to errata
int16_t fixSensitivity(); int16_t fixSensitivity();