25 #ifndef LCTR_INT_CONN_H 26 #define LCTR_INT_CONN_H 49 #define LCTR_MAX_CONS_CRC 2 51 #define LCTR_DATA_PDU_START_OFFSET 2 53 #define LCTR_DATA_PDU_FC_OFFSET 0 54 #define LCTR_DATA_PDU_LEN_OFFSET 1 56 #define LCTR_MAX_INSTANT 32767 58 #define LCTR_CTRL_DATA_HANDLE 0xFF 60 #define LCTR_LE_PING_ATTEMPTS 4 62 #define LCTR_CH_SEL_MAX 2 65 #define LCTR_GET_CONN_HANDLE(pCtx) (pCtx - pLctrConnTbl) 68 #define LCTR_GET_CONN_CTX(h) &(pLctrConnTbl[h]) 71 #define LCTR_GET_TXPOWER(pCtx, phy, option) \ 72 (pCtx->phyTxPower[phy - (((phy == LL_PHY_LE_CODED) && (option == BB_PHY_OPTIONS_BLE_S2)) ? 0 : 1)]) 75 #define LCTR_SET_TXPOWER(pCtx, phy, pow) (pCtx->phyTxPower[phy - 1] = pow) 78 #define LCTR_RSSI_LOW_THRESHOLD -65 81 #define LCTR_RSSI_HIGH_THRESHOLD -30 84 #define LCTR_PC_MIN_TIME 15 87 #define LCTR_PC_REQUEST_VAL 5 90 #define LCTR_RESET_TERM_REASON 0xFF 256 int8_t phyTxPower[LL_PC_PHY_TOTAL];
310 uint8_t peerApr[LL_PC_PHY_TOTAL];
397 uint8_t minTimeSpent;
398 uint8_t curTimeSpent;
492 void lctrConnDefaults(
void);
497 uint8_t lctrSelectNextDataChannel(
lctrConnCtx_t *pCtx, uint16_t numSkip);
498 uint8_t lctrSelectNextChannel2(
lctrConnCtx_t *pCtx, uint16_t numSkip);
502 void lctrConnTxCompletedHandler(
void);
503 void lctrConnRxPendingHandler(
void);
509 void lctrNotifyHostConnUpdateInd(
lctrConnCtx_t *pCtx, uint8_t status);
534 void lctrStoreConnFailEstablishTerminateReason(
lctrConnCtx_t *pCtx);
535 void lctrStoreLlcpTimeoutTerminateReason(
lctrConnCtx_t *pCtx);
537 void lctrStoreInstantPassedTerminateReason(
lctrConnCtx_t *pCtx);
553 void lctrNotifyHostDataLengthInd(
lctrConnCtx_t *pCtx, uint8_t status);
578 void lctrSendRejectInd(
lctrConnCtx_t *pCtx, uint8_t reason, bool_t forceRejectExtInd);
582 uint16_t lctrTxInitMem(uint8_t *pFreeMem, uint32_t freeMemSize);
583 uint8_t *lctrTxCtrlPduAlloc(uint8_t pduLen);
592 uint8_t *lctrRxPduAlloc(uint16_t maxRxLen);
593 void lctrRxPduFree(uint8_t *pBuf);
594 void lctrRxEnq(uint8_t *pBuf, uint16_t eventCounter, uint16_t connHandle);
595 uint8_t *lctrRxDeq(uint16_t *pConnHandle);
613 void lctrSetPacketTimeRestriction(
lctrConnCtx_t *pCtx, uint8_t txPhys);
625 uint16_t lctrSetupForTx(
lctrConnCtx_t *pCtx, uint8_t rxStatus, bool_t reqTx);
626 void lctrRxPostProcessing(
lctrConnCtx_t *pCtx, uint8_t *pRxBuf, uint8_t *pNextRxBuf, bool_t loadRxBuf);
630 bool_t lctrExceededMaxDur(
lctrConnCtx_t *pCtx, uint32_t ceStart, uint32_t pendDurUsec);
631 uint32_t lctrCalcPingPeriodMs(
lctrConnCtx_t *pCtx, uint32_t authTimeoutMs);
632 uint8_t lctrComputeSca(
void);
633 uint32_t lctrConnGetAnchorPoint(
lctrConnCtx_t *pCtx, uint16_t ceCounter);
635 uint8_t lctrGetPowerLimits(int8_t txPower);
638 uint32_t lctrGetConnRefTime(uint8_t connHandle, uint32_t *pDurUsec);
731 if (lctrSetEncryptPktCountHdlr)
752 if (lctrSetEncryptPktCountHdlr)
773 if (lctrSetEncryptPktCountHdlr)
805 if (lctrSetDecryptPktCountHdlr)
860 if (pCtx->
termReason == LL_ERROR_CODE_CONN_FAILED_TO_ESTABLISH)
862 pCtx->
termReason = LL_ERROR_CODE_CONN_TIMEOUT;
bool_t(* lctrPktDecHdlr_t)(PalCryptoEnc_t *pEnc, uint8_t *pBuf)
Call signature of a packet decryption handler.
void(* lctrLlcpEh_t)(lctrConnCtx_t *pCtx)
Call signature of an action handler.
Link layer controller connection interface file.
void(* lctrCipherBlkHdlr_t)(PalCryptoEnc_t *pEnc, uint8_t id, uint8_t dir)
Call signature of a cipher block handler.
Data length request or response PDU.
PHY request or response PDU.
BLE baseband interface file.
uint8_t powerMonitorScheme
bool_t(* lctrCheckCisEstAclFn_t)(uint16_t aclHandle)
Check if there is a CIS established by the ACL handle signature.
static void lctrIncPacketCounterTx(lctrConnCtx_t *pCtx)
Increment the Tx/encrypt packet counter.
Encryption mode data structure used in LlGetEncMode() and LlSetEncMode().
static void lctrSetBbPacketCounterTx(lctrConnCtx_t *pCtx)
Set the transmit packet counter value in the BB.
uint32_t firstRxStartTsUsec
wsfTimer_t tmrAuthTimeout
bool_t(* lctrPendCisDisc_t)(lctrConnCtx_t *pCtx)
Call signature of CIS pend disconnect function.
Connection parameter request/response values.
static void lctrDataTxDecAvailBuf(void)
Decrement available Tx data buffers.
Link layer controller advertising channel packet interface file.
Link layer manager connection interface file.
bool_t(* lctrCheckCisEstCisFn_t)(uint16_t cisHandle)
Check if CIS is enabled by the CIS handle signature.
bool_t isSlvPhyUpdInstant
Link layer controller data channel packet interface file.
static void lctrDataRxIncAvailBuf(uint8_t numBufs)
Increment available Rx data buffers.
Connection update indication PDU.
Link layer controller message data.
#define WSF_CS_EXIT(cs)
Exit a critical section.
Bluetooth Low Energy protocol specific operation parameters.
Vendor specific PDU handlers.
lctrConnParam_t connParam
void(* lctrCtrlPduHdlr_t)(lctrConnCtx_t *pCtx, uint8_t *pBuf)
Call signature of a control PDU handler.
wsfTimer_t tmrPingTimeout
static bool_t lctrCheckActiveOrPend(lctrConnCtx_t *pCtx, uint8_t proc)
Check if procedure is active, if not pend the procedure.
static bool_t lctrGetConnOpFlag(lctrConnCtx_t *pCtx, uint32_t flag)
Get connection operational mode flags.
PHY update indication PDU.
lctrCheckTermFn_t checkCisTerm
void(* lctrPcPowInd_t)(lctrConnCtx_t *pCtx, uint8_t phy, int8_t delta, int8_t txPower, bool_t phyChange)
Call signature of power change indication handler.
bool_t(* lctrPktEncHdlr_t)(PalCryptoEnc_t *pEnc, uint8_t *pHdr, uint8_t *pBuf, uint8_t *pMic)
Call signature of a packet encryption handler.
static void lctrStoreConnTimeoutTerminateReason(lctrConnCtx_t *pCtx)
Store connection timeout termination reason.
static void lctrDataTxIncAvailBuf(void)
Increment available Tx data buffers.
void(* lctrPcMonAct_t)(lctrConnCtx_t *pCtx)
Call signature of a power monitor function.
void * pHead
head of queue
Version indication control PDU.
bool_t controllerInitRead
static void lctrIncPacketCounterRx(lctrConnCtx_t *pCtx)
Increment the Rx/decrypt packet counter.
bool_t initialPathLossRead
Multi-protocol scheduler interface file.
lctrDataLen_t localDataPdu
Link layer constant definitions.
static void lctrFlagLinkTerm(lctrConnCtx_t *pCtx)
Set flags for link termination.
Connection update indication PDU.
static void lctrSetBbPacketCounterRx(lctrConnCtx_t *pCtx)
Set the receive packet counter value in the BB.
static void lctrCheckControlPduAck(lctrConnCtx_t *pCtx)
Service the Control PDU ACK state after a successful reception.
Data channel control PDU.
static bool_t lctrCheckForLinkTerm(lctrConnCtx_t *pCtx)
Set flags for link termination.
Baseband operation descriptor (BOD).
void(* lctrPcNotifyPwr_t)(lctrConnCtx_t *pCtx, uint8_t reason, uint8_t phy, int8_t txPower, uint8_t limits, int8_t delta)
Call signature of power report notification handler.
lctrCheckCisEstAclFn_t checkCisEstAcl
void(* lctrPktCntHdlr_t)(PalCryptoEnc_t *pEnc, uint64_t pktCnt)
Call signature of a set packet count handler.
uint8_t cisRssiExtremeTimeSpent
uint8_t(* LctrChSelHdlr_t)(lctrConnCtx_t *pCtx, uint16_t numSkip)
Call signature of a Channel state machine handler.
BLE baseband interface file.
bool_t(* LctrLlcpHdlr_t)(lctrConnCtx_t *pCtx, uint8_t event)
Call signature of a LLCP state machine handler.
static uint8_t lctrGetProcId(uint8_t event)
Get LLCP procedure ID.
Connection specification (LlCreateConn(), LlConnUpdate() and LlExtCreateConn()).
Internal link layer controller interface file.
#define WSF_CS_INIT(cs)
Initialize critical section. This macro may define a variable.
#define LL_CHAN_DATA_MAX_IDX
static void lctrSetControlPduAck(lctrConnCtx_t *pCtx)
Service the Control PDU ACK state after a successful transmission.
Transmit buffer descriptor.
bool_t(* lctrCheckTermFn_t)(uint16_t aclHandle)
Check for CIS termination signature.
lctrChanMapInd_t chanMapUpd
uint16_t localConnDurUsec
#define WSF_CS_ENTER(cs)
Enter a critical section.