Pocsagtxserial (#2099)

* sendpocsag first test
* optimize
* nicer
* overflow
This commit is contained in:
Totoo
2024-04-11 15:10:59 +02:00
committed by GitHub
parent 004799e1a3
commit e9c32504d1
4 changed files with 143 additions and 0 deletions

View File

@@ -122,6 +122,7 @@ class Message {
OrientationData = 64,
EnvironmentData = 65,
AudioBeep = 66,
PocsagTosend = 67,
MAX
};
@@ -1379,4 +1380,33 @@ class AudioBeepMessage : public Message {
uint32_t sample_rate = 24000;
uint32_t duration_ms = 100;
};
class PocsagTosendMessage : public Message {
public:
constexpr PocsagTosendMessage(
uint16_t baud = 1200,
uint8_t type = 2,
char function = 'D',
char phase = 'N',
uint8_t msglen = 0,
uint8_t msg[31] = {0},
uint64_t addr = 0)
: Message{ID::PocsagTosend},
baud{baud},
type{type},
function{function},
phase{phase},
msglen{msglen},
addr{addr} {
memcpy(this->msg, msg, 31);
}
uint16_t baud = 1200;
uint8_t type = 2;
char function = 'D';
char phase = 'N';
uint8_t msglen = 0;
uint8_t msg[31] = {0};
uint64_t addr = 0;
};
#endif /*__MESSAGE_H__*/