Commit dd2f0054 authored by weisenbergertub90's avatar weisenbergertub90
Browse files

Display asterisk for non digit and non letter character of callsign.

parent f03d75b9
......@@ -153,7 +153,13 @@ void Beacon_Body_Decoder_impl::handle_enable_status(pmt::pmt_t msg)
log.add_to_log_entry_new_line("");
log.ss << "Received callsign: ";
for (uint8_t i = 0; i < 6; i++) {
log.ss << (char)rx.callsign[i];
if(((((char)rx.callsign[i]) >= 0x30) && (((char)rx.callsign[i]) <= 0x3A))
|| ((((char)rx.callsign[i]) >= 0x41) && (((char)rx.callsign[i]) <= 0x5A))
|| ((((char)rx.callsign[i]) >= 0x60) && (((char)rx.callsign[i]) <= 0x7A))) {
log.ss << (char)rx.callsign[i];
} else {
log.ss << (char)0x2A;
}
}
log.write_new_log_entry(log.ss.str());
......
......@@ -186,7 +186,13 @@ int Beacon_Header_Decoder_impl::general_work(int noutput_items,
if (fr.read_callsign(in[i])) {
std::cout << "Callsign received: ";
for (uint8_t i = 0; i < 6; i++) {
std::cout << (char)rx.callsign[i];
if(((((char)rx.callsign[i]) >= 0x30) && (((char)rx.callsign[i]) <= 0x3A))
|| ((((char)rx.callsign[i]) >= 0x41) && (((char)rx.callsign[i]) <= 0x5A))
|| ((((char)rx.callsign[i]) >= 0x60) && (((char)rx.callsign[i]) <= 0x7A))) {
std::cout << (char)rx.callsign[i];
} else {
std::cout << (char)0x2A;
}
}
std::cout << std::endl;
// set next state to short data block
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment