Get to where we're actually finding airspy packet boundaries.

This commit is contained in:
Ian Gulliver
2016-02-14 06:20:17 +00:00
parent 34fec2dee8
commit 51690ba0df
6 changed files with 127 additions and 53 deletions

32
common.h Normal file
View File

@@ -0,0 +1,32 @@
#include <stdint.h>
#include <unistd.h>
#define BUF_LEN 4096
struct buf {
char *buf;
char *tmp;
size_t start;
size_t length;
};
#define MLAT_HZ 60000000
#define DATA_MAX 14
struct packet {
enum {
MODE_AC,
MODE_S_SHORT,
MODE_S_LONG,
} type;
char data[DATA_MAX];
uint64_t mlat_timestamp;
uint32_t rssi;
};
void buf_init(struct buf *, char *, char *);
void buf_alias(struct buf *, struct buf *);
ssize_t buf_fill(struct buf *, int);
void buf_consume(struct buf *, size_t);