Skip to content

Instantly share code, notes, and snippets.

@rema7
Last active July 16, 2019 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rema7/0c8fce1cab19988621692fae412353ea to your computer and use it in GitHub Desktop.
Save rema7/0c8fce1cab19988621692fae412353ea to your computer and use it in GitHub Desktop.
typedef struct ModemUcnwfRxInHeaderStruct {
...
uint8_t reserved[16];
uint16_t akzpSyncRely;
uint16_t akzpPhasorNum;
uint8_t reserved[12];
uint8_t payload[0];
} __attribute__((__packed__)) *ModemUcnwfRxInHeader;
static void printPacketMetadata(ModemUcnwfRxInHeader hdr)
{
fprintf(stderr, "timestamp=%d.%06d; rssi=%d; max_snr=%d; min_snr=%d; sigma=%d; sync_rely=%d; akzp_sync_rely=%d; akzp_phasor_num=%d; ",
be32toh(hdr->seconds), be32toh(hdr->useconds), be16toh(hdr->rssi),
hdr->maxSnr, hdr->minSnr, be16toh(hdr->sigma), be32toh(hdr->syncRely),
be16toh(hdr->akzpSyncRely), be16toh(hdr->akzpPhasorNum)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment