RadioLib
Universal wireless communication library for Arduino
SX128x Class Reference

Base class for SX128x series. All derived classes for SX128x (e.g. SX1280 or SX1281) inherit from this base class. This class should not be instantiated directly from Arduino sketch, only from its derived classes. More...

#include <SX128x.h>

Inheritance diagram for SX128x:
PhysicalLayer SX1281 SX1280 SX1282

Public Member Functions

 SX128x (Module *mod)
 Default constructor. More...
 
int16_t begin (float freq=2400.0, float bw=812.5, uint8_t sf=9, uint8_t cr=7, uint8_t syncWord=SX128X_SYNC_WORD_PRIVATE, int8_t power=10, uint16_t preambleLength=12)
 Initialization method for LoRa modem. More...
 
int16_t beginGFSK (float freq=2400.0, uint16_t br=800, float freqDev=400.0, int8_t power=10, uint16_t preambleLength=16)
 Initialization method for GFSK modem. More...
 
int16_t beginBLE (float freq=2400.0, uint16_t br=800, float freqDev=400.0, int8_t power=10, uint8_t dataShaping=RADIOLIB_SHAPING_0_5)
 Initialization method for BLE modem. More...
 
int16_t beginFLRC (float freq=2400.0, uint16_t br=650, uint8_t cr=3, int8_t power=10, uint16_t preambleLength=16, uint8_t dataShaping=RADIOLIB_SHAPING_0_5)
 Initialization method for FLRC modem. More...
 
int16_t reset (bool verify=true)
 Reset method. Will reset the chip to the default state using RST pin. More...
 
int16_t transmit (uint8_t *data, size_t len, uint8_t addr=0) override
 Blocking binary transmit method. Overloads for string-based transmissions are implemented in PhysicalLayer. More...
 
int16_t receive (uint8_t *data, size_t len) override
 Blocking binary receive method. Overloads for string-based transmissions are implemented in PhysicalLayer. More...
 
int16_t transmitDirect (uint32_t frf=0) override
 Starts direct mode transmission. More...
 
int16_t receiveDirect () override
 Starts direct mode reception. Only implemented for PhysicalLayer compatibility, as SX128x series does not support direct mode reception. Will always return ERR_UNKNOWN. More...
 
int16_t scanChannel ()
 Performs scan for LoRa transmission in the current channel. Detects both preamble and payload. More...
 
int16_t sleep (bool retainConfig=true)
 Sets the module to sleep mode. More...
 
int16_t standby () override
 Sets the module to standby mode (overload for PhysicalLayer compatibility, uses 13 MHz RC oscillator). More...
 
int16_t standby (uint8_t mode)
 Sets the module to standby mode. More...
 
void setDio1Action (void(*func)(void))
 Sets interrupt service routine to call when DIO1 activates. More...
 
void clearDio1Action ()
 Clears interrupt service routine to call when DIO1 activates.
 
int16_t startTransmit (uint8_t *data, size_t len, uint8_t addr=0) override
 Interrupt-driven binary transmit method. Overloads for string-based transmissions are implemented in PhysicalLayer. More...
 
int16_t startReceive (uint16_t timeout=SX128X_RX_TIMEOUT_INF)
 Interrupt-driven receive method. DIO1 will be activated when full packet is received. More...
 
int16_t readData (uint8_t *data, size_t len) override
 Reads data received after calling startReceive method. More...
 
int16_t setFrequency (float freq)
 Sets carrier frequency. Allowed values are in range from 2400.0 to 2500.0 MHz. More...
 
int16_t setBandwidth (float bw)
 Sets LoRa bandwidth. Allowed values are 203.125, 406.25, 812.5 and 1625.0 kHz. More...
 
int16_t setSpreadingFactor (uint8_t sf)
 Sets LoRa spreading factor. Allowed values range from 5 to 12. More...
 
int16_t setCodingRate (uint8_t cr, bool longInterleaving=false)
 Sets LoRa coding rate denominator. Allowed values range from 5 to 8. More...
 
int16_t setOutputPower (int8_t power)
 Sets output power. Allowed values are in range from -18 to 13 dBm. More...
 
