Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
105
Ver.1.0.0
ATT_ERR_INVALID_PARAMETE
R
0x85
mtu_size exceeds the max value
247.
When Master GATT layer needs to send long packet data to Slave, Master will
actively initiate “ATT_Exchange_MTU_req”, and Slave will respond with
“ATT_Exchange_MTU_rsp”. “ServerRxMTU” is the configured value of the API
“blc_att_setRxMtuSize”. The callback function registered via
“blc_att_registerMtuSizeExchangeCb” will be triggered, and the second parameter of
the callback is “ClientRxMTU” of Master.
3) Processing of long Tx packet data in 5316 Slave GATT layer
When 5316 Slave needs to send long packet data in GATT layer, it should obtain
Client RxMTU of Master first, and the eventual data length should not exceed
ClientRxMTU.
First Slave should call the API
“blc_att_setRxMtuSize” to set its ServerRxMTU.
Suppose it is set to 158.
blc_att_setRxMtuSize (158);
Then the API below should be called to actively initiate an
“ATT_Exchange_MTU_req”.
ble_sts_t
blc_att_requestMtuSizeExchange
(
u16
connHandle,
u16
mtu_size);
“connHandle” is ID of Slave conection, i.e. “BLS_CONN_HANDLE”, while “mtu_size”
is ServerRxMTU.
blc_att_requestMtuSizeExchange(BLS_CONN_HANDLE, 158);
After
the “ATT_Exchange_MTU_req” is received, Master will respond with
“ATT_Exchange_MTU_rsp”. Then the callback function registered via
“blc_att_registerMtuSizeExchangeCb” will be triggered, and the second parameter of
the callback function is ClientRxMTU of Master.
3.4.3.8 Write Request, Write Response
Please refer to
Core_v5.0
(Vol 3/Part F/3.4.5.1 and 3.4.5.2)
for details about “Write
Request
” and “Write Response”.
The “Write Request” command sent by Master specifies certain attHandle and attaches
related data. After the request is received, Slave will find the specified Attribute,
determine whether to process the data by using the callback function w or directly write
the data into corresponding Attribute Value depending on whether the callback function w
is set by user. Finally Slave will respond to Master via “Write Response”.
As shown below, by sending “Write Request”, Master writes Attribute Value of 0x0001 to
the Slave Attribute with the attHandle of 0x0016. Then Slave will execute the write
operation and respond to Master via “Write Response”.