mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-12 09:39:30 +00:00
POCSAG: decoder fixes, serial output, TX polarity cleanup (#3130)
RX: fix address/batch-boundary handling, add numeric continuation, add heuristic type detection toggle, pass inverted polarity flag, stream decoded messages over USB serial. TX: rename phase to polarity (Standard/Inverted), fix function validation (&&→||), fix serial shell payload read (offset tracking, 31-byte cap, preserve msglen). Decoder: remove color escapes from output (plain text for all consumers), guard count_alpha_fill against empty string, keep numeric_len across continuation batches. Serial format: POCSAG <baud> <addr> <func> <pol> <type> "<msg>" hex:<hex> Quote escaping for embedded " and \\ in alpha messages.
This commit is contained in:
@@ -35,8 +35,7 @@ enum BitRate : uint32_t {
|
||||
UNKNOWN,
|
||||
FSK512 = 512,
|
||||
FSK1200 = 1200,
|
||||
FSK2400 = 2400,
|
||||
FSK3200 = 3200
|
||||
FSK2400 = 2400
|
||||
};
|
||||
|
||||
enum PacketFlag : uint32_t {
|
||||
@@ -88,15 +87,25 @@ class POCSAGPacket {
|
||||
return flag_;
|
||||
}
|
||||
|
||||
void set_inverted(bool inverted) {
|
||||
inverted_ = inverted;
|
||||
}
|
||||
|
||||
bool inverted() const {
|
||||
return inverted_;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
codewords.fill(0);
|
||||
bitrate_ = 0u;
|
||||
flag_ = NORMAL;
|
||||
inverted_ = false;
|
||||
}
|
||||
|
||||
private:
|
||||
uint16_t bitrate_{0};
|
||||
PacketFlag flag_{NORMAL};
|
||||
bool inverted_{false};
|
||||
batch_t codewords{};
|
||||
Timestamp timestamp_{};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user