15 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_BLUETOOTH_MOCKBLUETOOTHDEVICE_H_ 16 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_BLUETOOTH_MOCKBLUETOOTHDEVICE_H_ 18 #include <unordered_map> 28 namespace sdkInterfaces {
49 std::future<bool>
pair()
override;
50 std::future<bool>
unpair()
override;
52 std::future<bool>
connect()
override;
58 bool toggleServiceConnection(
bool enabled, std::shared_ptr<services::BluetoothServiceInterface> service)
override;
65 std::vector<std::shared_ptr<services::BluetoothServiceInterface>> supportedServices);
79 std::unordered_map<std::string, std::shared_ptr<services::BluetoothServiceInterface>>
m_supportedServices;
105 std::promise<bool> pairPromise;
106 pairPromise.set_value(
true);
109 return pairPromise.get_future();
113 std::promise<bool> pairPromise;
114 pairPromise.set_value(
true);
117 return pairPromise.get_future();
125 std::promise<bool> connectionPromise;
126 connectionPromise.set_value(
true);
129 return connectionPromise.get_future();
133 std::promise<bool> connectionPromise;
134 connectionPromise.set_value(
true);
137 return connectionPromise.get_future();
148 std::vector<std::shared_ptr<services::SDPRecordInterface>> services;
150 services.push_back(service.second->getRecord());
158 return serviceIt->second;
169 std::shared_ptr<alexaClientSDK::avsCommon::sdkInterfaces::bluetooth::services::BluetoothServiceInterface> service) {
178 std::vector<std::shared_ptr<services::BluetoothServiceInterface>> supportedServices) :
185 for (
unsigned int i = 0; i < supportedServices.size(); ++i) {
186 auto service = supportedServices[i];
197 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_BLUETOOTH_MOCKBLUETOOTHDEVICE_H_ static constexpr std::size_t PAIRING_PIN_LENGTH_MIN
Definition: MockBluetoothDevice.h:34
Definition: gmock-actions.h:53
const std::string m_mac
Represent the Bluetooth device mac address.
Definition: MockBluetoothDevice.h:73
const std::string m_friendlyName
Represent the Bluetooth device friendly name.
Definition: MockBluetoothDevice.h:75
std::future< bool > pair() override
Definition: MockBluetoothDevice.h:104
std::string getFriendlyName() const override
Definition: MockBluetoothDevice.h:88
std::future< bool > disconnect() override
Definition: MockBluetoothDevice.h:132
Definition: AmdMetricWrapperTest.cpp:24
::std::string string
Definition: gtest-port.h:1097
utils::bluetooth::MediaStreamingState getStreamingState() override
Definition: MockBluetoothDevice.h:163
MediaStreamingState
An Enum representing the current state of the stream.
Definition: MediaStreamingState.h:25
std::future< bool > unpair() override
Definition: MockBluetoothDevice.h:112
bool isPaired() override
Definition: MockBluetoothDevice.h:100
std::string getMac() const override
Definition: MockBluetoothDevice.h:84
std::unordered_map< std::string, std::shared_ptr< services::BluetoothServiceInterface > > m_supportedServices
Represent the Bluetooth device supported Services.
Definition: MockBluetoothDevice.h:79
MockBluetoothDevice::MetaData m_metaData
Represent the Bluetooth device meta data.
Definition: MockBluetoothDevice.h:77
MockBluetoothDevice::MetaData getDeviceMetaData() override
Definition: MockBluetoothDevice.h:96
Represents a Bluetooth Device.
Definition: BluetoothDeviceInterface.h:100
MockBluetoothDevice(const std::string &mac, const std::string friendlyName, MetaData metaData, std::vector< std::shared_ptr< services::BluetoothServiceInterface >> supportedServices)
Constructor.
Definition: MockBluetoothDevice.h:174
bool setPairingPin(const std::string &pin) override
Definition: MockBluetoothDevice.h:140
bool isConnected() override
Definition: MockBluetoothDevice.h:120
DeviceState m_deviceState
Represent the Bluetooth device state.
Definition: MockBluetoothDevice.h:81
bool toggleServiceConnection(bool enabled, std::shared_ptr< services::BluetoothServiceInterface > service) override
Definition: MockBluetoothDevice.h:167
std::vector< std::shared_ptr< services::SDPRecordInterface > > getSupportedServices() override
Definition: MockBluetoothDevice.h:147
std::future< bool > connect() override
Definition: MockBluetoothDevice.h:124
Definition: MockBluetoothDevice.h:42
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
DeviceState
Definition: BluetoothDeviceInterface.h:48
static constexpr std::size_t PAIRING_PIN_LENGTH_MAX
Definition: MockBluetoothDevice.h:35
bool m_isPaired
Represent the pair status.
Definition: MockBluetoothDevice.h:69
DeviceState getDeviceState() override
Definition: MockBluetoothDevice.h:92
std::shared_ptr< services::BluetoothServiceInterface > getService(std::string uuid) override
Definition: MockBluetoothDevice.h:155
bool m_isConnected
Represent the connection status.
Definition: MockBluetoothDevice.h:71