diff --git a/features/FEATURE_BLE/ble/generic/GenericGap.h b/features/FEATURE_BLE/ble/generic/GenericGap.h index 93d6ebe65f..a6f0b2721b 100644 --- a/features/FEATURE_BLE/ble/generic/GenericGap.h +++ b/features/FEATURE_BLE/ble/generic/GenericGap.h @@ -348,6 +348,11 @@ private: pal::scanning_filter_policy_t _scanning_filter_policy; pal::advertising_filter_policy_t _advertising_filter_policy; mutable Whitelist_t _whitelist; + + bool _privacy_enabled; + PeripheralPrivacyConfiguration_t _peripheral_privacy_configuration; + CentralPrivacyConfiguration_t _central_privacy_configuration; + mbed::Timeout _advertising_timeout; mbed::Timeout _scan_timeout; pal::ConnectionEventMonitor::EventHandler *_connection_event_handler; diff --git a/features/FEATURE_BLE/source/generic/GenericGap.cpp b/features/FEATURE_BLE/source/generic/GenericGap.cpp index fd48e6783c..070447bdc0 100644 --- a/features/FEATURE_BLE/source/generic/GenericGap.cpp +++ b/features/FEATURE_BLE/source/generic/GenericGap.cpp @@ -390,6 +390,9 @@ GenericGap::GenericGap( _scanning_filter_policy(pal::scanning_filter_policy_t::NO_FILTER), _advertising_filter_policy(pal::advertising_filter_policy_t::NO_FILTER), _whitelist(), + _privacy_enabled(false), + _peripheral_privacy_configuration(default_peripheral_privacy_configuration), + _central_privacy_configuration(default_central_privacy_configuration), _advertising_timeout(), _scan_timeout(), _connection_event_handler(NULL) @@ -862,28 +865,38 @@ ble_error_t GenericGap::setPeripheralPrivacyConfiguration( const PeripheralPrivacyConfiguration_t *configuration ) { - return BLE_ERROR_NOT_IMPLEMENTED; + _peripheral_privacy_configuration = *configuration; + + + + return BLE_ERROR_NONE; } ble_error_t GenericGap::getPeripheralPrivacyConfiguration( PeripheralPrivacyConfiguration_t *configuration ) { - return BLE_ERROR_NOT_IMPLEMENTED; + *configuration = _peripheral_privacy_configuration; + + return BLE_ERROR_NONE; } ble_error_t GenericGap::setCentralPrivacyConfiguration( const CentralPrivacyConfiguration_t *configuration ) { - return BLE_ERROR_NOT_IMPLEMENTED; + _central_privacy_configuration = *configuration; + + return BLE_ERROR_NONE; } ble_error_t GenericGap::getCentralPrivacyConfiguration( CentralPrivacyConfiguration_t *configuration ) { - return BLE_ERROR_NOT_IMPLEMENTED; + *configuration = _central_privacy_configuration; + + return BLE_ERROR_NONE; } ble_error_t GenericGap::setAdvertisingData(const GapAdvertisingData &advData, const GapAdvertisingData &scanResponse)