2017-02-10 23:39:10 +00:00
|
|
|
/*
|
2019-05-22 23:06:18 +00:00
|
|
|
* Copyright 2016-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2017-02-10 23:39:10 +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.
|
|
|
|
*/
|
|
|
|
|
2017-03-10 00:01:46 +00:00
|
|
|
/// @file AlexaCommunicationsLibraryTest.cpp
|
|
|
|
|
2017-05-05 17:31:58 +00:00
|
|
|
#include <future>
|
|
|
|
#include <fstream>
|
|
|
|
#include <chrono>
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
#include <ACL/AVSConnectionManager.h>
|
2017-05-26 23:06:14 +00:00
|
|
|
#include <AVSCommon/AVS/Attachment/AttachmentManager.h>
|
|
|
|
#include <AVSCommon/AVS/Attachment/InProcessAttachment.h>
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
#include <CBLAuthDelegate/SQLiteCBLAuthDelegateStorage.h>
|
|
|
|
#include <ContextManager/ContextManager.h>
|
2017-05-05 17:31:58 +00:00
|
|
|
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
#include "Integration/ACLTestContext.h"
|
2017-02-10 23:39:10 +00:00
|
|
|
#include "Integration/ClientMessageHandler.h"
|
|
|
|
#include "Integration/ConnectionStatusObserver.h"
|
|
|
|
#include "Integration/ObservableMessageRequest.h"
|
|
|
|
|
|
|
|
namespace alexaClientSDK {
|
|
|
|
namespace integration {
|
2017-06-09 23:23:31 +00:00
|
|
|
namespace test {
|
2017-02-10 23:39:10 +00:00
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
using namespace acl;
|
|
|
|
using namespace avsCommon::avs;
|
|
|
|
using namespace avsCommon::avs::attachment;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
using namespace avsCommon::sdkInterfaces;
|
2017-05-26 23:06:14 +00:00
|
|
|
using namespace avsCommon::utils::sds;
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
using namespace registrationManager;
|
2017-02-10 23:39:10 +00:00
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
/// This is a basic synchronize JSON message which may be used to initiate a connection with AVS.
|
2017-10-02 22:59:05 +00:00
|
|
|
// clang-format off
|
2017-02-10 23:39:10 +00:00
|
|
|
static const std::string SYNCHRONIZE_STATE_JSON =
|
|
|
|
"{"
|
|
|
|
"\"context\":[{"
|
|
|
|
"\"header\":{"
|
|
|
|
"\"name\":\"SpeechState\","
|
|
|
|
"\"namespace\":\"SpeechSynthesizer\""
|
|
|
|
"},"
|
|
|
|
"\"payload\":{"
|
|
|
|
"\"playerActivity\":\"FINISHED\","
|
|
|
|
"\"offsetInMilliseconds\":0,"
|
|
|
|
"\"token\":\"\""
|
|
|
|
"}"
|
|
|
|
"}],"
|
|
|
|
"\"event\":{"
|
|
|
|
"\"header\":{"
|
|
|
|
"\"messageId\":\"00000000-0000-0000-0000-000000000000\","
|
|
|
|
"\"name\":\"SynchronizeState\","
|
|
|
|
"\"namespace\":\"System\""
|
|
|
|
"},"
|
|
|
|
"\"payload\":{"
|
|
|
|
"}"
|
|
|
|
"}"
|
|
|
|
"}";
|
2017-10-02 22:59:05 +00:00
|
|
|
// clang-format on
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
/// This is a partial JSON string that should not be parseable.
|
|
|
|
static const std::string BAD_SYNCHRONIZE_STATE_JSON = "{";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This string specifies a Recognize event using the specified profile.
|
|
|
|
*
|
2017-05-26 23:06:14 +00:00
|
|
|
* CLOSE_TALK performs end-of-speech detection on the client, so a stop-capture directive will not be received from AVS.
|
|
|
|
* NEAR_FIELD performs end-of-speech detection in AVS, so a stop-capture directive will be received from AVS.
|
2017-02-10 23:39:10 +00:00
|
|
|
*/
|
2017-10-02 22:59:05 +00:00
|
|
|
// clang-format off
|
2017-02-10 23:39:10 +00:00
|
|
|
#define RECOGNIZE_EVENT_JSON(PROFILE) \
|
|
|
|
"{" \
|
|
|
|
"\"event\":{" \
|
|
|
|
"\"payload\":{" \
|
|
|
|
"\"format\":\"AUDIO_L16_RATE_16000_CHANNELS_1\"," \
|
|
|
|
"\"profile\":\"" #PROFILE "\"" \
|
|
|
|
"}," \
|
|
|
|
"\"header\":{" \
|
|
|
|
"\"dialogRequestId\":\"dialogRequestId123\"," \
|
|
|
|
"\"messageId\":\"messageId123\"," \
|
|
|
|
"\"name\":\"Recognize\"," \
|
|
|
|
"\"namespace\":\"SpeechRecognizer\"" \
|
|
|
|
"}" \
|
|
|
|
"}," \
|
|
|
|
"\"context\":[{" \
|
|
|
|
"\"payload\":{" \
|
|
|
|
"\"activeAlerts\":[]," \
|
|
|
|
"\"allAlerts\":[]" \
|
|
|
|
"}," \
|
|
|
|
"\"header\":{" \
|
|
|
|
"\"name\":\"AlertsState\"," \
|
|
|
|
"\"namespace\":\"Alerts\"" \
|
|
|
|
"}" \
|
|
|
|
"}," \
|
|
|
|
"{" \
|
|
|
|
"\"payload\":{" \
|
|
|
|
"\"playerActivity\":\"IDLE\"," \
|
|
|
|
"\"offsetInMilliseconds\":0," \
|
|
|
|
"\"token\":\"\"" \
|
|
|
|
"}," \
|
|
|
|
"\"header\":{" \
|
|
|
|
"\"name\":\"PlaybackState\"," \
|
|
|
|
"\"namespace\":\"AudioPlayer\"" \
|
|
|
|
"}" \
|
|
|
|
"}," \
|
|
|
|
"{" \
|
|
|
|
"\"payload\":{" \
|
|
|
|
"\"muted\":false," \
|
|
|
|
"\"volume\":0" \
|
|
|
|
"}," \
|
|
|
|
"\"header\":{" \
|
|
|
|
"\"name\":\"VolumeState\"," \
|
|
|
|
"\"namespace\":\"Speaker\"" \
|
|
|
|
"}" \
|
|
|
|
"}," \
|
|
|
|
"{" \
|
|
|
|
"\"payload\":{" \
|
|
|
|
"\"playerActivity\":\"FINISHED\"," \
|
|
|
|
"\"offsetInMilliseconds\":0," \
|
|
|
|
"\"token\":\"\"" \
|
|
|
|
"}," \
|
|
|
|
"\"header\":{" \
|
|
|
|
"\"name\":\"SpeechState\"," \
|
|
|
|
"\"namespace\":\"SpeechSynthesizer\"" \
|
|
|
|
"}" \
|
|
|
|
"}]" \
|
|
|
|
"}"
|
2017-10-02 22:59:05 +00:00
|
|
|
// clang-format on
|
2017-02-10 23:39:10 +00:00
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
/// This string specifies a Recognize event using the CLOSE_TALK profile.
|
2017-02-10 23:39:10 +00:00
|
|
|
static const std::string CT_RECOGNIZE_EVENT_JSON = RECOGNIZE_EVENT_JSON(CLOSE_TALK);
|
2017-05-26 23:06:14 +00:00
|
|
|
/// This string specifies a Recognize event using the NEAR_FIELD profile.
|
2017-02-10 23:39:10 +00:00
|
|
|
static const std::string NF_RECOGNIZE_EVENT_JSON = RECOGNIZE_EVENT_JSON(NEAR_FIELD);
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
/// This string specifies an ExpectSpeechTimedOut event.
|
2017-10-02 22:59:05 +00:00
|
|
|
// clang-format off
|
2017-02-10 23:39:10 +00:00
|
|
|
static const std::string EXPECT_SPEECH_TIMED_OUT_EVENT_JSON =
|
|
|
|
"{"
|
|
|
|
"\"event\": {"
|
|
|
|
"\"header\": {"
|
|
|
|
"\"namespace\": \"SpeechRecognizer\","
|
|
|
|
"\"name\": \"ExpectSpeechTimedOut\","
|
|
|
|
"\"messageId\": \"messageId123\","
|
|
|
|
"},"
|
|
|
|
"\"payload\": {"
|
|
|
|
"}"
|
|
|
|
"}"
|
|
|
|
"}";
|
2017-10-02 22:59:05 +00:00
|
|
|
// clang-format on
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
/// This is a 16 bit 16 kHz little endian linear PCM audio file containing a recognized message for AVS
|
2017-05-26 23:06:14 +00:00
|
|
|
static const std::string RECOGNIZE_AUDIO_FILE_NAME = "recognize_test.wav";
|
2017-02-10 23:39:10 +00:00
|
|
|
/// This is a 16 bit 16 kHz little endian linear PCM audio file containing several seconds of silence
|
2017-05-26 23:06:14 +00:00
|
|
|
static const std::string SILENCE_AUDIO_FILE_NAME = "silence_test.wav";
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The value of MAX_THREADS is determined by the maximum number of streams we can have active at once which is defined
|
|
|
|
* in HTTP2Connection.cpp as a constant MAX_STREAMS=10. Streams include events, the downchannel and ping.
|
|
|
|
* Since we establish a downchannel when we connect, we can only have (MAX_STREAMS - 1) events sent at once.
|
|
|
|
* Therefore, the value of MAX_THREADS = MAX_STREAMS -1.
|
|
|
|
*/
|
2017-05-26 23:06:14 +00:00
|
|
|
static const int MAX_CONCURRENT_STREAMS = 9;
|
2017-02-10 23:39:10 +00:00
|
|
|
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
/// Path to the AlexaClientSDKConfig.json file (from command line arguments).
|
|
|
|
static std::string g_configPath;
|
|
|
|
/// Path to resources (e.g. audio files) for tests (from command line arguments).
|
|
|
|
static std::string g_inputPath;
|
2017-02-10 23:39:10 +00:00
|
|
|
|
|
|
|
class AlexaCommunicationsLibraryTest : public ::testing::Test {
|
2017-05-26 23:06:14 +00:00
|
|
|
public:
|
|
|
|
void SetUp() override {
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_context = ACLTestContext::create(g_configPath);
|
|
|
|
ASSERT_TRUE(m_context);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_clientMessageHandler = std::make_shared<ClientMessageHandler>(m_context->getAttachmentManager());
|
2017-02-10 23:39:10 +00:00
|
|
|
m_avsConnectionManager = AVSConnectionManager::create(
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_context->getMessageRouter(), false, {m_context->getConnectionStatusObserver()}, {m_clientMessageHandler});
|
|
|
|
ASSERT_TRUE(m_avsConnectionManager);
|
|
|
|
|
2017-02-10 23:39:10 +00:00
|
|
|
connect();
|
|
|
|
}
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
void TearDown() override {
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
// Note nullptr checks needed to avoid segaults if @c SetUp() failed.
|
|
|
|
if (m_avsConnectionManager) {
|
|
|
|
disconnect();
|
|
|
|
m_avsConnectionManager->shutdown();
|
|
|
|
}
|
|
|
|
m_context.reset();
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
void connect() {
|
2017-02-10 23:39:10 +00:00
|
|
|
m_avsConnectionManager->enable();
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
m_context->waitForConnected();
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
void disconnect() {
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
if (m_avsConnectionManager) {
|
|
|
|
m_avsConnectionManager->disable();
|
|
|
|
m_context->waitForDisconnected();
|
|
|
|
}
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2017-05-26 23:06:14 +00:00
|
|
|
* Function to send an Event to AVS.
|
2017-02-10 23:39:10 +00:00
|
|
|
*/
|
2017-05-26 23:06:14 +00:00
|
|
|
void sendEvent(
|
2017-10-02 22:59:05 +00:00
|
|
|
const std::string& jsonContent,
|
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status expectedStatus,
|
|
|
|
std::chrono::seconds timeout,
|
|
|
|
std::shared_ptr<avsCommon::avs::attachment::AttachmentReader> attachmentReader = nullptr) {
|
2017-05-18 05:02:48 +00:00
|
|
|
auto messageRequest = std::make_shared<ObservableMessageRequest>(jsonContent, attachmentReader);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-05-18 05:02:48 +00:00
|
|
|
m_avsConnectionManager->sendMessage(messageRequest);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_TRUE(messageRequest->waitFor(expectedStatus, timeout));
|
2017-08-17 00:13:40 +00:00
|
|
|
ASSERT_TRUE(messageRequest->hasSendCompleted() || messageRequest->wasExceptionReceived());
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-26 23:06:14 +00:00
|
|
|
* Function to create an attachmentReader given a filename.
|
2017-02-10 23:39:10 +00:00
|
|
|
*/
|
2017-10-02 22:59:05 +00:00
|
|
|
std::shared_ptr<InProcessAttachmentReader> createAttachmentReader(const std::string& fileName) {
|
2017-05-26 23:06:14 +00:00
|
|
|
// 1MB is large enough for our test audio samples.
|
2017-05-18 05:02:48 +00:00
|
|
|
const int mbBytes = 1024 * 1024;
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
// create an SDS with 1MB size, so we can write the entire audio file into it.
|
|
|
|
auto sdsBufferSize = InProcessSDS::calculateBufferSize(mbBytes);
|
|
|
|
auto sdsBuffer = std::make_shared<InProcessSDSTraits::Buffer>(sdsBufferSize);
|
|
|
|
std::shared_ptr<InProcessSDS> sds = InProcessSDS::create(sdsBuffer);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
// open the file.
|
|
|
|
auto is = std::make_shared<std::ifstream>(fileName, std::ios::binary);
|
|
|
|
EXPECT_TRUE(is->is_open());
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
// read the data from the file into the SDS, via the local buffer.
|
|
|
|
std::vector<char> localBuffer(mbBytes);
|
2017-05-18 05:02:48 +00:00
|
|
|
auto attachmentWriter = InProcessAttachmentWriter::create(sds);
|
|
|
|
while (*is) {
|
2017-05-26 23:06:14 +00:00
|
|
|
// data -> local buffer
|
2017-05-18 05:02:48 +00:00
|
|
|
is->read(localBuffer.data(), mbBytes);
|
2017-05-26 23:06:14 +00:00
|
|
|
size_t numBytesRead = static_cast<size_t>(is->gcount());
|
|
|
|
|
|
|
|
// local buffer -> sds
|
2017-05-18 05:02:48 +00:00
|
|
|
AttachmentWriter::WriteStatus writeStatus = AttachmentWriter::WriteStatus::OK;
|
|
|
|
attachmentWriter->write(localBuffer.data(), numBytesRead, &writeStatus);
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
// confirm the SDS write operation went ok
|
2017-10-02 22:59:05 +00:00
|
|
|
bool writeStatusOk =
|
|
|
|
(AttachmentWriter::WriteStatus::OK == writeStatus ||
|
|
|
|
AttachmentWriter::WriteStatus::CLOSED == writeStatus);
|
2017-05-26 23:06:14 +00:00
|
|
|
EXPECT_TRUE(writeStatusOk);
|
2017-05-18 05:02:48 +00:00
|
|
|
}
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
// closing the writer indicates to readers of the SDS that there is no more data that will be written.
|
2017-05-18 05:02:48 +00:00
|
|
|
attachmentWriter->close();
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
// create and return the reader.
|
2017-05-18 05:02:48 +00:00
|
|
|
std::shared_ptr<InProcessAttachmentReader> attachmentReader =
|
2018-02-12 23:31:53 +00:00
|
|
|
InProcessAttachmentReader::create(ReaderPolicy::NONBLOCKING, sds);
|
2017-05-26 23:06:14 +00:00
|
|
|
EXPECT_NE(attachmentReader, nullptr);
|
2017-05-18 05:02:48 +00:00
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
return attachmentReader;
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
Version 1.16 alexa-client-sdk
Changes in this update:
**Enhancements**
- Added support for SpeechSynthesizer v.1.2 which includes the new `playBehaviour` directive. For more information, see [SpeechSynthesizer v1.2](https://github.com/alexa/avs-device-sdk/wiki/SpeechSynthesizer-Interface-v1.2).
- Added support for pre-buffering in [AudioPlayer](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html). You can optionally choose the number of instances MediaPlayer uses in the [AlexaClientSDKconfig.json](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json). Important: the contract for [MediaPlayerInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1utils_1_1media_player_1_1_media_player_interface.html) has changed. You must now make sure that the `SourceId` value returned by `setSource()` is unique across all instances.
- AudioPlayer is now licensed under the Amazon Software License instead of the Apache Software License.
**Bug Fixes**
- Fixed Android issue that caused the build script to ignore PKG_CONFIG_PATH. This sometimes caused the build to use a preinstalled dependency instead of the specific version downloaded by the Android script (e.g - openssl).
- Fixed Android issue that prevented the Sample app from running at the same time as other applications using the microphone. Android doesn't inherently allow two applications to use the microphone. Pressing the mute button now temporarily stops Alexa from accessing the microphone.
- Added 'quit' (– q) to the settings sub menu.
- Fixed outdated dependencies issue in the Windows install script.
- Fixed reminders issue that caused Notification LEDs to stay on, even after dismissing the alert.
**Known Issues**
* 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 via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed 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.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
* On some devices, Alexa gets stuck in a permanent listening state. Pressing `t` and `h` in the Sample App doesn't exit the listening state.
* Exiting the `settings` menu doesn't provide a message to indicate that you are back in the main menu.
2019-10-25 20:19:44 +00:00
|
|
|
* Sends a SynchronizeState Event to AVS.
|
2017-02-10 23:39:10 +00:00
|
|
|
*/
|
Version 1.16 alexa-client-sdk
Changes in this update:
**Enhancements**
- Added support for SpeechSynthesizer v.1.2 which includes the new `playBehaviour` directive. For more information, see [SpeechSynthesizer v1.2](https://github.com/alexa/avs-device-sdk/wiki/SpeechSynthesizer-Interface-v1.2).
- Added support for pre-buffering in [AudioPlayer](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html). You can optionally choose the number of instances MediaPlayer uses in the [AlexaClientSDKconfig.json](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json). Important: the contract for [MediaPlayerInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1utils_1_1media_player_1_1_media_player_interface.html) has changed. You must now make sure that the `SourceId` value returned by `setSource()` is unique across all instances.
- AudioPlayer is now licensed under the Amazon Software License instead of the Apache Software License.
**Bug Fixes**
- Fixed Android issue that caused the build script to ignore PKG_CONFIG_PATH. This sometimes caused the build to use a preinstalled dependency instead of the specific version downloaded by the Android script (e.g - openssl).
- Fixed Android issue that prevented the Sample app from running at the same time as other applications using the microphone. Android doesn't inherently allow two applications to use the microphone. Pressing the mute button now temporarily stops Alexa from accessing the microphone.
- Added 'quit' (– q) to the settings sub menu.
- Fixed outdated dependencies issue in the Windows install script.
- Fixed reminders issue that caused Notification LEDs to stay on, even after dismissing the alert.
**Known Issues**
* 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 via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed 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.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
* On some devices, Alexa gets stuck in a permanent listening state. Pressing `t` and `h` in the Sample App doesn't exit the listening state.
* Exiting the `settings` menu doesn't provide a message to indicate that you are back in the main menu.
2019-10-25 20:19:44 +00:00
|
|
|
void sendSynchronizeStateEvent() {
|
|
|
|
sendEvent(
|
|
|
|
SYNCHRONIZE_STATE_JSON,
|
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS_NO_CONTENT,
|
|
|
|
std::chrono::seconds(40));
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
/// Context for running ACL based tests.
|
|
|
|
std::unique_ptr<ACLTestContext> m_context;
|
|
|
|
|
2017-02-10 23:39:10 +00:00
|
|
|
std::shared_ptr<ClientMessageHandler> m_clientMessageHandler;
|
|
|
|
std::shared_ptr<AVSConnectionManager> m_avsConnectionManager;
|
|
|
|
};
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
/// Test connecting and disconnecting from AVS.
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_connectAndDisconnect) {
|
2017-06-23 23:26:34 +00:00
|
|
|
// Connect is called in SetUp and disconnect is called in TearDown. Simply check that we are connected.
|
|
|
|
ASSERT_TRUE(m_avsConnectionManager->isConnected());
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-26 23:06:14 +00:00
|
|
|
* Test sending an Event to AVS.
|
2017-02-10 23:39:10 +00:00
|
|
|
*
|
2017-05-26 23:06:14 +00:00
|
|
|
* This test sends a SynchronizeState Event, which does not require an attachment, or receive a Directive in response.
|
2017-02-10 23:39:10 +00:00
|
|
|
*
|
|
|
|
* @see https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/reference/system#synchronizestate
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_sendEvent) {
|
2017-10-02 22:59:05 +00:00
|
|
|
sendEvent(
|
|
|
|
SYNCHRONIZE_STATE_JSON,
|
2017-10-30 22:14:38 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS_NO_CONTENT,
|
2017-10-02 22:59:05 +00:00
|
|
|
std::chrono::seconds(10));
|
2017-05-26 23:06:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function that tests the behavior of the ACL when an improperly formatted message is sent, expecting the server
|
2017-12-09 00:07:37 +00:00
|
|
|
* to return a bad request status.
|
2017-05-26 23:06:14 +00:00
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_sendInvalidEvent) {
|
2017-10-02 22:59:05 +00:00
|
|
|
sendEvent(
|
|
|
|
BAD_SYNCHRONIZE_STATE_JSON,
|
2017-12-09 00:07:37 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::BAD_REQUEST,
|
2017-10-02 22:59:05 +00:00
|
|
|
std::chrono::seconds(10));
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test ability to send an event with attachments to Alexa Voice Service.
|
|
|
|
*
|
|
|
|
* This test sends a RecognizeAudio event, which requires an attachment of the audio stream. In this case,
|
|
|
|
* we send a pre-recorded audio file which asks Alexa to "tell me a joke".
|
|
|
|
*
|
|
|
|
* @see https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/reference/speechrecognizer#recognize
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_sendEventWithAttachment) {
|
2017-05-26 23:06:14 +00:00
|
|
|
auto attachmentReader = createAttachmentReader(g_inputPath + "/" + RECOGNIZE_AUDIO_FILE_NAME);
|
2017-10-02 22:59:05 +00:00
|
|
|
sendEvent(
|
|
|
|
CT_RECOGNIZE_EVENT_JSON,
|
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
|
|
|
std::chrono::seconds(10),
|
|
|
|
attachmentReader);
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-26 23:06:14 +00:00
|
|
|
* Test sending an Event and receiving a Directive in response.
|
|
|
|
*
|
|
|
|
* This test sends a Recognize event, which includes an audio attachment. In this case, the audio file sent to AVS
|
|
|
|
* asks Alexa to "tell me a joke". The Speak Directive we expect in response will be the joke.
|
|
|
|
*
|
|
|
|
* @see https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/reference/audioplayer#states
|
2017-02-10 23:39:10 +00:00
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_sendEventAndReceiveDirective) {
|
2017-05-26 23:06:14 +00:00
|
|
|
auto attachmentReader = createAttachmentReader(g_inputPath + "/" + RECOGNIZE_AUDIO_FILE_NAME);
|
2017-10-02 22:59:05 +00:00
|
|
|
sendEvent(
|
|
|
|
CT_RECOGNIZE_EVENT_JSON,
|
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
|
|
|
std::chrono::seconds(10),
|
|
|
|
attachmentReader);
|
2017-02-10 23:39:10 +00:00
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
// We expect to receive Directives in response to the recognize Event. Wait for the first one.
|
|
|
|
ASSERT_TRUE(m_clientMessageHandler->waitForNext(std::chrono::seconds(20)));
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-26 23:06:14 +00:00
|
|
|
* Test sending multiple Events in succession and verify that AVS responds to each of them.
|
2017-02-10 23:39:10 +00:00
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_sendEventsSerially) {
|
2017-02-10 23:39:10 +00:00
|
|
|
const int NUMBER_OF_SUCCESSIVE_SENDS = 10;
|
|
|
|
for (int i = 0; i < NUMBER_OF_SUCCESSIVE_SENDS; ++i) {
|
Version 1.16 alexa-client-sdk
Changes in this update:
**Enhancements**
- Added support for SpeechSynthesizer v.1.2 which includes the new `playBehaviour` directive. For more information, see [SpeechSynthesizer v1.2](https://github.com/alexa/avs-device-sdk/wiki/SpeechSynthesizer-Interface-v1.2).
- Added support for pre-buffering in [AudioPlayer](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html). You can optionally choose the number of instances MediaPlayer uses in the [AlexaClientSDKconfig.json](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json). Important: the contract for [MediaPlayerInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1utils_1_1media_player_1_1_media_player_interface.html) has changed. You must now make sure that the `SourceId` value returned by `setSource()` is unique across all instances.
- AudioPlayer is now licensed under the Amazon Software License instead of the Apache Software License.
**Bug Fixes**
- Fixed Android issue that caused the build script to ignore PKG_CONFIG_PATH. This sometimes caused the build to use a preinstalled dependency instead of the specific version downloaded by the Android script (e.g - openssl).
- Fixed Android issue that prevented the Sample app from running at the same time as other applications using the microphone. Android doesn't inherently allow two applications to use the microphone. Pressing the mute button now temporarily stops Alexa from accessing the microphone.
- Added 'quit' (– q) to the settings sub menu.
- Fixed outdated dependencies issue in the Windows install script.
- Fixed reminders issue that caused Notification LEDs to stay on, even after dismissing the alert.
**Known Issues**
* 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 via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed 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.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
* On some devices, Alexa gets stuck in a permanent listening state. Pressing `t` and `h` in the Sample App doesn't exit the listening state.
* Exiting the `settings` menu doesn't provide a message to indicate that you are back in the main menu.
2019-10-25 20:19:44 +00:00
|
|
|
sendSynchronizeStateEvent();
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-26 23:06:14 +00:00
|
|
|
* Test sending multiple Events concurrently and verify that AVS responds to each of them.
|
2017-02-10 23:39:10 +00:00
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_sendEventsConcurrently) {
|
2017-05-26 23:06:14 +00:00
|
|
|
std::vector<std::future<void>> futures;
|
2017-02-10 23:39:10 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
for (int i = 0; i < MAX_CONCURRENT_STREAMS; ++i) {
|
Version 1.16 alexa-client-sdk
Changes in this update:
**Enhancements**
- Added support for SpeechSynthesizer v.1.2 which includes the new `playBehaviour` directive. For more information, see [SpeechSynthesizer v1.2](https://github.com/alexa/avs-device-sdk/wiki/SpeechSynthesizer-Interface-v1.2).
- Added support for pre-buffering in [AudioPlayer](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1audio_player_1_1_audio_player.html). You can optionally choose the number of instances MediaPlayer uses in the [AlexaClientSDKconfig.json](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json). Important: the contract for [MediaPlayerInterface](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1utils_1_1media_player_1_1_media_player_interface.html) has changed. You must now make sure that the `SourceId` value returned by `setSource()` is unique across all instances.
- AudioPlayer is now licensed under the Amazon Software License instead of the Apache Software License.
**Bug Fixes**
- Fixed Android issue that caused the build script to ignore PKG_CONFIG_PATH. This sometimes caused the build to use a preinstalled dependency instead of the specific version downloaded by the Android script (e.g - openssl).
- Fixed Android issue that prevented the Sample app from running at the same time as other applications using the microphone. Android doesn't inherently allow two applications to use the microphone. Pressing the mute button now temporarily stops Alexa from accessing the microphone.
- Added 'quit' (– q) to the settings sub menu.
- Fixed outdated dependencies issue in the Windows install script.
- Fixed reminders issue that caused Notification LEDs to stay on, even after dismissing the alert.
**Known Issues**
* 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 via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed 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.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
* On some devices, Alexa gets stuck in a permanent listening state. Pressing `t` and `h` in the Sample App doesn't exit the listening state.
* Exiting the `settings` menu doesn't provide a message to indicate that you are back in the main menu.
2019-10-25 20:19:44 +00:00
|
|
|
auto future = std::async(std::launch::async, [this]() { sendSynchronizeStateEvent(); });
|
2017-05-26 23:06:14 +00:00
|
|
|
futures.push_back(std::move(future));
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
for (auto& future : futures) {
|
2017-02-10 23:39:10 +00:00
|
|
|
auto status = future.wait_for(std::chrono::seconds(20));
|
|
|
|
ASSERT_EQ(status, std::future_status::ready);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-26 23:06:14 +00:00
|
|
|
* Test receiving an AVS Directive on the DownChannel.
|
2017-02-10 23:39:10 +00:00
|
|
|
*
|
2017-05-26 23:06:14 +00:00
|
|
|
* DownChannel Directives are unsolicited - they may be pushed to the client by AVS at any time.
|
|
|
|
* This test exercises this functionality by sending a RecognizeAudio Event with silence for the attached audio.
|
|
|
|
* By using the NEAR_FIELD audio profile, we expect AVS to detect the end of speech and send a StopCapture Directive.
|
2017-02-10 23:39:10 +00:00
|
|
|
*
|
2017-05-26 23:06:14 +00:00
|
|
|
* @see https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/reference/speechrecognizer#profiles
|
2017-02-10 23:39:10 +00:00
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_receiveDirectiveOnDownchannel) {
|
2017-05-26 23:06:14 +00:00
|
|
|
auto attachmentReader = createAttachmentReader(g_inputPath + "/" + SILENCE_AUDIO_FILE_NAME);
|
2017-10-02 22:59:05 +00:00
|
|
|
sendEvent(
|
|
|
|
NF_RECOGNIZE_EVENT_JSON,
|
2017-10-30 22:14:38 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS_NO_CONTENT,
|
2017-10-02 22:59:05 +00:00
|
|
|
std::chrono::seconds(10),
|
|
|
|
attachmentReader);
|
2017-02-10 23:39:10 +00:00
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
// Wait for the StopCapture Directive to be received.
|
2017-02-10 23:39:10 +00:00
|
|
|
ASSERT_TRUE(m_clientMessageHandler->waitForNext(std::chrono::seconds(20)));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-26 23:06:14 +00:00
|
|
|
* Test that a connection to AVS persists between sending Events.
|
2017-02-10 23:39:10 +00:00
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_persistentConnection) {
|
2017-05-26 23:06:14 +00:00
|
|
|
auto attachmentReader = createAttachmentReader(g_inputPath + "/" + RECOGNIZE_AUDIO_FILE_NAME);
|
2017-10-02 22:59:05 +00:00
|
|
|
sendEvent(
|
|
|
|
CT_RECOGNIZE_EVENT_JSON,
|
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
|
|
|
std::chrono::seconds(10),
|
|
|
|
attachmentReader);
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
ASSERT_FALSE(m_context->getConnectionStatusObserver()->waitFor(
|
2017-10-02 22:59:05 +00:00
|
|
|
ConnectionStatusObserverInterface::Status::DISCONNECTED, std::chrono::seconds(20)))
|
|
|
|
<< "Connection changed after a response was received";
|
|
|
|
sendEvent(
|
|
|
|
CT_RECOGNIZE_EVENT_JSON,
|
2017-10-30 22:14:38 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS_NO_CONTENT,
|
2017-10-02 22:59:05 +00:00
|
|
|
std::chrono::seconds(10),
|
|
|
|
attachmentReader);
|
2017-02-10 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
/**
|
|
|
|
* Test add- and removeConnectionStatuObserver, expecting the observer to be updated only when it is added.
|
|
|
|
*/
|
2019-05-22 23:06:18 +00:00
|
|
|
TEST_F(AlexaCommunicationsLibraryTest, test_multipleConnectionStatusObservers) {
|
2017-06-23 23:26:34 +00:00
|
|
|
auto observer = std::make_shared<ConnectionStatusObserver>();
|
|
|
|
m_avsConnectionManager->addConnectionStatusObserver(observer);
|
|
|
|
|
|
|
|
ASSERT_TRUE(observer->waitFor(ConnectionStatusObserverInterface::Status::CONNECTED));
|
|
|
|
|
|
|
|
// Remove the observer and disconnect, expecting the status to not change.
|
|
|
|
m_avsConnectionManager->removeConnectionStatusObserver(observer);
|
|
|
|
disconnect();
|
|
|
|
ASSERT_EQ(observer->getConnectionStatus(), ConnectionStatusObserverInterface::Status::CONNECTED);
|
Version 1.7.0 of the avs-device-sdk
Changes in this update:
**Enhancements**
* `AuthDelegate` and `AuthServer.py` have been replaced by `CBLAUthDelegate`, which provides a more straightforward path to authorization.
* Added a new configuration property called [`cblAuthDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L2). This object specifies parameters for `CBLAuthDelegate`.
* Added a new configuration property called [`miscDatabase`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L34), which is a generic key/value database to be used by various components.
* Added a new configuration property called [`dcfDelegate`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L17) This object specifies parameters for `DCFDelegate`. Within this object, values were added for the 'endpoint' and `overridenDcfPublishMessageBody`. 'endpoint' is the endpoint to connect to in order to send device capabilities. `overridenDcfPublishMessageBody`is the message that will get sent out to the Capabilities API. Note: values within the `dcfDelegate` object will only work in `DEBUG` builds.
* Added a new configuration property called [`deviceInfo`](https://github.com/alexa/avs-device-sdk/blob/master/Integration/AlexaClientSDKConfig.json#L9) which specifies device-identifying information for use by the Device Capability Framework (DCF), and for authorization (CBLAuthDelegate).
* Updated the Directive Sequencer to support wildcard directive handlers. This allows a handler for a given AVS interface to register at the namespace level, rather than specifying the names of all directives within that namespace.
* Updated the Raspberry Pi installation script to include `alsasink` in the configuration file.
* Added `audioSink` as a configuration option. This allows users to override the audio sink element used in `Gstreamer`.
* Added an interface for monitoring internet connection status: `InternetConnectionMonitorInterface.h`.
* The Alexa Communications Library (ACL) is no longer required to wait until authorization has succeeded before attempting to connect to AVS. Instead, `HTTP2Transport` handles waiting for authorization to complete.
* Added the Device Capabilities Framework (DCF) delegate. Device capabilities can now be sent for each capability interface using DCF publish messages.
* The sample app has been updated to send DCF publish messages, which will automatically occur when the sample app starts. Note: a DCF publish message must be successfully sent in order for communication with AVS to occur.
* The SDK now supports HTTP PUT messages.
* Added support for opt-arg style arguments and multiple configuration files. Now, the sample app can be invoked by either of these commands: `SampleApp <configfile> <debuglevel>` OR `SampleApp -C file1 -C file2 ... -L loglevel`.
**Bug Fixes**
* Issues [447](https://github.com/alexa/avs-device-sdk/issues/447) and [553](https://github.com/alexa/avs-device-sdk/issues/553) Fixed the `AttachmentRenderSource`'s handling of `BLOCKING` `AttachmentReaders`.
* Updated the `Logger` implementation to be more resilient to `nullptr` string inputs.
* Fixed a `TimeUtils` utility-related compile issue.
* Fixed a bug in which alerts failed to activate if the system was restarted without network connection.
* Fixed Android 64-bit build failure issue.
**Known Issues**
* The `ACL` may encounter issues if audio attachments are received but not consumed.
* `SpeechSynthesizerState` currently uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate state. These states may be removed in a future release.
* Some ERROR messages may be printed during start-up event if initialization proceeds normally and successfully.
* If an unrecoverable authorization error or an unrecoverable DCF error is encountered, the sample app may crash on shutdown.
* If a non-CBL `clientId` is included in the `deviceInfo` section of `AlexaClientSDKConfig.json`, the error will be reported as an unrecoverable authorization error, rather than a more specific error.
2018-04-18 22:17:28 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_context->getConnectionStatusObserver()->waitFor(ConnectionStatusObserverInterface::Status::DISCONNECTED));
|
2017-06-23 23:26:34 +00:00
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
} // namespace test
|
|
|
|
} // namespace integration
|
|
|
|
} // namespace alexaClientSDK
|
2017-06-23 23:26:34 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
int main(int argc, char** argv) {
|
2017-02-10 23:39:10 +00:00
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
if (argc < 3) {
|
2017-12-09 00:07:37 +00:00
|
|
|
std::cerr << "USAGE: " << std::string(argv[0]) << " <path_to_auth_delgate_config> <path_to_inputs_folder>"
|
2017-10-02 22:59:05 +00:00
|
|
|
<< std::endl;
|
2017-03-10 00:01:46 +00:00
|
|
|
return 1;
|
2017-02-10 23:39:10 +00:00
|
|
|
} else {
|
2017-06-09 23:23:31 +00:00
|
|
|
alexaClientSDK::integration::test::g_configPath = std::string(argv[1]);
|
|
|
|
alexaClientSDK::integration::test::g_inputPath = std::string(argv[2]);
|
2017-02-10 23:39:10 +00:00
|
|
|
return RUN_ALL_TESTS();
|
|
|
|
}
|
|
|
|
}
|