Add mode AC handling, and clean up the parsers and serializers to avoid duplication.

This commit is contained in:
Ian Gulliver
2016-02-27 21:50:15 -08:00
parent b7e32d1b48
commit 92334724f0
10 changed files with 176 additions and 296 deletions

View File

@@ -1,3 +1,5 @@
#pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
#include <assert.h>
#include <stdio.h>
#include <string.h>
@@ -8,10 +10,18 @@
char *packet_type_names[] = {
"INVALID",
"Mode-AC",
"Mode-S short",
"Mode-S long",
};
size_t packet_payload_len[] = {
0,
2,
7,
14,
};
static uint64_t packet_mlat_timestamp_scale_mhz_in(uint64_t timestamp, uint32_t mhz) {
assert(mhz > 0);
return timestamp * (PACKET_MLAT_MHZ / mhz);