kopia lustrzana https://github.com/jgromes/RadioLib
[RTTY] Added support for ITA2 print and println
rodzic
bdb864e87a
commit
91de1e2b9a
|
@ -97,13 +97,18 @@ void loop() {
|
|||
// RTTY client must be configured to 5 bits
|
||||
rtty.begin(434, 183, 45, 5);
|
||||
|
||||
// synd synchronization string ("RYRY..." corresponds
|
||||
// to binary 01010101010101010101...)
|
||||
ITA2 sync = "RYRYRYRY";
|
||||
rtty.println(sync);
|
||||
|
||||
// create ITA2-encoded string
|
||||
// NOTE: ASCII characters that do not have ITA2
|
||||
// equivalent will be replaced with NUL
|
||||
ITA2 itaStr = "HELLO WORLD\n";
|
||||
|
||||
// send the ITA2 string
|
||||
rtty.write(itaStr.byteArr(), itaStr.length());
|
||||
ITA2 itaStr = "HELLO WORLD";
|
||||
|
||||
// print the ITA2 string
|
||||
rtty.println(itaStr);
|
||||
*/
|
||||
|
||||
// turn transmitter off
|
||||
|
|
|
@ -124,6 +124,10 @@ size_t RTTYClient::write(uint8_t b) {
|
|||
return(1);
|
||||
}
|
||||
|
||||
size_t RTTYClient::print(ITA2& ita2) {
|
||||
return(RTTYClient::write(ita2.byteArr(), ita2.length()));
|
||||
}
|
||||
|
||||
size_t RTTYClient::print(const String& str) {
|
||||
return(RTTYClient::write((uint8_t*)str.c_str(), str.length()));
|
||||
}
|
||||
|
@ -176,7 +180,22 @@ size_t RTTYClient::print(double n, int digits) {
|
|||
}
|
||||
|
||||
size_t RTTYClient::println(void) {
|
||||
return(RTTYClient::write("\r\n"));
|
||||
size_t n = 0;
|
||||
if(_dataBits == 5) {
|
||||
// use ITA2 line
|
||||
ITA2 lf = "\r\n";
|
||||
n = RTTYClient::print(lf);
|
||||
} else {
|
||||
// use ASCII line
|
||||
n = RTTYClient::write("\r\n");
|
||||
}
|
||||
return(n);
|
||||
}
|
||||
|
||||
size_t RTTYClient::println(ITA2& ita2) {
|
||||
size_t n = RTTYClient::print(ita2);
|
||||
n += RTTYClient::println();
|
||||
return(n);
|
||||
}
|
||||
|
||||
size_t RTTYClient::println(const String& str) {
|
||||
|
|
|
@ -42,6 +42,7 @@ class RTTYClient {
|
|||
size_t write(uint8_t* buff, size_t len);
|
||||
size_t write(uint8_t b);
|
||||
|
||||
size_t print(ITA2 &);
|
||||
size_t print(const String &);
|
||||
size_t print(const char[]);
|
||||
size_t print(char);
|
||||
|
@ -53,6 +54,7 @@ class RTTYClient {
|
|||
size_t print(double, int = 2);
|
||||
|
||||
size_t println(void);
|
||||
size_t println(ITA2 &);
|
||||
size_t println(const String &s);
|
||||
size_t println(const char[]);
|
||||
size_t println(char);
|
||||
|
|
Ładowanie…
Reference in New Issue