Rtty tx and rx (#2977)

This commit is contained in:
Totoo
2026-02-16 14:34:55 +01:00
committed by GitHub
parent 95eafeb812
commit 794daf5257
21 changed files with 1809 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
#ifndef BAUDOT_HPP
#define BAUDOT_HPP
#include <cstdint>
#include <string>
namespace ui::external_app::rtty_tx {
class BaudotCoder {
public:
enum ShiftState { LETTERS,
FIGURES };
BaudotCoder()
: shiftState(LETTERS) {}
char decode(uint8_t baudotCode);
void encode(const std::string& src, uint8_t* dest, uint16_t* dest_length, uint16_t dest_max_size);
void set_usos(bool enable) { usos_enabled = enable; } // shift == set to letters too
private:
ShiftState shiftState;
bool usos_enabled = true;
char get_char_mapping(bool is_figures, uint8_t index) const;
};
} // namespace ui::external_app::rtty_tx
#endif // BAUDOT_HPP