GATTC_ExchangeMTURequest
C
uint16_t GATTC_ExchangeMTURequest(uint16_t connHandle, uint16_t mtuLen);
Description
Initiates an Exchange MTU Request from the GATT Client to the GATT Server.
Note
The requested MTU size is adjusted to be within the range of BLE_ATT_DEFAULT_MTU_LEN and BLE_ATT_MAX_MTU_LEN. If the requested MTU length is less than BLE_ATT_DEFAULT_MTU_LEN, then BLE_ATT_DEFAULT_MTU_LEN is requested. If the requested MTU length is greater than BLE_ATT_MAX_MTU_LEN, then BLE_ATT_MAX_MTU_LEN is requested.
Events generated
GATTC_EVT_ERROR_RESP is generated on failure to exchange MTU.
ATT_EVT_UPDATE_MTU is generated on successful MTU exchange.
ATT_EVT_TIMEOUT is generated if the server does not respond.
Parameters
Parameter | Description |
---|---|
[in] connHandle | Handle of the connection to send Exchange MTU Request. |
[in] mtuLen | Requested MTU length (within the range of BLE_ATT_DEFAULT_MTU_LEN to BLE_ATT_MAX_MTU_LEN). |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Successfully initiate the Exchange MTU Request. |
MBA_RES_FAIL | Operation rejected. |
MBA_RES_OOM | Memory allocation failure occurred internally. |
MBA_RES_INVALID_PARA | Invalid parameters, such as an invalid connection handle. |
MBA_RES_BUSY | GATT Client is busy with another ongoing request. |