Radiosonde-CRC-checkbox

Added CRC calculation for Vaisala radiosondes.

Added a Checkbox on APP for turning ON / OFF CRC. When CRC on, malformed packets are ignored.

Connected existing CRC function for METEOMAN sondes, using the same "CRC" checkbox logic.
This commit is contained in:
euquiq 2020-08-20 15:22:11 -03:00
parent c626d83c3b
commit e76a464f7e
4 changed files with 176 additions and 74 deletions

View file

@ -46,6 +46,7 @@ SondeView::SondeView(NavigationView& nav) {
&field_vga,
&rssi,
&check_log,
&check_crc,
&text_signature,
&text_serial,
&text_voltage,
@ -73,6 +74,10 @@ SondeView::SondeView(NavigationView& nav) {
check_log.on_select = [this](Checkbox&, bool v) {
logging = v;
};
check_crc.on_select = [this](Checkbox&, bool v) {
use_crc = v;
};
radio::enable({
tuning_frequency(),
@ -110,8 +115,10 @@ void SondeView::focus() {
}
void SondeView::on_packet(const sonde::Packet& packet) {
//const auto hex_formatted = packet.symbols_formatted();
if (use_crc && !packet.crc_ok()) //euquiq: Reject bad packet if crc is on
return;
text_signature.set(packet.type_string());
sonde_id = packet.serial_number(); //used also as tag on the geomap
text_serial.set(sonde_id);
@ -126,9 +133,6 @@ void SondeView::on_packet(const sonde::Packet& packet) {
if (logger && logging) {
logger->on_packet(packet);
}
/*if( packet.crc_ok() ) {
}*/
}
void SondeView::set_target_frequency(const uint32_t new_value) {