Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Macros | Typedefs | Enumerations | Functions
lctr_int_conn.h File Reference

Internal link layer controller connection interface file. More...

#include "lctr_int.h"
#include "lctr_api_conn.h"
#include "lctr_pdu_conn.h"
#include "lctr_pdu_adv.h"
#include "lmgr_api_conn.h"
#include "ll_defs.h"
#include "sch_api.h"
#include "bb_ble_api.h"
#include "bb_ble_api_op.h"
#include "wsf_cs.h"
#include "wsf_msg.h"
#include "wsf_timer.h"

Go to the source code of this file.

Data Structures

struct  lctrConnCtx_t
 Connection context. More...
 

Macros

#define LCTR_MAX_CONS_CRC   2
 
#define LCTR_DATA_PDU_START_OFFSET   2
 
#define LCTR_DATA_PDU_FC_OFFSET   0
 
#define LCTR_DATA_PDU_LEN_OFFSET   1
 
#define LCTR_MAX_INSTANT   32767
 
#define LCTR_CTRL_DATA_HANDLE   0xFF
 
#define LCTR_LE_PING_ATTEMPTS   4
 
#define LCTR_CH_SEL_MAX   2
 
#define LCTR_GET_CONN_HANDLE(pCtx)   (pCtx - pLctrConnTbl)
 Resolve the connection handle from the context pointer. More...
 
#define LCTR_GET_CONN_CTX(h)    &(pLctrConnTbl[h])
 Resolve connection context from the handle. More...
 
#define LCTR_GET_TXPOWER(pCtx, phy, option)   (pCtx->phyTxPower[phy - (((phy == LL_PHY_LE_CODED) && (option == BB_PHY_OPTIONS_BLE_S2)) ? 0 : 1)])
 Resolve txPower from phy index. More...
 
#define LCTR_SET_TXPOWER(pCtx, phy, pow)   (pCtx->phyTxPower[phy - 1] = pow)
 Set the txpower of a specified PHY. More...
 
#define LCTR_RSSI_LOW_THRESHOLD   -65
 Low threshold for power monitoring. More...
 
#define LCTR_RSSI_HIGH_THRESHOLD   -30
 High threshold for power monitoring. More...
 
#define LCTR_PC_MIN_TIME   15
 Minimum time spent until request. More...
 
#define LCTR_PC_REQUEST_VAL   5
 Default request of increase/decrease in value. More...
 
#define LCTR_RESET_TERM_REASON   0xFF
 Special reset terminate reason. More...
 

Typedefs

typedef bool_t(* lctrCheckCisEstCisFn_t) (uint16_t cisHandle)
 Check if CIS is enabled by the CIS handle signature. More...
 
typedef bool_t(* lctrCheckTermFn_t) (uint16_t aclHandle)
 Check for CIS termination signature. More...
 
typedef bool_t(* lctrCheckCisEstAclFn_t) (uint16_t aclHandle)
 Check if there is a CIS established by the ACL handle signature. More...
 
typedef void(* lctrCipherBlkHdlr_t) (PalCryptoEnc_t *pEnc, uint8_t id, uint8_t dir)
 Call signature of a cipher block handler. More...
 
typedef bool_t(* lctrPktEncHdlr_t) (PalCryptoEnc_t *pEnc, uint8_t *pHdr, uint8_t *pBuf, uint8_t *pMic)
 Call signature of a packet encryption handler. More...
 
typedef bool_t(* lctrPktDecHdlr_t) (PalCryptoEnc_t *pEnc, uint8_t *pBuf)
 Call signature of a packet decryption handler. More...
 
typedef void(* lctrPktCntHdlr_t) (PalCryptoEnc_t *pEnc, uint64_t pktCnt)
 Call signature of a set packet count handler. More...
 
typedef bool_t(* LctrLlcpHdlr_t) (lctrConnCtx_t *pCtx, uint8_t event)
 Call signature of a LLCP state machine handler. More...
 
typedef void(* lctrCtrlPduHdlr_t) (lctrConnCtx_t *pCtx, uint8_t *pBuf)
 Call signature of a control PDU handler. More...
 
typedef uint8_t(* LctrChSelHdlr_t) (lctrConnCtx_t *pCtx, uint16_t numSkip)
 Call signature of a Channel state machine handler. More...
 
typedef void(* lctrLlcpEh_t) (lctrConnCtx_t *pCtx)
 Call signature of an action handler. More...
 
