Skip to content

Commit f4ee83f

Browse files
committed
Cordio: remove LegacyGap implementation
1 parent 555158c commit f4ee83f

File tree

4 files changed

+0
-136
lines changed

4 files changed

+0
-136
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioGattServer.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,6 @@ class GattServer : public ::ble::interface::GattServer<GattServer>,
149149
*/
150150
void setPreferredConnectionParams(const ::Gap::ConnectionParams_t& params);
151151

152-
/**
153-
* @see ::GattServer::setDeviceName
154-
*/
155-
ble_error_t setDeviceName(const uint8_t *deviceName);
156-
157-
/**
158-
* @see ::GattServer::getDeviceName
159-
*/
160-
void getDeviceName(const uint8_t*& name, uint16_t& length);
161-
162-
/**
163-
* @see ::GattServer::setAppearance
164-
*/
165-
void setAppearance(GapAdvertisingData::Appearance appearance);
166-
167-
/**
168-
* @see ::GattServer::getAppearance
169-
*/
170-
GapAdvertisingData::Appearance getAppearance();
171-
172152
/**
173153
* @see ::GattServer::reset
174154
*/

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalGenericAccessService.h

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,69 +19,6 @@ class GenericAccessService : public ::ble::pal::GenericAccessService {
1919

2020
virtual ~GenericAccessService() { }
2121

22-
virtual ble_error_t get_device_name_length(uint8_t& length) {
23-
#if BLE_FEATURE_GATT_SERVER
24-
const uint8_t* name = NULL;
25-
uint16_t actual_length = 0;
26-
27-
gatt_server().getDeviceName(name, actual_length);
28-
length = actual_length;
29-
30-
return BLE_ERROR_NONE;
31-
#else
32-
return BLE_ERROR_NOT_IMPLEMENTED;
33-
#endif
34-
}
35-
36-
virtual ble_error_t get_device_name(Span<uint8_t>& array) {
37-
#if BLE_FEATURE_GATT_SERVER
38-
const uint8_t* name = NULL;
39-
uint16_t length = 0;
40-
41-
gatt_server().getDeviceName(name, length);
42-
43-
if (length > array.size()) {
44-
return BLE_ERROR_PARAM_OUT_OF_RANGE;
45-
}
46-
47-
memcpy(array.data(), name, length);
48-
49-
return BLE_ERROR_NONE;
50-
#else
51-
return BLE_ERROR_NOT_IMPLEMENTED;
52-
#endif // BLE_FEATURE_GATT_SERVER
53-
}
54-
55-
virtual ble_error_t set_device_name(const uint8_t* device_name) {
56-
#if BLE_FEATURE_GATT_SERVER
57-
return gatt_server().setDeviceName(device_name);
58-
#else
59-
return BLE_ERROR_NOT_IMPLEMENTED;
60-
#endif // BLE_FEATURE_GATT_SERVER
61-
}
62-
63-
virtual ble_error_t get_appearance(
64-
GapAdvertisingData::Appearance& appearance
65-
) {
66-
#if BLE_FEATURE_GATT_SERVER
67-
appearance = gatt_server().getAppearance();
68-
return BLE_ERROR_NONE;
69-
#else
70-
return BLE_ERROR_NOT_IMPLEMENTED;
71-
#endif // BLE_FEATURE_GATT_SERVER
72-
}
73-
74-
virtual ble_error_t set_appearance(
75-
GapAdvertisingData::Appearance appearance
76-
) {
77-
#if BLE_FEATURE_GATT_SERVER
78-
gatt_server().setAppearance(appearance);
79-
return BLE_ERROR_NONE;
80-
#else
81-
return BLE_ERROR_NOT_IMPLEMENTED;
82-
#endif // BLE_FEATURE_GATT_SERVER
83-
}
84-
8522
virtual ble_error_t get_peripheral_prefered_connection_parameters(
8623
::Gap::ConnectionParams_t& parameters
8724
) {

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioGattServer.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -818,47 +818,6 @@ void GattServer::setPreferredConnectionParams(const ::Gap::ConnectionParams_t& p
818818
memcpy(generic_access_service.ppcp + 6, &params.connectionSupervisionTimeout, 2);
819819
}
820820

821-
ble_error_t GattServer::setDeviceName(const uint8_t *deviceName)
822-
{
823-
size_t length = 0;
824-
825-
if (deviceName != NULL) {
826-
length = strlen((const char*)deviceName);
827-
}
828-
829-
if (length == 0) {
830-
free(generic_access_service.device_name_value());
831-
} else {
832-
uint8_t* res = (uint8_t*) realloc(generic_access_service.device_name_value(), length);
833-
if (res == NULL) {
834-
return BLE_ERROR_NO_MEM;
835-
}
836-
837-
generic_access_service.device_name_value() = res;
838-
memcpy(res, deviceName, length);
839-
}
840-
841-
generic_access_service.device_name_length = length;
842-
843-
return BLE_ERROR_NONE;
844-
}
845-
846-
void GattServer::getDeviceName(const uint8_t*& name, uint16_t& length)
847-
{
848-
length = generic_access_service.device_name_length;
849-
name = generic_access_service.device_name_value();
850-
}
851-
852-
void GattServer::setAppearance(GapAdvertisingData::Appearance appearance)
853-
{
854-
generic_access_service.appearance = appearance;
855-
}
856-
857-
GapAdvertisingData::Appearance GattServer::getAppearance()
858-
{
859-
return (GapAdvertisingData::Appearance) generic_access_service.appearance;
860-
}
861-
862821
ble_error_t GattServer::reset_(void)
863822
{
864823
Base::reset_();

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioImplementations.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "ble/pal/AttClientToGattClientAdapter.h"
2727
#include "ble/pal/PalGap.h"
2828

29-
#include "source/LegacyGap.tpp"
3029
#include "source/gap/Gap.tpp"
3130
#include "source/GattClient.tpp"
3231
#include "source/SecurityManager.tpp"
@@ -121,14 +120,3 @@ template class ble::interface::Gap<
121120
SecurityManagerImpl
122121
>
123122
>;
124-
125-
template class ble::interface::LegacyGap<
126-
ble::generic::GenericGap<
127-
ble::pal::vendor::cordio::Gap,
128-
SecurityManagerImpl::PalSecurityManager,
129-
SecurityManagerImpl
130-
>
131-
>;
132-
133-
134-

0 commit comments

Comments
 (0)