avs-device-sdk/BluetoothImplementations/BlueZ/test/BlueZHIDTest.cpp

43 lines
1.4 KiB
C++
Raw Permalink Normal View History

Version 1.18.0 alexa-client-sdk Changes in this update: **Enhancements** * Added support for [Bluetooth Interface 2.0](https://developer.amazon.com/docs/alexa/alexa-voice-service/bluetooth.html). This interface adds support for multiple simultaneous connections to Bluetooth peripherals. * Added support for [Audio Focus Manager Library (AFML) Multi Activity](https://developer.amazon.com/docs/alexa/avs-device-sdk/sdk-interaction-model.html). This interface enhances the behavior of a device so it can handle more than one Activity per Channel. * Added the `obfuscatePrivateData` logging method to help remove certain data from logs. * Updated `MediaPlayerObserverInterface` to include metadata about playback states. * Added SDK extension point. You can integrate CMake projects into the SDK without cloning those projects into a subdirectory. **Bug fixes** * Fixed Mac/OSX issue that caused an unresponsive Sample App when not connected to the internet. * Fixed issue that prevented sample app from exiting various states. * Fixed `UIManager` issue that caused an error in the logs when the device with built without the wake word enabled. * Fixed volume issue that caused timers to ascend in volume when setting up ascending alarms. * Fixed alert volume issue that caused any changes to the alert volume to notify observers. * Fixed EQ issue where changes to the EQ band levels didn't notify observers. * Fixed Bluetooth bug that caused short notification sounds from a connected phone to stop audio playback on the device. **Known Issues** * Build errors can occur on the Raspberry Pi due to incorrect linking of the atomic library. A suggested workaround is to add the following `set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")` to the top most CMake file. * The WebVTT dependency required for `captions` isn't supported for Windows/Android. * Exiting from the setting option takes you back to the Options Menu directly. It doesn't provide a message to indicate that you're back in the main menu. * Failing Unit Tests and AIP Unit tests are disabled on Windows * `AudioInputProcessor` unit tests don't build on Windows when with the `-DCMAKE_BUILD_TYPE=DEBUG` cmake parameter. * Music playback history isn't displayed in the Alexa app for certain account and device types. * When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail. * Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40. * If a device loses a network connection, the lost connection status isn't returned though local TTS. * ACL encounters issues if it receives audio attachments but doesn't consume them. * Media streamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous. * If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing. * The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported. * When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed. * `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB. * Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio. * A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice. * `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior. * The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2020-02-19 18:35:26 +00:00
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Version 1.18.0 alexa-client-sdk Changes in this update: **Enhancements** * Added support for [Bluetooth Interface 2.0](https://developer.amazon.com/docs/alexa/alexa-voice-service/bluetooth.html). This interface adds support for multiple simultaneous connections to Bluetooth peripherals. * Added support for [Audio Focus Manager Library (AFML) Multi Activity](https://developer.amazon.com/docs/alexa/avs-device-sdk/sdk-interaction-model.html). This interface enhances the behavior of a device so it can handle more than one Activity per Channel. * Added the `obfuscatePrivateData` logging method to help remove certain data from logs. * Updated `MediaPlayerObserverInterface` to include metadata about playback states. * Added SDK extension point. You can integrate CMake projects into the SDK without cloning those projects into a subdirectory. **Bug fixes** * Fixed Mac/OSX issue that caused an unresponsive Sample App when not connected to the internet. * Fixed issue that prevented sample app from exiting various states. * Fixed `UIManager` issue that caused an error in the logs when the device with built without the wake word enabled. * Fixed volume issue that caused timers to ascend in volume when setting up ascending alarms. * Fixed alert volume issue that caused any changes to the alert volume to notify observers. * Fixed EQ issue where changes to the EQ band levels didn't notify observers. * Fixed Bluetooth bug that caused short notification sounds from a connected phone to stop audio playback on the device. **Known Issues** * Build errors can occur on the Raspberry Pi due to incorrect linking of the atomic library. A suggested workaround is to add the following `set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")` to the top most CMake file. * The WebVTT dependency required for `captions` isn't supported for Windows/Android. * Exiting from the setting option takes you back to the Options Menu directly. It doesn't provide a message to indicate that you're back in the main menu. * Failing Unit Tests and AIP Unit tests are disabled on Windows * `AudioInputProcessor` unit tests don't build on Windows when with the `-DCMAKE_BUILD_TYPE=DEBUG` cmake parameter. * Music playback history isn't displayed in the Alexa app for certain account and device types. * When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail. * Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40. * If a device loses a network connection, the lost connection status isn't returned though local TTS. * ACL encounters issues if it receives audio attachments but doesn't consume them. * Media streamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous. * If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing. * The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported. * When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed. * `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB. * Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio. * A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice. * `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior. * The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
2020-02-19 18:35:26 +00:00
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "BlueZ/BlueZHID.h"
namespace alexaClientSDK {
namespace bluetoothImplementations {
namespace blueZ {
namespace test {
using namespace ::testing;
/// Test that a valid object is returned.
TEST(BlueZHIDTest, test_createSucceeds) {
ASSERT_THAT(BlueZHID::create(), NotNull());
}
/// Test the correct SDP record is returned.
TEST(BlueZHIDTest, test_checkSDPRecord) {
auto sdp = BlueZHID::create()->getRecord();
ASSERT_EQ(sdp->getUuid(), std::string(avsCommon::sdkInterfaces::bluetooth::services::HIDInterface::UUID));
ASSERT_EQ(sdp->getName(), std::string(avsCommon::sdkInterfaces::bluetooth::services::HIDInterface::NAME));
}
} // namespace test
} // namespace blueZ
} // namespace bluetoothImplementations
} // namespace alexaClientSDK