typedef void(* lctrPcMonAct_t) (lctrConnCtx_t *pCtx)
 Call signature of a power monitor function. More...
 
typedef 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. More...
 
typedef 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. More...
 
typedef bool_t(* lctrPendCisDisc_t) (lctrConnCtx_t *pCtx)
 Call signature of CIS pend disconnect function. More...
 

Enumerations

Functions

static void lctrFlagLinkTerm (lctrConnCtx_t *pCtx)
 Set flags for link termination. More...
 
static void lctrCheckControlPduAck (lctrConnCtx_t *pCtx)
 Service the Control PDU ACK state after a successful reception. More...
 
static void lctrSetControlPduAck (lctrConnCtx_t *pCtx)
 Service the Control PDU ACK state after a successful transmission. More...
 
static bool_t lctrCheckForLinkTerm (lctrConnCtx_t *pCtx)
 Set flags for link termination. More...
 
static void lctrIncPacketCounterTx (lctrConnCtx_t *pCtx)
 Increment the Tx/encrypt packet counter. More...
 
static void lctrIncPacketCounterRx (lctrConnCtx_t *pCtx)
 Increment the Rx/decrypt packet counter. More...
 
static void lctrSetBbPacketCounterTx (lctrConnCtx_t *pCtx)
 Set the transmit packet counter value in the BB. More...
 
static void lctrSetBbPacketCounterRx (lctrConnCtx_t *pCtx)
 Set the receive packet counter value in the BB. More...
 
static bool_t lctrCheckActiveOrPend (lctrConnCtx_t *pCtx, uint8_t proc)
 Check if procedure is active, if not pend the procedure. More...
 
static void lctrStoreConnTimeoutTerminateReason (lctrConnCtx_t *pCtx)
 Store connection timeout termination reason. More...
 
static void lctrDataTxIncAvailBuf (void)
 Increment available Tx data buffers. More...
 
static void lctrDataTxDecAvailBuf (void)
 Decrement available Tx data buffers. More...
 
static void lctrDataRxIncAvailBuf (uint8_t numBufs)
 Increment available Rx data buffers. More...
 
static bool_t lctrGetConnOpFlag (lctrConnCtx_t *pCtx, uint32_t flag)
 Get connection operational mode flags. More...
 
static uint8_t lctrGetProcId (uint8_t event)
 Get LLCP procedure ID. More...
 

Detailed Description

Internal link layer controller connection interface file.

Copyright (c) 2013-2019 Arm Ltd. All Rights Reserved.

Copyright (c) 2019-2020 Packetcraft, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file lctr_int_conn.h.

Macro Definition Documentation

#define LCTR_CH_SEL_MAX   2

Total number of channel selection algorithms.

Definition at line 62 of file lctr_int_conn.h.

#define LCTR_CTRL_DATA_HANDLE   0xFF

Connection handle used for LL control PDUs.

Definition at line 58 of file lctr_int_conn.h.

#define LCTR_DATA_PDU_FC_OFFSET   0

Flow control fields data PDU offset.

Definition at line 53 of file lctr_int_conn.h.

#define LCTR_DATA_PDU_LEN_OFFSET   1

Length field data PDU offset.

Definition at line 54 of file lctr_int_conn.h.

#define LCTR_DATA_PDU_START_OFFSET   2

Data PDU start offset in a buffer (match ACL header size).

Definition at line 51 of file lctr_int_conn.h.

#define LCTR_GET_CONN_CTX (   h)    &(pLctrConnTbl[h])

Resolve connection context from the handle.

Definition at line 68 of file lctr_int_conn.h.

#define LCTR_GET_CONN_HANDLE (   pCtx)    (pCtx - pLctrConnTbl)

Resolve the connection handle from the context pointer.

Definition at line 65 of file lctr_int_conn.h.

#define LCTR_GET_TXPOWER (   pCtx,
  phy,
  option 
)    (pCtx->phyTxPower[phy - (((phy == LL_PHY_LE_CODED) && (option == BB_PHY_OPTIONS_BLE_S2)) ? 0 : 1)])

Resolve txPower from phy index.

Definition at line 71 of file lctr_int_conn.h.

#define LCTR_LE_PING_ATTEMPTS   4

LE Ping attempts.

Definition at line 60 of file lctr_int_conn.h.

#define LCTR_MAX_CONS_CRC   2

