|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <esp32_bluetooth.h>


Public Member Functions | |
| Esp32Bluetooth () | |
| ~Esp32Bluetooth () override | |
| Result< void > | init () override |
| void | startAdvertising () override |
| void | stopAdvertising () override |
| bool | isConnected () const override |
| bool | isAdvertising () const override |
| uint32_t | nextWakeDelayMs (uint32_t nowMs) const override |
| void | tick () override |
| const char * | getDeviceName () const override |
| Return the local BLE device name. | |
| const char * | getDeviceAddress () const override |
| const char * | sourceId () const override |
| bool | pauseForMaintenance () override |
| void | resumeFromMaintenance () override |
| bool | suspendForMaintenance () override |
| Release radio resources before memory-intensive maintenance. | |
| void | resumeAfterMaintenance () override |
| Resume advertising after maintenance completes. | |
| bool | isAvailable () const override |
| CompanionCapabilities | capabilities () const override |
| void | setCallCallback (CompanionCallCallback cb, void *userData) override |
| void | setMediaCallback (CompanionMediaCallback cb, void *userData) override |
| void | setConnectionCallback (BleConnectionCallback cb, void *userData) override |
| void | setNotificationCallback (CompanionNotificationCallback cb, void *userData) override |
| void | setTimeCallback (CompanionTimeCallback cb, void *userData) override |
| void | setAvailabilityCallback (CompanionAvailabilityCallback cb, void *userData) override |
| bool | acceptCall () override |
| bool | rejectCall () override |
| bool | hangupCall () override |
| bool | dial (const char *number) override |
| bool | mediaCommand (CompanionMediaAction action) override |
| bool | dismissNotification (uint32_t uid) override |
Public Member Functions inherited from ersa::hal::IBluetooth | |
| virtual | ~IBluetooth ()=default |
Public Member Functions inherited from ersa::hal::ICompanionSource | |
| virtual | ~ICompanionSource ()=default |
| virtual Result< void > | initSource () |
| virtual void | tickSource () |
| virtual void | shutdownSource () |
Private Member Functions | |
| void | beginAdvertising () |
Private Attributes | |
| Impl * | pImpl_ {nullptr} |
| CompanionCallCallback | callCb_ {nullptr} |
| void * | callUserData_ {nullptr} |
| CompanionMediaCallback | mediaCb_ {nullptr} |
| void * | mediaUserData_ {nullptr} |
| BleConnectionCallback | connCb_ {nullptr} |
| void * | connUserData_ {nullptr} |
| CompanionNotificationCallback | notifCb_ {nullptr} |
| void * | notifUserData_ {nullptr} |
| CompanionTimeCallback | timeCb_ {nullptr} |
| void * | timeUserData_ {nullptr} |
| CompanionAvailabilityCallback | availabilityCb_ {nullptr} |
| void * | availabilityUserData_ {nullptr} |
| bool | lastSourceAvailability_ {false} |
| bool | maintenanceSuspended_ {false} |
| std::atomic< uint32_t > | tickUsers_ {0} |
ESP32 BLE transport and current Apple companion-source composition.
The implementation currently satisfies both independent contracts because this product uses one radio/client stack. BluetoothManager receives the IBluetooth and ICompanionSource base references separately, so a future Android, Linux, or test provider can replace companion semantics without changing the transport interface. The pImpl keeps the large vendor BLE implementation out of this header and reduces SDK coupling for consumers.
|
default |
Create the vendor stack lazily; init() performs hardware setup.
|
overridedefault |
Stop callbacks/workers and release the opaque ESP32 implementation.
|
overridevirtual |
Queue a request to answer the current incoming call.
Implements ersa::hal::ICompanionSource.
|
private |
|
overridevirtual |
Return a by-value snapshot so callers cannot retain mutable provider state.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Request dialing; the number format is provider-defined international text.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Request remote removal of one notification when the peer supports it.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Return a stable formatted address string owned by the backend.
Implements ersa::hal::IBluetooth.
|
overridevirtual |
Return the local BLE device name.
Implements ersa::hal::IBluetooth.
|
overridevirtual |
Queue a request to end the current active call.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Initialize the controller and service transport required by the product.
Implements ersa::hal::IBluetooth.
|
overridevirtual |
Return advertising state when the backend can report it, else false.
Reimplemented from ersa::hal::IBluetooth.
|
overridevirtual |
Report whether commands/data are currently usable from the peer.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Return current link state; this does not imply companion services are ready.
Implements ersa::hal::IBluetooth.
|
overridevirtual |
Send a transport-neutral playback action after capability checks.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
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 from ersa::hal::IBluetooth.
|
overridevirtual |
Release provider-owned resources before OTA or other memory-heavy work.
Reimplemented from ersa::hal::ICompanionSource.
|
overridevirtual |
Queue a request to reject the current incoming call.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Resume advertising after maintenance completes.
Reimplemented from ersa::hal::IBluetooth.
|
overridevirtual |
Restore provider activity after maintenance; safe after partial pause.
Reimplemented from ersa::hal::ICompanionSource.
|
overridevirtual |
Install or clear a sink for provider availability transitions.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Install or clear a sink for call-state transitions.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
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.
Implements ersa::hal::IBluetooth.
|
overridevirtual |
Install or clear a sink for media metadata/playback updates.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Install or clear a sink for notification add/update/remove events.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Install or clear a sink for a peer-provided current time.
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Implements ersa::hal::ICompanionSource.
|
overridevirtual |
Begin or resume advertising; repeated calls should be safe.
Implements ersa::hal::IBluetooth.
|
overridevirtual |
Stop advertising without necessarily tearing down an established link.
Implements ersa::hal::IBluetooth.
|
overridevirtual |
Release radio resources before memory-intensive maintenance.
Reimplemented from ersa::hal::IBluetooth.
|
overridevirtual |
Run bounded maintenance deferred from radio callbacks.
Reimplemented from ersa::hal::IBluetooth.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |