Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ersa::hal::IBluetooth Class Referenceabstract

#include <bluetooth.h>

Inheritance diagram for ersa::hal::IBluetooth:
Inheritance graph
[legend]

Public Member Functions

virtual ~IBluetooth ()=default
 
virtual Result< void > init ()=0
 
virtual void startAdvertising ()=0
 
virtual void stopAdvertising ()=0
 
virtual bool suspendForMaintenance ()
 Release radio resources before memory-intensive maintenance.
 
virtual void resumeAfterMaintenance ()
 Resume advertising after maintenance completes.
 
virtual bool isConnected () const =0
 
virtual bool isAdvertising () const
 
virtual uint32_t nextWakeDelayMs (uint32_t nowMs) const
 
virtual void tick ()
 
virtual const char * getDeviceName () const =0
 Return the local BLE device name.
 
virtual const char * getDeviceAddress () const =0
 
virtual void setConnectionCallback (BleConnectionCallback cb, void *userData)=0
 

Detailed Description

BLE transport, advertising, and link-state contract.

This interface owns radio lifecycle only. Companion semantics such as calls, notifications, media, and phone time live behind ICompanionSource so another transport/provider can supply them without pretending to be this BLE stack. Driver callbacks should hand off work and avoid running UI code directly.

Constructor & Destructor Documentation

◆ ~IBluetooth()

virtual ersa::hal::IBluetooth::~IBluetooth ( )
virtualdefault

Member Function Documentation

◆ getDeviceAddress()

virtual const char * ersa::hal::IBluetooth::getDeviceAddress ( ) const
pure virtual

Return a stable formatted address string owned by the backend.

Implemented in ersa::services::DummyBle, ersa::hal::Esp32Bluetooth, and ersa::test::MockBluetooth.

◆ getDeviceName()

virtual const char * ersa::hal::IBluetooth::getDeviceName ( ) const
pure virtual

Return the local BLE device name.

Implemented in ersa::services::DummyBle, ersa::hal::Esp32Bluetooth, and ersa::test::MockBluetooth.

◆ init()

virtual Result< void > ersa::hal::IBluetooth::init ( )
pure virtual

Initialize the controller and service transport required by the product.

Implemented in ersa::services::DummyBle, ersa::hal::Esp32Bluetooth, and ersa::test::MockBluetooth.

◆ isAdvertising()

virtual bool ersa::hal::IBluetooth::isAdvertising ( ) const
inlinevirtual

Return advertising state when the backend can report it, else false.

Reimplemented in ersa::test::MockBluetooth, and ersa::hal::Esp32Bluetooth.

◆ isConnected()

virtual bool ersa::hal::IBluetooth::isConnected ( ) const
pure virtual

Return current link state; this does not imply companion services are ready.

Implemented in ersa::services::DummyBle, ersa::hal::Esp32Bluetooth, and ersa::test::MockBluetooth.

◆ nextWakeDelayMs()

virtual uint32_t ersa::hal::IBluetooth::nextWakeDelayMs ( uint32_t  nowMs) const
inlinevirtual

Return delay until the next required BLE maintenance deadline. UINT32_MAX means there is no scheduled deadline; sleep policy uses this value to choose a safe wait duration without polling continuously.

Reimplemented in ersa::hal::Esp32Bluetooth.

◆ resumeAfterMaintenance()

virtual void ersa::hal::IBluetooth::resumeAfterMaintenance ( )
inlinevirtual

Resume advertising after maintenance completes.

Reimplemented in ersa::hal::Esp32Bluetooth.

◆ setConnectionCallback()

virtual void ersa::hal::IBluetooth::setConnectionCallback ( BleConnectionCallback  cb,
void *  userData 
)
pure virtual

Register the single BLE link-state callback; null clears it. This reports transport only. Use ICompanionSource for provider/session readiness because encrypted link-up can precede service discovery.

Implemented in ersa::hal::Esp32Bluetooth, ersa::test::MockBluetooth, and ersa::services::DummyBle.

◆ startAdvertising()

virtual void ersa::hal::IBluetooth::startAdvertising ( )
pure virtual

Begin or resume advertising; repeated calls should be safe.

Implemented in ersa::services::DummyBle, ersa::hal::Esp32Bluetooth, and ersa::test::MockBluetooth.

◆ stopAdvertising()

virtual void ersa::hal::IBluetooth::stopAdvertising ( )
pure virtual

Stop advertising without necessarily tearing down an established link.

Implemented in ersa::services::DummyBle, ersa::hal::Esp32Bluetooth, and ersa::test::MockBluetooth.

◆ suspendForMaintenance()

virtual bool ersa::hal::IBluetooth::suspendForMaintenance ( )
inlinevirtual

Release radio resources before memory-intensive maintenance.

Reimplemented in ersa::hal::Esp32Bluetooth.

◆ tick()

virtual void ersa::hal::IBluetooth::tick ( )
inlinevirtual

Run bounded maintenance deferred from radio callbacks.

Reimplemented in ersa::hal::Esp32Bluetooth.


The documentation for this class was generated from the following file: