[SX127x] Added default startReceive method

This commit is contained in:
jgromes 2023-05-28 22:20:25 +02:00
parent f936d53639
commit a16322097a
2 changed files with 15 additions and 3 deletions

View file

@ -366,6 +366,10 @@ int16_t SX127x::packetMode() {
return(this->mod->SPIsetRegValue(RADIOLIB_SX127X_REG_PACKET_CONFIG_2, RADIOLIB_SX127X_DATA_MODE_PACKET, 6, 6)); return(this->mod->SPIsetRegValue(RADIOLIB_SX127X_REG_PACKET_CONFIG_2, RADIOLIB_SX127X_DATA_MODE_PACKET, 6, 6));
} }
int16_t SX127x::startReceive() {
return(this->startReceive(0, RADIOLIB_SX127X_RXCONTINUOUS));
}
int16_t SX127x::startReceive(uint8_t len, uint8_t mode) { int16_t SX127x::startReceive(uint8_t len, uint8_t mode) {
// set mode to standby // set mode to standby
int16_t state = setMode(RADIOLIB_SX127X_STANDBY); int16_t state = setMode(RADIOLIB_SX127X_STANDBY);

View file

@ -772,12 +772,20 @@ class SX127x: public PhysicalLayer {
int16_t finishTransmit() override; int16_t finishTransmit() override;
/*! /*!
\brief Interrupt-driven receive method. DIO0 will be activated when full valid packet is received. \brief Interrupt-driven receive method with default parameters.
\param len Expected length of packet to be received. Required for LoRa spreading factor 6. Implemented for compatibility with PhysicalLayer.
\param mode Receive mode to be used. Defaults to RxContinuous.
\returns \ref status_codes \returns \ref status_codes
*/ */
int16_t startReceive(uint8_t len = 0, uint8_t mode = RADIOLIB_SX127X_RXCONTINUOUS); int16_t startReceive();
/*!
\brief Interrupt-driven receive method. DIO0 will be activated when full valid packet is received.
\param len Expected length of packet to be received, or 0 when unused.
Defaults to 0, non-zero required for LoRa spreading factor 6.
\param mode Receive mode to be used.
\returns \ref status_codes
*/
int16_t startReceive(uint8_t len, uint8_t mode);
/*! /*!
\brief Interrupt-driven receive method, implemented for compatibility with PhysicalLayer. \brief Interrupt-driven receive method, implemented for compatibility with PhysicalLayer.