Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
BLEInstanceBase Class Referenceabstract

Private interface used to implement the BLE class. More...

#include <BLEInstanceBase.h>

Public Member Functions

 BLEInstanceBase ()
 Base constructor. More...
 
virtual ~BLEInstanceBase ()
 Virtual destructor of the interface. More...
 
virtual void processEvents ()=0
 Process ALL pending events living in the vendor BLE subsystem. More...
 
void signalEventsToProcess (BLE::InstanceID_t id)
 Signal to BLE that events needing processing are available. More...
 
virtual ble_error_t init (BLE::InstanceID_t instanceID, FunctionPointerWithContext< BLE::InitializationCompleteCallbackContext * > initCallback)=0
 Start the initialization of the vendor BLE subsystem. More...
 
virtual bool hasInitialized (void) const =0
 Check whether the vendor BLE subsystem has been initialized or not. More...
 
virtual ble_error_t shutdown (void)=0
 Shutdown the vendor BLE subsystem. More...
 
virtual const char * getVersion (void)=0
 Fetches a NULL terminated string representation of the underlying BLE vendor subsystem. More...
 
virtual GapgetGap (void)=0
 Accessor to the vendor implementation of the Gap interface. More...
 
virtual const GapgetGap (void) const =0
 Const alternative to getGap(). More...
 
virtual GattServergetGattServer (void)=0
 Accessor to the vendor implementation of the GattServer interface. More...
 
virtual const GattServergetGattServer (void) const =0
 A const alternative to getGattServer(). More...
 
virtual GattClientgetGattClient (void)=0
 Accessor to the vendor implementation of the GattClient interface. More...
 
virtual SecurityManagergetSecurityManager (void)=0
 Accessor to the vendor implementation of the SecurityManager interface. More...
 
virtual const SecurityManagergetSecurityManager (void) const =0
 A const alternative to getSecurityManager(). More...
 
virtual void waitForEvent (void)=0
 Process pending events present in the vendor subsystem; then, put the MCU to sleep until an external source wakes it up. More...
 

Detailed Description

Private interface used to implement the BLE class.

The BLE class delegates all its abstract operations to an instance of this abstract class, which every vendor port of Mbed BLE shall implement.

The vendor port shall also define an implementation of the freestanding function createBLEInstance(). The BLE API uses this singleton function to gain access to a concrete implementation of this class defined in the vendor port.

Attention
This class is part of the porting API and is not meant to be used by end users of BLE API.
See also
BLE

Definition at line 54 of file BLEInstanceBase.h.

Constructor & Destructor Documentation

Base constructor.

Definition at line 60 of file BLEInstanceBase.h.

virtual ~BLEInstanceBase ( )
virtual

Virtual destructor of the interface.

Member Function Documentation

virtual Gap& getGap ( void  )
pure virtual

Accessor to the vendor implementation of the Gap interface.

Returns
A reference to a Gap object associated to this BLEInstanceBase instance.
See also
BLE::gap() Gap
virtual const Gap& getGap ( void  ) const
pure virtual

Const alternative to getGap().

Returns
A const reference to a Gap object associated to this BLEInstanceBase instance.
See also
BLE::gap() Gap
virtual GattClient& getGattClient ( void  )
pure virtual

Accessor to the vendor implementation of the GattClient interface.

Returns
A reference to a GattClient object associated to this BLEInstanceBase instance.
See also
BLE::gattClient() GattClient
virtual GattServer& getGattServer ( void  )
pure virtual

Accessor to the vendor implementation of the GattServer interface.

Returns
A reference to a GattServer object associated to this BLEInstanceBase instance.
See also
BLE::gattServer() GattServer
virtual const GattServer& getGattServer ( void  ) const
pure virtual

A const alternative to getGattServer().

Returns
A const reference to a GattServer object associated to this BLEInstanceBase instance.
See also
BLE::gattServer() GattServer
virtual SecurityManager& getSecurityManager ( void  )
pure virtual

Accessor to the vendor implementation of the SecurityManager interface.

Returns
A reference to a SecurityManager object associated to this BLEInstanceBase instance.
See also
BLE::securityManager() SecurityManager
virtual const SecurityManager& getSecurityManager ( void  ) const
pure virtual

A const alternative to getSecurityManager().

Returns
A const reference to a SecurityManager object associated to this BLEInstancebase instance.
See also
BLE::securityManager() SecurityManager
virtual const char* getVersion ( void  )
pure virtual

Fetches a NULL terminated string representation of the underlying BLE vendor subsystem.

Returns
A pointer to the NULL terminated string representation of the underlying BLE stack's version.
See also
BLE::getVersion()
virtual bool hasInitialized ( void  ) const
pure virtual

Check whether the vendor BLE subsystem has been initialized or not.

Returns
true if the initialization has completed for the vendor BLE subsystem.
Note
this function is invoked by BLE::hasInitialized()
See also
BLE::init() BLE::hasInitialized()
virtual ble_error_t init ( BLE::InstanceID_t  instanceID,
FunctionPointerWithContext< BLE::InitializationCompleteCallbackContext * >  initCallback 
)
pure virtual

Start the initialization of the vendor BLE subsystem.

Calls to this function are initiated by BLE::init, instanceID identify the BLE instance which issue that call while the initCallback is used to signal asynchronously the completion of the initialization process.

Parameters
[in]instanceIDIdentifier of the BLE instance requesting initialization.
[in]initCallbackCallback which the vendor port shall invoke when the initialization completes.

This is an optional parameter set to NULL when not supplied.

Returns
BLE_ERROR_NONE if the initialization procedure started successfully.
Postcondition
initCallback shall be invoked upon completion of the initialization process.
hasInitialized() shall return false until the initialization is complete, and it shall return true after succesful completion of the initialization process.
See also
BLE::init()
virtual void processEvents ( )
pure virtual

Process ALL pending events living in the vendor BLE subsystem.

Return once all pending events have been consumed.

See also
BLE::processEvents()
virtual ble_error_t shutdown ( void  )
pure virtual

Shutdown the vendor BLE subsystem.

This operation includes purging the stack of GATT and GAP state and clearing all state from other BLE components, such as the SecurityManager. Clearing all states may be realized by a call to Gap::reset(), GattClient::reset(), GattServer::reset() and SecurityManager::reset().

BLE::init() must be called afterward to reinstantiate services and GAP state.

Returns
BLE_ERROR_NONE if the underlying stack and all other services of the BLE API were shut down correctly.
Postcondition
hasInitialized() shall return false.
Note
This function is invoked by BLE::shutdown().
See also
BLE::shutdown() BLE::init() BLE::hasInitialized() Gap::reset() GattClient::reset() GattServer::reset() SecurityManager::reset() .
void signalEventsToProcess ( BLE::InstanceID_t  id)

Signal to BLE that events needing processing are available.

The vendor port shall call this function whenever there are events ready to be processed in the internal stack or BLE subsystem. As a result of this call, the callback registered by the end user via BLE::onEventsToProcess will be invoked.

Parameters
[in]idIdentifier of the BLE instance, which does have events to ready to be processed.
virtual void waitForEvent ( void  )
pure virtual

Process pending events present in the vendor subsystem; then, put the MCU to sleep until an external source wakes it up.

Attention
This function is deprecated in the BLE class. It will be removed from this interface once it is removed from BLE.
See also
BLE::waitForEvent() BLE::processEvents()
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.