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

BellModem.h
#if !defined(_RADIOLIB_BELL_MODEM_H)
#define _RADIOLIB_BELL_MODEM_H
#include "../../TypeDef.h"
#include "../../Module.h"
#if defined(RADIOLIB_BUILD_ARDUINO)
#include "../../ArduinoHal.h"
#endif
#if !defined(RADIOLIB_EXCLUDE_BELL)
#include "../PhysicalLayer/PhysicalLayer.h"
#include "../AFSK/AFSK.h"
#include "../Print/Print.h"
#include "../Print/ITA2String.h"
struct BellModem_t {
int16_t freqMark;
int16_t freqSpace;
int16_t baudRate;
int16_t freqMarkReply;
int16_t freqSpaceReply;
};
// currently implemented Bell modems
extern const struct BellModem_t Bell101;
extern const struct BellModem_t Bell103;
extern const struct BellModem_t Bell202;
class BellClient: public AFSKClient, public RadioLibPrint {
public:
bool reply;
explicit BellClient(PhysicalLayer* phy, uint32_t pin);
BellClient(AFSKClient* aud);
int16_t begin(const BellModem_t& modem);
int16_t setModem(const BellModem_t& modem);
int16_t setCorrection(float corr);
size_t write(uint8_t b);
int16_t idle();
int16_t standby();
#if !defined(RADIOLIB_GODMODE)
private:
#endif
BellModem_t modemType;
float correction = 1.0;
uint16_t toneLen = 0;
bool autoStart = true;
};
#endif
#endif
AFSKClient
Client for audio-based transmissions. Requires Arduino tone() function, and a module capable of direc...
Definition: AFSK.h:16
AFSKClient::begin
int16_t begin()
Initialization method.
Definition: AFSK.cpp:13
BellClient
Client for Bell modem communication. The public interface is the same as Arduino Serial.
Definition: BellModem.h:57
BellClient::setModem
int16_t setModem(const BellModem_t &modem)
Set Bell modem.
Definition: BellModem.cpp:44
BellClient::standby
int16_t standby()
Set the modem to standby (transmitter off).
Definition: BellModem.cpp:93
BellClient::setCorrection
int16_t setCorrection(float corr)
Set correction coefficient for tone length.
Definition: BellModem.cpp:50
BellClient::reply
bool reply
Whether the modem is replying. On some modems, the replying station has different tone frequencies.
Definition: BellModem.h:65
BellClient::write
size_t write(uint8_t b)
Write one byte. Implementation of interface of the RadioLibPrint/Print class.
Definition: BellModem.cpp:55
BellClient::idle
int16_t idle()
Set the modem to idle (ready to transmit).
Definition: BellModem.cpp:88
PhysicalLayer
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition: PhysicalLayer.h:33
RadioLibPrint
Definition: Print.h:14
Bell101
Definition: BellModem.cpp:4
Bell103
Definition: BellModem.cpp:12
Bell202
Definition: BellModem.cpp:20
BellModem_t
Definition of the Bell-compatible modem.
Definition: BellModem.h:21
BellModem_t::freqSpace
int16_t freqSpace
Frequency of the space tone.
Definition: BellModem.h:30
BellModem_t::freqSpaceReply
int16_t freqSpaceReply
Frequency of the space tone when replying.
Definition: BellModem.h:45
BellModem_t::baudRate
int16_t baudRate
Baud rate.
Definition: BellModem.h:35
BellModem_t::freqMarkReply
int16_t freqMarkReply
Frequency of the mark tone when replying.
Definition: BellModem.h:40
BellModem_t::freqMark
int16_t freqMark
Frequency of the mark tone.
Definition: BellModem.h:25