From e9c0f587af161e44dc303dcd9d697ff6c4e0a89b Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Wed, 21 Nov 2018 09:17:47 +0000 Subject: [PATCH] fix constness to match recent const changes --- features/FEATURE_BLE/ble/gap/Gap.h | 8 ++--- features/FEATURE_BLE/ble/generic/GenericGap.h | 34 +++++++++---------- features/FEATURE_BLE/source/gap/Gap.cpp | 6 ++-- .../FEATURE_BLE/source/generic/GenericGap.cpp | 12 +++---- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/features/FEATURE_BLE/ble/gap/Gap.h b/features/FEATURE_BLE/ble/gap/Gap.h index 4c0d719707..2ff90d6843 100644 --- a/features/FEATURE_BLE/ble/gap/Gap.h +++ b/features/FEATURE_BLE/ble/gap/Gap.h @@ -52,7 +52,7 @@ public: * * @param event Advertising report @see AdvertisingReportEvent_t for details. */ - virtual void onAdvertisingReport(const AdvertisingReportEvent &event) { } + void onAdvertisingReport(const AdvertisingReportEvent &event) { } /** Called when scan times out. */ @@ -229,7 +229,7 @@ public: */ virtual ble_error_t setAdvertisingPayload( advertising_handle_t handle, - mbed::Span payload, + mbed::Span payload, bool minimiseFragmentation = false ); @@ -243,7 +243,7 @@ public: */ virtual ble_error_t setAdvertisingScanResponse( advertising_handle_t handle, - mbed::Span response, + mbed::Span response, bool minimiseFragmentation = false ); @@ -298,7 +298,7 @@ public: */ virtual ble_error_t setPeriodicAdvertisingPayload( advertising_handle_t handle, - mbed::Span payload + mbed::Span payload ); /** Start periodic advertising for a given set. Periodic advertising will not start until diff --git a/features/FEATURE_BLE/ble/generic/GenericGap.h b/features/FEATURE_BLE/ble/generic/GenericGap.h index 0b70b4484f..ecd38e24c0 100644 --- a/features/FEATURE_BLE/ble/generic/GenericGap.h +++ b/features/FEATURE_BLE/ble/generic/GenericGap.h @@ -78,55 +78,55 @@ public: /** @copydoc Gap::IsFeatureSupported */ - bool isFeatureSupported( + virtual bool isFeatureSupported( controller_supported_features_t feature ); /** @copydoc Gap::getMaxAdvertisingSetNumber */ - uint8_t getMaxAdvertisingSetNumber(); + virtual uint8_t getMaxAdvertisingSetNumber(); /** @copydoc Gap::getMaxAdvertisingDataLength */ - uint8_t getMaxAdvertisingDataLength(); + virtual uint8_t getMaxAdvertisingDataLength(); /** @copydoc Gap::createAdvertisingSet */ - ble_error_t createAdvertisingSet( + virtual ble_error_t createAdvertisingSet( advertising_handle_t *handle, const AdvertisingParameters ¶meters ); /** @copydoc Gap::destroyAdvertisingSet */ - ble_error_t destroyAdvertisingSet(advertising_handle_t handle); + virtual ble_error_t destroyAdvertisingSet(advertising_handle_t handle); /** @copydoc Gap::setAdvertisingParams */ - ble_error_t setAdvertisingParameters( + virtual ble_error_t setAdvertisingParameters( advertising_handle_t handle, const AdvertisingParameters ¶ms ); /** @copydoc Gap::setAdvertisingPayload */ - ble_error_t setAdvertisingPayload( + virtual ble_error_t setAdvertisingPayload( advertising_handle_t handle, - mbed::Span payload, + mbed::Span payload, bool minimiseFragmentation ); /** @copydoc Gap::setAdvertisingScanResponse */ - ble_error_t setAdvertisingScanResponse( + virtual ble_error_t setAdvertisingScanResponse( advertising_handle_t handle, - mbed::Span response, + mbed::Span response, bool minimiseFragmentation ); /** @copydoc Gap::startAdvertising */ - ble_error_t startAdvertising( + virtual ble_error_t startAdvertising( advertising_handle_t handle, adv_duration_t maxDuration, uint8_t maxEvents @@ -134,11 +134,11 @@ public: /** @copydoc Gap::stopAdvertising */ - ble_error_t stopAdvertising(advertising_handle_t handle); + virtual ble_error_t stopAdvertising(advertising_handle_t handle); /** @copydoc Gap::isAdvertisingActive */ - bool isAdvertisingActive(advertising_handle_t handle); + virtual bool isAdvertisingActive(advertising_handle_t handle); /** @copydoc Gap::setPeriodicAdvertisingParameters */ @@ -153,7 +153,7 @@ public: */ virtual ble_error_t setPeriodicAdvertisingPayload( advertising_handle_t handle, - mbed::Span payload + mbed::Span payload ); /** @copydoc Gap::startPeriodicAdvertising @@ -529,7 +529,7 @@ public: /** * @copydoc ::Gap::processConnectionEvent */ - void processConnectionEvent( + virtual void processConnectionEvent( Handle_t handle, Role_t role, peer_address_type_t peerAddrType, @@ -544,7 +544,7 @@ public: /** * @copydoc ::Gap::processDisconnectionEvent */ - void processDisconnectionEvent( + virtual void processDisconnectionEvent( Handle_t handle, DisconnectionReason_t reason ); @@ -552,7 +552,7 @@ public: private: ble_error_t setAdvertisingData( advertising_handle_t handle, - mbed::Span payload, + mbed::Span payload, bool minimiseFragmentation, bool scan_response ); diff --git a/features/FEATURE_BLE/source/gap/Gap.cpp b/features/FEATURE_BLE/source/gap/Gap.cpp index 77dfda8ba0..7b685f4545 100644 --- a/features/FEATURE_BLE/source/gap/Gap.cpp +++ b/features/FEATURE_BLE/source/gap/Gap.cpp @@ -60,7 +60,7 @@ ble_error_t Gap::setAdvertisingParameters( ble_error_t Gap::setAdvertisingPayload( advertising_handle_t handle, - mbed::Span payload, + mbed::Span payload, bool minimiseFragmentation ) { /* Requesting action from porter(s): override this API if this capability is supported. */ @@ -69,7 +69,7 @@ ble_error_t Gap::setAdvertisingPayload( ble_error_t Gap::setAdvertisingScanResponse( advertising_handle_t handle, - mbed::Span response, + mbed::Span response, bool minimiseFragmentation ) { /* Requesting action from porter(s): override this API if this capability is supported. */ @@ -107,7 +107,7 @@ ble_error_t Gap::setPeriodicAdvertisingParameters( ble_error_t Gap::setPeriodicAdvertisingPayload( advertising_handle_t handle, - mbed::Span payload + mbed::Span payload ) { /* Requesting action from porter(s): override this API if this capability is supported. */ return BLE_ERROR_NOT_IMPLEMENTED; diff --git a/features/FEATURE_BLE/source/generic/GenericGap.cpp b/features/FEATURE_BLE/source/generic/GenericGap.cpp index 3884e31274..46759fc287 100644 --- a/features/FEATURE_BLE/source/generic/GenericGap.cpp +++ b/features/FEATURE_BLE/source/generic/GenericGap.cpp @@ -1907,7 +1907,7 @@ ble_error_t GenericGap::setExtendedAdvertisingParameters( ble_error_t GenericGap::setAdvertisingPayload( advertising_handle_t handle, - mbed::Span payload, + mbed::Span payload, bool minimiseFragmentation ) { return setAdvertisingData(handle, payload, minimiseFragmentation, false); @@ -1915,7 +1915,7 @@ ble_error_t GenericGap::setAdvertisingPayload( ble_error_t GenericGap::setAdvertisingScanResponse( advertising_handle_t handle, - mbed::Span response, + mbed::Span response, bool minimiseFragmentation ) { return setAdvertisingData(handle, response, minimiseFragmentation, true); @@ -1923,7 +1923,7 @@ ble_error_t GenericGap::setAdvertisingScanResponse( ble_error_t GenericGap::setAdvertisingData( advertising_handle_t handle, - mbed::Span payload, + mbed::Span payload, bool minimiseFragmentation, bool scan_response ) { @@ -1995,7 +1995,7 @@ ble_error_t GenericGap::setAdvertisingData( } // extract the payload - mbed::Span sub_payload = payload.subspan( + mbed::Span sub_payload = payload.subspan( i, std::min(MAX_HCI_DATA_LENGTH, (end - i)) ); @@ -2153,7 +2153,7 @@ ble_error_t GenericGap::setPeriodicAdvertisingParameters( ble_error_t GenericGap::setPeriodicAdvertisingPayload( advertising_handle_t handle, - mbed::Span payload + mbed::Span payload ) { if (handle == LEGACY_ADVERTISING_HANDLE) { @@ -2189,7 +2189,7 @@ ble_error_t GenericGap::setPeriodicAdvertisingPayload( } // extract the payload - mbed::Span sub_payload = payload.subspan( + mbed::Span sub_payload = payload.subspan( i, std::min(MAX_HCI_DATA_LENGTH, (end - i)) );