Pau Espin Pedrol | 778b30a | 2019-06-28 13:27:24 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <stdint.h> |
| 4 | #include <osmocom/core/endian.h> |
| 5 | |
| 6 | struct trxd_hdr_common { |
| 7 | #if OSMO_IS_LITTLE_ENDIAN |
| 8 | uint8_t tn:3, |
| 9 | reserved:1, |
| 10 | version:4; |
| 11 | #elif OSMO_IS_BIG_ENDIAN |
| 12 | uint8_t version:4, |
| 13 | reserved:1, |
| 14 | tn:3; |
| 15 | #endif |
| 16 | uint32_t fn; /* big endian */ |
| 17 | } __attribute__ ((packed)); |
| 18 | |
| 19 | struct trxd_hdr_v0_specific { |
| 20 | uint8_t rssi; |
| 21 | uint16_t toa; /* big endian */ |
| 22 | } __attribute__ ((packed)); |
| 23 | |
| 24 | struct trxd_hdr_v0 { |
| 25 | struct trxd_hdr_common common; |
| 26 | struct trxd_hdr_v0_specific v0; |
| 27 | uint8_t soft_bits[0]; |
| 28 | } __attribute__ ((packed)); |