diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h index 2370287b13..0232b27fef 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h @@ -149,26 +149,6 @@ public: */ void setPreferredConnectionParams(const ::Gap::ConnectionParams_t& params); - /** - * @see ::GattServer::setDeviceName - */ - ble_error_t setDeviceName(const uint8_t *deviceName); - - /** - * @see ::GattServer::getDeviceName - */ - void getDeviceName(const uint8_t*& name, uint16_t& length); - - /** - * @see ::GattServer::setAppearance - */ - void setAppearance(GapAdvertisingData::Appearance appearance); - - /** - * @see ::GattServer::getAppearance - */ - GapAdvertisingData::Appearance getAppearance(); - /** * @see ::GattServer::reset */ diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h index 951dd4803e..5eea4cefdb 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h @@ -19,69 +19,6 @@ public: virtual ~GenericAccessService() { } - virtual ble_error_t get_device_name_length(uint8_t& length) { -#if BLE_FEATURE_GATT_SERVER - const uint8_t* name = NULL; - uint16_t actual_length = 0; - - gatt_server().getDeviceName(name, actual_length); - length = actual_length; - - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif - } - - virtual ble_error_t get_device_name(Span& array) { -#if BLE_FEATURE_GATT_SERVER - const uint8_t* name = NULL; - uint16_t length = 0; - - gatt_server().getDeviceName(name, length); - - if (length > array.size()) { - return BLE_ERROR_PARAM_OUT_OF_RANGE; - } - - memcpy(array.data(), name, length); - - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - - virtual ble_error_t set_device_name(const uint8_t* device_name) { -#if BLE_FEATURE_GATT_SERVER - return gatt_server().setDeviceName(device_name); -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - - virtual ble_error_t get_appearance( - GapAdvertisingData::Appearance& appearance - ) { -#if BLE_FEATURE_GATT_SERVER - appearance = gatt_server().getAppearance(); - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - - virtual ble_error_t set_appearance( - GapAdvertisingData::Appearance appearance - ) { -#if BLE_FEATURE_GATT_SERVER - gatt_server().setAppearance(appearance); - return BLE_ERROR_NONE; -#else - return BLE_ERROR_NOT_IMPLEMENTED; -#endif // BLE_FEATURE_GATT_SERVER - } - virtual ble_error_t get_peripheral_prefered_connection_parameters( ::Gap::ConnectionParams_t& parameters ) { diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp index 8c8bf7a412..f7131e4623 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp @@ -818,47 +818,6 @@ void GattServer::setPreferredConnectionParams(const ::Gap::ConnectionParams_t& p memcpy(generic_access_service.ppcp + 6, ¶ms.connectionSupervisionTimeout, 2); } -ble_error_t GattServer::setDeviceName(const uint8_t *deviceName) -{ - size_t length = 0; - - if (deviceName != NULL) { - length = strlen((const char*)deviceName); - } - - if (length == 0) { - free(generic_access_service.device_name_value()); - } else { - uint8_t* res = (uint8_t*) realloc(generic_access_service.device_name_value(), length); - if (res == NULL) { - return BLE_ERROR_NO_MEM; - } - - generic_access_service.device_name_value() = res; - memcpy(res, deviceName, length); - } - - generic_access_service.device_name_length = length; - - return BLE_ERROR_NONE; -} - -void GattServer::getDeviceName(const uint8_t*& name, uint16_t& length) -{ - length = generic_access_service.device_name_length; - name = generic_access_service.device_name_value(); -} - -void GattServer::setAppearance(GapAdvertisingData::Appearance appearance) -{ - generic_access_service.appearance = appearance; -} - -GapAdvertisingData::Appearance GattServer::getAppearance() -{ - return (GapAdvertisingData::Appearance) generic_access_service.appearance; -} - ble_error_t GattServer::reset_(void) { Base::reset_(); diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioImplementations.cpp b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioImplementations.cpp index f1526a2515..73265ccda0 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioImplementations.cpp +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioImplementations.cpp @@ -26,7 +26,6 @@ #include "ble/pal/AttClientToGattClientAdapter.h" #include "ble/pal/PalGap.h" -#include "source/LegacyGap.tpp" #include "source/gap/Gap.tpp" #include "source/GattClient.tpp" #include "source/SecurityManager.tpp" @@ -121,14 +120,3 @@ template class ble::interface::Gap< SecurityManagerImpl > >; - -template class ble::interface::LegacyGap< - ble::generic::GenericGap< - ble::pal::vendor::cordio::Gap, - SecurityManagerImpl::PalSecurityManager, - SecurityManagerImpl - > ->; - - -