4#ifndef PROTOCORE_RADIO_SNIFF_H
5#define PROTOCORE_RADIO_SNIFF_H
35#define RADIO_SNIFF_TAP_LEN 20
41 uint32_t (*
i2f32)(
const uint8_t *, int32_t);
42 size_t (*
tap_record)(
const uint8_t *, uint8_t *, size_t,
const uint8_t *, size_t, int32_t, uint16_t, uint32_t,
76 size_t flen, int32_t rssi_dbm, uint16_t channel, uint32_t ts_sec,
#define PROTOCORE_UNUSED
Suppress the unused warning. Every module ends in a namespace most callers only partly use.
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
size_t protocore_radio_sniff_global_header(const uint8_t *work, uint8_t *out, size_t cap)
Write the pcap global header for a TAP-framed 802.15.4 sniff. 24, .
size_t protocore_radio_sniff_tap_record(const uint8_t *work, uint8_t *out, size_t cap, const uint8_t *frame, size_t flen, int32_t rssi_dbm, uint16_t channel, uint32_t ts_sec, uint32_t ts_usec)
Write one capture record: a pcap record header, the 802.15.4 TAP .
uint32_t protocore_radio_sniff_i2f32(const uint8_t *work, int32_t dbm)
Encode a signed integer dBm value as an IEEE-754 float32 .
Dispatch table. Addressed by offset, so the layout is asserted below.
size_t(* global_header)(const uint8_t *, uint8_t *, size_t)
uint32_t(* i2f32)(const uint8_t *, int32_t)
size_t(* tap_record)(const uint8_t *, uint8_t *, size_t, const uint8_t *, size_t, int32_t, uint16_t, uint32_t, uint32_t)