int16_t setPreambleLength (uint32_t preambleLength)
 Sets preamble length for currently active modem. Allowed values range from 1 to 65535. More...
 
int16_t setBitRate (uint16_t br)
 Sets FSK or FLRC bit rate. Allowed values are 125, 250, 400, 500, 800, 1000, 1600 and 2000 kbps (for FSK modem) or 260, 325, 520, 650, 1000 and 1300 (for FLRC modem). More...
 
int16_t setFrequencyDeviation (float freqDev) override
 Sets FSK frequency deviation. Allowed values range from 0.0 to 3200.0 kHz. More...
 
int16_t setDataShaping (uint8_t sh) override
 Sets time-bandwidth product of Gaussian filter applied for shaping. Allowed values are RADIOLIB_SHAPING_0_5 or RADIOLIB_SHAPING_1_0. Set to RADIOLIB_SHAPING_NONE to disable data shaping. More...
 
int16_t setSyncWord (uint8_t *syncWord, uint8_t len)
 Sets FSK/FLRC sync word in the form of array of up to 5 bytes (FSK). For FLRC modem, the sync word must be exactly 4 bytes long. More...
 
int16_t setSyncWord (uint8_t syncWord, uint8_t controlBits=0x44)
 Sets LoRa sync word. More...
 
int16_t setCRC (uint8_t len, uint32_t initial=0x1D0F, uint16_t polynomial=0x1021)
 Sets CRC configuration. More...
 
int16_t setWhitening (bool enabled)
 Sets whitening parameters, not available for LoRa or FLRC modem. More...
 
int16_t setAccessAddress (uint32_t addr)
 Sets BLE access address. More...
 
float getRSSI ()
 Gets RSSI (Recorded Signal Strength Indicator) of the last received packet. More...
 
float getSNR ()
 Gets SNR (Signal to Noise Ratio) of the last received packet. Only available for LoRa or ranging modem. More...
 
size_t getPacketLength (bool update=true) override
 Query modem for the packet length of received payload. More...
 
uint32_t getTimeOnAir (size_t len)
 Get expected time-on-air for a given size of payload. More...
 
int16_t implicitHeader (size_t len)
 Set implicit header mode for future reception/transmission. More...
 
int16_t explicitHeader ()
 Set explicit header mode for future reception/transmission. More...
 
int16_t setEncoding (uint8_t encoding) override
 Sets transmission encoding. Serves only as alias for PhysicalLayer compatibility. More...
 
void setRfSwitchPins (RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn)
 Some modules contain external RF switch controlled by two pins. This function gives RadioLib control over those two pins to automatically switch Rx and Tx state. When using automatic RF switch control, DO NOT change the pin mode of rxEn or txEn from Arduino sketch! More...
 
uint8_t random ()
 Dummy random method, to ensure PhysicalLayer compatibility. More...
 
int16_t transmit (__FlashStringHelper *fstr, uint8_t addr=0)
 Arduino Flash String transmit method. More...
 
int16_t transmit (String &str, uint8_t addr=0)
 Arduino String transmit method. More...
 
int16_t transmit (const char *str, uint8_t addr=0)
 C-string transmit method. More...
 
virtual int16_t transmit (uint8_t *data, size_t len, uint8_t addr=0)=0
 Binary transmit method. Must be implemented in module class. More...
 
int16_t receive (String &str, size_t len=0)
 Arduino String receive method. More...
 
virtual int16_t receive (uint8_t *data, size_t len)=0
 Binary receive method. Must be implemented in module class. More...
 
int16_t startTransmit (String &str, uint8_t addr=0)
 Interrupt-driven Arduino String transmit method. Unlike the standard transmit method, this one is non-blocking. Interrupt pin will be activated when transmission finishes. More...
 
int16_t startTransmit (const char *str, uint8_t addr=0)
 Interrupt-driven Arduino String transmit method. Unlike the standard transmit method, this one is non-blocking. Interrupt pin will be activated when transmission finishes. More...
 
virtual int16_t startTransmit (uint8_t *data, size_t len, uint8_t addr=0)=0
 Interrupt-driven binary transmit method. More...
 
