![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <BluetoothLocalInterface.h>
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 |
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.
|
virtualdefault |
Destructor
|
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.
mac | The MAC address associated with the device. |
Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.
|
pure virtual |
Disconnect from the device matching the given MAC address.
mac | The MAC address associated with the device. |
Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.
|
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.
mac | The MAC address associated with the device. |
Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.
|
pure virtual |
Puts the device into the desired discoverable mode.
discoverable | A bool indicating whether it should be discoverable. |
Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.
|
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()
addr | The MAC address associated with the device |
pin | BT pairing pin |
Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.
|
pure virtual |
Puts the device into the desired scan mode.
scanning | A bool indicating whether it should be scanning. |
Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.
|
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.
mac | The MAC address associated with the device. |
Implemented in alexaClientSDK::acsdkBluetooth::Bluetooth.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0