add API to trigger MTU negotiation

pull/9537/head
paul-szczepanek-arm 2019-01-16 16:55:50 +00:00
parent 02d5391cd0
commit c10fc2eb8e
3 changed files with 34 additions and 0 deletions

View File

@ -635,6 +635,27 @@ public:
(void) characteristic;
}
/**
* Trigger MTU negotiation. This might result in a Gap event onAttMtuChange
* being called if MTU changes.
*
* @note This does not guarantee a change in MTU size. If size remains
* unchanged no event will be generated.
*
* @param connection Connection on which the MTU is to be negotiated.
*
* @return BLE_ERROR_NONE if the procedure has been launched successfully
* otherwise an appropriate error.
*/
virtual ble_error_t negotiateAttMtu(
Gap::Handle_t connection
) {
/* Requesting action from porter(s): override this API if this
capability is supported. */
(void) connection;
return BLE_ERROR_NOT_IMPLEMENTED;
}
/**
* Register an handler for Handle Value Notification/Indication events.
*

View File

@ -111,6 +111,13 @@ public:
const DiscoveredCharacteristic& characteristic
);
/**
* @see GattClient::negotiateAttMtu
*/
virtual ble_error_t negotiateAttMtu(
connection_handle_t connection
);
/**
* @see GattClient::reset
*/

View File

@ -1259,6 +1259,12 @@ void GenericGattClient::terminateCharacteristicDescriptorDiscovery(
}
ble_error_t GenericGattClient::negotiateAttMtu(
connection_handle_t connection
) {
return _pal_client->exchange_mtu(connection);
}
ble_error_t GenericGattClient::reset(void) {
// _is_reseting prevent executions of new procedure while the instance resets.