int16_t readData (String &str, size_t len=0)
 Reads data that was received after calling startReceive method. More...
 
virtual int16_t readData (uint8_t *data, size_t len)=0
 Reads data that was received after calling startReceive method. More...
 
- Public Member Functions inherited from PhysicalLayer
 PhysicalLayer (float freqStep, size_t maxPacketLength)
 Default constructor. More...
 
int16_t transmit (__FlashStringHelper *fstr, uint8_t addr=0)
 Arduino Flash String transmit method. More...
 
int16_t transmit (String &str, uint8_t addr=0)
 Arduino String transmit method. More...
 
int16_t transmit (const char *str, uint8_t addr=0)
 C-string transmit method. More...
 
int16_t receive (String &str, size_t len=0)
 Arduino String receive method. More...
 
int16_t startTransmit (String &str, uint8_t addr=0)
 Interrupt-driven Arduino String transmit method. Unlike the standard transmit method, this one is non-blocking. Interrupt pin will be activated when transmission finishes. More...
 
int16_t startTransmit (const char *str, uint8_t addr=0)
 Interrupt-driven Arduino String transmit method. Unlike the standard transmit method, this one is non-blocking. Interrupt pin will be activated when transmission finishes. More...
 
int16_t readData (String &str, size_t len=0)
 Reads data that was received after calling startReceive method. More...
 
float getFreqStep () const
 Gets the module frequency step size that was set in constructor. More...
 
int32_t random (int32_t max)
 Get truly random number in range 0 - max. More...
 
int32_t random (int32_t min, int32_t max)
 Get truly random number in range min - max. More...
 
int16_t startDirect ()
 Configure module parameters for direct modes. Must be called prior to "ham" modes like RTTY or AX.25. Only available in FSK mode. More...
 
int16_t setDirectSyncWord (uint32_t syncWord, uint8_t len)
 Set sync word to be used to determine start of packet in direct reception mode. More...
 
virtual void setDirectAction (void(*func)(void))=0
 Set interrupt service routine function to call when data bit is receveid in direct mode. Must be implemented in module class. More...
 
virtual void readBit (uint8_t pin)=0
 Function to read and process data bit in direct reception mode. Must be implemented in module class. More...
 
int16_t available ()
 Get the number of direct mode bytes currently available in buffer. More...
 
uint8_t read ()
 Get data from direct mode buffer. More...
 

Detailed Description

Base class for SX128x series. All derived classes for SX128x (e.g. SX1280 or SX1281) inherit from this base class. This class should not be instantiated directly from Arduino sketch, only from its derived classes.

Constructor & Destructor Documentation

◆ SX128x()

SX128x::SX128x ( Module mod)

Default constructor.

Parameters
modInstance of Module that will be used to communicate with the radio.

Member Function Documentation

◆ begin()

int16_t SX128x::begin ( float  freq = 2400.0,
float  bw = 812.5,
uint8_t  sf = 9,
uint8_t  cr = 7,
uint8_t  syncWord = SX128X_SYNC_WORD_PRIVATE,
int8_t  power = 10,
uint16_t  preambleLength = 12 
)

Initialization method for LoRa modem.

Parameters
freqCarrier frequency in MHz. Defaults to 2400.0 MHz.
bwLoRa bandwidth in kHz. Defaults to 812.5 kHz.
sfLoRa spreading factor. Defaults to 9.
crLoRa coding rate denominator. Defaults to 7 (coding rate 4/7).
syncWord2-byte LoRa sync word. Defaults to SX128X_SYNC_WORD_PRIVATE (0x12).
powerOutput power in dBm. Defaults to 10 dBm.
preambleLengthLoRa preamble length in symbols. Defaults to 12 symbols.
Returns
Status Codes

◆ beginBLE()

int16_t SX128x::beginBLE ( float  freq = 2400.0,
uint16_t  br = 800,
float  freqDev = 400.0,
int8_t  power = 10,
uint8_t  dataShaping = RADIOLIB_SHAPING_0_5 
)

Initialization method for BLE modem.

