Interface IHandsfreeClient
interface IHandsfreeClient
Extends com.amazon.apmf.IStandard
Methods
addListener()
Subscribe to hands-free client connection events that are triggered by the remote device OR by another application. A call to IHandsfreeClientConnection::connect() does NOT trigger events in this listener. This listener is for receiving events related to connections triggered by the remote device and other applications only. Privilege: com.amazon.bluetooth.privilege.accesscom.amazon.apmf.ISubscription*addListener(IHandsfreeClientListener*listener)
Parameters
listener
IHandsfreeClientListener* — Required
Callback for receiving hands-free client incoming
connection events OR connections triggered by other applications. See
IHandsfreeClientListener.
Returns
com.amazon.apmf.ISubscription*
Returns pointer to ISubscription.
getOrMakeHandsfreeClientDevice()
Creates a hands-free client connection interface for a specific device. This API only creates the interface (creating a IHandsfreeClientConnection object), it does NOT create a profile-level hands-free connection automatically. If an interface already exists for the specified device, it is returned by this API. For outgoing connections: The IHandsfreeClientConnection::connect() function must be called to initiate the profile connection. For incoming connections/connections initiated by other applications: IHandsfreeClientListener::onConnection() is received with the IHandsfreeClientConnection interface for the connected device. If the client application drops the reference to the IHandsfreeClientConnection interface, the IHandsfreeClientConnectionListener does not receive events.IHandsfreeClientConnection*getOrMakeHandsfreeClientDevice(IDevice*device)
Parameters
device
IDevice* — Required
The device to create the interface for.
Returns
IHandsfreeClientConnection*
Returns a connection interface, see IHandsfreeClientConnection. The
connection interface is a smart pointer and it must be stored as long as
the caller wants to use this connection.
getConnectedDevices()
Get the list of devices currently connected with the hands-free profile. This returns and array of IDevice objects that have active connections only. If there is no hands-free client profile connection active, it is not be included in this list. To interact with a device, the IHandsfreeClient::getOrMakeHandsfreeClientDevice() function needs to be called on each device to retrieve the IHandsfreeClientConnection interface. To register for events related to the device, a call to IHandsfreeClientConnection::addListener is required to register the IHandsfreeClientConnectionListener. Privilege: com.amazon.bluetooth.privilege.accessIDevice*[]getConnectedDevices()
Returns
IDevice*[]
Returns an array of connected devices. Empty if no devices connected.

