fix iq exporter config name

pull/1320/head
AlexandreRouma 2024-02-03 01:43:16 +01:00
rodzic d5fa76df06
commit bddfe5396f
2 zmienionych plików z 38 dodań i 38 usunięć

Wyświetl plik

@ -85,22 +85,22 @@ namespace pocsag {
void Decoder::flushMessage() {
if (!msg.empty()) {
// // Unpack bits
// std::string outStr = "";
// for (int i = 0; (i+7) <= msg.size(); i += 7) {
// uint8_t b0 = msg[i];
// uint8_t b1 = msg[i+1];
// uint8_t b2 = msg[i+2];
// uint8_t b3 = msg[i+3];
// uint8_t b4 = msg[i+4];
// uint8_t b5 = msg[i+5];
// uint8_t b6 = msg[i+6];
// outStr += (char)((b6<<6) | (b5<<5) | (b4<<4) | (b3<<3) | (b2<<2) | (b1<<1) | b0);
// }
// onMessage(addr, msgType, outStr);
// Unpack bits
std::string outStr = "";
for (int i = 0; (i+7) <= msg.size(); i += 7) {
uint8_t b0 = msg[i];
uint8_t b1 = msg[i+1];
uint8_t b2 = msg[i+2];
uint8_t b3 = msg[i+3];
uint8_t b4 = msg[i+4];
uint8_t b5 = msg[i+5];
uint8_t b6 = msg[i+6];
outStr += (char)((b6<<6) | (b5<<5) | (b4<<4) | (b3<<3) | (b2<<2) | (b1<<1) | b0);
}
onMessage(addr, msgType, outStr);
// Send out message
onMessage(addr, msgType, msg);
// // Send out message
// onMessage(addr, msgType, msg);
// Reset state
msg.clear();
@ -167,31 +167,31 @@ namespace pocsag {
//msg += NUMERIC_CHARSET[data & 0b1111];
}
else if (msgType == MESSAGE_TYPE_ALPHANUMERIC) {
// Alpha messages pack 7bit characters in the entire codeword stream
int lasti;
for (int i = -leftInLast; i <= POCSAG_DATA_BITS_PER_CW-7; i += 7) {
// Read 7 bits
char c = 0;
if (i < 0) {
c = (lastMsgData & ((1 << (-i)) - 1)) << (7+i);
}
c |= (data >> (13 - i)) & 0b1111111;
// // Alpha messages pack 7bit characters in the entire codeword stream
// int lasti;
// for (int i = -leftInLast; i <= POCSAG_DATA_BITS_PER_CW-7; i += 7) {
// // Read 7 bits
// char c = 0;
// if (i < 0) {
// c = (lastMsgData & ((1 << (-i)) - 1)) << (7+i);
// }
// c |= (data >> (13 - i)) & 0b1111111;
// Save character
bitswapChar(c, c);
msg += c;
// // Save character
// bitswapChar(c, c);
// msg += c;
// Update last successful unpack
lasti = i;
}
// Save how much is still left to read
leftInLast = 20 - (lasti + 7);
// // Pack the bits backwards
// for (int i = 19; i >= 0; i--) {
// msg += (char)((data >> i) & 1);
// // Update last successful unpack
// lasti = i;
// }
// // Save how much is still left to read
// leftInLast = 20 - (lasti + 7);
// Pack the bits backwards
for (int i = 19; i >= 0; i--) {
msg += (char)((data >> i) & 1);
}
}
// Save last data

Wyświetl plik

@ -570,7 +570,7 @@ private:
MOD_EXPORT void _INIT_() {
json def = json({});
std::string root = (std::string)core::args["root"];
config.setPath(root + "/iq_exporter_config_config.json");
config.setPath(root + "/iq_exporter_config.json");
config.load(def);
config.enableAutoSave();
}