Skip to content

Commit 7ba7f3e

Browse files
fix toggling off ble feature signing
1 parent d147abc commit 7ba7f3e

File tree

9 files changed

+55
-17
lines changed

9 files changed

+55
-17
lines changed

connectivity/FEATURE_BLE/source/cordio/source/BLEInstanceBaseImpl.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
#include "source/pal/PalAttClient.h"
2727
#include "source/pal/PalSecurityManager.h"
2828
#include "source/pal/PalGap.h"
29+
#if BLE_FEATURE_SIGNING
2930
#include "source/pal/PalSigningMonitor.h"
31+
#endif //BLE_FEATURE_SIGNING
3032
#include "source/pal/PalAttClientToGattClient.h"
3133

3234
#include "source/BLEInstanceBaseImpl.h"
@@ -283,6 +285,7 @@ PalGattClient &BLEInstanceBase::getPalGattClient()
283285
#if BLE_FEATURE_SECURITY
284286
ble::impl::SecurityManager &BLEInstanceBase::getSecurityManagerImpl()
285287
{
288+
#if BLE_FEATURE_SIGNING
286289
// Creation of a proxy monitor to let the security manager register to
287290
// the gatt client and gatt server.
288291
static struct : ble::PalSigningMonitor {
@@ -296,11 +299,14 @@ ble::impl::SecurityManager &BLEInstanceBase::getSecurityManagerImpl()
296299
#endif // BLE_FEATURE_GATT_SERVER
297300
}
298301
} signing_event_monitor;
302+
#endif //BLE_FEATURE_SIGNING
299303

