AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Protected Attributes | List of all members
alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule Class Reference

#include <MockBluetoothDeviceConnectionRule.h>

Inheritance diagram for alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule:
Collaboration graph
[legend]

Public Member Functions

 MockBluetoothDeviceConnectionRule (std::set< DeviceCategory > categories, std::set< std::string > profiles)
 
bool shouldExplicitlyConnect () override
 
bool shouldExplicitlyDisconnect () override
 
std::set< std::shared_ptr< BluetoothDeviceInterface > > devicesToDisconnect (std::map< DeviceCategory, std::set< std::shared_ptr< BluetoothDeviceInterface >>> connectedDevices) override
 
std::set< DeviceCategorygetDeviceCategories () override
 
std::set< std::string > getDependentProfiles () override
 
void setExplicitlyConnect (bool explicitlyConnect)
 
void setExplicitlyDisconnect (bool explicitlyDisconnect)
 
void setDevicesToDisconnect (std::set< std::shared_ptr< BluetoothDeviceInterface >> devices)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface
virtual ~BluetoothDeviceConnectionRuleInterface ()=default
 

Protected Attributes

std::set< DeviceCategorym_categories
 
std::set< std::string > m_profiles
 
bool m_explicitlyConnect
 
bool m_explicitlyDisconnect
 
std::set< std::shared_ptr< BluetoothDeviceInterface > > m_disconnectedDevices
 

Detailed Description

Mock class that implements BluetoothDeviceConnectionRuleInterface.

Constructor & Destructor Documentation

◆ MockBluetoothDeviceConnectionRule()

alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::MockBluetoothDeviceConnectionRule ( std::set< DeviceCategory categories,
std::set< std::string >  profiles 
)

Member Function Documentation

◆ devicesToDisconnect()

std::set< std::shared_ptr< BluetoothDeviceInterface > > alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::devicesToDisconnect ( std::map< DeviceCategory, std::set< std::shared_ptr< BluetoothDeviceInterface >>>  connectedDevices)
overridevirtual

The rule to get a set of Bluetooth devices needed to disconnect when the Bluetooth device connects.

Parameters
connectedDevicesthe current connected devices.
Returns
the set of Bluetooth devices needed to disconnect.

Implements alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface.

◆ getDependentProfiles()

std::set< std::string > alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::getDependentProfiles ( )
overridevirtual

Get the set of profile uuids which support those device categories defined in the connection rule.

Returns
The set of profile uuids.

Implements alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface.

◆ getDeviceCategories()

std::set< DeviceCategory > alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::getDeviceCategories ( )
overridevirtual

Get the set of device categories using the connection rule.

Returns
The set of DeviceCategory of the connection rule.

Implements alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface.

◆ setDevicesToDisconnect()

void alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::setDevicesToDisconnect ( std::set< std::shared_ptr< BluetoothDeviceInterface >>  devices)

Helper function to test devicesToDisconnect(Map<DeviceCategory, Set<BluetoothDeviceInterface>>) method.

Parameters
devicesa set of devices needed to disconnect.

◆ setExplicitlyConnect()

void alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::setExplicitlyConnect ( bool  explicitlyConnect)

Helper function to test shouldExplicitlyConnect() method.

Parameters
explicitlyConnectA bool indicating if a device needs to explicitly connect.

◆ setExplicitlyDisconnect()

void alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::setExplicitlyDisconnect ( bool  explicitlyDisconnect)

Helper function to test shouldExplicitlyDisconnect() method.

Parameters
explicitlyDisconnectA bool indicating if a device needs to explicitly connect.

◆ shouldExplicitlyConnect()

bool alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::shouldExplicitlyConnect ( )
overridevirtual

The rule to explicitly connect the Bluetooth device after pair.

Returns
true if the caller needs to handle connect logic.

Implements alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface.

◆ shouldExplicitlyDisconnect()

bool alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::shouldExplicitlyDisconnect ( )
overridevirtual

The rule to explicitly disconnect the Bluetooth device before unpair.

Returns
true if the caller needs to handle disconnect logic.

Implements alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface.

Member Data Documentation

◆ m_categories

std::set<DeviceCategory> alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::m_categories
protected

◆ m_disconnectedDevices

std::set<std::shared_ptr<BluetoothDeviceInterface> > alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::m_disconnectedDevices
protected

◆ m_explicitlyConnect

bool alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::m_explicitlyConnect
protected

◆ m_explicitlyDisconnect

bool alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::m_explicitlyDisconnect
protected

◆ m_profiles

std::set<std::string> alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::test::MockBluetoothDeviceConnectionRule::m_profiles
protected

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

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