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

@@ -6,17 +6,21 @@
#define PACKET_DATA_LEN_MAX 14
struct packet {
const uint8_t *source_id;
enum {
enum packet_type {
PACKET_TYPE_NONE,
PACKET_TYPE_MODE_AC,
PACKET_TYPE_MODE_S_SHORT,
PACKET_TYPE_MODE_S_LONG,
} type;
#define NUM_TYPES 3
#define NUM_TYPES 4
uint8_t payload[PACKET_DATA_LEN_MAX];
uint64_t mlat_timestamp;
uint32_t rssi;
};
extern char *packet_type_names[];
extern size_t packet_payload_len[];
#define PACKET_PAYLOAD_LEN_MAX 14
#define PACKET_MLAT_MHZ 120
// Use the signed max to avoid problems with some consumers; it's large enough to not matter.