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"
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
394#if BLE_FEATURE_GATT_CLIENT
412#if BLE_FEATURE_SECURITY
450 friend class ble::BLEInstanceBase;
460 BLE(ble::BLEInstanceBase &transport);
473 ble::BLEInstanceBase &transport;
Function like object adapter over freestanding and member functions.
Abstract away BLE-capable radio transceivers or SOCs.
const ble::Gap & gap() const
A const alternative to gap().
ble::GattServer & gattServer()
Accessor to GattServer.
void onEventsToProcess(const OnEventsToProcessCallback_t &on_event_cb)
Register a callback called when the BLE stack has pending work.
FunctionPointerWithContext< OnEventsToProcessCallbackContext * > OnEventsToProcessCallback_t
Events to process event handler.
const ble::SecurityManager & securityManager() const
A const alternative to securityManager().
static const char * errorToString(ble_error_t error)
Translate error code into a printable string.
ble_error_t init(InitializationCompleteCallback_t completion_cb=nullptr)
Initialize the BLE controller/stack.
void signalEventsToProcess()
This function allows the BLE stack to signal that there is work to do and event processing should be ...
static const InstanceID_t NUM_INSTANCES
The number of permitted BLE instances for the application.
ble::GattClient & gattClient()
Accessors to GattClient.
ble_error_t shutdown()
Shut down the underlying stack, and reset state of this BLE instance.
unsigned InstanceID_t
Opaque type used to store the ID of a BLE instance.
InstanceID_t getInstanceID() const
Fetch the ID of a BLE instance.
const char * getVersion()
This call allows the application to get the BLE stack version information.
const ble::GattServer & gattServer() const
A const alternative to gattServer().
ble_error_t init(T *object, void(T::*completion_cb)(InitializationCompleteCallbackContext *context))
Initialize the BLE controller/stack.
bool hasInitialized() const
Indicate if the BLE instance has been initialized.
void processEvents()
Process ALL pending events living in the BLE stack and return once all events have been consumed.
static BLE & Instance()
Get a reference to the BLE singleton.
static const InstanceID_t DEFAULT_INSTANCE
The value of the BLE::InstanceID_t for the default BLE instance.
ble::SecurityManager & securityManager()
Accessors to SecurityManager.
ble::Gap & gap()
Accessor to Gap.
void(* InitializationCompleteCallback_t)(InitializationCompleteCallbackContext *context)
Initialization complete event handler.
const ble::GattClient & gattClient() const
A const alternative to gattClient().
Define device discovery, connection and link management procedures.
Define procedures required for interacting with a distant GATT server.
Construct and operates a GATT server.
ble_error_t
Error codes for the BLE API.
Entry namespace for all BLE API definitions.
Initialization complete event.
BLE & ble
Reference to the BLE object that has been initialized.
ble_error_t error
Error status of the initialization.
BLE & ble
The ble instance which have events to process.