mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 14:43:18 +00:00
Yet another POCSAG bugfix (multi-batch messages are not cut anymore)
Added BCH ECC functions for checking, error correction and encoding
This commit is contained in:
@@ -23,16 +23,20 @@
|
||||
#ifndef __POCSAG_H__
|
||||
#define __POCSAG_H__
|
||||
|
||||
#define POCSAG_PREAMBLE_LENGTH 576
|
||||
#define POCSAG_TIMEOUT (576 * 2) // Preamble length * 2
|
||||
#define POCSAG_SYNC 0x7CD215D8
|
||||
#define POCSAG_IDLE 0x7A89C197
|
||||
#define POCSAG_SYNCWORD 0x7CD215D8
|
||||
#define POCSAG_IDLEWORD 0x7A89C197
|
||||
#define POCSAG_AUDIO_RATE 24000
|
||||
#define POCSAG_BATCH_LENGTH (17 * 32)
|
||||
|
||||
#include "pocsag_packet.hpp"
|
||||
#include "bch_code.hpp"
|
||||
|
||||
namespace pocsag {
|
||||
|
||||
// Todo: these enums suck, make a better decode_batch
|
||||
|
||||
enum Mode : uint32_t {
|
||||
STATE_CLEAR,
|
||||
STATE_HAVE_ADDRESS,
|
||||
@@ -58,7 +62,9 @@ struct POCSAGState {
|
||||
std::string bitrate_str(BitRate bitrate);
|
||||
std::string flag_str(PacketFlag packetflag);
|
||||
|
||||
bool decode_batch(const POCSAGPacket& batch, POCSAGState * const state);
|
||||
void insert_BCH(BCHCode& BCH_code, uint32_t * codeword);
|
||||
void pocsag_encode(BCHCode& BCH_code, const std::string text, const uint32_t address, std::vector<uint32_t>& codewords);
|
||||
bool pocsag_decode_batch(const POCSAGPacket& batch, POCSAGState * const state);
|
||||
|
||||
} /* namespace pocsag */
|
||||
|
||||
|
Reference in New Issue
Block a user