# RadioLib: src/protocols/FSK4/FSK4.h Source File

FSK4.h
#if !defined(_RADIOLIB_FSK4_H)
#define _RADIOLIB_FSK4_H
#include "../../TypeDef.h"
#if !RADIOLIB_EXCLUDE_FSK4
#include "../PhysicalLayer/PhysicalLayer.h"
#include "../AFSK/AFSK.h"
class FSK4Client {
public:
explicit FSK4Client(PhysicalLayer* phy);
#if !RADIOLIB_EXCLUDE_AFSK
explicit FSK4Client(AFSKClient* audio);
#endif
// basic methods
int16_t begin(float base, uint32_t shift, uint16_t rate);
void idle();
int16_t setCorrection(int16_t offsets[4], float length = 1.0f);
size_t write(uint8_t* buff, size_t len);
size_t write(uint8_t b);
int16_t standby();
#if !RADIOLIB_GODMODE
private:
#endif
PhysicalLayer* phyLayer;
#if !RADIOLIB_EXCLUDE_AFSK
AFSKClient* audioClient;
#endif
uint32_t baseFreq = 0, baseFreqHz = 0;
uint32_t shiftFreq = 0, shiftFreqHz = 0;
RadioLibTime_t bitDuration = 0;
uint32_t tones[4] = { 0 };
uint32_t tonesHz[4] = { 0 };
void tone(uint8_t i);
int16_t transmitDirect(uint32_t freq = 0, uint32_t freqHz = 0);
int32_t getRawShift(int32_t shift);
};
#endif
#endif
AFSKClient
Client for audio-based transmissions. Requires Arduino tone() function, and a module capable of direc...
Definition: AFSK.h:16
FSK4Client
Client for FSK-4 communication. The public interface is the same as Arduino Serial.
Definition: FSK4.h:15
FSK4Client::begin
int16_t begin(float base, uint32_t shift, uint16_t rate)
Initialization method.
Definition: FSK4.cpp:19
FSK4Client::FSK4Client
FSK4Client(PhysicalLayer *phy)
Constructor for FSK-4 mode.
Definition: FSK4.cpp:5
FSK4Client::idle
void idle()
Send out idle condition (RF tone at mark frequency).
Definition: FSK4.cpp:43
FSK4Client::standby
int16_t standby()
Stop transmitting.
Definition: FSK4.cpp:98
FSK4Client::write
size_t write(uint8_t *buff, size_t len)
Transmit binary data.
Definition: FSK4.cpp:57
FSK4Client::setCorrection
int16_t setCorrection(int16_t offsets[4], float length=1.0f)
Set correction coefficients for frequencies and tone length.
Definition: FSK4.cpp:48
PhysicalLayer
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition: PhysicalLayer.h:54
RadioLibTime_t
unsigned long RadioLibTime_t
Type used for durations in RadioLib.
Definition: TypeDef.h:586