weathex wrx301d: double check JSON output

test
Zilog80 2023-09-19 16:07:07 +02:00
rodzic 08a335f705
commit 254a64f9a6
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -481,6 +481,8 @@ int print_frame() {
// JSON
if (option_json && gpx.chk2ok) {
if (gpx.chk1ok && gpx.sn2 == gpx.sn1 && gpx.cnt2 == gpx.cnt1) // double check, unreliable checksums
{
char *ver_jsn = NULL;
fprintf(stdout, "{ \"type\": \"%s\"", "WXR301");
fprintf(stdout, ", \"frame\": %u", gpx.cnt2);
@ -506,6 +508,7 @@ int print_frame() {
if (ver_jsn && *ver_jsn != '\0') fprintf(stdout, ", \"version\": \"%s\"", ver_jsn);
fprintf(stdout, " }\n");
fprintf(stdout, "\n");
}
}
}