22 #include "platform/mbed_error.h"    23 #include "platform/mbed_assert.h"    24 #include "platform/mbed_toolchain.h"    27 #include "ble/GattClient.h"    28 #include "ble/GattServer.h"    29 #include "ble/SecurityManager.h"    31 #include "ble/common/BLERoles.h"    32 #include "ble/common/BLETypes.h"    33 #include "ble/common/blecommon.h"    39 class BLEInstanceBase;
   158     BLE(
const BLE &) = 
delete;
   159     BLE &operator=(
const BLE &) = 
delete;
   186     MBED_DEPRECATED_SINCE(
"mbed-os-6.3.0", 
"BLE singleton supports one instance. You may create multiple"   187                           "instances by using the constructor. Please use BLE::Instance().")
   198     MBED_DEPRECATED_SINCE(
"mbed-os-6.3.0", 
"BLE singleton supports one instance. You may create multiple"   199                           "instances by using the constructor.")
   309         return initImplementation(callback);
   326         return initImplementation(callback);
   376 #if BLE_FEATURE_GATT_SERVER   392 #endif // BLE_FEATURE_GATT_SERVER   394 #if BLE_FEATURE_GATT_CLIENT   410 #endif // BLE_FEATURE_GATT_CLIENT   412 #if BLE_FEATURE_SECURITY   429 #endif // BLE_FEATURE_SECURITY   450     friend class ble::BLEInstanceBase;
   460     BLE(ble::BLEInstanceBase &transport);
   473     ble::BLEInstanceBase &transport; 
 
const char * getVersion()
This call allows the application to get the BLE stack version information. 
Define device discovery, connection and link management procedures. 
Construct and operates a GATT server. 
void(* InitializationCompleteCallback_t)(InitializationCompleteCallbackContext *context)
Initialization complete event handler. 
static BLE & Instance()
Get a reference to the BLE singleton. 
static const InstanceID_t NUM_INSTANCES
The number of permitted BLE instances for the application. 
FunctionPointerWithContext< OnEventsToProcessCallbackContext * > OnEventsToProcessCallback_t
Events to process event handler. 
void processEvents()
Process ALL pending events living in the BLE stack and return once all events have been consumed...
ble_error_t shutdown()
Shut down the underlying stack, and reset state of this BLE instance. 
static const InstanceID_t DEFAULT_INSTANCE
The value of the BLE::InstanceID_t for the default BLE instance. 
bool hasInitialized() const 
Indicate if the BLE instance has been initialized. 
Initialization complete event. 
ble::SecurityManager & securityManager()
Accessors to SecurityManager. 
void onEventsToProcess(const OnEventsToProcessCallback_t &on_event_cb)
Register a callback called when the BLE stack has pending work. 
ble_error_t init(T *object, void(T::*completion_cb)(InitializationCompleteCallbackContext *context))
Initialize the BLE controller/stack. 
InstanceID_t getInstanceID() const 
Fetch the ID of a BLE instance. 
ble::GattClient & gattClient()
Accessors to GattClient. 
ble_error_t init(InitializationCompleteCallback_t completion_cb=nullptr)
Initialize the BLE controller/stack. 
Define procedures required for interacting with a distant GATT server. 
static const char * errorToString(ble_error_t error)
Translate error code into a printable string. 
void signalEventsToProcess()
This function allows the BLE stack to signal that there is work to do and event processing should be ...
ble::GattServer & gattServer()
Accessor to GattServer. 
unsigned InstanceID_t
Opaque type used to store the ID of a BLE instance. 
ble_error_t error
Error status of the initialization. 
ble::Gap & gap()
Accessor to Gap. 
Entry namespace for all BLE API definitions. 
BLE & ble
The ble instance which have events to process. 
Abstract away BLE-capable radio transceivers or SOCs. 
ble_error_t
Error codes for the BLE API.