Parameters
freqCarrier frequency in MHz. Defaults to 2400.0 MHz.
brBLE bit rate in kbps. Defaults to 800 kbps.
freqDevFrequency deviation from carrier frequency in kHz. Defaults to 400.0 kHz.
powerOutput power in dBm. Defaults to 10 dBm.
dataShapingTime-bandwidth product of the Gaussian filter to be used for shaping. Defaults to 0.5.
Returns
Status Codes

◆ beginFLRC()

int16_t SX128x::beginFLRC ( float  freq = 2400.0,
uint16_t  br = 650,
uint8_t  cr = 3,
int8_t  power = 10,
uint16_t  preambleLength = 16,
uint8_t  dataShaping = RADIOLIB_SHAPING_0_5 
)

Initialization method for FLRC modem.

Parameters
freqCarrier frequency in MHz. Defaults to 2400.0 MHz.
brFLRC bit rate in kbps. Defaults to 650 kbps.
crFLRC coding rate. Defaults to 3 (coding rate 3/4).
powerOutput power in dBm. Defaults to 10 dBm.

\parma preambleLength FLRC preamble length in bits. Defaults to 16 bits.

Parameters
dataShapingTime-bandwidth product of the Gaussian filter to be used for shaping. Defaults to 0.5.
Returns
Status Codes

◆ beginGFSK()

int16_t SX128x::beginGFSK ( float  freq = 2400.0,
uint16_t  br = 800,
float  freqDev = 400.0,
int8_t  power = 10,
uint16_t  preambleLength = 16 
)

Initialization method for GFSK modem.

Parameters
freqCarrier frequency in MHz. Defaults to 2400.0 MHz.
brFSK bit rate in kbps. Defaults to 800 kbps.
freqDevFrequency deviation from carrier frequency in kHz. Defaults to 400.0 kHz.
powerOutput power in dBm. Defaults to 10 dBm.

\parma preambleLength FSK preamble length in bits. Defaults to 16 bits.

Returns
Status Codes

◆ explicitHeader()

int16_t SX128x::explicitHeader ( )

Set explicit header mode for future reception/transmission.

Parameters
lenPayload length in bytes.
Returns
Status Codes

◆ getPacketLength()

size_t SX128x::getPacketLength ( bool  update = true)
overridevirtual

Query modem for the packet length of received payload.

Parameters
updateUpdate received packet length. Will return cached value when set to false.
Returns
Length of last received packet in bytes.

Implements PhysicalLayer.

◆ getRSSI()

float SX128x::getRSSI ( )

Gets RSSI (Recorded Signal Strength Indicator) of the last received packet.

Returns
RSSI of the last received packet in dBm.

◆ getSNR()

float SX128x::getSNR ( )

Gets SNR (Signal to Noise Ratio) of the last received packet. Only available for LoRa or ranging modem.

Returns
SNR of the last received packet in dB.

◆ getTimeOnAir()

uint32_t SX128x::getTimeOnAir ( size_t  len)

Get expected time-on-air for a given size of payload.

Parameters
lenPayload length in bytes.
Returns
Expected time-on-air in microseconds.
Todo:
implement this mess - SX1280 datasheet v3.0 section 7.4.4.2

◆ implicitHeader()

int16_t SX128x::implicitHeader ( size_t  len)

Set implicit header mode for future reception/transmission.

Returns
Status Codes

◆ random()

uint8_t SX128x::random ( )
virtual

Dummy random method, to ensure PhysicalLayer compatibility.

Returns
Always returns 0.

Implements PhysicalLayer.

◆ readData() [1/3]

int16_t PhysicalLayer::readData

Reads data that was received after calling startReceive method.

Parameters
strAddress of Arduino String to save the received data.
lenExpected number of characters in the message.
Returns
Status Codes

◆ readData() [2/3]

int16_t SX128x::readData ( uint8_t *  data,
size_t  len 
)
overridevirtual

Reads data received after calling startReceive method.

Parameters
dataPointer to array to save the received binary data.
lenNumber of bytes that will be received. Must be known in advance for binary transmissions.
Returns
Status Codes

Implements PhysicalLayer.

◆ readData() [3/3]

virtual int16_t PhysicalLayer::readData

Reads data that was received after calling startReceive method.

