mirror of https://github.com/ARMmbed/mbed-os.git
add API to trigger MTU negotiation
parent
02d5391cd0
commit
c10fc2eb8e
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -111,6 +111,13 @@ public:
|
|||
const DiscoveredCharacteristic& characteristic
|
||||
);
|
||||
|
||||
/**
|
||||
* @see GattClient::negotiateAttMtu
|
||||
*/
|
||||
virtual ble_error_t negotiateAttMtu(
|
||||
connection_handle_t connection
|
||||
);
|
||||
|
||||
/**
|
||||
* @see GattClient::reset
|
||||
*/
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue