Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
67
Ver.1.0.0
Data length “n”: 1.
Three cases to exit Conn state Slave role and corresponding reasons are listed as below:
1) If Slave fails to receive packet from Master for a duration due to RF communication
problem (e.g. bad RF or Master is powered off), and “connection supervision
timeout
” expires, this event will be triggered to terminate connection and return to
None Conn state. The terminate reason is HCI_ERR_CONN_TIMEOUT (0x08).
2)
If Master sends “terminate” command to actively terminate connection, after Slave
responds to the command with an ack, this event will be triggered to terminate
connection and return to None Conn state. The terminate reason is the Error Code in
the “LL_TERMINATE_IND” control packet received in Slave Link Layer. The Error
Code is determined by Master. Common Error Code includes
HCI_ERR_REMOTE_USER_TERM_CONN (0x13),
HCI_ERR_CONN_TERM_MIC_FAILURE (0x3D), and etc.
3) If Slave calls the API
“bls_ll_terminateConnection (u8 reason)” to actively terminate
connection, this event will be triggered. The terminate reason is the actual parameter
“reason” of this API.
3.2.7.6 BLT_EV_FLAG_ENCRYPTION_CONN_DONE
Event trigger condition: This event will be triggered when encryption of Link Layer is
finished (i.e. Link Layer receives “start encryption response” from Master).
Pointer
“p”: p points to an u8-type variable “smp_flag”, which indicates current encryption
of Link Layer is triggered during first pairing or auto re-
connection. If “smp_flag” is 0, it
indicates first pairing; if “smp_flag” is 1, it indicates auto re-connection.
#define
SMP_STANDARD_PAIR 0
#define
SMP_FAST_CONNECT 1
Data length
“n”: 1.
3.2.7.7 BLT_EV_FLAG_DATA_LENGTH_EXCHANGE
Event trigger condition: This event will be triggered when Slave and Master exchange
max data length of Link Layer, i.e. one side sends “ll_length_req”, while the other side
responds with “ll_length_rsp”. If Slave actively sends “ll_length_req”, this event won’t be
triggered until “ll_length_rsp” is received. If Master initiates “ll_length_req”, this event will
be triggered immediately after Slave responds with “ll_length_rsp”.
Data length
“n”: 12.
Pointer
“p”: p points to data of a memory area, corresponding to the beginning six u16-
type variables in the structure below.
typedef
struct
{
u16
connEffectiveMaxRxOctets
;
u16
connEffectiveMaxTxOctets
;
u16
connMaxRxOctets
;
u16
connMaxTxOctets
;