Parameters
dataPointer to array to save the received binary data.
lenNumber of bytes that will be received. Must be known in advance for binary transmissions.
Returns
Status Codes

◆ receive() [1/3]

int16_t PhysicalLayer::receive

Arduino String receive method.

Parameters
strAddress of Arduino String to save the received data.
lenExpected number of characters in the message. Leave as 0 if expecting a unknown size packet
Returns
Status Codes

◆ receive() [2/3]

int16_t SX128x::receive ( uint8_t *  data,
size_t  len 
)
overridevirtual

Blocking binary receive method. Overloads for string-based transmissions are implemented in PhysicalLayer.

Parameters
dataBinary data to be sent.
lenNumber of bytes to send.
Returns
Status Codes

Implements PhysicalLayer.

◆ receive() [3/3]

virtual int16_t PhysicalLayer::receive

Binary receive method. Must be implemented in module class.

Parameters
dataPointer to array to save the received binary data.
lenNumber of bytes that will be received. Must be known in advance for binary transmissions.
Returns
Status Codes

◆ receiveDirect()

int16_t SX128x::receiveDirect ( )
overridevirtual

Starts direct mode reception. Only implemented for PhysicalLayer compatibility, as SX128x series does not support direct mode reception. Will always return ERR_UNKNOWN.

Returns
Status Codes

Implements PhysicalLayer.

◆ reset()

int16_t SX128x::reset ( bool  verify = true)

Reset method. Will reset the chip to the default state using RST pin.

Parameters
verifyWhether correct module startup should be verified. When set to true, RadioLib will attempt to verify the module has started correctly by repeatedly issuing setStandby command. Enabled by default.
Returns
Status Codes

◆ scanChannel()

int16_t SX128x::scanChannel ( )

Performs scan for LoRa transmission in the current channel. Detects both preamble and payload.

Returns
Status Codes

◆ setAccessAddress()

int16_t SX128x::setAccessAddress ( uint32_t  addr)

Sets BLE access address.

Parameters
addrBLE access address.
Returns
Status Codes

◆ setBandwidth()

int16_t SX128x::setBandwidth ( float  bw)

Sets LoRa bandwidth. Allowed values are 203.125, 406.25, 812.5 and 1625.0 kHz.

Parameters
bwLoRa bandwidth to be set in kHz.
Returns
Status Codes

◆ setBitRate()

int16_t SX128x::setBitRate ( uint16_t  br)

Sets FSK or FLRC bit rate. Allowed values are 125, 250, 400, 500, 800, 1000, 1600 and 2000 kbps (for FSK modem) or 260, 325, 520, 650, 1000 and 1300 (for FLRC modem).

Parameters
brFSK/FLRC bit rate to be set in kbps.
Returns
Status Codes

◆ setCodingRate()

int16_t SX128x::setCodingRate ( uint8_t  cr,
bool  longInterleaving = false 
)

Sets LoRa coding rate denominator. Allowed values range from 5 to 8.

Parameters
crLoRa coding rate denominator to be set.
longInterleavingWhether to enable long interleaving mode. Not available for coding rate 4/7, defaults to false.
Returns
Status Codes

◆ setCRC()

int16_t SX128x::setCRC ( uint8_t  len,
uint32_t  initial = 0x1D0F,
uint16_t  polynomial = 0x1021 
)

Sets CRC configuration.

Parameters
lenCRC length in bytes, Allowed values are 1, 2 or 3, set to 0 to disable CRC.
initialInitial CRC value. Defaults to 0x1D0F (CCIT CRC), not available for LoRa modem.
polynomialPolynomial for CRC calculation. Defaults to 0x1021 (CCIT CRC), not available for LoRa or BLE modem.
Returns
Status Codes

◆ setDataShaping()

int16_t SX128x::setDataShaping ( uint8_t  sh)
overridevirtual

Sets time-bandwidth product of Gaussian filter applied for shaping. Allowed values are RADIOLIB_SHAPING_0_5 or RADIOLIB_SHAPING_1_0. Set to RADIOLIB_SHAPING_NONE to disable data shaping.

Parameters
shTime-bandwidth product of Gaussian filter to be set.
Returns
Status Codes

