openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
Loading...
Searching...
No Matches
ccc_shim_wrap.c File Reference

— per-frame STS interception: woz_uwb_set_sts_iv() substitutes the CCC STS for the FiRa MAC; target only. More...

#include <stddef.h>
#include <stdint.h>
#include "woz_log.h"
#include "woz_bytes.h"
#include <deca_device_api.h>
#include "ccc_shim.h"
#include "uwb_seam.h"
Include dependency graph for ccc_shim_wrap.c:

Macros

#define CCC_SHIM_LOG_FRAMES   8
 Log the first N intercepted STS IVs — confirms the blob index layout.
 

Functions

void ccc_shim_wrap_log_reset (void)
 Reset the frame logging counter to zero, used for re-enabling diagnostics after the first N frames.
 
static void pack_key (dwt_sts_cp_key_t *out, const uint8_t dursk[CCC_DURSK_LEN])
 Pack a 16-byte dURSK into the DW3000 STS-key register image.
 
static void pack_iv (dwt_sts_cp_iv_t *out, const uint8_t sts_v[CCC_STS_V_LEN])
 Pack a 16-byte STS-V into the DW3000 STS-IV register image (whole-16 reverse then per-word LE).
 
void woz_uwb_set_sts_iv (dwt_sts_cp_iv_t *pStsIv)
 Intercept DW3000 STS IV configuration, deriving dURSK and STS-V from CCC secrets and configuring the radio; falls through to the plain decadriver load if the shim is inactive.
 

Variables

static uint32_t g_log_frames
 Count of intercepted IVs; the first CCC_SHIM_LOG_FRAMES are logged.
 

Detailed Description

— per-frame STS interception: woz_uwb_set_sts_iv() substitutes the CCC STS for the FiRa MAC; target only.

Function Documentation

◆ ccc_shim_wrap_log_reset()

void ccc_shim_wrap_log_reset ( void  )

Reset the frame logging counter to zero, used for re-enabling diagnostics after the first N frames.

Reset the wrap's first-N-frame IV log budget (target only).

◆ pack_iv()

static void pack_iv ( dwt_sts_cp_iv_t *  out,
const uint8_t  sts_v[CCC_STS_V_LEN] 
)
static

Pack a 16-byte STS-V into the DW3000 STS-IV register image (whole-16 reverse then per-word LE).

Parameters
outDW3000 STS-IV register structure (iv0, iv1, iv2, iv3).
sts_v16-byte STS-V value.

◆ woz_uwb_set_sts_iv()

void woz_uwb_set_sts_iv ( dwt_sts_cp_iv_t *  pStsIv)

Intercept DW3000 STS IV configuration, deriving dURSK and STS-V from CCC secrets and configuring the radio; falls through to the plain decadriver load if the shim is inactive.

Parameters
pStsIvDW3000 STS-IV register structure (also holds the MAC's own frame index).