AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
alexaClientSDK::integration::test::AVSCommunication Class Reference
Inheritance diagram for alexaClientSDK::integration::test::AVSCommunication:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::integration::test::AVSCommunication:
Collaboration graph
[legend]

Public Member Functions

void connect ()
 
void disconnect ()
 
std::shared_ptr< ConnectionStatusObservergetConnectionStatusObserver ()
 
bool sendEvent (const std::string &jsonContent, avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status expectedStatus, std::chrono::seconds timeout, std::shared_ptr< avsCommon::avs::attachment::AttachmentReader > attachmentReader=nullptr)
 
bool checkForServerSideDisconnect ()
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 

Static Public Member Functions

static std::unique_ptr< AVSCommunicationcreate (std::shared_ptr< AuthDelegateInterface > authDelegate)
 

Protected Member Functions

void doShutdown () override
 

Detailed Description

This class tests the functionality for communication between client and AVS using ACL library.

Member Function Documentation

◆ checkForServerSideDisconnect()

bool alexaClientSDK::integration::test::AVSCommunication::checkForServerSideDisconnect ( )

The function to check for Server Side Disconnect for the current connection.

Returns
true if disconnect is due to SERVER_SIDE_DISCONNECT else false.

◆ connect()

void alexaClientSDK::integration::test::AVSCommunication::connect ( )

The function to establish connection by enabling the m_avsConnectionManager.

◆ create()

std::unique_ptr< AVSCommunication > alexaClientSDK::integration::test::AVSCommunication::create ( std::shared_ptr< AuthDelegateInterface authDelegate)
static

Create an AVSCommunication object which initializes m_connectionStatusObserver, m_avsConnectionManager, m_authDelegate and m_messageRouter.

Parameters
authDelegateAuthDelegate to use to authorize access to AVS.
Returns
The created AVSCommunication object or nullptr if create fails.

◆ disconnect()

void alexaClientSDK::integration::test::AVSCommunication::disconnect ( )

The function to tear down the connection by disabling the m_avsConnectionManager.

◆ doShutdown()

void alexaClientSDK::integration::test::AVSCommunication::doShutdown ( )
overrideprotectedvirtual

Prepares/enables this object to be deleted. This should be the last function called on this object prior to deleting (or resetting) its shared_ptr.

Warning
  • Attempting to call functions on this object after calling shutdown() can result in undefined behavior.
  • Neglecting to call shutdown() on this object can result in resource leaks or other undefined behavior.

Implements alexaClientSDK::avsCommon::utils::RequiresShutdown.

◆ getConnectionStatusObserver()

std::shared_ptr< ConnectionStatusObserver > alexaClientSDK::integration::test::AVSCommunication::getConnectionStatusObserver ( )

Function to retun the connection status observer.

◆ sendEvent()

bool alexaClientSDK::integration::test::AVSCommunication::sendEvent ( const std::string &  jsonContent,
avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status  expectedStatus,
std::chrono::seconds  timeout,
std::shared_ptr< avsCommon::avs::attachment::AttachmentReader attachmentReader = nullptr 
)

The function to send one message to AVS.

Parameters
jsonContentThe content in json format to send in the message.
expectedStatusThe expected status of the message being sent to AVS.
timeoutThe maximum time to wait for the expectedStatus.
attachmentReaderThe attachment reader for the MessageRequest.
Returns
true if expected avsCommon::sdkInterfaces::MessageRequestObserverInterface::Status is received within the timeout else false.

The documentation for this class was generated from the following file:

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