Implements PhysicalLayer.

◆ setDio1Action()

void SX128x::setDio1Action ( void(*)(void)  func)

Sets interrupt service routine to call when DIO1 activates.

Parameters
funcISR to call.

◆ setEncoding()

int16_t SX128x::setEncoding ( uint8_t  encoding)
overridevirtual

Sets transmission encoding. Serves only as alias for PhysicalLayer compatibility.

Parameters
encodingEncoding to be used. Set to 0 for NRZ, and 2 for whitening.
Returns
Status Codes

Implements PhysicalLayer.

◆ setFrequency()

int16_t SX128x::setFrequency ( float  freq)

Sets carrier frequency. Allowed values are in range from 2400.0 to 2500.0 MHz.

Parameters
freqCarrier frequency to be set in MHz.
Returns
Status Codes

◆ setFrequencyDeviation()

int16_t SX128x::setFrequencyDeviation ( float  freqDev)
overridevirtual

Sets FSK frequency deviation. Allowed values range from 0.0 to 3200.0 kHz.

Parameters
freqDevFSK frequency deviation to be set in kHz.
Returns
Status Codes

Implements PhysicalLayer.

◆ setOutputPower()

int16_t SX128x::setOutputPower ( int8_t  power)

Sets output power. Allowed values are in range from -18 to 13 dBm.

Parameters
powerOutput power to be set in dBm.
Returns
Status Codes

◆ setPreambleLength()

int16_t SX128x::setPreambleLength ( uint32_t  preambleLength)

Sets preamble length for currently active modem. Allowed values range from 1 to 65535.

Parameters
preambleLengthPreamble length to be set in symbols (LoRa) or bits (FSK/BLE/FLRC).
Returns
Status Codes

◆ setRfSwitchPins()

void SX128x::setRfSwitchPins ( RADIOLIB_PIN_TYPE  rxEn,
RADIOLIB_PIN_TYPE  txEn 
)

Some modules contain external RF switch controlled by two pins. This function gives RadioLib control over those two pins to automatically switch Rx and Tx state. When using automatic RF switch control, DO NOT change the pin mode of rxEn or txEn from Arduino sketch!

Parameters
rxEnRX enable pin.
txEnTX enable pin.

◆ setSpreadingFactor()

int16_t SX128x::setSpreadingFactor ( uint8_t  sf)

Sets LoRa spreading factor. Allowed values range from 5 to 12.

Parameters
sfLoRa spreading factor to be set.
Returns
Status Codes

◆ setSyncWord() [1/2]

int16_t SX128x::setSyncWord ( uint8_t *  syncWord,
uint8_t  len 
)

Sets FSK/FLRC sync word in the form of array of up to 5 bytes (FSK). For FLRC modem, the sync word must be exactly 4 bytes long.

Parameters
syncWordSync word to be set.
lenSync word length in bytes.
Returns
Status Codes
Todo:
add support for multiple sync words

◆ setSyncWord() [2/2]

int16_t SX128x::setSyncWord ( uint8_t  syncWord,
uint8_t  controlBits = 0x44 
)

Sets LoRa sync word.

Parameters
syncWordLoRa sync word to be set.
controlBitsUndocumented control bits, required for compatibility purposes.
Returns
Status Codes

◆ setWhitening()

int16_t SX128x::setWhitening ( bool  enabled)

Sets whitening parameters, not available for LoRa or FLRC modem.

Parameters
enabledSet to true to enable whitening.
Returns
Status Codes

◆ sleep()

int16_t SX128x::sleep ( bool  retainConfig = true)

Sets the module to sleep mode.

Parameters
retainConfigSet to true to retain configuration and data buffer or to false to discard current configuration and data buffer. Defaults to true.
Returns
Status Codes

◆ standby() [1/2]

int16_t SX128x::standby ( )
overridevirtual

Sets the module to standby mode (overload for PhysicalLayer compatibility, uses 13 MHz RC oscillator).

Returns
Status Codes

Implements PhysicalLayer.

◆ standby() [2/2]

int16_t SX128x::standby ( uint8_t  mode)

Sets the module to standby mode.

