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

ParameterDescription
[in] connHandleHandle of the connection to send Exchange MTU Request.
[in] mtuLenRequested MTU length (within the range of BLE_ATT_DEFAULT_MTU_LEN to BLE_ATT_MAX_MTU_LEN).

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully initiate the Exchange MTU Request.
MBA_RES_FAILOperation rejected.
MBA_RES_OOMMemory allocation failure occurred internally.
MBA_RES_INVALID_PARAInvalid parameters, such as an invalid connection handle.
MBA_RES_BUSYGATT Client is busy with another ongoing request.