2017-05-26 23:06:14 +00:00
|
|
|
/*
|
2018-02-12 23:31:53 +00:00
|
|
|
* Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2017-05-26 23:06:14 +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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/// @file SpeechSynthesizerIntegrationTest.cpp
|
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
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
#include <chrono>
|
|
|
|
#include <deque>
|
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 <fstream>
|
|
|
|
#include <future>
|
|
|
|
#include <iostream>
|
2017-05-26 23:06:14 +00:00
|
|
|
#include <mutex>
|
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 <string>
|
2017-05-26 23:06:14 +00:00
|
|
|
#include <unordered_map>
|
|
|
|
|
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 <gtest/gtest.h>
|
|
|
|
|
|
|
|
#include <ADSL/DirectiveSequencer.h>
|
|
|
|
#include <ADSL/MessageInterpreter.h>
|
|
|
|
#include <AFML/FocusManager.h>
|
|
|
|
#include <AVSCommon/AVS/Attachment/InProcessAttachmentReader.h>
|
|
|
|
#include <AVSCommon/AVS/Attachment/InProcessAttachmentWriter.h>
|
|
|
|
#include <AVSCommon/AVS/BlockingPolicy.h>
|
|
|
|
#include <AVSCommon/Utils/JSON/JSONUtils.h>
|
|
|
|
#include <AVSCommon/Utils/LibcurlUtils/HTTPContentFetcherFactory.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/DirectiveHandlerInterface.h>
|
|
|
|
#include <AVSCommon/SDKInterfaces/DirectiveHandlerResultInterface.h>
|
|
|
|
#include <AVSCommon/Utils/Logger/LogEntry.h>
|
|
|
|
#include <SpeechSynthesizer/SpeechSynthesizer.h>
|
|
|
|
|
|
|
|
#include "Integration/ACLTestContext.h"
|
2017-05-26 23:06:14 +00:00
|
|
|
#include "Integration/ClientMessageHandler.h"
|
|
|
|
#include "Integration/ConnectionStatusObserver.h"
|
|
|
|
#include "Integration/ObservableMessageRequest.h"
|
|
|
|
#include "Integration/TestMessageSender.h"
|
|
|
|
#include "Integration/TestSpeechSynthesizerObserver.h"
|
2017-06-09 23:23:31 +00:00
|
|
|
#include "Integration/TestDirectiveHandler.h"
|
|
|
|
#include "Integration/TestExceptionEncounteredSender.h"
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
#ifdef GSTREAMER_MEDIA_PLAYER
|
|
|
|
#include "MediaPlayer/MediaPlayer.h"
|
2017-06-09 23:23:31 +00:00
|
|
|
#else
|
|
|
|
#include "Integration/TestMediaPlayer.h"
|
2017-05-26 23:06:14 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace alexaClientSDK {
|
|
|
|
namespace integration {
|
2017-06-09 23:23:31 +00:00
|
|
|
namespace test {
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
using namespace acl;
|
|
|
|
using namespace adsl;
|
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 afml;
|
2017-06-23 23:26:34 +00:00
|
|
|
using namespace avsCommon;
|
|
|
|
using namespace avsCommon::avs;
|
|
|
|
using namespace avsCommon::avs::attachment;
|
|
|
|
using namespace avsCommon::sdkInterfaces;
|
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::utils::json;
|
2017-06-23 23:26:34 +00:00
|
|
|
using namespace avsCommon::utils::mediaPlayer;
|
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::utils::sds;
|
2017-06-09 23:23:31 +00:00
|
|
|
using namespace capabilityAgents::speechSynthesizer;
|
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 contextManager;
|
2017-05-26 23:06:14 +00:00
|
|
|
using namespace sdkInterfaces;
|
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
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
#ifdef GSTREAMER_MEDIA_PLAYER
|
|
|
|
using namespace mediaPlayer;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This string specifies a Recognize event using the specified profile.
|
|
|
|
*
|
|
|
|
* CLOSE_TALK performs end-of-speech detection on the client, so no directive is sent from AVS to stop recording.
|
|
|
|
* NEAR_FIELD performs end-of-speech detection in AVS, so a directive is sent from AVS to stop recording.
|
|
|
|
*/
|
2017-10-02 22:59:05 +00:00
|
|
|
// clang-format off
|
2017-05-26 23:06:14 +00:00
|
|
|
#define RECOGNIZE_EVENT_JSON(PROFILE, DIALOG_REQUEST_ID ) \
|
|
|
|
"{" \
|
|
|
|
"\"event\":{" \
|
|
|
|
"\"payload\":{" \
|
|
|
|
"\"format\":\"AUDIO_L16_RATE_16000_CHANNELS_1\"," \
|
|
|
|
"\"profile\":\"" #PROFILE "\"" \
|
|
|
|
"}," \
|
|
|
|
"\"header\":{" \
|
|
|
|
"\"dialogRequestId\":\"" DIALOG_REQUEST_ID "\"," \
|
|
|
|
"\"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-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Joke" to be recognized.
|
|
|
|
static const std::string RECOGNIZE_JOKE_AUDIO_FILE_NAME = "/recognize_joke_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Wikipedia" to be recognized.
|
|
|
|
static const std::string RECOGNIZE_WIKI_AUDIO_FILE_NAME = "/recognize_wiki_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Lions" to be recognized.
|
|
|
|
static const std::string RECOGNIZE_LIONS_AUDIO_FILE_NAME = "/recognize_lions_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Flashbriefing" to be recognized.
|
|
|
|
static const std::string RECOGNIZE_FLASHBRIEFING_AUDIO_FILE_NAME = "/recognize_flashbriefing_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "What's up" to be recognized.
|
|
|
|
static const std::string RECOGNIZE_WHATS_UP_AUDIO_FILE_NAME = "/recognize_whats_up_test.wav";
|
|
|
|
// This is a 16 bit 16 kHz little endian linear PCM audio file of "Volume up" to be recognized.
|
|
|
|
static const std::string RECOGNIZE_VOLUME_UP_AUDIO_FILE_NAME = "/recognize_volume_up_test.wav";
|
|
|
|
// String to be used as a basic DialogRequestID.
|
|
|
|
#define FIRST_DIALOG_REQUEST_ID "DialogRequestID123"
|
|
|
|
// String to be used as a DialogRequestID when the first has already been used.
|
|
|
|
#define SECOND_DIALOG_REQUEST_ID "DialogRequestID456"
|
|
|
|
// This string specifies a Recognize event using the CLOSE_TALK profile and uses the first DialogRequestID.
|
|
|
|
static const std::string CT_FIRST_RECOGNIZE_EVENT_JSON = RECOGNIZE_EVENT_JSON(CLOSE_TALK, FIRST_DIALOG_REQUEST_ID);
|
|
|
|
// This string specifies a Recognize event using the CLOSE_TALK profile and uses the first DialogRequestID.
|
|
|
|
static const std::string CT_FIRST_RECOGNIZE_EVENT_JSON_NEAR = RECOGNIZE_EVENT_JSON(NEAR_FIELD, FIRST_DIALOG_REQUEST_ID);
|
|
|
|
// This string specifies a Recognize event using the CLOSE_TALK profile and uses the second DialogRequestID.
|
|
|
|
static const std::string CT_SECOND_RECOGNIZE_EVENT_JSON = RECOGNIZE_EVENT_JSON(CLOSE_TALK, SECOND_DIALOG_REQUEST_ID);
|
|
|
|
// This string to be used for Speak Directives which use the NAMESPACE_SPEECH_SYNTHESIZER namespace.
|
|
|
|
static const std::string NAME_SPEAK = "Speak";
|
|
|
|
// This string to be used for Speak Directives which use the NAMESPACE_SPEECH_SYNTHESIZER namespace.
|
|
|
|
static const std::string NAME_RECOGNIZE = "Recognize";
|
|
|
|
// This string to be used for AdjustVolume Directives which use the NAMESPACE_SPEAKER namespace.
|
|
|
|
static const std::string NAME_ADJUST_VOLUME = "AdjustVolume";
|
|
|
|
// This string to be used for ExpectSpeech Directives which use the NAMESPACE_SPEECH_RECOGNIZER namespace.
|
|
|
|
static const std::string NAME_EXPECT_SPEECH = "ExpectSpeech";
|
|
|
|
// This string to be used for SetMute Directives which use the NAMESPACE_SPEAKER namespace.
|
|
|
|
static const std::string NAME_SET_MUTE = "SetMute";
|
|
|
|
// This string to be used for SpeechStarted Directives which use the NAMESPACE_SPEECH_SYNTHESIZER namespace.
|
|
|
|
static const std::string NAME_SPEECH_STARTED = "SpeechStarted";
|
|
|
|
// This string to be used for SpeechFinished Directives which use the NAMESPACE_SPEECH_SYNTHESIZER namespace.
|
|
|
|
static const std::string NAME_SPEECH_FINISHED = "SpeechFinished";
|
|
|
|
// This String to be used to register the SpeechRecognizer namespace to a DirectiveHandler.
|
|
|
|
static const std::string NAMESPACE_SPEECH_RECOGNIZER = "SpeechRecognizer";
|
|
|
|
// This String to be used to register the SpeechSynthesizer namespace to a DirectiveHandler.
|
|
|
|
static const std::string NAMESPACE_SPEECH_SYNTHESIZER = "SpeechSynthesizer";
|
2017-06-23 23:26:34 +00:00
|
|
|
// This String to be used to register the Speaker namespace to a DirectiveHandler.
|
2017-05-26 23:06:14 +00:00
|
|
|
static const std::string NAMESPACE_SPEAKER = "Speaker";
|
|
|
|
// This pair connects a Speak name and SpeechSynthesizer namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName SPEAK_PAIR = {NAMESPACE_SPEECH_SYNTHESIZER, NAME_SPEAK};
|
|
|
|
// This pair connects a ExpectSpeech name and SpeechRecognizer namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName EXPECT_SPEECH_PAIR = {NAMESPACE_SPEECH_RECOGNIZER, NAME_EXPECT_SPEECH};
|
|
|
|
// This pair connects a SetMute name and Speaker namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName SET_MUTE_PAIR = {NAMESPACE_SPEAKER, NAME_SET_MUTE};
|
|
|
|
// This pair connects a SetMute name and Speaker namespace for use in DirectiveHandler registration.
|
|
|
|
static const NamespaceAndName ADJUST_VOLUME_PAIR = {NAMESPACE_SPEAKER, NAME_ADJUST_VOLUME};
|
|
|
|
// Sample dialog activity id.
|
|
|
|
static const std::string DIALOG_ACTIVITY_ID = "Dialog";
|
|
|
|
/// Sample alerts activity id.
|
|
|
|
static const std::string ALERTS_ACTIVITY_ID = "Alerts";
|
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
|
|
|
// A timeout in seconds for a directive to reach the DirectiveHandler.
|
2017-05-26 23:06:14 +00:00
|
|
|
static const std::chrono::seconds WAIT_FOR_TIMEOUT_DURATION(15);
|
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
|
|
|
// A timeout in seconds for an event to be sent to @c AVS.
|
2017-06-23 23:26:34 +00:00
|
|
|
static const std::chrono::seconds SEND_EVENT_TIMEOUT_DURATION(20);
|
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
|
|
|
// A timeout in seconds for a directive to reach the DirectiveHandler.
|
2017-05-26 23:06:14 +00:00
|
|
|
static const std::chrono::seconds DIRECTIVE_TIMEOUT_DURATION(7);
|
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
|
|
|
// Timeout to use when expecting o reach the timeout.
|
2017-05-26 23:06:14 +00:00
|
|
|
static const std::chrono::seconds WANTING_TIMEOUT_DURATION(1);
|
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
|
|
|
// A timeout in seconds for the Media Player to finish playing.
|
2017-09-19 22:08:49 +00:00
|
|
|
static const std::chrono::seconds WAIT_FOR_MEDIA_PLAYER_TIMEOUT_DURATION(60);
|
|
|
|
// This Integer to be used to specify number of Speak Directives to validate in test handleMultipleConsecutiveSpeaks.
|
|
|
|
// Although we anticipate four Speak Directives, we validate only three Speak Directives.
|
|
|
|
// Validating three Speak Directives helps keep the test short.
|
|
|
|
static const unsigned int NUMBER_OF_SPEAK_DIRECTIVES_TO_VALIDATE = 3;
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
/// JSON key to get the event object of a message.
|
|
|
|
static const std::string JSON_MESSAGE_EVENT_KEY = "event";
|
|
|
|
/// JSON key to get the directive object of a message.
|
|
|
|
static const std::string JSON_MESSAGE_DIRECTIVE_KEY = "directive";
|
|
|
|
/// JSON key to get the header object of a message.
|
|
|
|
static const std::string JSON_MESSAGE_HEADER_KEY = "header";
|
|
|
|
/// JSON key to get the namespace value of a header.
|
|
|
|
static const std::string JSON_MESSAGE_NAMESPACE_KEY = "namespace";
|
|
|
|
/// JSON key to get the name value of a header.
|
|
|
|
static const std::string JSON_MESSAGE_NAME_KEY = "name";
|
|
|
|
/// JSON key to get the messageId value of a header.
|
|
|
|
static const std::string JSON_MESSAGE_MESSAGE_ID_KEY = "messageId";
|
|
|
|
/// JSON key to get the dialogRequestId value of a header.
|
|
|
|
static const std::string JSON_MESSAGE_DIALOG_REQUEST_ID_KEY = "dialogRequestId";
|
|
|
|
/// JSON key to get the payload object of a message.
|
|
|
|
static const std::string JSON_MESSAGE_PAYLOAD_KEY = "payload";
|
|
|
|
|
|
|
|
/// String to identify log entries originating from this file.
|
|
|
|
static const std::string TAG("SpeechSynthesizerIntegrationTest");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a LogEntry using this file's TAG and the specified event string.
|
|
|
|
*
|
|
|
|
* @param The event string for this @c LogEntry.
|
|
|
|
*/
|
2017-06-23 23:26:34 +00:00
|
|
|
#define LX(event) alexaClientSDK::avsCommon::utils::logger::LogEntry(TAG, event)
|
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
|
|
|
/// 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-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
/// A test observer that mocks out the ChannelObserverInterface##onFocusChanged() call.
|
|
|
|
class TestClient : public ChannelObserverInterface {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*/
|
2017-10-02 22:59:05 +00:00
|
|
|
TestClient() : m_focusState(FocusState::NONE) {
|
2017-05-26 23:06:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implementation of the ChannelObserverInterface##onFocusChanged() callback.
|
|
|
|
*
|
|
|
|
* @param focusState The new focus state of the Channel observer.
|
|
|
|
*/
|
|
|
|
void onFocusChanged(FocusState focusState) override {
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
|
|
|
m_queue.push_back(focusState);
|
|
|
|
m_focusState = focusState;
|
|
|
|
m_wakeTrigger.notify_all();
|
|
|
|
}
|
2017-06-23 23:26:34 +00:00
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
/**
|
|
|
|
* Waits for the ChannelObserverInterface##onFocusChanged() callback.
|
|
|
|
*
|
|
|
|
* @param timeout The amount of time to wait for the callback.
|
|
|
|
* @param focusChanged An output parameter that notifies the caller whether a callback occurred.
|
|
|
|
* @return Returns @c true if the callback occured within the timeout period and @c false otherwise.
|
|
|
|
*/
|
|
|
|
FocusState waitForFocusChange(std::chrono::milliseconds timeout) {
|
|
|
|
FocusState ret;
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
|
|
|
if (!m_wakeTrigger.wait_for(lock, timeout, [this]() { return !m_queue.empty(); })) {
|
|
|
|
ret = m_focusState;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
ret = m_queue.front();
|
|
|
|
m_queue.pop_front();
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
FocusState getCurrentFocusState() {
|
|
|
|
return m_focusState;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
/// The focus state of the observer.
|
|
|
|
FocusState m_focusState;
|
|
|
|
|
|
|
|
/// A lock to guard against focus state changes.
|
|
|
|
std::mutex m_mutex;
|
|
|
|
|
|
|
|
/// Trigger to wake up waitForNext calls.
|
|
|
|
std::condition_variable m_wakeTrigger;
|
|
|
|
/// Queue of received focus states that have not been waited on.
|
|
|
|
std::deque<FocusState> m_queue;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SpeechSynthesizerTest : public ::testing::Test {
|
|
|
|
protected:
|
|
|
|
virtual 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-06-09 23:23:31 +00:00
|
|
|
m_exceptionEncounteredSender = std::make_shared<TestExceptionEncounteredSender>();
|
2017-12-09 00:07:37 +00:00
|
|
|
m_dialogUXStateAggregator = std::make_shared<avsCommon::avs::DialogUXStateAggregator>();
|
2017-06-23 23:26:34 +00:00
|
|
|
|
|
|
|
DirectiveHandlerConfiguration config;
|
|
|
|
config[SET_MUTE_PAIR] = BlockingPolicy::BLOCKING;
|
|
|
|
config[ADJUST_VOLUME_PAIR] = BlockingPolicy::BLOCKING;
|
|
|
|
config[EXPECT_SPEECH_PAIR] = BlockingPolicy::BLOCKING;
|
|
|
|
m_directiveHandler = std::make_shared<TestDirectiveHandler>(config);
|
|
|
|
|
2017-06-09 23:23:31 +00:00
|
|
|
m_directiveSequencer = DirectiveSequencer::create(m_exceptionEncounteredSender);
|
2017-05-26 23:06:14 +00:00
|
|
|
m_messageInterpreter = std::make_shared<MessageInterpreter>(
|
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_exceptionEncounteredSender, m_directiveSequencer, m_context->getAttachmentManager());
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// Set up connection and connect
|
|
|
|
m_avsConnectionManager = std::make_shared<TestMessageSender>(
|
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_messageInterpreter);
|
|
|
|
ASSERT_TRUE(m_avsConnectionManager);
|
|
|
|
|
2017-05-26 23:06:14 +00:00
|
|
|
connect();
|
|
|
|
|
Version 1.8 alexa-client-sdk
Changes in this update:
Enhancements
Added local stop functionality. This allows a user to stop an active function, such as an alert or timer, by uttering "Alexa, stop" when an Alexa-enabled product is offline.
Alerts in the background now stream in 10 sec intervals, rather than continuously.
Added support for France to the sample app.
friendlyName can now be updated for BlueZ implementations of BlueZBluetoothDevice and BlueZHostController.
Bug Fixes
Fixed an issue where the Bluetooth agent didn't clear user data upon reset, including paired devices and the uuidMapping table.
Fixed MediaPlayer threading issues. Now each instance has it's own glib main loop thread, rather than utilizing the default main context worker thread.
Fixed segmentation fault issues that occurred when certain static initializers needed to be initialized in a certain order, but the order wasn't defined.
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.
The Alexa app doesn't always indicate when a device is successfully connected via Bluetooth.
Connecting a product to streaming media via Bluetooth will sometimes stop media playback within the source application. Resuming playback through the source application or toggling next/previous will correct playback.
When a source device is streaming silence via Bluetooth, the Alexa companion app indicates that audio content is streaming.
The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation is not yet supported.
On some products, interrupted Bluetooth playback may not resume if other content is locally streamed.
On Raspberry Pi, when streaming audio via Bluetooth, sometimes the audio stream stutters.
On Raspberry Pi, BlueALSA must be terminated each time the device boots. See Raspberry Pi Quick Start Guide for more information.
2018-06-27 21:41:15 +00:00
|
|
|
m_focusManager = std::make_shared<FocusManager>(FocusManager::getDefaultAudioChannels());
|
2017-05-26 23:06:14 +00:00
|
|
|
m_testClient = std::make_shared<TestClient>();
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_TRUE(
|
|
|
|
m_focusManager->acquireChannel(FocusManager::ALERTS_CHANNEL_NAME, m_testClient, ALERTS_ACTIVITY_ID));
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
|
|
|
|
#ifdef GSTREAMER_MEDIA_PLAYER
|
2017-10-30 22:14:38 +00:00
|
|
|
m_mediaPlayer =
|
|
|
|
MediaPlayer::create(std::make_shared<avsCommon::utils::libcurlUtils::HTTPContentFetcherFactory>());
|
2017-06-09 23:23:31 +00:00
|
|
|
#else
|
|
|
|
m_mediaPlayer = std::make_shared<TestMediaPlayer>();
|
2017-05-26 23:06:14 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Create and register the SpeechSynthesizer.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_speechSynthesizer = SpeechSynthesizer::create(
|
2017-10-02 22:59:05 +00:00
|
|
|
m_mediaPlayer,
|
|
|
|
m_avsConnectionManager,
|
|
|
|
m_focusManager,
|
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->getContextManager(),
|
2017-12-09 00:07:37 +00:00
|
|
|
m_exceptionEncounteredSender,
|
|
|
|
m_dialogUXStateAggregator);
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->addDirectiveHandler(m_speechSynthesizer);
|
|
|
|
m_speechSynthesizerObserver = std::make_shared<TestSpeechSynthesizerObserver>();
|
2017-05-26 23:06:14 +00:00
|
|
|
m_speechSynthesizer->addObserver(m_speechSynthesizerObserver);
|
2017-12-09 00:07:37 +00:00
|
|
|
m_speechSynthesizer->addObserver(m_dialogUXStateAggregator);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
ASSERT_TRUE(m_directiveSequencer->addDirectiveHandler(m_directiveHandler));
|
2017-05-26 23:06:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send and event to AVS. Blocks until a status is received.
|
|
|
|
*
|
|
|
|
* @param message The message to send.
|
|
|
|
* @param expectStatus The status to expect from the call to send the message.
|
|
|
|
* @param timeout How long to wait for a result from delivering the message.
|
|
|
|
*/
|
2017-10-02 22:59:05 +00:00
|
|
|
void sendEvent(
|
|
|
|
const std::string& jsonContent,
|
|
|
|
std::shared_ptr<avsCommon::avs::attachment::AttachmentReader> attachmentReader,
|
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status expectedStatus,
|
|
|
|
std::chrono::seconds timeout) {
|
2017-05-26 23:06:14 +00:00
|
|
|
auto messageRequest = std::make_shared<ObservableMessageRequest>(jsonContent, attachmentReader);
|
|
|
|
m_avsConnectionManager->sendMessage(messageRequest);
|
|
|
|
ASSERT_TRUE(messageRequest->waitFor(expectedStatus, timeout));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function to setup a message and send it to AVS.
|
|
|
|
*
|
|
|
|
* @param json A JSON string containing the message to send.
|
|
|
|
* @param expectStatus The status to expect from the call to send the message.
|
|
|
|
* @param timeout How long to wait for a result from delivering the message.
|
|
|
|
*/
|
|
|
|
void setupMessageAndSend(
|
2017-10-02 22:59:05 +00:00
|
|
|
const std::string& json,
|
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status expectedStatus,
|
|
|
|
std::chrono::seconds timeout) {
|
2017-05-26 23:06:14 +00:00
|
|
|
sendEvent(json, nullptr, expectedStatus, timeout);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function to setup a message with an attachment and send it to AVS.
|
|
|
|
*
|
|
|
|
* @param json A JSON string containing the message to send.
|
|
|
|
* @param file Name of the file to read the attachment from.
|
|
|
|
* @param expectStatus The status to expect from the call to send the message.
|
|
|
|
* @param timeout How long to wait for a result from delivering the message.
|
|
|
|
*/
|
|
|
|
void setupMessageWithAttachmentAndSend(
|
2017-10-02 22:59:05 +00:00
|
|
|
const std::string& json,
|
|
|
|
std::string& file,
|
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status expectedStatus,
|
|
|
|
std::chrono::seconds timeout) {
|
2017-05-26 23:06:14 +00:00
|
|
|
auto is = std::make_shared<std::ifstream>(file, std::ios::binary);
|
|
|
|
ASSERT_TRUE(is->is_open());
|
|
|
|
|
|
|
|
const int mbBytes = 1024 * 1024;
|
|
|
|
|
|
|
|
std::vector<char> localBuffer(mbBytes);
|
|
|
|
|
|
|
|
auto bufferSize = InProcessSDS::calculateBufferSize(localBuffer.size());
|
|
|
|
auto buffer = std::make_shared<InProcessSDSTraits::Buffer>(bufferSize);
|
|
|
|
std::shared_ptr<InProcessSDS> sds = InProcessSDS::create(buffer);
|
|
|
|
|
|
|
|
auto attachmentWriter = InProcessAttachmentWriter::create(sds);
|
|
|
|
|
|
|
|
while (*is) {
|
|
|
|
is->read(localBuffer.data(), mbBytes);
|
|
|
|
size_t numBytesRead = is->gcount();
|
|
|
|
AttachmentWriter::WriteStatus writeStatus = AttachmentWriter::WriteStatus::OK;
|
|
|
|
attachmentWriter->write(localBuffer.data(), numBytesRead, &writeStatus);
|
|
|
|
|
|
|
|
// write status should be either OK or CLOSED
|
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
|
|
|
ASSERT_TRUE(writeStatusOk);
|
|
|
|
}
|
|
|
|
|
|
|
|
attachmentWriter->close();
|
|
|
|
|
|
|
|
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
|
|
|
ASSERT_NE(attachmentReader, nullptr);
|
|
|
|
|
|
|
|
sendEvent(json, attachmentReader, expectedStatus, std::chrono::seconds(timeout));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Waits for the ChannelObserverInterface##onFocusChanged() callback.
|
|
|
|
*
|
|
|
|
* @param timeout The amount of time to wait for the callback.
|
|
|
|
* @param focusChanged An output parameter that notifies the caller whether a callback occurred.
|
|
|
|
* @return Returns @c true if the callback occured within the timeout period and @c false otherwise.
|
|
|
|
*/
|
|
|
|
FocusState waitForFocusChange(std::chrono::milliseconds timeout) {
|
|
|
|
std::unique_lock<std::mutex> lock(m_mutex);
|
2017-10-02 22:59:05 +00:00
|
|
|
m_focusChanged.wait_for(lock, timeout, [this]() { return m_focusChangeOccurred; });
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
return m_focusState;
|
|
|
|
}
|
|
|
|
|
|
|
|
void TearDown() override {
|
|
|
|
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
|
|
|
// Note that these nullptr checks are needed to avoid segaults if @c SetUp() failed.
|
|
|
|
if (m_speechSynthesizer) {
|
|
|
|
// m_speechSynthesizer->removeObserver(m_dialogUXStateAggregator);
|
|
|
|
m_speechSynthesizer->shutdown();
|
|
|
|
}
|
|
|
|
if (m_directiveSequencer) {
|
|
|
|
m_directiveSequencer->shutdown();
|
|
|
|
}
|
|
|
|
if (m_avsConnectionManager) {
|
|
|
|
m_avsConnectionManager->shutdown();
|
|
|
|
}
|
|
|
|
#ifdef GSTREAMER_MEDIA_PLAYER
|
|
|
|
if (m_mediaPlayer) {
|
|
|
|
m_mediaPlayer->shutdown();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
m_context.reset();
|
2017-05-26 23:06:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Connect to AVS.
|
|
|
|
*/
|
|
|
|
void connect() {
|
|
|
|
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-05-26 23:06:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disconnect from AVS.
|
|
|
|
*/
|
|
|
|
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-05-26 23:06:14 +00:00
|
|
|
}
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
bool checkSentEventName(TestMessageSender::SendParams sendParams, std::string expectedName) {
|
2017-05-26 23:06:14 +00:00
|
|
|
if (TestMessageSender::SendParams::Type::SEND == sendParams.type) {
|
|
|
|
std::string eventString;
|
|
|
|
std::string eventHeader;
|
|
|
|
std::string eventName;
|
2017-10-30 22:14:38 +00:00
|
|
|
jsonUtils::retrieveValue(sendParams.request->getJsonContent(), JSON_MESSAGE_EVENT_KEY, &eventString);
|
|
|
|
jsonUtils::retrieveValue(eventString, JSON_MESSAGE_HEADER_KEY, &eventHeader);
|
|
|
|
jsonUtils::retrieveValue(eventHeader, JSON_MESSAGE_NAME_KEY, &eventName);
|
2017-05-26 23:06:14 +00:00
|
|
|
return eventName == expectedName;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
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-05-26 23:06:14 +00:00
|
|
|
std::shared_ptr<TestMessageSender> m_avsConnectionManager;
|
2017-06-09 23:23:31 +00:00
|
|
|
std::shared_ptr<TestExceptionEncounteredSender> m_exceptionEncounteredSender;
|
2017-05-26 23:06:14 +00:00
|
|
|
std::shared_ptr<TestDirectiveHandler> m_directiveHandler;
|
|
|
|
std::shared_ptr<DirectiveSequencerInterface> m_directiveSequencer;
|
|
|
|
std::shared_ptr<MessageInterpreter> m_messageInterpreter;
|
|
|
|
std::shared_ptr<TestSpeechSynthesizerObserver> m_speechSynthesizerObserver;
|
|
|
|
std::shared_ptr<SpeechSynthesizer> m_speechSynthesizer;
|
2017-12-09 00:07:37 +00:00
|
|
|
std::shared_ptr<avsCommon::avs::DialogUXStateAggregator> m_dialogUXStateAggregator;
|
2017-05-26 23:06:14 +00:00
|
|
|
std::shared_ptr<FocusManager> m_focusManager;
|
|
|
|
std::shared_ptr<TestClient> m_testClient;
|
|
|
|
FocusState m_focusState;
|
|
|
|
std::mutex m_mutex;
|
|
|
|
std::condition_variable m_focusChanged;
|
|
|
|
bool m_focusChangeOccurred;
|
|
|
|
|
|
|
|
#ifdef GSTREAMER_MEDIA_PLAYER
|
|
|
|
std::shared_ptr<MediaPlayer> m_mediaPlayer;
|
|
|
|
#else
|
2017-06-09 23:23:31 +00:00
|
|
|
std::shared_ptr<TestMediaPlayer> m_mediaPlayer;
|
2017-05-26 23:06:14 +00:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test ability for the SpeechSynthesizer to handle one Speak directive.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* This test is intended to test the SpeechSynthesizer's ability to receive one directive, play it using a MediaPlayer
|
|
|
|
* then return to a finished state.
|
2017-05-26 23:06:14 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
TEST_F(SpeechSynthesizerTest, handleOneSpeech) {
|
2017-12-09 00:07:37 +00:00
|
|
|
// SpeechSynthesizerObserverInterface defaults to a FINISHED state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// Send audio of "Joke" that will prompt SetMute and Speak.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(FIRST_DIALOG_REQUEST_ID);
|
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
|
|
|
std::string file = g_inputPath + RECOGNIZE_JOKE_AUDIO_FILE_NAME;
|
2017-05-26 23:06:14 +00:00
|
|
|
setupMessageWithAttachmentAndSend(
|
|
|
|
CT_FIRST_RECOGNIZE_EVENT_JSON,
|
|
|
|
file,
|
2017-10-02 22:59:05 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
2017-05-26 23:06:14 +00:00
|
|
|
SEND_EVENT_TIMEOUT_DURATION);
|
|
|
|
|
|
|
|
TestMessageSender::SendParams sendRecognizeParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendRecognizeParams, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Wait for the directive to route through to our handler.
|
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::PREHANDLE);
|
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::HANDLE);
|
|
|
|
|
|
|
|
// Unblock the queue so SpeechSynthesizer can do its work.
|
|
|
|
params.result->setCompleted();
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechSynthesizer is now playing.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::GAINING_FOCUS);
|
|
|
|
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::PLAYING);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that SS grabs the channel focus by seeing that the test client has been backgrounded.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// SpeechStarted was sent.
|
2017-05-26 23:06:14 +00:00
|
|
|
TestMessageSender::SendParams sendStartedParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Media Player has finished.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// SpeechFinished is sent here.
|
|
|
|
TestMessageSender::SendParams sendFinishedParams = m_avsConnectionManager->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Alerts channel regains the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test ability for the SpeechSynthesizer to handle multiple consecutive Speak directives.
|
|
|
|
*
|
2017-10-02 22:59:05 +00:00
|
|
|
* This test is intended to test the SpeechSynthesizer's ability to receive multiple directives, play each using a
|
|
|
|
* MediaPlayer then return to a finished state and notify the DirectiveSequencer that the directive was handled. This is
|
|
|
|
* done by sending a Recognize event to AVS with audio of "What's up?" which returns four sets of SetMute and Speak.
|
2017-05-26 23:06:14 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
TEST_F(SpeechSynthesizerTest, handleMultipleConsecutiveSpeaks) {
|
2017-12-09 00:07:37 +00:00
|
|
|
// SpeechSynthesizerObserverInterface defaults to a FINISHED state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// Send audio of "What's up" that will prompt four sets of SetMute and Speak.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(FIRST_DIALOG_REQUEST_ID);
|
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
|
|
|
std::string file = g_inputPath + RECOGNIZE_WHATS_UP_AUDIO_FILE_NAME;
|
2017-05-26 23:06:14 +00:00
|
|
|
setupMessageWithAttachmentAndSend(
|
|
|
|
CT_FIRST_RECOGNIZE_EVENT_JSON,
|
|
|
|
file,
|
2017-10-02 22:59:05 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
2017-05-26 23:06:14 +00:00
|
|
|
SEND_EVENT_TIMEOUT_DURATION);
|
|
|
|
|
|
|
|
TestMessageSender::SendParams sendRecognizeParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendRecognizeParams, NAME_RECOGNIZE));
|
|
|
|
|
2017-09-19 22:08:49 +00:00
|
|
|
for (unsigned int x = 0; x < NUMBER_OF_SPEAK_DIRECTIVES_TO_VALIDATE; ++x) {
|
2017-05-26 23:06:14 +00:00
|
|
|
// Each iteration, remove the blocking setMute directive.
|
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::HANDLE) {
|
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
}
|
|
|
|
params.result->setCompleted();
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechSynthesizer is now speaking.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::GAINING_FOCUS);
|
|
|
|
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::PLAYING);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that SS grabs the channel focus by seeing that the test client has been backgrounded.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// SpeechStarted has sent.
|
2017-10-02 22:59:05 +00:00
|
|
|
TestMessageSender::SendParams sendStartedParams =
|
|
|
|
m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(sendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
|
|
|
// Media Player has finished.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_MEDIA_PLAYER_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// SpeechFinished was sent.
|
2017-10-02 22:59:05 +00:00
|
|
|
TestMessageSender::SendParams sendFinishedParams =
|
|
|
|
m_avsConnectionManager->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(sendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
|
|
|
// Alerts channel regains the foreground.
|
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test ability for the SpeechSynthesizer to handle one Speak directive.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* This test is intended to test the SpeechSynthesizer's ability to receive one directive, play it using a MediaPlayer
|
|
|
|
* then return to a finished state. Once the Speak reaches the SpeechSynthesizer, the dialogRequestID is changed and
|
2017-05-26 23:06:14 +00:00
|
|
|
* all directives are cancelled.
|
|
|
|
*
|
|
|
|
*/
|
2017-06-23 23:26:34 +00:00
|
|
|
TEST_F(SpeechSynthesizerTest, bargeInOnOneSpeech) {
|
2017-12-09 00:07:37 +00:00
|
|
|
// SpeechSynthesizerObserverInterface defaults to a FINISHED state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// Send audio of "Joke" that will prompt SetMute and Speak.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(FIRST_DIALOG_REQUEST_ID);
|
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
|
|
|
std::string file = g_inputPath + RECOGNIZE_JOKE_AUDIO_FILE_NAME;
|
2017-05-26 23:06:14 +00:00
|
|
|
setupMessageWithAttachmentAndSend(
|
|
|
|
CT_FIRST_RECOGNIZE_EVENT_JSON,
|
|
|
|
file,
|
2017-10-02 22:59:05 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
2017-05-26 23:06:14 +00:00
|
|
|
SEND_EVENT_TIMEOUT_DURATION);
|
|
|
|
|
|
|
|
TestMessageSender::SendParams sendRecognizeParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendRecognizeParams, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Wait for the directive to route through to our handler.
|
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::PREHANDLE);
|
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::HANDLE);
|
|
|
|
|
|
|
|
// Unblock the queue so SpeechSynthesizer can do its work.
|
|
|
|
params.result->setCompleted();
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechSynthesizer is now speaking.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::GAINING_FOCUS);
|
|
|
|
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::PLAYING);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// Change the dialogRequestID to cancel the queued directives.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(SECOND_DIALOG_REQUEST_ID);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that SS grabs the channel focus by seeing that the test client has been backgrounded.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// SpeechStarted was sent.
|
2017-05-26 23:06:14 +00:00
|
|
|
TestMessageSender::SendParams sendStartedParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
|
|
|
// SpeechSynthesizer has finished.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// No SpeechFinished was sent.
|
|
|
|
TestMessageSender::SendParams sendFinishedParams = m_avsConnectionManager->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_FALSE(checkSentEventName(sendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Alerts channel regains the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test ability for the SpeechSynthesizer to handle a barge in at the begining of consucutive speaks.
|
|
|
|
*
|
2017-10-02 22:59:05 +00:00
|
|
|
* This test is intended to test the SpeechSynthesizer's ability to receive multiple directives, play each using a
|
|
|
|
* MediaPlayer then return to a finished state and notify the DirectiveSequencer that the directive was handled. This is
|
|
|
|
* done by sending a Recognize event to AVS with audio of "What's up?" which returns four sets of SetMute and Speak.
|
|
|
|
* Once the first Speak reaches the SpeechSynthesizer, the dialogRequestID is changed and all directives are cancelled.
|
2017-05-26 23:06:14 +00:00
|
|
|
*
|
|
|
|
*/
|
2017-06-23 23:26:34 +00:00
|
|
|
TEST_F(SpeechSynthesizerTest, bargeInOnMultipleSpeaksAtTheBeginning) {
|
2017-12-09 00:07:37 +00:00
|
|
|
// SpeechSynthesizerObserverInterface defaults to a FINISHED state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// Send audio of "What's Up" that will prompt four sets of SetMute and Speak.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(FIRST_DIALOG_REQUEST_ID);
|
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
|
|
|
std::string file = g_inputPath + RECOGNIZE_WHATS_UP_AUDIO_FILE_NAME;
|
2017-05-26 23:06:14 +00:00
|
|
|
setupMessageWithAttachmentAndSend(
|
|
|
|
CT_FIRST_RECOGNIZE_EVENT_JSON,
|
|
|
|
file,
|
2017-10-02 22:59:05 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
2017-05-26 23:06:14 +00:00
|
|
|
SEND_EVENT_TIMEOUT_DURATION);
|
|
|
|
|
|
|
|
TestMessageSender::SendParams sendRecognizeParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendRecognizeParams, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Wait for the directive to route through to our handler.
|
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
|
|
|
|
// While blocked, change the dialogRequestID.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(SECOND_DIALOG_REQUEST_ID);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.type == TestDirectiveHandler::DirectiveParams::Type::HANDLE) {
|
|
|
|
params.result->setCompleted();
|
|
|
|
}
|
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
}
|
2017-10-02 22:59:05 +00:00
|
|
|
|
|
|
|
// SpeechSynthesizer is still finished.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WANTING_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that the test client is still in the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WANTING_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechStarted is not sent.
|
|
|
|
TestMessageSender::SendParams canceledSendStartedParams =
|
|
|
|
m_avsConnectionManager->waitForNext(WANTING_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_FALSE(checkSentEventName(canceledSendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
|
|
|
// Media Player has not changed.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WANTING_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// SpeechFinished is not sent.
|
2017-10-02 22:59:05 +00:00
|
|
|
TestMessageSender::SendParams canceledSendFinishedParams =
|
|
|
|
m_avsConnectionManager->waitForNext(WANTING_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_FALSE(checkSentEventName(canceledSendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Alerts channel regains the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WANTING_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-06-23 23:26:34 +00:00
|
|
|
}
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test ability for the SpeechSynthesizer to handle a barge in in the middle of consucutive speaks.
|
|
|
|
*
|
2017-10-02 22:59:05 +00:00
|
|
|
* This test is intended to test the SpeechSynthesizer's ability to receive multiple directives, play each using a
|
|
|
|
* MediaPlayer then return to a finished state and notify the DirectiveSequencer that the directive was handled. This is
|
|
|
|
* done by sending a Recognize event to AVS with audio of "What's up?" which returns four sets of SetMute and Speak.
|
|
|
|
* While the Speak directives are being handled, the dialogRequestID is changed and all directives are cancelled.
|
2017-05-26 23:06:14 +00:00
|
|
|
*
|
|
|
|
*/
|
2017-06-23 23:26:34 +00:00
|
|
|
TEST_F(SpeechSynthesizerTest, bargeInOnMultipleSpeaksInTheMiddle) {
|
2017-12-09 00:07:37 +00:00
|
|
|
// SpeechSynthesizerObserverInterface defaults to a FINISHED state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// Send audio of "What's up" that will prompt four sets of SetMute and Speak.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(FIRST_DIALOG_REQUEST_ID);
|
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
|
|
|
std::string file = g_inputPath + RECOGNIZE_WHATS_UP_AUDIO_FILE_NAME;
|
2017-05-26 23:06:14 +00:00
|
|
|
setupMessageWithAttachmentAndSend(
|
|
|
|
CT_FIRST_RECOGNIZE_EVENT_JSON,
|
|
|
|
file,
|
2017-10-02 22:59:05 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
2017-05-26 23:06:14 +00:00
|
|
|
SEND_EVENT_TIMEOUT_DURATION);
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
TestMessageSender::SendParams sendRecognizeParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(sendRecognizeParams, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Wait for the directive to route through to our handler.
|
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
bool handleFound = false;
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT && !handleFound) {
|
|
|
|
if (params.type == TestDirectiveHandler::DirectiveParams::Type::HANDLE) {
|
|
|
|
handleFound = true;
|
2017-06-23 23:26:34 +00:00
|
|
|
} else {
|
2017-05-26 23:06:14 +00:00
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
2017-06-23 23:26:34 +00:00
|
|
|
}
|
2017-05-26 23:06:14 +00:00
|
|
|
}
|
|
|
|
ASSERT_TRUE(handleFound);
|
|
|
|
|
|
|
|
// Unblock the queue so SS can do its work.
|
|
|
|
params.result->setCompleted();
|
2017-10-02 22:59:05 +00:00
|
|
|
|
|
|
|
// SpeechSynthesizer is now speaking.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::GAINING_FOCUS);
|
|
|
|
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::PLAYING);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that SS grabs the channel focus by seeing that the test client has been backgrounded.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// SpeechStarted is sent.
|
2017-05-26 23:06:14 +00:00
|
|
|
TestMessageSender::SendParams sendStartedParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Media Player has finished.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// SpeechFinished is sent here.
|
|
|
|
TestMessageSender::SendParams sendFinishedParams = m_avsConnectionManager->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Alerts channel regains the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
|
|
|
|
// While blocked, change the dialogRequestID to cancel the queued directives.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(SECOND_DIALOG_REQUEST_ID);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
|
|
|
if (params.type == TestDirectiveHandler::DirectiveParams::Type::HANDLE) {
|
|
|
|
// Unblock the queue so SS can do its work.
|
|
|
|
params.result->setCompleted();
|
|
|
|
}
|
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
}
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechSynthesizer is still finished.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WANTING_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that the test client is still in the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WANTING_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechStarted is not sent.
|
|
|
|
TestMessageSender::SendParams canceledSendStartedParams =
|
|
|
|
m_avsConnectionManager->waitForNext(WANTING_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_FALSE(checkSentEventName(canceledSendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
|
|
|
// Media Player has not changed.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WANTING_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// SpeechFinished is not sent.
|
2017-10-02 22:59:05 +00:00
|
|
|
TestMessageSender::SendParams canceledSendFinishedParams =
|
|
|
|
m_avsConnectionManager->waitForNext(WANTING_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_FALSE(checkSentEventName(canceledSendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Alerts channel regains the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WANTING_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
2017-06-23 23:26:34 +00:00
|
|
|
}
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test ability for the SpeechSynthesizer to handle a Multiturn scenario.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* This test is intended to test the SpeechSynthesizer's ability to receive one directive, play it using a MediaPlayer
|
2017-10-02 22:59:05 +00:00
|
|
|
* then return to a finished state. Another recognize event is then sent to AVS is response to the ExpectSpeech
|
|
|
|
* directive which prompts another Speak directive to be handled.
|
2017-05-26 23:06:14 +00:00
|
|
|
*/
|
|
|
|
TEST_F(SpeechSynthesizerTest, multiturnScenario) {
|
2017-12-09 00:07:37 +00:00
|
|
|
// SpeechSynthesizerObserverInterface defaults to a FINISHED state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// Send audio of "Wikipedia" that will prompt SetMute, Speak, and ExpectSpeech.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(FIRST_DIALOG_REQUEST_ID);
|
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
|
|
|
std::string file = g_inputPath + RECOGNIZE_WIKI_AUDIO_FILE_NAME;
|
2017-05-26 23:06:14 +00:00
|
|
|
setupMessageWithAttachmentAndSend(
|
|
|
|
CT_FIRST_RECOGNIZE_EVENT_JSON,
|
|
|
|
file,
|
2017-10-02 22:59:05 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
2017-05-26 23:06:14 +00:00
|
|
|
SEND_EVENT_TIMEOUT_DURATION);
|
|
|
|
|
|
|
|
TestMessageSender::SendParams sendRecognizeParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendRecognizeParams, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Wait for the directive to route through to our handler.
|
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_NE(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
2017-06-23 23:26:34 +00:00
|
|
|
while (params.type == TestDirectiveHandler::DirectiveParams::Type::HANDLE) {
|
2017-05-26 23:06:14 +00:00
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
}
|
|
|
|
params.result->setCompleted();
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechSynthesizer is now speaking.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::GAINING_FOCUS);
|
|
|
|
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::PLAYING);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Check that SS grabs the channel focus by seeing that the test client has been backgrounded.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// SpeechStarted is sent.
|
2017-05-26 23:06:14 +00:00
|
|
|
TestMessageSender::SendParams sendStartedParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
|
|
|
// Media Player has finished.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// SpeechFinished is sent here.
|
|
|
|
TestMessageSender::SendParams sendFinishedParams = m_avsConnectionManager->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_TRUE(checkSentEventName(sendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Alerts channel regains the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
2017-06-23 23:26:34 +00:00
|
|
|
bool expectSpeechFound = false;
|
2017-05-26 23:06:14 +00:00
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
2017-06-23 23:26:34 +00:00
|
|
|
if (params.type == TestDirectiveHandler::DirectiveParams::Type::HANDLE) {
|
2017-05-26 23:06:14 +00:00
|
|
|
if (params.directive->getName() == NAME_EXPECT_SPEECH) {
|
|
|
|
expectSpeechFound = true;
|
|
|
|
}
|
|
|
|
// Unblock the queue so SS can do its work.
|
|
|
|
params.result->setCompleted();
|
|
|
|
}
|
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
}
|
|
|
|
ASSERT_TRUE(expectSpeechFound);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Clear out remaining directives.
|
|
|
|
m_directiveSequencer->setDialogRequestId(FIRST_DIALOG_REQUEST_ID);
|
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
|
|
|
std::string secondFile = g_inputPath + RECOGNIZE_LIONS_AUDIO_FILE_NAME;
|
2017-05-26 23:06:14 +00:00
|
|
|
setupMessageWithAttachmentAndSend(
|
|
|
|
CT_FIRST_RECOGNIZE_EVENT_JSON,
|
|
|
|
secondFile,
|
2017-10-02 22:59:05 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
2017-05-26 23:06:14 +00:00
|
|
|
SEND_EVENT_TIMEOUT_DURATION);
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
TestMessageSender::SendParams secondSendRecognizeParams =
|
|
|
|
m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(secondSendRecognizeParams, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
while (params.type != TestDirectiveHandler::DirectiveParams::Type::TIMEOUT) {
|
2017-06-23 23:26:34 +00:00
|
|
|
if (params.type == TestDirectiveHandler::DirectiveParams::Type::HANDLE) {
|
2017-05-26 23:06:14 +00:00
|
|
|
// Unblock the queue so SS can do its work.
|
|
|
|
params.result->setCompleted();
|
|
|
|
}
|
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
}
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechSynthesizer is now speaking.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::GAINING_FOCUS);
|
|
|
|
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::PLAYING);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that SS grabs the channel focus by seeing that the test client has been backgrounded.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::BACKGROUND);
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechStarted is sent.
|
|
|
|
TestMessageSender::SendParams secondSendStartedParams =
|
|
|
|
m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(secondSendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Media Player has finished.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// SpeechFinished is sent here.
|
2017-10-02 22:59:05 +00:00
|
|
|
TestMessageSender::SendParams secondSendFinishedParams =
|
|
|
|
m_avsConnectionManager->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(secondSendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Alerts channel regains the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WAIT_FOR_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test ability for the SpeechSynthesizer to handle no directives.
|
|
|
|
*
|
|
|
|
* This test is intended to test the SpeechSynthesizer's ability to do nothing when there are no Speak directives. A
|
|
|
|
* Recognize event with audio of "Volume up" is sent to AVS to prompt a AdjustVolume directive but no Speak directives.
|
|
|
|
*/
|
2017-06-23 23:26:34 +00:00
|
|
|
TEST_F(SpeechSynthesizerTest, handleNoSpeakDirectives) {
|
2017-12-09 00:07:37 +00:00
|
|
|
// SpeechSynthesizerObserverInterface defaults to a FINISHED state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// Send audio of "Volume up" that will prompt an adjustVolume directive.
|
2017-06-23 23:26:34 +00:00
|
|
|
m_directiveSequencer->setDialogRequestId(FIRST_DIALOG_REQUEST_ID);
|
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
|
|
|
std::string file = g_inputPath + RECOGNIZE_VOLUME_UP_AUDIO_FILE_NAME;
|
2017-05-26 23:06:14 +00:00
|
|
|
setupMessageWithAttachmentAndSend(
|
|
|
|
CT_FIRST_RECOGNIZE_EVENT_JSON,
|
|
|
|
file,
|
2017-10-02 22:59:05 +00:00
|
|
|
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status::SUCCESS,
|
2017-05-26 23:06:14 +00:00
|
|
|
SEND_EVENT_TIMEOUT_DURATION);
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
TestMessageSender::SendParams sendRecognizeParams = m_avsConnectionManager->waitForNext(DIRECTIVE_TIMEOUT_DURATION);
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_TRUE(checkSentEventName(sendRecognizeParams, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Wait for the directive to route through to our handler.
|
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::PREHANDLE);
|
|
|
|
params = m_directiveHandler->waitForNext(WAIT_FOR_TIMEOUT_DURATION);
|
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::HANDLE);
|
|
|
|
ASSERT_EQ(params.directive->getName(), NAME_ADJUST_VOLUME);
|
|
|
|
|
|
|
|
// Unblock the queue so SS can do its work.
|
|
|
|
params.result->setCompleted();
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechSynthesizer just defaults to Playing state.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WANTING_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that the test client is still in the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WANTING_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// SpeechStarted is not sent.
|
2017-05-26 23:06:14 +00:00
|
|
|
TestMessageSender::SendParams sendStartedParams = m_avsConnectionManager->waitForNext(WANTING_TIMEOUT_DURATION);
|
|
|
|
ASSERT_FALSE(checkSentEventName(sendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// Media Player has not changed.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WANTING_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// SpeechFinished is not sent.
|
|
|
|
TestMessageSender::SendParams sendFinishedParams = m_avsConnectionManager->waitForNext(WANTING_TIMEOUT_DURATION);
|
|
|
|
ASSERT_FALSE(checkSentEventName(sendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Alerts channel regains the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WANTING_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test ability for the test setup to handle no directives.
|
|
|
|
*
|
2017-06-23 23:26:34 +00:00
|
|
|
* This test is intended to test the SpeechSynthesizer's ability to do nothing when there are no Speak directives. No
|
2017-05-26 23:06:14 +00:00
|
|
|
* Recognize events are sent to trigger any directives.
|
|
|
|
*/
|
|
|
|
TEST_F(SpeechSynthesizerTest, handleNoDirectives) {
|
2017-12-09 00:07:37 +00:00
|
|
|
// SpeechSynthesizerObserverInterface defaults to a FINISHED state.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WAIT_FOR_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
TestMessageSender::SendParams sendRecognizeParams = m_avsConnectionManager->waitForNext(WANTING_TIMEOUT_DURATION);
|
|
|
|
ASSERT_FALSE(checkSentEventName(sendRecognizeParams, NAME_RECOGNIZE));
|
|
|
|
|
|
|
|
// Wait for the directive to route through to our handler.
|
|
|
|
TestDirectiveHandler::DirectiveParams params = m_directiveHandler->waitForNext(WANTING_TIMEOUT_DURATION);
|
|
|
|
ASSERT_EQ(params.type, TestDirectiveHandler::DirectiveParams::Type::TIMEOUT);
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
// SpeechSynthesizer defaults to Finished state.
|
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WANTING_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Check that the test client is still in the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WANTING_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// SpeechStarted is not sent.
|
2017-05-26 23:06:14 +00:00
|
|
|
TestMessageSender::SendParams sendStartedParams = m_avsConnectionManager->waitForNext(WANTING_TIMEOUT_DURATION);
|
|
|
|
ASSERT_FALSE(checkSentEventName(sendStartedParams, NAME_SPEECH_STARTED));
|
|
|
|
|
|
|
|
// Media Player has not changed.
|
2017-10-02 22:59:05 +00:00
|
|
|
ASSERT_EQ(
|
|
|
|
m_speechSynthesizerObserver->waitForNext(WANTING_TIMEOUT_DURATION),
|
2017-12-09 00:07:37 +00:00
|
|
|
SpeechSynthesizerObserverInterface::SpeechSynthesizerState::FINISHED);
|
2017-05-26 23:06:14 +00:00
|
|
|
|
|
|
|
// SpeechFinished is not sent.
|
|
|
|
TestMessageSender::SendParams sendFinishedParams = m_avsConnectionManager->waitForNext(WANTING_TIMEOUT_DURATION);
|
|
|
|
ASSERT_FALSE(checkSentEventName(sendFinishedParams, NAME_SPEECH_FINISHED));
|
|
|
|
|
2017-06-23 23:26:34 +00:00
|
|
|
// Alerts channel regains the foreground.
|
2017-05-26 23:06:14 +00:00
|
|
|
ASSERT_EQ(m_testClient->waitForFocusChange(WANTING_TIMEOUT_DURATION), FocusState::FOREGROUND);
|
|
|
|
}
|
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
} // namespace test
|
|
|
|
} // namespace integration
|
|
|
|
} // namespace alexaClientSDK
|
2017-05-26 23:06:14 +00:00
|
|
|
|
2017-10-02 22:59:05 +00:00
|
|
|
int main(int argc, char** argv) {
|
2017-05-26 23:06:14 +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_AlexaClientSDKConfig.json> <path_to_inputs_folder>"
|
2017-10-02 22:59:05 +00:00
|
|
|
<< std::endl;
|
2017-05-26 23:06:14 +00:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
} else {
|
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
|
|
|
alexaClientSDK::integration::test::g_configPath = std::string(argv[1]);
|
|
|
|
alexaClientSDK::integration::test::g_inputPath = std::string(argv[2]);
|
2017-05-26 23:06:14 +00:00
|
|
|
return RUN_ALL_TESTS();
|
|
|
|
}
|
|
|
|
}
|