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

#include <companion_source.h>

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

Public Member Functions

virtual ~ICompanionSource ()=default
 
virtual const char * sourceId () const =0
 
virtual Result< void > initSource ()
 
virtual bool pauseForMaintenance ()
 
virtual void resumeFromMaintenance ()
 
virtual void tickSource ()
 
virtual void shutdownSource ()
 
virtual bool isAvailable () const =0
 
virtual CompanionCapabilities capabilities () const =0
 
virtual void setCallCallback (CompanionCallCallback, void *)=0
 
virtual void setMediaCallback (CompanionMediaCallback, void *)=0
 
virtual void setNotificationCallback (CompanionNotificationCallback, void *)=0
 
virtual void setTimeCallback (CompanionTimeCallback, void *)=0
 
virtual void setAvailabilityCallback (CompanionAvailabilityCallback, void *)=0
 
virtual bool acceptCall ()=0
 
virtual bool rejectCall ()=0
 
virtual bool hangupCall ()=0
 
virtual bool dial (const char *number)=0
 
virtual bool mediaCommand (CompanionMediaAction action)=0
 
virtual bool dismissNotification (uint32_t uid)=0
 

Detailed Description

Semantic companion data and command contract independent of radio transport.

BluetoothManager consumes this contract to normalize provider events and check capabilities before issuing commands. Source identity remains stable while availability and capabilities may change as peers connect or drop.

Constructor & Destructor Documentation

◆ ~ICompanionSource()

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

Permit provider cleanup through the interface.

Member Function Documentation

◆ acceptCall()

virtual bool ersa::hal::ICompanionSource::acceptCall ( )
pure virtual

Queue a request to answer the current incoming call.

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

◆ capabilities()

virtual CompanionCapabilities ersa::hal::ICompanionSource::capabilities ( ) const
pure virtual

Return a by-value snapshot so callers cannot retain mutable provider state.

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

◆ dial()

virtual bool ersa::hal::ICompanionSource::dial ( const char *  number)
pure virtual

Request dialing; the number format is provider-defined international text.

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

◆ dismissNotification()

virtual bool ersa::hal::ICompanionSource::dismissNotification ( uint32_t  uid)
pure virtual

Request remote removal of one notification when the peer supports it.

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

◆ hangupCall()

virtual bool ersa::hal::ICompanionSource::hangupCall ( )
pure virtual

Queue a request to end the current active call.

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

◆ initSource()

virtual Result< void > ersa::hal::ICompanionSource::initSource ( )
inlinevirtual

Initialize provider state after the transport itself has initialized.

◆ isAvailable()

virtual bool ersa::hal::ICompanionSource::isAvailable ( ) const
pure virtual

Report whether commands/data are currently usable from the peer.

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

◆ mediaCommand()

virtual bool ersa::hal::ICompanionSource::mediaCommand ( CompanionMediaAction  action)
pure virtual

Send a transport-neutral playback action after capability checks.

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

◆ pauseForMaintenance()

virtual bool ersa::hal::ICompanionSource::pauseForMaintenance ( )
inlinevirtual

Release provider-owned resources before OTA or other memory-heavy work.

Reimplemented in ersa::hal::Esp32Bluetooth.

◆ rejectCall()

virtual bool ersa::hal::ICompanionSource::rejectCall ( )
pure virtual

Queue a request to reject the current incoming call.

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

◆ resumeFromMaintenance()

virtual void ersa::hal::ICompanionSource::resumeFromMaintenance ( )
inlinevirtual

Restore provider activity after maintenance; safe after partial pause.

Reimplemented in ersa::hal::Esp32Bluetooth.

◆ setAvailabilityCallback()

virtual void ersa::hal::ICompanionSource::setAvailabilityCallback ( CompanionAvailabilityCallback  ,
void *   
)
pure virtual

Install or clear a sink for provider availability transitions.

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

◆ setCallCallback()

virtual void ersa::hal::ICompanionSource::setCallCallback ( CompanionCallCallback  ,
void *   
)
pure virtual

Install or clear a sink for call-state transitions.

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

◆ setMediaCallback()

virtual void ersa::hal::ICompanionSource::setMediaCallback ( CompanionMediaCallback  ,
void *   
)
pure virtual

Install or clear a sink for media metadata/playback updates.

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

◆ setNotificationCallback()

virtual void ersa::hal::ICompanionSource::setNotificationCallback ( CompanionNotificationCallback  ,
void *   
)
pure virtual

Install or clear a sink for notification add/update/remove events.

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

◆ setTimeCallback()

virtual void ersa::hal::ICompanionSource::setTimeCallback ( CompanionTimeCallback  ,
void *   
)
pure virtual

Install or clear a sink for a peer-provided current time.

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

◆ shutdownSource()

virtual void ersa::hal::ICompanionSource::shutdownSource ( )
inlinevirtual

Stop workers and clear callbacks before provider destruction.

◆ sourceId()

virtual const char * ersa::hal::ICompanionSource::sourceId ( ) const
pure virtual

◆ tickSource()

virtual void ersa::hal::ICompanionSource::tickSource ( )
inlinevirtual

Pump bounded deferred work; asynchronous providers may leave this empty.


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