Added function setting in POCSAG TX

POCSAG TX: Max message length is now 30 (was 16 for no reason)
This commit is contained in:
furrtek
2017-09-23 04:53:42 +01:00
parent a6d2b766f4
commit 9acfdcbd41
7 changed files with 37 additions and 35 deletions

View File

@@ -102,8 +102,7 @@ uint32_t get_digit_code(char code) {
return code;
}
void pocsag_encode(
const MessageType type, BCHCode& BCH_code, const std::string message, const uint32_t address,
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) {
size_t b, c, address_slot;
@@ -122,8 +121,7 @@ void pocsag_encode(
codeword = (address & 0x1FFFF8U) << 10;
address_slot = (address & 7) * 2;
// Function
if (type == MessageType::ALPHANUMERIC)
codeword |= (3 << 11);
codeword |= (function << 11);
insert_BCH(BCH_code, &codeword);

View File

@@ -76,7 +76,7 @@ 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 std::string message,
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);

View File

@@ -79,8 +79,7 @@ public:
}
void clear() {
for (uint32_t c = 0; c < 16; c++)
codewords[c] = 0;
codewords.fill(0);
bitrate_ = UNKNOWN;
flag_ = NORMAL;
}
@@ -88,7 +87,7 @@ public:
private:
BitRate bitrate_ { UNKNOWN };
PacketFlag flag_ { NORMAL };
uint32_t codewords[16];
std::array <uint32_t, 16> codewords;
Timestamp timestamp_ { };
};