Cypress Bluetooth Mesh Gateway
cypress::embedded::BLE Class Reference

Description

Defines Embedded BLE Class.

Public Types

typedef unsigned InstanceID_t
 Opaque type used to store the ID of a BLE instance.
 

Public Member Functions

InstanceID_t getInstanceID (void) const
 Fetch the ID of a BLE instance. More...
 
ble_error_t init (void(*callback)(void))
 Initialize the Embedded BLE stack/controller.
 
ble_error_t shutdown (void)
 Shutdown the Embedded BLE stack/controller.
 
ble_error_t reset (void)
 Reset the Embedded BLE stack/controller - think of it is a s/w reset button for BT controller.
 
int hasInitialized (void)
 Returns whether the Embedded Bluetooth stack has been initialized or not.
 
void setInitialized (void)
 Sets Embedded Bluetooth stack status to True(1).
 
ble_init_callback_t get_initCallback (void)
 Returns Embedded Bluetooth stack initialization-callback method.
 
Meshmesh ()
 Returns Mesh instance associated with BLE.
 
Gapgap ()
 Returns GAP instance associated with BLE.
 

Static Public Member Functions

static BLEInstance (void)
 Get a reference to the Embedded BLE singleton corresponding to a given interface. More...
 
static const char * errorToString (ble_error_t error)
 Translate error code into a printable string. More...
 

Static Public Attributes

static const InstanceID_t DEFAULT_INSTANCE = 0
 The value of the BLE::InstanceID_t for the default BLE instance.
 

Member Function Documentation

◆ Instance()

static BLE& cypress::embedded::BLE::Instance ( void  )
inlinestatic

Get a reference to the Embedded BLE singleton corresponding to a given interface.

Note
Calling Instance() is preferred over constructing a BLE object directly because it returns references to singleton.
Returns
A reference to a single object.

◆ getInstanceID()

InstanceID_t cypress::embedded::BLE::getInstanceID ( void  ) const
inline

Fetch the ID of a BLE instance.

Returns
Instance id of this BLE instance.

◆ errorToString()

static const char* cypress::embedded::BLE::errorToString ( ble_error_t  error)
static

Translate error code into a printable string.

Parameters
[in]errorError code returned by BLE functions.
Returns
A pointer to a const string describing the error.