35 #if (LL_ENABLE_TESTER) 36 #include "ll_tester_api.h" 37 #include "lctr_int_tester.h" 49 #define LCTR_DATA_CHAN_DLY 1 52 #define LCTR_DATA_CHAN_DLY_AUX_UNCODED 2 55 #define LCTR_DATA_CHAN_DLY_AUX_CODED 3 58 #define LCTR_CONN_IND_TICKS(x) ((x) * (1250 / LL_BLE_US_PER_TICK)) 61 #define LCTR_CONN_IND_MS(x) ((x) + ((x) >> 2) + (((x) & 3) ? 1 : 0)) 64 #define LCTR_CONN_IND_US(x) ((x) * 1250) 67 #define LCTR_CONN_IND_TO_MS(x) ((x) * 10) 70 #define LCTR_US_TO_CONN_IND(x) LL_MATH_DIV_1250(x) 73 #define LCTR_BLE_TO_US(x) ((x) * LL_BLE_US_PER_TICK) 76 #define LCTR_PER_INTER_TO_US(x) ((x) * 1250) 79 #define LCTR_PER_INTER_TO_MS(x) LL_MATH_DIV_1250(x) 82 #define LCTR_PER_SYNC_TIMEOUT_TO_MS(x) ((x) * 10) 85 #define LCTR_ISO_INT_TO_US(x) ((x) * 1250) 88 #define LCTR_FAST_TERM_CNT 6 91 #define LCTR_ADV_PKT_1M_US(len) ((LL_PREAMBLE_LEN_1M + LL_AA_LEN + LL_ADV_HDR_LEN + len + LL_CRC_LEN) << 3) 94 #define LCTR_CONN_IND_PKT_1M_US LCTR_ADV_PKT_1M_US(LL_CONN_IND_PDU_LEN) 97 #define LCTR_ADVB_BUF_EXTRA_SIZE 6 100 #define LCTR_ADVB_BUF_SIZE (WSF_MAX(BB_FIXED_ADVB_PKT_LEN, LL_ADVB_MAX_LEN) + LCTR_ADVB_BUF_EXTRA_SIZE) 103 #define LCTR_ADVB_BUF_OFFSET_RSSI ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 0) 106 #define LCTR_ADVB_BUF_OFFSET_RX_RPA ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 1) 109 #define LCTR_ADVB_BUF_OFFSET_CRC ((LCTR_ADVB_BUF_SIZE - LCTR_ADVB_BUF_EXTRA_SIZE) + 2) 112 #define LCTR_SCH_MAX_SPAN ((BbGetBbTimerBoundaryUs() >> 1) + 1) 115 #define LCTR_MAX_SCA 7 118 #define LCTR_SUP_TIMEOUT_VAL_TO_US(x) (x * 10000) 147 extern const uint16_t scaPpmTbl[];
148 extern bool_t lctrResetEnabled;
158 uint32_t lctrComputeAccessAddr(
void);
159 uint32_t lctrComputeSeedAccessAddr(
void);
160 uint8_t lctrComputeHopInc(
void);
161 uint8_t lctrPeriodicSelectNextChannel(
lmgrChanParam_t *pChanParam, uint16_t eventCounter);
163 uint16_t lctrCalcTotalAccuracy(uint8_t mstScaIdx);
164 uint32_t lctrComputeCrcInit(
void);
165 uint32_t lctrCalcWindowWideningUsec(uint32_t unsyncTimeUsec, uint32_t caPpm);
168 void lctrNotifyHostHwErrInd(uint8_t code);
169 void lctrNotifyHostConnectInd(uint16_t handle, uint8_t role,
lctrConnInd_t *pConnInd,
170 uint8_t peerIdAddrType, uint64_t peerIdAddr, uint64_t peerRpa,
171 uint64_t localRpa, uint8_t status, uint8_t usedChSel);
174 void lctrMstScanExecuteSm(uint8_t event);
175 void lctrMstInitExecuteSm(uint8_t event);
176 void lctrSlvAdvExecuteSm(uint8_t event);
188 static inline uint16_t
lctrCalcDID(
const uint8_t *pBuf, uint16_t len)
uint32_t LlMathRandNum(void)
Generate random number.
static PalBbPhy_t lctrPhysBitToPhy(uint8_t physBit)
Convert PHYS bit to PHY.
uint32_t CalcCrc32(uint32_t crcInit, uint32_t len, const uint8_t *pBuf)
Calculate the CRC-32 of the given buffer.
static uint16_t lctrCalcDID(const uint8_t *pBuf, uint16_t len)
Calculate DID.
Link layer controller common interface file.
void(* LctrResetHdlr_t)(void)
Call signature of a reset handler.
Common message structure passed to event handler.
void(* LctrMsgDisp_t)(lctrMsgHdr_t *pMsg)
Call signature of a message dispatch handler.
Link layer manager common interface file.
void(* LctrRmCback_t)(uint32_t rsvnOffs[], uint32_t refTime)
Reservation manager callback signature.
Link layer constant definitions.
uint8_t(* lctrChClassHdlr_t)(uint64_t chanMap)
Channel class update handler call signature.
void(* LctrEvtHdlr_t)(void)
Call signature of a message dispatch handler.
Link Layer math utilities.
static uint8_t lctrPhyToPhysBit(uint8_t phy)
Convert PHY to PHYS bit.