300304
static ble::impl::SecurityManager m_instance(
301305
ble::impl::PalSecurityManager::get_security_manager(),
302-
getGapImpl(),
303-
signing_event_monitor
306+
getGapImpl()
307+
#if BLE_FEATURE_SIGNING
308+
, signing_event_monitor
309+
#endif //BLE_FEATURE_SIGNING
304310
#if BLE_FEATURE_PRIVACY
305311
, getPrivateAddressRegistry()
306312
#endif //BLE_FEATURE_PRIVACY

connectivity/FEATURE_BLE/source/cordio/source/BLEInstanceBaseImpl.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@
5454
#endif
5555

5656
namespace ble {
57-
57+
#if BLE_FEATURE_SIGNING
5858
class PalSigningMonitor;
59+
#endif //BLE_FEATURE_SIGNING
5960

6061
namespace impl {
6162

@@ -70,8 +71,9 @@ class BLEInstanceBase final : public ble::BLEInstanceBase {
7071
using Timeout = mbed::Timeout;
7172
using Timer = mbed::Timer;
7273
#endif
73-
74+
#if BLE_FEATURE_SIGNING
7475
friend PalSigningMonitor;
76+
#endif //BLE_FEATURE_SIGNING
7577

7678
/**
7779
* Construction with an HCI driver.

connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,9 @@ GattServer::GattServer() :
16291629
updatesEnabledCallback(nullptr),
16301630
updatesDisabledCallback(nullptr),
16311631
confirmationReceivedCallback(nullptr),
1632+
#if BLE_FEATURE_SIGNING
16321633
_signing_event_handler(nullptr),
1634+
#endif //BLE_FEATURE_SIGNING
16331635
cccds(),
16341636
cccd_values(),
16351637
cccd_handles(),
@@ -1645,12 +1647,14 @@ GattServer::GattServer() :
16451647
{
16461648
}
16471649

1650+
#if BLE_FEATURE_SIGNING
16481651
void GattServer::set_signing_event_handler(
16491652
PalSigningMonitorEventHandler *signing_event_handler
16501653
)
16511654
{
16521655
_signing_event_handler = signing_event_handler;
16531656
}
1657+
#endif //BLE_FEATURE_SIGNING
16541658

16551659
void GattServer::onDataSent(const DataSentCallback_t &callback)
16561660
{

connectivity/FEATURE_BLE/source/cordio/source/GattServerImpl.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939

4040
#include "source/BLEInstanceBase.h"
4141
#include "source/generic/GattServerEvents.h"
42+
#if BLE_FEATURE_SIGNING
4243
#include "source/pal/PalSigningMonitor.h"
44+
#endif //BLE_FEATURE_SIGNING
4345

4446
namespace ble {
4547

@@ -49,10 +51,16 @@ class PalGenericAccessService;
4951
class BLE;
5052

5153
namespace impl {
52-
class GattServer : public PalSigningMonitor {
54+
class GattServer
55+
#if BLE_FEATURE_SIGNING
56+
: public PalSigningMonitor
57+
#endif //BLE_FEATURE_SIGNING
58+
{
5359
friend ble::BLE;
5460
friend ble::PalAttClient;
61+
#if BLE_FEATURE_SIGNING
5562
friend PalSigningMonitor;
63+
#endif //BLE_FEATURE_SIGNING
5664
friend PalGenericAccessService;
5765

5866
using EventHandler = ble::GattServer::EventHandler;
@@ -214,11 +222,11 @@ class GattServer : public PalSigningMonitor {
214222
void initialize();
215223

216224
static uint8_t atts_auth_cb(dmConnId_t connId, uint8_t permit, uint16_t handle);
217-
225+
#if BLE_FEATURE_SIGNING
218226
void set_signing_event_handler(
219227
PalSigningMonitorEventHandler *signing_event_handler
220228
) override;
221-
229+
#endif //BLE_FEATURE_SIGNING
222230
private:
223231

224232
GattServer();
@@ -361,8 +369,9 @@ class GattServer : public PalSigningMonitor {
361369
* The registered callback handler for confirmation received events.
362370
*/
363371
EventCallback_t confirmationReceivedCallback;
364-
372+
#if BLE_FEATURE_SIGNING
365373
PalSigningMonitorEventHandler *_signing_event_handler;
374+
#endif //BLE_FEATURE_SIGNING
366375

367376
attsCccSet_t cccds[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT];
368377
uint16_t cccd_values[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT];

connectivity/FEATURE_BLE/source/generic/GattClientImpl.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
#include "ble/gatt/CharacteristicDescriptorDiscovery.h"
3131
#include "ble/gatt/GattCallbackParamTypes.h"
3232
#include "source/pal/PalGattClient.h"
33+
#if BLE_FEATURE_SIGNING
3334
#include "source/pal/PalSigningMonitor.h"
35+
#endif //BLE_FEATURE_SIGNING
3436
#include "ble/GattClient.h"
3537

3638
namespace ble {
@@ -40,9 +42,13 @@ class BLEInstanceBase;
4042
namespace impl {
4143

4244
class GattClient :
45+
#if BLE_FEATURE_SIGNING
4346
public PalSigningMonitor,
47+
#endif //BLE_FEATURE_SIGNING
4448
public PalGattClientEventHandler {
49+
#if BLE_FEATURE_SIGNING
4550
friend PalSigningMonitor;
51+
#endif //BLE_FEATURE_SIGNING
4652
friend BLEInstanceBase;
4753
public:
4854
using EventHandler = ble::GattClient::EventHandler;
@@ -163,11 +169,12 @@ class GattClient :
163169
/* private implementation follows */
164170

165171
private:
172+
#if BLE_FEATURE_SIGNING
166173
/**
167174
* @see ble::PalSigningMonitor::set_signing_event_handler
168175
*/
169176
void set_signing_event_handler(PalSigningMonitorEventHandler *signing_event_handler) override;
170-
177+
#endif //BLE_FEATURE_SIGNING
171178
/**
172179
* @see PalGattClient::EventHandler::on_att_mtu_change
173180
*/
@@ -244,7 +251,9 @@ class GattClient :
244251

245252
PalGattClient &_pal_client;
246253
ServiceDiscovery::TerminationCallback_t _termination_callback;
254+
#if BLE_FEATURE_SIGNING
247255
PalSigningMonitorEventHandler *_signing_event_handler;
256+
#endif // BLE_FEATURE_SIGNING
248257
mutable ProcedureControlBlock *control_blocks;
249258
bool _is_reseting;
250259

connectivity/FEATURE_BLE/source/generic/SecurityManagerImpl.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333

3434
#include "source/pal/GapTypes.h"
3535
#include "source/pal/PalConnectionMonitor.h"
36+
#if BLE_FEATURE_SIGNING
3637
#include "source/pal/PalSigningMonitor.h"
38+
#endif //BLE_FEATURE_SIGNING
3739
#include "source/pal/PalSecurityManager.h"
3840

3941
#include "source/generic/SecurityDb.h"
@@ -479,15 +481,19 @@ class SecurityManager :
479481
public:
480482
SecurityManager(
481483
ble::PalSecurityManager &palImpl,
482-
ble::PalConnectionMonitor &connMonitorImpl,
483-
ble::PalSigningMonitor &signingMonitorImpl
484+
ble::PalConnectionMonitor &connMonitorImpl
485+
#if BLE_FEATURE_SIGNING
486+
, ble::PalSigningMonitor &signingMonitorImpl
487+
#endif //BLE_FEATURE_SIGNING
484488
#if BLE_FEATURE_PRIVACY
485489
, PrivateAddressController &privateAddressController
486490
#endif // BLE_FEATURE_PRIVACY
487491
) : eventHandler(nullptr),
488492
_pal(palImpl),
489493
_connection_monitor(connMonitorImpl),
494+
#if BLE_FEATURE_SIGNING
490495
_signing_monitor(signingMonitorImpl),
496+
#endif //BLE_FEATURE_SIGNING
491497
_db(nullptr),
492498
#if BLE_FEATURE_PRIVACY
493499
_private_address_controller(privateAddressController),
@@ -681,7 +687,9 @@ class SecurityManager :
681687

682688
PalSecurityManager &_pal;
683689
PalConnectionMonitor &_connection_monitor;
690+
#if BLE_FEATURE_SIGNING
684691
PalSigningMonitor &_signing_monitor;
692+
#endif //BLE_FEATURE_SIGNING
685693

686694
SecurityDb *_db;
687695
#if BLE_FEATURE_PRIVACY

connectivity/FEATURE_BLE/source/pal/PalAttClientToGattClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ ble_error_t PalAttClientToGattClient::write_without_response(
184184
);
185185
}
186186

187-
187+
#if BLE_FEATURE_SIGNING
188188
ble_error_t PalAttClientToGattClient::signed_write_without_response(
189189
connection_handle_t connection_handle,
190190
attribute_handle_t characteristic_value_handle,
@@ -197,7 +197,7 @@ ble_error_t PalAttClientToGattClient::signed_write_without_response(
197197
value
198198
);
199199
}
200-
200+
#endif // BLE_FEATURE_SIGNING
201201

202202
ble_error_t PalAttClientToGattClient::write_attribute(
203203
connection_handle_t connection_handle,

connectivity/FEATURE_BLE/source/pal/PalAttClientToGattClient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class PalAttClientToGattClient : public PalGattClient {
140140
attribute_handle_t characteristic_value_handle,
141141
const Span<const uint8_t>& value
142142
) override;
143-
143+
#if BLE_FEATURE_SIGNING
144144
/**
145145
* @see ble::PalGattClient::signed_write_without_response
146146
*/
@@ -149,7 +149,7 @@ class PalAttClientToGattClient : public PalGattClient {
149149
attribute_handle_t characteristic_value_handle,
150150
const Span<const uint8_t>& value
151151
) override;
152-
152+
#endif //BLE_FEATURE_SIGNING
153153
/**
154154
* @see ble::PalGattClient::write_attribute
155155
*/

connectivity/FEATURE_BLE/source/pal/PalGattClient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ class PalGattClient {
472472
attribute_handle_t characteristic_value_handle,
473473
const Span<const uint8_t>& value
474474
) = 0;
475-
475+
#if BLE_FEATURE_SIGNING
476476
/**
477477
* Send a Signed Write without Response command to the server.
478478
*
@@ -494,7 +494,7 @@ class PalGattClient {
494494
attribute_handle_t characteristic_value_handle,
495495
const Span<const uint8_t>& value
496496
) = 0;
497-
497+
#endif //BLE_FEATURE_SIGNING
498498
/**
499499
* Send a write request to the server.
500500
*

0 commit comments

Comments
 (0)