[RTTY] Added Doxygen comments
This commit is contained in:
parent
0ea2cf1596
commit
3e6a780c4b
1 changed files with 77 additions and 14 deletions
|
@ -16,13 +16,45 @@ static const char ITA2Table[ITA2_LENGTH][2] = {{'\0', '\0'}, {'E', '3'}, {'\n',
|
||||||
{'T', '5'}, {'Z', '+'}, {'L', ')'}, {'W', '2'}, {'H', 0x7F}, {'Y', '6'}, {'P', '0'}, {'Q', '1'},
|
{'T', '5'}, {'Z', '+'}, {'L', ')'}, {'W', '2'}, {'H', 0x7F}, {'Y', '6'}, {'P', '0'}, {'Q', '1'},
|
||||||
{'O', '9'}, {'B', '?'}, {'G', '&'}, {0x7F, 0x7F}, {'M', '.'}, {'X', '/'}, {'V', ';'}, {0x7F, 0x7F}};
|
{'O', '9'}, {'B', '?'}, {'G', '&'}, {0x7F, 0x7F}, {'M', '.'}, {'X', '/'}, {'V', ';'}, {0x7F, 0x7F}};
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class ITA2String
|
||||||
|
|
||||||
|
\brief ITA2-encoded string.
|
||||||
|
*/
|
||||||
class ITA2String {
|
class ITA2String {
|
||||||
public:
|
public:
|
||||||
|
/*!
|
||||||
|
\brief Default single-character constructor.
|
||||||
|
|
||||||
|
\param c ASCII-encoded character to encode as ITA2.
|
||||||
|
*/
|
||||||
ITA2String(char c);
|
ITA2String(char c);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Default string constructor.
|
||||||
|
|
||||||
|
\param str ASCII-encoded string to encode as ITA2.
|
||||||
|
*/
|
||||||
ITA2String(const char* str);
|
ITA2String(const char* str);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Default destructor.
|
||||||
|
*/
|
||||||
~ITA2String();
|
~ITA2String();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Gets the length of the ITA2 string. This number is not the same as the length of ASCII-encoded string!
|
||||||
|
|
||||||
|
\returns Length of ITA2-encoded string.
|
||||||
|
*/
|
||||||
size_t length();
|
size_t length();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Gets the ITA2 representation of the ASCII string set in constructor.
|
||||||
|
|
||||||
|
\returns Pointer to dynamically allocated array, which contains ITA2-encoded bytes.
|
||||||
|
It is the caller's responsibility to deallocate this memory!
|
||||||
|
*/
|
||||||
uint8_t* byteArr();
|
uint8_t* byteArr();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -33,18 +65,49 @@ class ITA2String {
|
||||||
uint16_t getBits(char c);
|
uint16_t getBits(char c);
|
||||||
};
|
};
|
||||||
|
|
||||||
// supported ancoding schemes
|
// supported encoding schemes
|
||||||
#define ASCII 0
|
#define ASCII 0
|
||||||
#define ASCII_EXTENDED 1
|
#define ASCII_EXTENDED 1
|
||||||
#define ITA2 2
|
#define ITA2 2
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class RTTYClient
|
||||||
|
|
||||||
|
\brief Client for RTTY communication. The public interface is the same as Arduino Serial.
|
||||||
|
*/
|
||||||
class RTTYClient {
|
class RTTYClient {
|
||||||
public:
|
public:
|
||||||
|
/*!
|
||||||
|
\brief Default constructor.
|
||||||
|
|
||||||
|
\param phy Pointer to the wireless module providing PhysicalLayer communication.
|
||||||
|
*/
|
||||||
RTTYClient(PhysicalLayer* phy);
|
RTTYClient(PhysicalLayer* phy);
|
||||||
|
|
||||||
// basic methods
|
// basic methods
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Initialization method.
|
||||||
|
|
||||||
|
\param base Base (space) RF frequency to be used in MHz.
|
||||||
|
|
||||||
|
\param shift Frequency shift between mark and space in Hz.
|
||||||
|
|
||||||
|
\param rate Baud rate to be used during transmission.
|
||||||
|
|
||||||
|
\param encoding Encoding to be used. Defaults to ASCII.
|
||||||
|
|
||||||
|
\param stopBits Number of stop bits to be used.
|
||||||
|
|
||||||
|
\returns \ref status_codes
|
||||||
|
*/
|
||||||
int16_t begin(float base, uint16_t shift, uint16_t rate, uint8_t encoding = ASCII, uint8_t stopBits = 1);
|
int16_t begin(float base, uint16_t shift, uint16_t rate, uint8_t encoding = ASCII, uint8_t stopBits = 1);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Send out idle condition (RF tone at mark frequency).
|
||||||
|
*/
|
||||||
void idle();
|
void idle();
|
||||||
|
|
||||||
size_t write(const char* str);
|
size_t write(const char* str);
|
||||||
size_t write(uint8_t* buff, size_t len);
|
size_t write(uint8_t* buff, size_t len);
|
||||||
size_t write(uint8_t b);
|
size_t write(uint8_t b);
|
||||||
|
|
Loading…
Add table
Reference in a new issue