Parameters
modeOscillator to be used in standby mode. Can be set to SX128X_STANDBY_RC (13 MHz RC oscillator) or SX128X_STANDBY_XOSC (52 MHz external crystal oscillator).
Returns
Status Codes

◆ startReceive()

int16_t SX128x::startReceive ( uint16_t  timeout = SX128X_RX_TIMEOUT_INF)

Interrupt-driven receive method. DIO1 will be activated when full packet is received.

Parameters
timeoutRaw timeout value, expressed as multiples of 15.625 us. Defaults to SX128X_RX_TIMEOUT_INF for infinite timeout (Rx continuous mode), set to SX128X_RX_TIMEOUT_NONE for no timeout (Rx single mode).
Returns
Status Codes

◆ startTransmit() [1/4]

int16_t PhysicalLayer::startTransmit

Interrupt-driven Arduino String transmit method. Unlike the standard transmit method, this one is non-blocking. Interrupt pin will be activated when transmission finishes.

Parameters
strC-string that will be transmitted.
addrNode address to transmit the packet to. Only used in FSK mode.
Returns
Status Codes

◆ startTransmit() [2/4]

int16_t PhysicalLayer::startTransmit

Interrupt-driven Arduino String transmit method. Unlike the standard transmit method, this one is non-blocking. Interrupt pin will be activated when transmission finishes.

Parameters
strAddress of Arduino String that will be transmitted.
addrNode address to transmit the packet to. Only used in FSK mode.
Returns
Status Codes

◆ startTransmit() [3/4]

int16_t SX128x::startTransmit ( uint8_t *  data,
size_t  len,
uint8_t  addr = 0 
)
overridevirtual

Interrupt-driven binary transmit method. Overloads for string-based transmissions are implemented in PhysicalLayer.

Parameters
dataBinary data to be sent.
lenNumber of bytes to send.
addrAddress to send the data to. Unsupported, compatibility only.
Returns
Status Codes

Implements PhysicalLayer.

◆ startTransmit() [4/4]

virtual int16_t PhysicalLayer::startTransmit

Interrupt-driven binary transmit method.

Parameters
dataBinary data that will be transmitted.
lenLength of binary data to transmit (in bytes).
addrNode address to transmit the packet to. Only used in FSK mode.
Returns
Status Codes

◆ transmit() [1/5]

int16_t PhysicalLayer::transmit

Arduino Flash String transmit method.

Parameters
strPointer to Arduino Flash String that will be transmitted.
addrNode address to transmit the packet to. Only used in FSK mode.
Returns
Status Codes

◆ transmit() [2/5]

int16_t PhysicalLayer::transmit

C-string transmit method.

Parameters
strC-string that will be transmitted.
addrNode address to transmit the packet to. Only used in FSK mode.
Returns
Status Codes

◆ transmit() [3/5]

int16_t PhysicalLayer::transmit

Arduino String transmit method.

Parameters
strAddress of Arduino string that will be transmitted.
addrNode address to transmit the packet to. Only used in FSK mode.
Returns
Status Codes

◆ transmit() [4/5]

int16_t SX128x::transmit ( uint8_t *  data,
size_t  len,
uint8_t  addr = 0 
)
overridevirtual

Blocking binary transmit method. Overloads for string-based transmissions are implemented in PhysicalLayer.

Parameters
dataBinary data to be sent.
lenNumber of bytes to send.
addrAddress to send the data to. Unsupported, compatibility only.
Returns
Status Codes

Implements PhysicalLayer.

◆ transmit() [5/5]

virtual int16_t PhysicalLayer::transmit

Binary transmit method. Must be implemented in module class.

Parameters
dataBinary data that will be transmitted.
lenLength of binary data to transmit (in bytes).
addrNode address to transmit the packet to. Only used in FSK mode.
Returns
Status Codes

◆ transmitDirect()

int16_t SX128x::transmitDirect ( uint32_t  frf = 0)
overridevirtual

Starts direct mode transmission.

Parameters
frfRaw RF frequency value. Defaults to 0, required for quick frequency shifts in RTTY.
Returns
Status Codes

Implements PhysicalLayer.


The documentation for this class was generated from the following files: