mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 16:16:18 +00:00
POCSAG State machine fix (#1410)
* Reset color for well-formed message fragments * better colors * Fix POGSAG decode state machine * Invert is_message to make more clear * Use new escape string constants * Run ECC twice, better diagnostics * center status icon --------- Co-authored-by: kallanreed <kallanreed@noreply.github.com>
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
|
||||
namespace pocsag {
|
||||
|
||||
// Todo: these enums suck, make a better decode_batch
|
||||
// TODO: these enums suck, make a better decode_batch
|
||||
|
||||
enum Mode : uint32_t {
|
||||
STATE_CLEAR,
|
||||
@@ -45,6 +45,7 @@ enum Mode : uint32_t {
|
||||
|
||||
enum OutputType : uint32_t {
|
||||
EMPTY,
|
||||
IDLE,
|
||||
ADDRESS,
|
||||
MESSAGE
|
||||
};
|
||||
@@ -56,6 +57,7 @@ enum MessageType : uint32_t {
|
||||
};
|
||||
|
||||
struct POCSAGState {
|
||||
uint8_t codeword_index;
|
||||
uint32_t function;
|
||||
uint32_t address;
|
||||
Mode mode = STATE_CLEAR;
|
||||
@@ -78,7 +80,9 @@ std::string flag_str(PacketFlag packetflag);
|
||||
void insert_BCH(BCHCode& BCH_code, uint32_t* codeword);
|
||||
uint32_t get_digit_code(char code);
|
||||
void pocsag_encode(const MessageType type, BCHCode& BCH_code, const uint32_t function, const std::string message, const uint32_t address, std::vector<uint32_t>& codewords);
|
||||
void pocsag_decode_batch(const POCSAGPacket& batch, POCSAGState* const state);
|
||||
|
||||
// Returns true if the batch has more to process.
|
||||
bool pocsag_decode_batch(const POCSAGPacket& batch, POCSAGState& state);
|
||||
|
||||
} /* namespace pocsag */
|
||||
|
||||
|
Reference in New Issue
Block a user