Maximum number of consecutive CRC failures.

Definition at line 49 of file lctr_int_conn.h.

#define LCTR_MAX_INSTANT   32767

Maximum instant value for connection update.

Definition at line 56 of file lctr_int_conn.h.

#define LCTR_PC_MIN_TIME   15

Minimum time spent until request.

Definition at line 84 of file lctr_int_conn.h.

#define LCTR_PC_REQUEST_VAL   5

Default request of increase/decrease in value.

Definition at line 87 of file lctr_int_conn.h.

#define LCTR_RESET_TERM_REASON   0xFF

Special reset terminate reason.

Definition at line 90 of file lctr_int_conn.h.

#define LCTR_RSSI_HIGH_THRESHOLD   -30

High threshold for power monitoring.

Definition at line 81 of file lctr_int_conn.h.

#define LCTR_RSSI_LOW_THRESHOLD   -65

Low threshold for power monitoring.

Definition at line 78 of file lctr_int_conn.h.

#define LCTR_SET_TXPOWER (   pCtx,
  phy,
  pow 
)    (pCtx->phyTxPower[phy - 1] = pow)

Set the txpower of a specified PHY.

Definition at line 75 of file lctr_int_conn.h.

Typedef Documentation

typedef bool_t(* lctrCheckCisEstAclFn_t) (uint16_t aclHandle)

Check if there is a CIS established by the ACL handle signature.

Definition at line 193 of file lctr_int_conn.h.

typedef bool_t(* lctrCheckCisEstCisFn_t) (uint16_t cisHandle)

Check if CIS is enabled by the CIS handle signature.

Definition at line 189 of file lctr_int_conn.h.

typedef bool_t(* lctrCheckTermFn_t) (uint16_t aclHandle)

Check for CIS termination signature.

Definition at line 191 of file lctr_int_conn.h.

typedef uint8_t(* LctrChSelHdlr_t) (lctrConnCtx_t *pCtx, uint16_t numSkip)

Call signature of a Channel state machine handler.

Definition at line 431 of file lctr_int_conn.h.

typedef void(* lctrCipherBlkHdlr_t) (PalCryptoEnc_t *pEnc, uint8_t id, uint8_t dir)

Call signature of a cipher block handler.

Definition at line 413 of file lctr_int_conn.h.

typedef void(* lctrCtrlPduHdlr_t) (lctrConnCtx_t *pCtx, uint8_t *pBuf)

Call signature of a control PDU handler.

Definition at line 428 of file lctr_int_conn.h.

typedef void(* lctrLlcpEh_t) (lctrConnCtx_t *pCtx)

Call signature of an action handler.

Definition at line 434 of file lctr_int_conn.h.

typedef bool_t(* LctrLlcpHdlr_t) (lctrConnCtx_t *pCtx, uint8_t event)

Call signature of a LLCP state machine handler.

Definition at line 425 of file lctr_int_conn.h.

typedef void(* lctrPcMonAct_t) (lctrConnCtx_t *pCtx)

Call signature of a power monitor function.

Definition at line 437 of file lctr_int_conn.h.

typedef 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.

Definition at line 443 of file lctr_int_conn.h.

typedef 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.

Definition at line 440 of file lctr_int_conn.h.

typedef bool_t(* lctrPendCisDisc_t) (lctrConnCtx_t *pCtx)

Call signature of CIS pend disconnect function.

Definition at line 446 of file lctr_int_conn.h.

typedef void(* lctrPktCntHdlr_t) (PalCryptoEnc_t *pEnc, uint64_t pktCnt)

Call signature of a set packet count handler.

Definition at line 422 of file lctr_int_conn.h.

typedef bool_t(* lctrPktDecHdlr_t) (PalCryptoEnc_t *pEnc, uint8_t *pBuf)

Call signature of a packet decryption handler.

Definition at line 419 of file lctr_int_conn.h.

typedef bool_t(* lctrPktEncHdlr_t) (PalCryptoEnc_t *pEnc, uint8_t *pHdr, uint8_t *pBuf, uint8_t *pMic)

Call signature of a packet encryption handler.

Definition at line 416 of file lctr_int_conn.h.

Enumeration Type Documentation

anonymous enum

Connected states.

Enumerator
LCTR_CONN_STATE_INITIALIZED 

Connection initialized.

LCTR_CONN_STATE_ESTABLISHED_STARTUP 

