AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Member Functions | List of all members
alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface Class Referenceabstract

Represents a Bluetooth Device. More...

#include <BluetoothDeviceInterface.h>

Inheritance diagram for alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface:
Inheritance graph
[legend]

Classes

struct  MetaData
 

Public Member Functions

virtual ~BluetoothDeviceInterface ()=default
 Destructor. More...
 
virtual std::string getMac () const =0
 
virtual std::string getFriendlyName () const =0
 
virtual DeviceState getDeviceState ()=0
 
virtual MetaData getDeviceMetaData ()=0
 
virtual bool isPaired ()=0
 
virtual std::future< bool > pair ()=0
 
virtual std::future< bool > unpair ()=0
 
virtual bool isConnected ()=0
 
virtual std::future< bool > connect ()=0
 
virtual std::future< bool > disconnect ()=0
 
virtual bool setPairingPin (const std::string &pin)=0
 
virtual std::vector< std::shared_ptr< services::SDPRecordInterface > > getSupportedServices ()=0
 
virtual std::shared_ptr< services::BluetoothServiceInterfacegetService (std::string uuid)=0
 
virtual utils::bluetooth::MediaStreamingState getStreamingState ()=0
 
virtual bool toggleServiceConnection (bool enabled, std::shared_ptr< services::BluetoothServiceInterface > service)=0
 

Detailed Description

Represents a Bluetooth Device.

Constructor & Destructor Documentation

◆ ~BluetoothDeviceInterface()

virtual alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::~BluetoothDeviceInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ connect()

virtual std::future<bool> alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::connect ( )
pure virtual

Initiate a connect with this device.

Returns
Indicates whether connecting was successful.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ disconnect()

virtual std::future<bool> alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::disconnect ( )
pure virtual

Initiate a disconnect with this device.

Returns
Indicates whether disconnect was successful.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ getDeviceMetaData()

virtual MetaData alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::getDeviceMetaData ( )
pure virtual

Getter for the Bluetooth device metadata.

Returns
the meta data of the Bluetooth device.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ getDeviceState()

virtual DeviceState alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::getDeviceState ( )
pure virtual

Getter for the DeviceState.

Returns
The DeviceState of the current device.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ getFriendlyName()

virtual std::string alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::getFriendlyName ( ) const
pure virtual

Getter for the friendly name.

Returns
The friendly name of the Bluetooth Device.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ getMac()

virtual std::string alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::getMac ( ) const
pure virtual

Getter for the MAC address.

Returns
The MAC address of the Bluetooth Device.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ getService()

virtual std::shared_ptr<services::BluetoothServiceInterface> alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::getService ( std::string  uuid)
pure virtual

Get the Bluetooth service that this device supports.

Parameters
uuidthe uuid of the Bluetooth Service.
Returns
A pointer to an instance of the BluetoothServiceInterface if supported, else a nullptr.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ getStreamingState()

virtual utils::bluetooth::MediaStreamingState alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::getStreamingState ( )
pure virtual
Returns
The current media streaming state of the BluetoothDevice if the device supports A2DP streaming.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ getSupportedServices()

virtual std::vector<std::shared_ptr<services::SDPRecordInterface> > alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::getSupportedServices ( )
pure virtual

◆ isConnected()

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::isConnected ( )
pure virtual

Getter for the paired state of the device. This should return the state after any pending state changes have been resolved.

Returns
A bool representing whether the device is connected.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ isPaired()

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::isPaired ( )
pure virtual

Getter for the paired state of the device. This should return the state after any pending state changes have been resolved.

Returns
A bool representing whether the device is paired.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ pair()

virtual std::future<bool> alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::pair ( )
pure virtual

Initiate a pair with this device.

Returns
Indicates whether pairing was successful.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ setPairingPin()

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::setPairingPin ( const std::string &  pin)
pure virtual

Sets the pairing pin for the current pairing attempt. PIN length can range from 4 to 16 alphanumeric characters, though most devices will only accept numeric characters in the PIN. Expected call flow is: pair() -> PIN request callback -> setPairingPin()

Parameters
pinBT pairing pin
Returns
Indicates whether pairing pin was set.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ toggleServiceConnection()

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::toggleServiceConnection ( bool  enabled,
std::shared_ptr< services::BluetoothServiceInterface service 
)
pure virtual

Toggle the profile of a device, which restricts the future connection/disconnection.

Parameters
enabledTrue if need to connect the certain profile, false to disconnect.
serviceThe target profile to toggle.
Returns
A bool indicating success.

Implemented in alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.

◆ unpair()

virtual std::future<bool> alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface::unpair ( )
pure virtual

Initiate an unpair with this device.

Returns
Indicates whether the unpairing was successful.

Implemented in alexaClientSDK::bluetoothImplementations::blueZ::BlueZBluetoothDevice, and alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDevice.


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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0