File tree Expand file tree Collapse file tree 3 files changed +18
-16
lines changed
connectivity/FEATURE_BLE/libraries/ble-api-implementation Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Original file line number Diff line number Diff line change 33
33
#include " att_api.h"
34
34
#include " SecurityManager.h"
35
35
36
- #include " ble/BLE.h"
37
36
#include " ble/types/GattCallbackParamTypes.h"
38
37
#include " ble/internal/PalSigningMonitor.h"
39
38
40
- /* ! Maximum count of characteristics that can be stored for authorisation purposes */
41
- #define MAX_CHARACTERISTIC_AUTHORIZATION_CNT 20
42
-
43
- /* ! client characteristic configuration descriptors settings */
44
- #define MAX_CCCD_CNT 20
45
-
46
39
namespace ble {
47
40
48
41
// fwd declaration of PalAttClient and BLE
@@ -346,12 +339,12 @@ class GattServer :
346
339
347
340
PalSigningMonitorEventHandler *_signing_event_handler;
348
341
349
- attsCccSet_t cccds[MAX_CCCD_CNT ];
350
- uint16_t cccd_values[MAX_CCCD_CNT ];
351
- uint16_t cccd_handles[MAX_CCCD_CNT ];
342
+ attsCccSet_t cccds[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT ];
343
+ uint16_t cccd_values[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT ];
344
+ uint16_t cccd_handles[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT ];
352
345
uint8_t cccd_cnt;
353
346
354
- GattCharacteristic *_auth_char[MAX_CHARACTERISTIC_AUTHORIZATION_CNT ];
347
+ GattCharacteristic *_auth_char[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CHARACTERISTIC_AUTHORISATION_COUNT ];
355
348
uint8_t _auth_char_count;
356
349
357
350
struct {
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " ble-api-implementation"
2
+ "name" : " ble-api-implementation" ,
3
+ "config" : {
4
+ "max-characteristic-authorisation-count" : {
5
+ "help" : " Maximum count of characteristics that can be stored for authorisation purposes." ,
6
+ "value" : 20
7
+ },
8
+ "max-cccd-count" : {
9
+ "help" : " Client characteristic configuration descriptors settings." ,
10
+ "value" : 20
11
+ }
12
+ }
3
13
}
Original file line number Diff line number Diff line change 20
20
#include < algorithm>
21
21
#include " ble/GattServer.h"
22
22
#include " ble/internal/BLEInstanceBase.h"
23
- #include " mbed.h"
24
23
#include " wsf_types.h"
25
24
#include " att_api.h"
26
25
@@ -407,7 +406,7 @@ ble_error_t GattServer::insert_characteristic_value_attribute(
407
406
characteristic->isReadAuthorizationEnabled () ||
408
407
characteristic->isWriteAuthorizationEnabled ()
409
408
) {
410
- if ( _auth_char_count >= MAX_CHARACTERISTIC_AUTHORIZATION_CNT ) {
409
+ if ( _auth_char_count >= MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CHARACTERISTIC_AUTHORISATION_COUNT ) {
411
410
return BLE_ERROR_NO_MEM;
412
411
}
413
412
_auth_char[_auth_char_count] = characteristic;
@@ -447,7 +446,7 @@ ble_error_t GattServer::insert_descriptor(
447
446
448
447
// handle the special case of a CCCD
449
448
if (descriptor->getUUID () == UUID (BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG)) {
450
- if (cccd_cnt >= MAX_CCCD_CNT ) {
449
+ if (cccd_cnt >= MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT ) {
451
450
return BLE_ERROR_NO_MEM;
452
451
}
453
452
@@ -553,7 +552,7 @@ ble_error_t GattServer::insert_cccd(
553
552
GattCharacteristic *characteristic,
554
553
attsAttr_t *&attribute_it
555
554
) {
556
- if (cccd_cnt >= MAX_CCCD_CNT ) {
555
+ if (cccd_cnt >= MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT ) {
557
556
return BLE_ERROR_NO_MEM;
558
557
}
559
558
You can’t perform that action at this time.
0 commit comments