Connection established before ready to start LLCP.

LCTR_CONN_STATE_ESTABLISHED_READY 

Connection established and ready to start LLCP.

LCTR_CONN_STATE_TERMINATING 

Connection terminating.

Definition at line 97 of file lctr_int_conn.h.

anonymous enum

LLCP states.

Enumerator
LCTR_LLCP_STATE_IDLE 

LLCP idle state.

LCTR_LLCP_STATE_BUSY 

LLCP busy state.

LCTR_LLCP_STATE_TOTAL 

Total number of LLCP states.

Definition at line 106 of file lctr_int_conn.h.

anonymous enum

Common LLCP states.

Enumerator
LCTR_CMN_STATE_IDLE 

LLCP idle state.

LCTR_CMN_STATE_BUSY 

LLCP busy state.

LCTR_CMN_STATE_TOTAL 

Total number of LLCP states.

Definition at line 114 of file lctr_int_conn.h.

anonymous enum

SVT states.

Enumerator
LCTR_SVT_STATE_IDLE 

SVT idle state.

LCTR_SVT_STATE_URGENT 

SVT urgent state.

LCTR_SVT_STATE_FATAL 

SVT fatal state.

LCTR_SVT_STATE_TOTAL 

Total number of SVT state.

Definition at line 122 of file lctr_int_conn.h.

anonymous enum

Periodic sync source.

Enumerator
LCTR_SYNC_SRC_SCAN 

Periodic sync info from scanner.

LCTR_SYNC_SRC_BCST 

Periodic sync info from broadcaster.

LCTR_SYNC_SRC_TOTAL 

Total number of periodic sync source.

Definition at line 131 of file lctr_int_conn.h.

anonymous enum

Common LLCP procedure IDs.

Enumerator
LCTR_PROC_CMN_TERM 

Termination procedure.

LCTR_PROC_CMN_CH_MAP_UPD 

Channel map update procedure.

LCTR_PROC_CMN_FEAT_EXCH 

Feature exchange procedure.

LCTR_PROC_CMN_VER_EXCH 

Version exchange procedure.

LCTR_PROC_CMN_DATA_LEN_UPD 

Data length update procedure.

LCTR_PROC_CMN_SET_MIN_USED_CHAN 

Set minimum number of used channels procedure.

LCTR_PROC_CMN_PER_ADV_SYNC_TRSF 

Periodic advertising sync transfer procedure.

LCTR_PROC_CMN_REQ_PEER_SCA 

Request peer SCA procedure.

LCTR_PROC_CMN_TOTAL 

Total number of common procedures.

LCTR_PROC_CONN_UPD 

Connection update procedure.

LCTR_PROC_CONN_PARAM 

Connection parameter procedure.

LCTR_PROC_ENCRYPT 

Encryption Start or Restart procedure.

LCTR_PROC_LE_PING 

LE Ping procedure.

LCTR_PROC_PHY_UPD 

PHY update procedure.

LCTR_PROC_PHY_UPD_PEER 

Peer-initiated PHY update procedure.

LCTR_PROC_CIS_EST 

CIS establishment procedure.

LCTR_PROC_CIS_EST_PEER 

Peer-initiated CIS establishment procedure.

LCTR_PROC_CIS_TERM 

CIS termination procedure.

LCTR_PROC_CIS_TERM_PEER 

Peer-initiated CIS termination procedure.

LCTR_PROC_PWR_IND 

Power indication prodecure.

LCTR_PROC_PWR_CTRL 

Power control procedure.

LCTR_PROC_INVALID 

Invalid ID.

Definition at line 139 of file lctr_int_conn.h.

anonymous enum

Power control monitor schemes.

Enumerator
LCTR_PC_MONITOR_AUTO 

Automatic monitoring scheme.

LCTR_PC_MONITOR_PATH_LOSS 

Path loss monitoring scheme.

LCTR_PC_MONITOR_SCHEME_TOTAL 

Total number of monitoring schemes.

Definition at line 172 of file lctr_int_conn.h.

anonymous enum

Power control scheme states.

Enumerator
LCTR_PC_MONITOR_DISABLED 

Disabled monitoring.

LCTR_PC_MONITOR_ENABLED 

Monitoring enabled.

LCTR_PC_MONITOR_READY 

Monitoring ready for enable.

Definition at line 181 of file lctr_int_conn.h.

