adaptation for book and plug demo

Dependents:   BookAndPlug

Fork of BLE_API by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

BLEInstanceBase Class Reference

BLEInstanceBase Class Reference

The interface for the transport object to be created by the target library's createBLEInstance(). More...

#include <BLEInstanceBase.h>

Public Member Functions

virtual ~BLEInstanceBase ()
 Virtual destructor of the interface.
virtual ble_error_t init (BLE::InstanceID_t instanceID, FunctionPointerWithContext< BLE::InitializationCompleteCallbackContext * > initCallback)=0
 Initialize the underlying BLE stack.
virtual bool hasInitialized (void) const =0
 Check whether the underlying stack has already been initialized, possible with a call to init().
virtual ble_error_t shutdown (void)=0
 Shutdown the underlying BLE stack.
virtual const char * getVersion (void)=0
 Fetches a string representation of the underlying BLE stack's version.
virtual Gap & getGap ()=0
 Accessor to Gap.
virtual const Gap & getGap () const =0
 A const alternative to getGap().
virtual GattServer & getGattServer ()=0
 Accessor to GattServer.
virtual const GattServer & getGattServer () const =0
 A const alternative to getGattServer().
virtual GattClient & getGattClient ()=0
 Accessors to GattClient.
virtual SecurityManager & getSecurityManager ()=0
 Accessors to SecurityManager.
virtual const SecurityManager & getSecurityManager () const =0
 A const alternative to getSecurityManager().
virtual void waitForEvent (void)=0
 Yield control to the BLE stack or to other tasks waiting for events.
virtual void processEvents ()=0
 Process ALL pending events living in the BLE stack .
void signalEventsToProcess (BLE::InstanceID_t id)
 This function allow the BLE stack to signal that their is work to do and event processing should be done (BLE::processEvent()).

Detailed Description

The interface for the transport object to be created by the target library's createBLEInstance().

Note:
This class is part of the interface of BLE API with the implementation; therefore, it is meant to be used only by porters rather than normal BLE API users.

Definition at line 36 of file BLEInstanceBase.h.


Constructor & Destructor Documentation

~BLEInstanceBase (  ) [virtual]

Virtual destructor of the interface.

Definition at line 20 of file BLEInstanceBase.cpp.


Member Function Documentation

virtual Gap& getGap (  ) [pure virtual]

Accessor to Gap.

This function is used by BLE::gap().

Returns:
A reference to a Gap object associated to this BLE instance.
virtual const Gap& getGap (  ) const [pure virtual]

A const alternative to getGap().

Returns:
A const reference to a Gap object associated to this BLE instance.
virtual GattClient& getGattClient (  ) [pure virtual]

Accessors to GattClient.

This function is used by BLE::gattClient().

Returns:
A reference to a GattClient object associated to this BLE instance.
virtual const GattServer& getGattServer (  ) const [pure virtual]

A const alternative to getGattServer().

Returns:
A const reference to a GattServer object associated to this BLE instance.
virtual GattServer& getGattServer (  ) [pure virtual]

Accessor to GattServer.

This function is used by BLE::gattServer().

Returns:
A reference to a GattServer object associated to this BLE instance.
virtual SecurityManager& getSecurityManager (  ) [pure virtual]

Accessors to SecurityManager.

This function is used by BLE::securityManager().

Returns:
A reference to a SecurityManager object associated to this BLE instance.
virtual const SecurityManager& getSecurityManager (  ) const [pure virtual]

A const alternative to getSecurityManager().

Returns:
A const reference to a SecurityManager object associated to this BLE instance.
virtual const char* getVersion ( void   ) [pure virtual]

Fetches a string representation of the underlying BLE stack's version.

Returns:
A pointer to the string representation of the underlying BLE stack's version.
virtual bool hasInitialized ( void   ) const [pure virtual]

Check whether the underlying stack has already been initialized, possible with a call to init().

Returns:
true if the initialization has completed for the underlying BLE stack.
virtual ble_error_t init ( BLE::InstanceID_t  instanceID,
FunctionPointerWithContext< BLE::InitializationCompleteCallbackContext * >  initCallback 
) [pure virtual]

Initialize the underlying BLE stack.

This should be called before anything else in the BLE API.

Parameters:
[in]instanceIDThe ID of the instance to initialize.
[in]initCallbackA callback for when initialization completes for a BLE instance. This is an optional parameter set to NULL when not supplied.
Returns:
BLE_ERROR_NONE if the initialization procedure was started successfully.
virtual void processEvents (  ) [pure virtual]

Process ALL pending events living in the BLE stack .

Return once all events have been consumed.

virtual ble_error_t shutdown ( void   ) [pure virtual]

Shutdown the underlying BLE stack.

This includes purging the stack of GATT and GAP state and clearing all state from other BLE components such as the SecurityManager. init() must be called afterwards to re-instantiate services and GAP state.

Returns:
BLE_ERROR_NONE if the underlying stack and all other services of the BLE API were shutdown correctly.
void signalEventsToProcess ( BLE::InstanceID_t  id )

This function allow the BLE stack to signal that their is work to do and event processing should be done (BLE::processEvent()).

Parameters:
id,:The ID of the BLE instance which does have events to process.

Definition at line 25 of file BLEInstanceBase.cpp.

virtual void waitForEvent ( void   ) [pure virtual]

Yield control to the BLE stack or to other tasks waiting for events.

refer to BLE::waitForEvent().