Skip to content

Commit 4768bc7

Browse files
review fixes
1 parent c7918ed commit 4768bc7

File tree

8 files changed

+27
-40
lines changed

8 files changed

+27
-40
lines changed

connectivity/FEATURE_BLE/include/ble/BLE.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ class BLE {
188188
* @return A reference to a single object.
189189
*
190190
* @pre id shall be less than NUM_INSTANCES.
191-
* @deprecated BLE singleton supports one instance. You may create multiple instances by using the constructor.
192-
* Please use BLE::Instance().
191+
*
193192
*/
193+
MBED_DEPRECATED_SINCE("mbed-os-6.3.0", "BLE singleton supports one instance. You may create multiple"
194+
"instances by using the constructor. Please use BLE::Instance().")
194195
static BLE &Instance(InstanceID_t id)
195196
{
196197
return Instance();
@@ -200,8 +201,9 @@ class BLE {
200201
* Fetch the ID of a BLE instance.
201202
*
202203
* @return Instance id of this BLE instance.
203-
* @deprecated BLE singleton supports one instance. You may create multiple instances by using the constructor.
204204
*/
205+
MBED_DEPRECATED_SINCE("mbed-os-6.3.0", "BLE singleton supports one instance. You may create multiple"
206+
"instances by using the constructor.")
205207
InstanceID_t getInstanceID(void) const
206208
{
207209
return DEFAULT_INSTANCE;

connectivity/FEATURE_BLE/include/ble/Gap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ class Gap {
555555
/**
556556
* Preferred connection parameter display in Generic Access Service.
557557
*/
558-
typedef struct PreferredConnectionParams_t {
558+
typedef struct {
559559
/**
560560
* Minimum interval between two connection events allowed for a
561561
* connection.

connectivity/FEATURE_BLE/include/ble/GattServer.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,7 @@
3333

3434
#include "ble/BLE.h"
3535

36-
/*! Maximum count of characteristics that can be stored for authorisation purposes */
37-
#define MAX_CHARACTERISTIC_AUTHORIZATION_CNT 20
38-
39-
/*! client characteristic configuration descriptors settings */
40-
#define MAX_CCCD_CNT 20
41-
4236
namespace ble {
43-
class PalAttClient;
44-
class BLE;
4537

4638
/**
4739
* @addtogroup ble

connectivity/FEATURE_BLE/include/ble/SecurityManager.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -921,15 +921,9 @@ class SecurityManager
921921

922922
public:
923923
#if !defined(DOXYGEN_ONLY)
924-
/** For backwards compatibility. This enm is now in BLETypes.h
925-
* @deprecated, use the enum in ble namespace */
926-
enum Keypress_t {
927-
KEYPRESS_STARTED, /**< Passkey entry started */
928-
KEYPRESS_ENTERED, /**< Passkey digit entered */
929-
KEYPRESS_ERASED, /**< Passkey digit erased */
930-
KEYPRESS_CLEARED, /**< Passkey cleared */
931-
KEYPRESS_COMPLETED, /**< Passkey entry completed */
932-
};
924+
/** For backwards compatibility. This enum is now in BLETypes.h
925+
* @deprecated use the enum in ble namespace */
926+
typedef ble::Keypress_t Keypress_t;
933927
#endif // !defined(DOXYGEN_ONLY)
934928
};
935929

connectivity/FEATURE_BLE/include/ble/internal/BLEInstanceBase.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727

2828
namespace ble {
2929

30-
class SecurityManager;
31-
class Gap;
32-
class GattClient;
33-
class GattServer;
34-
3530
/**
3631
* @addtogroup ble
3732
* @{

connectivity/FEATURE_BLE/libraries/ble-api-implementation/include/ble/internal/GattServerImpl.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@
3737
#include "ble/types/GattCallbackParamTypes.h"
3838
#include "ble/internal/PalSigningMonitor.h"
3939

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-
4640
namespace ble {
4741

4842
// fwd declaration of PalAttClient and BLE
@@ -346,12 +340,12 @@ class GattServer :
346340

347341
PalSigningMonitorEventHandler *_signing_event_handler;
348342

349-
attsCccSet_t cccds[MAX_CCCD_CNT];
350-
uint16_t cccd_values[MAX_CCCD_CNT];
351-
uint16_t cccd_handles[MAX_CCCD_CNT];
343+
attsCccSet_t cccds[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT];
344+
uint16_t cccd_values[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT];
345+
uint16_t cccd_handles[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT];
352346
uint8_t cccd_cnt;
353347

354-
GattCharacteristic *_auth_char[MAX_CHARACTERISTIC_AUTHORIZATION_CNT];
348+
GattCharacteristic *_auth_char[MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CHARACTERISTIC_AUTHORISATION_COUNT];
355349
uint8_t _auth_char_count;
356350

357351
struct {
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
{
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+
}
313
}

connectivity/FEATURE_BLE/libraries/ble-api-implementation/source/GattServerImpl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ ble_error_t GattServer::insert_characteristic_value_attribute(
406406
characteristic->isReadAuthorizationEnabled() ||
407407
characteristic->isWriteAuthorizationEnabled()
408408
) {
409-
if ( _auth_char_count >= MAX_CHARACTERISTIC_AUTHORIZATION_CNT) {
409+
if ( _auth_char_count >= MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CHARACTERISTIC_AUTHORISATION_COUNT) {
410410
return BLE_ERROR_NO_MEM;
411411
}
412412
_auth_char[_auth_char_count] = characteristic;
@@ -446,7 +446,7 @@ ble_error_t GattServer::insert_descriptor(
446446

447447
// handle the special case of a CCCD
448448
if (descriptor->getUUID() == UUID(BLE_UUID_DESCRIPTOR_CLIENT_CHAR_CONFIG)) {
449-
if (cccd_cnt >= MAX_CCCD_CNT) {
449+
if (cccd_cnt >= MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT) {
450450
return BLE_ERROR_NO_MEM;
451451
}
452452

@@ -552,7 +552,7 @@ ble_error_t GattServer::insert_cccd(
552552
GattCharacteristic *characteristic,
553553
attsAttr_t *&attribute_it
554554
) {
555-
if (cccd_cnt >= MAX_CCCD_CNT) {
555+
if (cccd_cnt >= MBED_CONF_BLE_API_IMPLEMENTATION_MAX_CCCD_COUNT) {
556556
return BLE_ERROR_NO_MEM;
557557
}
558558

0 commit comments

Comments
 (0)