mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-23 06:14:13 -04:00
HH:MM in POCSAG RX
This commit is contained in:
parent
0a549c8192
commit
1b9465716f
8 changed files with 27 additions and 10 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
/firmware/application/application.bin
|
||||||
/CMakeCache.txt
|
/CMakeCache.txt
|
||||||
/Makefile
|
/Makefile
|
||||||
/firmware/baseband/Makefile
|
/firmware/baseband/Makefile
|
||||||
|
|
|
@ -59,6 +59,10 @@ void POCSAGLogger::on_packet(const pocsag::POCSAGPacket& packet, const uint32_t
|
||||||
log_file.write_entry(packet.timestamp(), entry);
|
log_file.write_entry(packet.timestamp(), entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void POCSAGLogger::on_decoded(const pocsag::POCSAGPacket& packet, const std::string text) {
|
||||||
|
log_file.write_entry(packet.timestamp(), text);
|
||||||
|
}
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
void POCSAGAppView::update_freq(rf::Frequency f) {
|
void POCSAGAppView::update_freq(rf::Frequency f) {
|
||||||
|
@ -69,7 +73,7 @@ void POCSAGAppView::update_freq(rf::Frequency f) {
|
||||||
|
|
||||||
portapack::persistent_memory::set_tuned_frequency(f); // Maybe not ?
|
portapack::persistent_memory::set_tuned_frequency(f); // Maybe not ?
|
||||||
|
|
||||||
auto mhz = to_string_dec_int(f / 1000000, 3);
|
auto mhz = to_string_dec_int(f / 1000000, 4);
|
||||||
auto hz100 = to_string_dec_int((f / 100) % 10000, 4, '0');
|
auto hz100 = to_string_dec_int((f / 100) % 10000, 4, '0');
|
||||||
|
|
||||||
strcat(finalstr, mhz.c_str());
|
strcat(finalstr, mhz.c_str());
|
||||||
|
@ -141,12 +145,10 @@ void POCSAGAppView::on_packet(const POCSAGPacketMessage * message) {
|
||||||
bool eom = false;
|
bool eom = false;
|
||||||
uint32_t codeword;
|
uint32_t codeword;
|
||||||
std::string alphanum_text = "";
|
std::string alphanum_text = "";
|
||||||
std::string output_text = "";
|
std::string output_text = "MSG:";
|
||||||
char ascii_char;
|
char ascii_char;
|
||||||
|
|
||||||
if( logger ) {
|
if( logger ) logger->on_packet(message->packet, target_frequency());
|
||||||
logger->on_packet(message->packet, target_frequency());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < 16; i++) {
|
for (size_t i = 0; i < 16; i++) {
|
||||||
codeword = message->packet[i];
|
codeword = message->packet[i];
|
||||||
|
@ -187,6 +189,9 @@ void POCSAGAppView::on_packet(const POCSAGPacketMessage * message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.writeln(output_text);
|
console.writeln(output_text);
|
||||||
|
|
||||||
|
if (logger) logger->on_decoded(message->packet, output_text);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Address
|
// Address
|
||||||
if (codeword == POCSAG_IDLE) {
|
if (codeword == POCSAG_IDLE) {
|
||||||
|
@ -199,7 +204,11 @@ void POCSAGAppView::on_packet(const POCSAGPacketMessage * message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eom) {
|
if (eom) {
|
||||||
console.writeln("ADDR:" + to_string_hex(address, 6) + " F:" + to_string_dec_uint(function) + " ");
|
if (address || function)
|
||||||
|
console.writeln(to_string_time(message->packet.timestamp()) + " ADDR:" + to_string_hex(address, 6) + " F:" + to_string_dec_uint(function) + " ");
|
||||||
|
else
|
||||||
|
console.writeln(to_string_time(message->packet.timestamp()) + " Tone only ");
|
||||||
|
|
||||||
ascii_idx = 0;
|
ascii_idx = 0;
|
||||||
ascii_data = 0;
|
ascii_data = 0;
|
||||||
batch_cnt = 0;
|
batch_cnt = 0;
|
||||||
|
|
|
@ -42,6 +42,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_packet(const pocsag::POCSAGPacket& packet, const uint32_t frequency);
|
void on_packet(const pocsag::POCSAGPacket& packet, const uint32_t frequency);
|
||||||
|
void on_decoded(const pocsag::POCSAGPacket& packet, const std::string text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LogFile log_file;
|
LogFile log_file;
|
||||||
|
@ -104,7 +105,7 @@ private:
|
||||||
};
|
};
|
||||||
Button button_setfreq {
|
Button button_setfreq {
|
||||||
{ 0, 20, 12 * 8, 20 },
|
{ 0, 20, 12 * 8, 20 },
|
||||||
"---.----M"
|
"----.----"
|
||||||
};
|
};
|
||||||
|
|
||||||
Console console {
|
Console console {
|
||||||
|
|
|
@ -121,6 +121,11 @@ std::string to_string_datetime(const rtc::RTC& value) {
|
||||||
to_string_dec_uint(value.second(), 2, '0');
|
to_string_dec_uint(value.second(), 2, '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string to_string_time(const rtc::RTC& value) {
|
||||||
|
return to_string_dec_uint(value.hour(), 2, '0') + ":" +
|
||||||
|
to_string_dec_uint(value.minute(), 2, '0');
|
||||||
|
}
|
||||||
|
|
||||||
std::string to_string_timestamp(const rtc::RTC& value) {
|
std::string to_string_timestamp(const rtc::RTC& value) {
|
||||||
return to_string_dec_uint(value.year(), 4, '0') +
|
return to_string_dec_uint(value.year(), 4, '0') +
|
||||||
to_string_dec_uint(value.month(), 2, '0') +
|
to_string_dec_uint(value.month(), 2, '0') +
|
||||||
|
|
|
@ -35,6 +35,7 @@ std::string to_string_dec_int(const int32_t n, const int32_t l = 0, const char f
|
||||||
std::string to_string_hex(const uint32_t n, const int32_t l = 0);
|
std::string to_string_hex(const uint32_t n, const int32_t l = 0);
|
||||||
|
|
||||||
std::string to_string_datetime(const rtc::RTC& value);
|
std::string to_string_datetime(const rtc::RTC& value);
|
||||||
|
std::string to_string_time(const rtc::RTC& value);
|
||||||
std::string to_string_timestamp(const rtc::RTC& value);
|
std::string to_string_timestamp(const rtc::RTC& value);
|
||||||
|
|
||||||
#endif/*__STRING_FORMAT_H__*/
|
#endif/*__STRING_FORMAT_H__*/
|
||||||
|
|
|
@ -44,11 +44,11 @@ void AFSKSetupView::focus() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AFSKSetupView::update_freq(rf::Frequency f) {
|
void AFSKSetupView::update_freq(rf::Frequency f) {
|
||||||
char finalstr[9] = {0};
|
char finalstr[10] = {0};
|
||||||
|
|
||||||
portapack::persistent_memory::set_tuned_frequency(f);
|
portapack::persistent_memory::set_tuned_frequency(f);
|
||||||
|
|
||||||
auto mhz = to_string_dec_int(f / 1000000, 3);
|
auto mhz = to_string_dec_int(f / 1000000, 4);
|
||||||
auto hz100 = to_string_dec_int((f / 100) % 10000, 4, '0');
|
auto hz100 = to_string_dec_int((f / 100) % 10000, 4, '0');
|
||||||
|
|
||||||
strcat(finalstr, mhz.c_str());
|
strcat(finalstr, mhz.c_str());
|
||||||
|
|
|
@ -47,7 +47,7 @@ private:
|
||||||
};
|
};
|
||||||
Button button_setfreq {
|
Button button_setfreq {
|
||||||
{ 8, 48, 104, 32 },
|
{ 8, 48, 104, 32 },
|
||||||
"---.----M"
|
"----.----"
|
||||||
};
|
};
|
||||||
|
|
||||||
Text text_bps {
|
Text text_bps {
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue