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

#include <BluetoothLocalInterface.h>

Inheritance diagram for alexaClientSDK::acsdkBluetoothInterfaces::BluetoothLocalInterface:
Inheritance graph
[legend]

Public Member Functions

virtual ~BluetoothLocalInterface ()=default
 
virtual void setDiscoverableMode (bool discoverable)=0
 
virtual void setScanMode (bool scanning)=0
 
virtual void pair (const std::string &addr)=0
 
virtual void unpair (const std::string &addr)=0
 
virtual void connect (const std::string &addr)=0
 
virtual void disconnect (const std::string &addr)=0
 
virtual void setPairingPin (const std::string &addr, const std::string &pin)=0
 

Detailed Description

Contains functions corresponding to high-level Bluetooth operations on a device. Relative to their connectivity-level counterparts the functions defined by this interface abstract out various details, instead defaulting to certain values (determined by business logic) or providing these values through internal states maintained by the implementing class. Services invoking Bluetooth functionality through this interface should expect relevant business logic (e.g. connection rules) around the call to be applied.

For all API calls, the resulting BT state should be received directly from BT connectivity.

Clients that wish to deviate from the "norm" for a device or expect singular changes in BT state (e.g. connecting to a device without connection rules) should call BT connectivity APIs directly.

Constructor & Destructor Documentation

◆ ~BluetoothLocalInterface()

virtual alexaClientSDK::acsdkBluetoothInterfaces::BluetoothLocalInterface::~BluetoothLocalInterface ( )
virtualdefault

Destructor

Member Function Documentation

◆ connect()

virtual void alexaClientSDK::acsdkBluetoothInterfaces::BluetoothLocalInterface::connect ( const std::string &  addr)
pure virtual

Connect with the device matching the given MAC address.

Refer to an endpoint's corresponding connection rule to determine which device(s) to disconnect.

Parameters
macThe MAC address associated with the device.

Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.

◆ disconnect()

virtual void alexaClientSDK::acsdkBluetoothInterfaces::BluetoothLocalInterface::disconnect ( const std::string &  addr)
pure virtual

Disconnect from the device matching the given MAC address.

Parameters
macThe MAC address associated with the device.

Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.

◆ pair()

virtual void alexaClientSDK::acsdkBluetoothInterfaces::BluetoothLocalInterface::pair ( const std::string &  addr)
pure virtual

Pair with the device matching the given MAC address.

Default behavior will remove the device from discoverable and scanning modes on a successful pairing attempt. Refer to an endpoint's corresponding connection rule to determine if an explicit connection attempt should be made afterwards.

Parameters
macThe MAC address associated with the device.

Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.

◆ setDiscoverableMode()

virtual void alexaClientSDK::acsdkBluetoothInterfaces::BluetoothLocalInterface::setDiscoverableMode ( bool  discoverable)
pure virtual

Puts the device into the desired discoverable mode.

Parameters
discoverableA bool indicating whether it should be discoverable.

Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.

◆ setPairingPin()

virtual void alexaClientSDK::acsdkBluetoothInterfaces::BluetoothLocalInterface::setPairingPin ( const std::string &  addr,
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
addrThe MAC address associated with the device
pinBT pairing pin

Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.

◆ setScanMode()

virtual void alexaClientSDK::acsdkBluetoothInterfaces::BluetoothLocalInterface::setScanMode ( bool  scanning)
pure virtual

Puts the device into the desired scan mode.

Parameters
scanningA bool indicating whether it should be scanning.

Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.

◆ unpair()

virtual void alexaClientSDK::acsdkBluetoothInterfaces::BluetoothLocalInterface::unpair ( const std::string &  addr)
pure virtual

Unpair with the device matching the given MAC address.

Refer to an endpoint's corresponding connection rule to determine if an explicit disconnect should be made prior.

Parameters
macThe MAC address associated with the device.

Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.


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