|
18 | 18 | #include "ble/BLE.h"
|
19 | 19 | #include "ble/BLEInstanceBase.h"
|
20 | 20 | #include "platform/mbed_critical.h"
|
| 21 | +#include "Deprecated.h" |
21 | 22 |
|
22 | 23 | #if defined(TARGET_OTA_ENABLED)
|
23 | 24 | #include "ble/services/DFUService.h"
|
|
32 | 33 | #include <mbed_toolchain.h>
|
33 | 34 | #endif
|
34 | 35 |
|
35 |
| -#if defined(__GNUC__) && !defined(__CC_ARM) |
36 |
| -#define BLE_DEPRECATED_API_USE_BEGIN \ |
37 |
| - _Pragma("GCC diagnostic push") \ |
38 |
| - _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") |
39 |
| -#elif defined(__CC_ARM) |
40 |
| -#define BLE_DEPRECATED_API_USE_BEGIN \ |
41 |
| - _Pragma("push") \ |
42 |
| - _Pragma("diag_suppress 1361") |
43 |
| -#else |
44 |
| -#define BLE_DEPRECATED_API_USE_BEGIN |
45 |
| -#endif |
46 |
| - |
47 |
| -#if defined(__GNUC__) && !defined(__CC_ARM) |
48 |
| -#define BLE_DEPRECATED_API_USE_END \ |
49 |
| - _Pragma("GCC diagnostic pop") |
50 |
| -#elif defined(__CC_ARM) |
51 |
| -#define BLE_DEPRECATED_API_USE_END \ |
52 |
| - _Pragma("pop") |
53 |
| -#else |
54 |
| -#define BLE_DEPRECATED_API_USE_END |
55 |
| -#endif |
56 |
| - |
57 | 36 | static const char* error_strings[] = {
|
58 | 37 | "BLE_ERROR_NONE: No error",
|
59 | 38 | "BLE_ERROR_BUFFER_OVERFLOW: The requested action would cause a buffer overflow and has been aborted",
|
@@ -167,18 +146,18 @@ BLE::Instance(InstanceID_t id)
|
167 | 146 | static BLE *singletons[NUM_INSTANCES];
|
168 | 147 | if (id < NUM_INSTANCES) {
|
169 | 148 | if (singletons[id] == NULL) {
|
170 |
| -BLE_DEPRECATED_API_USE_BEGIN |
| 149 | +BLE_DEPRECATED_API_USE_BEGIN() |
171 | 150 | singletons[id] = new BLE(id); /* This object will never be freed. */
|
172 |
| -BLE_DEPRECATED_API_USE_END |
| 151 | +BLE_DEPRECATED_API_USE_END() |
173 | 152 | }
|
174 | 153 |
|
175 | 154 | return *singletons[id];
|
176 | 155 | }
|
177 | 156 |
|
178 | 157 | /* we come here only in the case of a bad interfaceID. */
|
179 |
| -BLE_DEPRECATED_API_USE_BEGIN |
| 158 | +BLE_DEPRECATED_API_USE_BEGIN() |
180 | 159 | static BLE badSingleton(NUM_INSTANCES /* this is a bad index; and will result in a NULL transport. */);
|
181 |
| -BLE_DEPRECATED_API_USE_END |
| 160 | +BLE_DEPRECATED_API_USE_END() |
182 | 161 | return badSingleton;
|
183 | 162 | }
|
184 | 163 |
|
@@ -352,7 +331,7 @@ void BLE::signalEventsToProcess()
|
352 | 331 |
|
353 | 332 | // start of deprecated functions
|
354 | 333 |
|
355 |
| -BLE_DEPRECATED_API_USE_BEGIN |
| 334 | +BLE_DEPRECATED_API_USE_BEGIN() |
356 | 335 |
|
357 | 336 | // NOTE: move and remove deprecation once private
|
358 | 337 | BLE::BLE(InstanceID_t instanceIDIn) : instanceID(instanceIDIn), transport(),
|
@@ -519,5 +498,5 @@ void BLE::onRadioNotification(void (*callback)(bool)) {
|
519 | 498 | }
|
520 | 499 |
|
521 | 500 |
|
522 |
| -BLE_DEPRECATED_API_USE_END |
| 501 | +BLE_DEPRECATED_API_USE_END() |
523 | 502 |
|
0 commit comments