modules/woz_uwb/src/ccc/ccc_mac.h
asxeem/openaliro
Module

ccc_mac.h

CCC UWB MAC layer: ranging-round scheduling, SP0 frame codec, DS-TWR.

modules/woz_uwb/src/ccc/ccc_mac.h7 documented symbols

Overview

CCC UWB MAC layer: ranging-round scheduling, SP0 frame codec, DS-TWR.

depends on ccc_kdf.h  ·  used by ccc_mac.c ccc_session.h ccc_shim_rx.c

API

Cstruct ccc_mhr_fields

modules/woz_uwb/src/ccc/ccc_mac.h:35

The per-frame-variable fields of an SP0 MHR (fixed fields are built in by ccc_build_mhr).

Cstruct ccc_pre_poll

modules/woz_uwb/src/ccc/ccc_mac.h:52

Pre-POLL request message parameters.

Cstruct ccc_responder_ts

modules/woz_uwb/src/ccc/ccc_mac.h:69

One responder's timestamp record in a Final_Data message.

Cstruct ccc_final_data

modules/woz_uwb/src/ccc/ccc_mac.h:79

Final_Data message parameters.

Cstruct ccc_ran_params

modules/woz_uwb/src/ccc/ccc_mac.h:116

Per-session ranging schedule parameters (negotiated in setup).

Cstruct ccc_hop_decision

modules/woz_uwb/src/ccc/ccc_mac.h:128

The initiator's next-block hop decision, carried in Final_Data.

Cstruct ccc_ds_twr

modules/woz_uwb/src/ccc/ccc_mac.h:148

The four DS-TWR intervals, in ranging-timestamp ticks (uint32, wrap mod 2^32).

Fuint16_t ccc_hop_round_index(uint32_t block_index, uint32_t hop_key_rw, uint32_t n_round)

modules/woz_uwb/src/ccc/ccc_mac.h:13

Default hopping round index S(i) in [0, n_round) for a ranging block, keyed by HOP_Key_RW.

##define CCC_MHR_LEN 23

modules/woz_uwb/src/ccc/ccc_mac.h:18

SP0 MHR length, bytes.

##define CCC_PRE_POLL_LEN 13

modules/woz_uwb/src/ccc/ccc_mac.h:20

Pre-POLL MAC payload length, bytes.

##define CCC_FINAL_DATA_HDR_LEN 18

modules/woz_uwb/src/ccc/ccc_mac.h:22

Final_Data payload length before the responder records, bytes.

##define CCC_RESPONDER_LEN 7

modules/woz_uwb/src/ccc/ccc_mac.h:24

One responder timestamp record in a Final_Data payload, bytes.

##define CCC_MAX_RESPONDERS 10

modules/woz_uwb/src/ccc/ccc_mac.h:26

Max responders in one Final_Data (127-byte payload cap).

##define CCC_MSG_ID_PRE_POLL 0x01u

modules/woz_uwb/src/ccc/ccc_mac.h:28

Vendor Specific Information message ID for Pre-POLL.

##define CCC_MSG_ID_FINAL_DATA 0x02u

modules/woz_uwb/src/ccc/ccc_mac.h:30

Vendor Specific Information message ID for Final_Data.

Fint ccc_build_mhr(const struct ccc_mhr_fields *f, uint8_t out[CCC_MHR_LEN])

modules/woz_uwb/src/ccc/ccc_mac.h:44

Build the 23-byte SP0 MHR (little-endian on the wire).

Fint ccc_parse_mhr(const uint8_t in[CCC_MHR_LEN], struct ccc_mhr_fields *f)

modules/woz_uwb/src/ccc/ccc_mac.h:47

Parse and validate a 23-byte SP0 MHR, extracting the variable fields (-EINVAL on mismatch).

Fint ccc_pre_poll_pack(const struct ccc_pre_poll *p, uint8_t out[CCC_PRE_POLL_LEN])

modules/woz_uwb/src/ccc/ccc_mac.h:61

Pack a Pre-POLL payload little-endian.

Fint ccc_pre_poll_parse(const uint8_t in[CCC_PRE_POLL_LEN], struct ccc_pre_poll *p)

modules/woz_uwb/src/ccc/ccc_mac.h:64

Parse a 13-byte Pre-POLL payload.

Fint ccc_final_data_pack(const struct ccc_final_data *f, uint8_t *out, size_t cap, size_t *len)

modules/woz_uwb/src/ccc/ccc_mac.h:91

Pack a Final_Data payload little-endian.

Fint ccc_final_data_parse(const uint8_t *in, size_t len, struct ccc_final_data *f)

modules/woz_uwb/src/ccc/ccc_mac.h:94

Parse a Final_Data payload (-EINVAL if length is inconsistent with num_responders).

Cenum ccc_hop_mode

modules/woz_uwb/src/ccc/ccc_mac.h:99

Hopping mode. Adaptive (interference-driven) is out of scope.

Cenum ccc_slot

modules/woz_uwb/src/ccc/ccc_mac.h:105

Slot role within a ranging round.

Fuint16_t ccc_block_round(const struct ccc_ran_params *p, uint32_t block)

modules/woz_uwb/src/ccc/ccc_mac.h:134

The ranging round a block uses (block 0 uses round 0; continuous hopping uses S(i) for i>=1).

Fuint32_t ccc_slot_sts_index(const struct ccc_ran_params *p, uint32_t block, uint16_t round, enum ccc_slot slot, uint8_t responder)

modules/woz_uwb/src/ccc/ccc_mac.h:137

STS index for one slot of a ranging round (uint32 wraps mod 2^32).

Fstruct ccc_hop_decision ccc_initiator_next_hop(const struct ccc_ran_params *p, uint32_t block)

modules/woz_uwb/src/ccc/ccc_mac.h:141

The initiator's hop decision for the block after block, written into its Final_Data.

Fuint32_t ccc_ds_twr_tof(const struct ccc_ds_twr *t)

modules/woz_uwb/src/ccc/ccc_mac.h:156

DS-TWR one-way time-of-flight in timestamp ticks (0 if the denominator is 0).

Fint ccc_responder_ds_twr(const struct ccc_final_data *fd, uint8_t responder, uint32_t t_reply1, uint32_t t_round2, struct ccc_ds_twr *out)

modules/woz_uwb/src/ccc/ccc_mac.h:159

Assemble the DS-TWR intervals at the responder from a received Final_Data.

##define CCC_STS_INDEX_MAX 0x7FFFFFFFu

modules/woz_uwb/src/ccc/ccc_mac.h:165

STS index at which the URSK must be discarded: 2^31 − 1.

Fbool ccc_ursk_exhausted(const struct ccc_ran_params *p, uint32_t block)

modules/woz_uwb/src/ccc/ccc_mac.h:169

Whether the current URSK is exhausted for a ranging block (true once its highest STS index would exceed 2^31-1).