AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Macros | Functions | Variables
BluetoothTest.cpp File Reference
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <fstream>
#include <sstream>
#include <acsdkApplicationAudioPipelineFactoryInterfaces/MockApplicationAudioPipelineFactory.h>
#include <acsdkBluetoothInterfaces/MockBluetoothDeviceObserver.h>
#include <acsdkShutdownManagerInterfaces/MockShutdownNotifier.h>
#include <AVSCommon/AVS/Attachment/MockAttachmentManager.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/BluetoothDeviceInterface.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/MockBluetoothDevice.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/MockBluetoothDeviceConnectionRule.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/MockBluetoothDeviceManager.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/MockBluetoothHostController.h>
#include <AVSCommon/SDKInterfaces/MockDirectiveHandlerResult.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/Services/A2DPSinkInterface.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/Services/A2DPSourceInterface.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/Services/AVRCPControllerInterface.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/Services/AVRCPTargetInterface.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/Services/HIDInterface.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/Services/MockBluetoothService.h>
#include <AVSCommon/SDKInterfaces/Bluetooth/Services/SPPInterface.h>
#include <AVSCommon/SDKInterfaces/MockChannelVolumeInterface.h>
#include <AVSCommon/SDKInterfaces/MockExceptionEncounteredSender.h>
#include <AVSCommon/SDKInterfaces/MockContextManager.h>
#include <AVSCommon/SDKInterfaces/MockFocusManager.h>
#include <AVSCommon/SDKInterfaces/MockMessageSender.h>
#include <AVSCommon/SDKInterfaces/Endpoints/MockEndpointCapabilitiesRegistrar.h>
#include <AVSCommon/Utils/Bluetooth/BluetoothEventBus.h>
#include <AVSCommon/Utils/Bluetooth/DeviceCategory.h>
#include <AVSCommon/Utils/Bluetooth/SDPRecords.h>
#include <AVSCommon/Utils/Configuration/ConfigurationNode.h>
#include <AVSCommon/Utils/JSON/JSONUtils.h>
#include <AVSCommon/Utils/MediaPlayer/MockMediaPlayer.h>
#include <AVSCommon/Utils/Memory/Memory.h>
#include <AVSCommon/Utils/Optional.h>
#include <RegistrationManager/MockCustomerDataManager.h>
#include "acsdkBluetooth/BasicDeviceConnectionRule.h"
#include "acsdkBluetooth/Bluetooth.h"
#include "acsdkBluetooth/BluetoothNotifier.h"
#include "acsdkBluetooth/DeviceConnectionRulesAdapter.h"
#include "acsdkBluetooth/SQLiteBluetoothStorage.h"
Include dependency graph for BluetoothTest.cpp:

Classes

class  alexaClientSDK::acsdkBluetooth::test::BluetoothTest
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::acsdkBluetooth
 
 alexaClientSDK::acsdkBluetooth::test
 

Macros

#define LX(event)   alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
 

Functions

static std::chrono::milliseconds alexaClientSDK::acsdkBluetooth::test::WAIT_TIMEOUT_MS (1000)
 Wait timeout. More...
 
static std::chrono::milliseconds alexaClientSDK::acsdkBluetooth::test::EVENT_PROCESS_DELAY_MS (500)
 
static bool alexaClientSDK::acsdkBluetooth::test::fileExists (const std::string &file)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_createBTWithNullParams)
 Test that create() returns a nullptr if called with invalid arguments. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_createBTWithDuplicateDeviceCategoriesInConnectionRules)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_createBTWithLackOfProfilesInConnectionRules)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleConnectByDeviceIdsDirectiveWithTwoA2DPDevices)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleConnectByDeviceIdsDirectiveWithOnePhoneOneGadget)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleConnectByProfileWithUnmatchedProfileName)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleConnectByProfileWithMatchedProfileName)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleConnectLocal)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, DISABLED_test_handlePairDevices)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handlePairLocal)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleUnpairDevices)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleUnpairLocal)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleDisconnectDevices)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleDisconnectLocal)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_handleSetDeviceCategories)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_contentDucksUponReceivingBackgroundFocus)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_contentUnducksUponReceivingForegroundOrNoneFocus)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_streamingStateChange)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (BluetoothTest, test_focusStateChange)
 

Variables

static const std::string alexaClientSDK::acsdkBluetooth::test::TAG {"BluetoothTest"}
 String to identify log entries originating from this file. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_BLUETOOTH_DEVICE_MAC = "01:23:45:67:89:ab"
 Test Bluetooth device mac address 1. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_BLUETOOTH_FRIENDLY_NAME = "test_friendly_name_1"
 Test Bluetooth device friendly name 1. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_BLUETOOTH_UUID = "650f973b-c2ab-4c6e-bff4-3788cd521340"
 Test Bluetooth device uuid 1. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_BLUETOOTH_DEVICE_MAC_2 = "11:23:45:67:89:ab"
 Test Bluetooth device mac address 2. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_BLUETOOTH_FRIENDLY_NAME_2 = "test_friendly_name_2"
 Test Bluetooth device friendly name 2. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_BLUETOOTH_UUID_2 = "650f973b-c2ab-4c6e-bff4-3788cd521341"
 Test Bluetooth device uuid 2. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_BLUETOOTH_DEVICE_MAC_3 = "21:23:45:67:89:ab"
 Test Bluetooth device mac address 3. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_BLUETOOTH_FRIENDLY_NAME_3 = "test_friendly_name_3"
 Test Bluetooth device friendly name 3. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_BLUETOOTH_UUID_3 = "650f973b-c2ab-4c6e-bff4-3788cd521342"
 Test Bluetooth device uuid 3. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_DATABASE = "BluetoothCATest.db"
 Test Database file name. Can be changed if there are conflicts. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::BLUETOOTH_JSON
 