anonymous enum

LLCP state machine handlers.

Enumerator
LCTR_LLCP_SM_ENCRYPT 

Encryption LLCP state machine.

LCTR_LLCP_SM_PING 

Ping state machine.

LCTR_LLCP_SM_CONN_UPD 

Connection update state machine.

LCTR_LLCP_SM_PHY_UPD 

PHY update state machine.

LCTR_LLCP_SM_CIS_EST 

CIS establishment state machine.

LCTR_LLCP_SM_CIS_TERM 

CIS termination state machine.

LCTR_LLCP_SM_PC 

Power control state machine.

LCTR_LLCP_SM_CMN 

Common LLCP state machine.

LCTR_LLCP_SM_TOTAL 

Total number of LLCP state machine.

Definition at line 449 of file lctr_int_conn.h.

Function Documentation

static bool_t lctrCheckActiveOrPend ( lctrConnCtx_t pCtx,
uint8_t  proc 
)
static

Check if procedure is active, if not pend the procedure.

Parameters
pCtxConnection context.
procProcedure ID to check/pend.
Returns
TRUE if active procedure, FALSE if pended.

Definition at line 838 of file lctr_int_conn.h.

static void lctrCheckControlPduAck ( lctrConnCtx_t pCtx)
static

Service the Control PDU ACK state after a successful reception.

Parameters
pCtxConnection context.

Definition at line 667 of file lctr_int_conn.h.

static bool_t lctrCheckForLinkTerm ( lctrConnCtx_t pCtx)
static

Set flags for link termination.

Parameters
pCtxConnection context.
Returns
TRUE if connection is terminated, FALSE otherwise.

Definition at line 698 of file lctr_int_conn.h.

static void lctrDataRxIncAvailBuf ( uint8_t  numBufs)
static

Increment available Rx data buffers.

Parameters
numBufsNumber of completed packets.

Definition at line 901 of file lctr_int_conn.h.

static void lctrDataTxDecAvailBuf ( void  )
static

Decrement available Tx data buffers.

Definition at line 885 of file lctr_int_conn.h.

static void lctrDataTxIncAvailBuf ( void  )
static

Increment available Tx data buffers.

Definition at line 871 of file lctr_int_conn.h.

static void lctrFlagLinkTerm ( lctrConnCtx_t pCtx)
static

Set flags for link termination.

Parameters
pCtxConnection context.

Definition at line 647 of file lctr_int_conn.h.

static bool_t lctrGetConnOpFlag ( lctrConnCtx_t pCtx,
uint32_t  flag 
)
static

Get connection operational mode flags.

Parameters
pCtxConnection context to get the flag.
flagFlags.
Returns
Status error code.

Set mode flags governing LL operations of a given connection.

Definition at line 922 of file lctr_int_conn.h.

static uint8_t lctrGetProcId ( uint8_t  event)
static

Get LLCP procedure ID.

Parameters
eventEvent.
Returns
LLCP procedure event ID.

Definition at line 936 of file lctr_int_conn.h.

static void lctrIncPacketCounterRx ( lctrConnCtx_t pCtx)
static

Increment the Rx/decrypt packet counter.

Parameters
pCtxConnection context.

Definition at line 750 of file lctr_int_conn.h.

static void lctrIncPacketCounterTx ( lctrConnCtx_t pCtx)
static

Increment the Tx/encrypt packet counter.

Parameters
pCtxConnection context.

Definition at line 729 of file lctr_int_conn.h.

static void lctrSetBbPacketCounterRx ( lctrConnCtx_t pCtx)
static

Set the receive packet counter value in the BB.

Parameters
pCtxConnection context.

Definition at line 803 of file lctr_int_conn.h.

static void lctrSetBbPacketCounterTx ( lctrConnCtx_t pCtx)
static

Set the transmit packet counter value in the BB.

Parameters
pCtxConnection context.

Definition at line 771 of file lctr_int_conn.h.

static void lctrSetControlPduAck ( lctrConnCtx_t pCtx)
static

Service the Control PDU ACK state after a successful transmission.

Parameters
pCtxConnection context.

Definition at line 683 of file lctr_int_conn.h.

static void lctrStoreConnTimeoutTerminateReason ( lctrConnCtx_t pCtx)
static

Store connection timeout termination reason.

Parameters
pCtxConnection context.

Definition at line 858 of file lctr_int_conn.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.