static const std::string alexaClientSDK::acsdkBluetooth::test::FILE_EXISTS_ERROR = "Database File " + TEST_DATABASE + " already exists."
 Error message for when the file already exists. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::NAMESPACE_BLUETOOTH = "Bluetooth"
 Namespace of Bluetooth. More...
 
static const NamespaceAndName alexaClientSDK::acsdkBluetooth::test::BLUETOOTH_STATE {NAMESPACE_BLUETOOTH, "BluetoothState"}
 THe Bluetooth state portion of the Context. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::MESSAGE_EVENT_KEY = "event"
 JSON key for the event section of a message. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::MESSAGE_HEADER_KEY = "header"
 JSON key for the header section of a message. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::MESSAGE_NAME_KEY = "name"
 JSON key for the name section of a message. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::PAYLOAD_KEY = "payload"
 JSON key for the payload section of a message. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::REQUESTER_KEY = "requester"
 JSON key for the requester section of a message. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::CLOUD_REQUESTER_VALUE = "CLOUD"
 JSON value for the cloud requester. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::DEVICE_REQUESTER_VALUE = "DEVICE"
 JSON value for the device requester. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::CONNECT_BY_DEVICE_IDS_DIRECTIVE = "ConnectByDeviceIds"
 ConnectByDevice directive. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::CONNECT_BY_PROFILE_DIRECTIVE = "ConnectByProfile"
 ConnectByProfile directive. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::PAIR_DEVICES_DIRECTIVE = "PairDevices"
 PairDevice directive. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::UNPAIR_DEVICES_DIRECTIVE = "UnpairDevices"
 UnpairDevice directive. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::DISCONNECT_DEVICES_DIRECTIVE = "DisconnectDevices"
 DisconnectDevice directive. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::SET_DEVICE_CATEGORIES = "SetDeviceCategories"
 SetDeviceCategories directive. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_MESSAGE_ID = "MessageId_Test"
 Test message id. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_MESSAGE_ID_2 = "MessageId_Test_2"
 Test message id. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_CONNECT_BY_DEVICE_IDS_PAYLOAD
 ConnectByDeviceIds payload. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::CONNECT_BY_DEVICE_IDS_SUCCEEDED = "ConnectByDeviceIdsSucceeded"
 The ConnectByDeviceIdSucceeded event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::CONNECT_BY_PROFILE_SUCCEEDED = "ConnectByProfileSucceeded"
 The ConnectByProfileSucceeded event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::CONNECT_BY_PROFILE_FAILED = "ConnectByProfileFailed"
 The ConnectByProfileFailed event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::PAIR_DEVICES_SUCCEEDED = "PairDevicesSucceeded"
 The PairDeviceSucceeded event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::UNPAIR_DEVICES_SUCCEEDED = "UnpairDevicesSucceeded"
 The UnpairDeviceSucceeded event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::SET_DEVICE_CATEGORIES_SUCCEEDED = "SetDeviceCategoriesSucceeded"
 The SetDeviceCategoriesSucceeded event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::DISCONNECT_DEVICES_SUCCEEDED = "DisconnectDevicesSucceeded"
 The DisconnectDeviceSucceeded event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::SCAN_DEVICES_REPORT = "ScanDevicesReport"
 The ScanDevicesUpdated event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::STREAMING_STARTED = "StreamingStarted"
 The StreamingStarted event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::STREAMING_ENDED = "StreamingEnded"
 The StreamingEnded event name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_UNMATCHED_PROFILE_NAME = "HFP"
 Test unmatched profile name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_MATCHED_PROFILE_NAME = "AVRCP"
 Test matched profile name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_PROFILE_VERSION = "1"
 Test profile version. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_CONNECT_BY_PROFILE_PAYLOAD_1
 ConnectByDeviceProfile payload 1. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_CONNECT_BY_PROFILE_PAYLOAD_2
 ConnectByDeviceProfile payload 2. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_PAIR_DEVICES_PAYLOAD
 PairDevices payload. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_UNPAIR_DEVICES_PAYLOAD
 UnpairDevices payload. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_DISCONNECT_DEVICES_PAYLOAD
 DisconnectDevices payload. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_SET_DEVICE_CATEGORIES_PAYLOAD
 SetDeviceCategories payload. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::MOCK_CONTEXT
 Mock Context. More...
 

Macro Definition Documentation

◆ LX

#define LX (   event)    alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)

Create a LogEntry using this file's TAG and the specified event string.

Parameters
Theevent string for this LogEntry.

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