AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::capabilityAgents::system::SoftwareInfoSender Class Reference

#include <SoftwareInfoSender.h>

Inheritance diagram for alexaClientSDK::capabilityAgents::system::SoftwareInfoSender:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilityAgents::system::SoftwareInfoSender:
Collaboration graph
[legend]

Public Member Functions

bool setFirmwareVersion (avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion firmwareVersion)
 
DirectiveHandlerInterface and CapabilityAgent Functions
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration () const override
 
void handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
 
void preHandleDirective (std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
 
void handleDirective (std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
 
void cancelDirective (std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
 
RequiresShutdown Functions
void doShutdown () override
 
ConnectionStatusObserverInterface Functions
void onConnectionStatusChanged (avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::Status status, avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::ChangedReason reason) override
 
SoftwareInfoSenderObserverInterface Functions
void onFirmwareVersionAccepted (avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion firmwareVersion) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
virtual ~CapabilityAgent ()=default
 
void preHandleDirective (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result) override final
 
bool handleDirective (const std::string &messageId) override final
 
void cancelDirective (const std::string &messageId) override final
 
void onDeregistered () override
 
void onFocusChanged (FocusState newFocus, MixingBehavior behavior) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface
virtual ~DirectiveHandlerInterface ()=default
 
virtual void handleDirectiveImmediately (std::shared_ptr< avsCommon::avs::AVSDirective > directive)=0
 
virtual void preHandleDirective (std::shared_ptr< avsCommon::avs::AVSDirective > directive, std::unique_ptr< DirectiveHandlerResultInterface > result)=0
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ChannelObserverInterface
virtual ~ChannelObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::StateProviderInterface
virtual ~StateProviderInterface ()=default
 
virtual void provideState (const avs::NamespaceAndName &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual void provideState (const avs::CapabilityTag &stateProviderName, const ContextRequestToken stateRequestToken)
 
virtual bool canStateBeRetrieved ()
 
virtual bool hasReportableStateProperties ()
 
virtual bool shouldQueryState ()
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ContextRequesterInterface
virtual ~ContextRequesterInterface ()=default
 
virtual void onContextAvailable (const std::string &jsonContext)
 
virtual void onContextAvailable (const endpoints::EndpointIdentifier &endpointId, const avs::AVSContext &endpointContext, ContextRequestToken requestToken)
 
virtual void onContextFailure (const ContextRequestError error)
 
virtual void onContextFailure (const ContextRequestError error, ContextRequestToken token)
 
- 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
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface
virtual ~ConnectionStatusObserverInterface ()=default
 
virtual void onConnectionStatusChanged (const Status status, const std::vector< EngineConnectionStatus > &engineStatuses)
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface
virtual ~SoftwareInfoSenderObserverInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< SoftwareInfoSendercreate (avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion firmwareVersion, bool sendSoftwareInfoUponConnect, std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface >> observers, std::shared_ptr< avsCommon::sdkInterfaces::AVSConnectionManagerInterface > connection, std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface
enum  Status { Status::DISCONNECTED, Status::PENDING, Status::CONNECTED }
 
enum  ChangedReason {
  ChangedReason::NONE, ChangedReason::SUCCESS, ChangedReason::UNRECOVERABLE_ERROR, ChangedReason::ACL_CLIENT_REQUEST,
  ChangedReason::ACL_DISABLED, ChangedReason::DNS_TIMEDOUT, ChangedReason::CONNECTION_TIMEDOUT, ChangedReason::CONNECTION_THROTTLED,
  ChangedReason::INVALID_AUTH, ChangedReason::PING_TIMEDOUT, ChangedReason::WRITE_TIMEDOUT, ChangedReason::READ_TIMEDOUT,
  ChangedReason::FAILURE_PROTOCOL_ERROR, ChangedReason::INTERNAL_ERROR, ChangedReason::SERVER_INTERNAL_ERROR, ChangedReason::SERVER_SIDE_DISCONNECT,
  ChangedReason::SERVER_ENDPOINT_CHANGED
}
 
- Protected Member Functions inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
 CapabilityAgent (const std::string &nameSpace, std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender)
 
virtual std::shared_ptr< DirectiveInfocreateDirectiveInfo (std::shared_ptr< AVSDirective > directive, std::unique_ptr< sdkInterfaces::DirectiveHandlerResultInterface > result)
 
virtual void preHandleDirective (std::shared_ptr< DirectiveInfo > info)=0
 
virtual void handleDirective (std::shared_ptr< DirectiveInfo > info)=0
 
virtual void cancelDirective (std::shared_ptr< DirectiveInfo > info)=0
 
void removeDirective (const std::string &messageId)
 
void sendExceptionEncounteredAndReportFailed (std::shared_ptr< DirectiveInfo > info, const std::string &message, avsCommon::avs::ExceptionErrorType type=avsCommon::avs::ExceptionErrorType::INTERNAL_ERROR)
 
const std::pair< std::string, std::string > buildJsonEventString (const std::string &eventName, const std::string &dialogRequestIdString="", const std::string &payload="{}", const std::string &context="") const
 
- Protected Attributes inherited from alexaClientSDK::avsCommon::avs::CapabilityAgent
const std::string m_namespace
 The namespace of the capability agent. More...
 
std::shared_ptr< sdkInterfaces::ExceptionEncounteredSenderInterfacem_exceptionEncounteredSender
 Object to use to send exceptionEncountered messages. More...
 

Detailed Description

SoftwareInfoSender is a CapabilityAgent that handles the System.ReportSoftwareInfo directive and the sending of System.SoftwareInfo events to AVS.

See also
https://developer.amazon.com/docs/alexa/alexa-voice-service/system.html#reportsoftwareinfo-directive
https://developer.amazon.com/docs/alexa/alexa-voice-service/system.html#softwareinfo-event

Member Function Documentation

◆ cancelDirective()

void alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::cancelDirective ( std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo info)
override

◆ create()

std::shared_ptr< SoftwareInfoSender > alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::create ( avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion  firmwareVersion,
bool  sendSoftwareInfoUponConnect,
std::unordered_set< std::shared_ptr< avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface >>  observers,
std::shared_ptr< avsCommon::sdkInterfaces::AVSConnectionManagerInterface connection,
std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface messageSender,
std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface exceptionEncounteredSender 
)
static

Creates a new SoftwareInfoSender instance.

Parameters
firmwareVersionThe firmware version to include in SoftwareInfo events.
sendSoftwareInfoUponConnectWhether the SoftwareInfo event should be sent upon connecting.
observerAn object to receive notifications from this SoftwareInfoSender.
connectionOur connection to AVS.
messageSenderObject for sending messages to AVS.
exceptionEncounteredSenderThe object to use for sending ExceptionEncountered messages.
Returns
An instance of SoftwareInfoSender if successful else nullptr.

◆ doShutdown()

void alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::doShutdown ( )
overridevirtual

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.

◆ getConfiguration()

avsCommon::avs::DirectiveHandlerConfiguration alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::getConfiguration ( ) const
overridevirtual

Returns the configuration of the directive handler.

The configuration consists of multiple directive routing rules and their respective blocking policy. The directives will be matched from the most specific rule (with all fields defined) to the least specific rule (which only matches the directive endpointId).

Returns
The avs::DirectiveHandlerConfiguration of the handler.

Implements alexaClientSDK::avsCommon::sdkInterfaces::DirectiveHandlerInterface.

◆ handleDirective()

void alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::handleDirective ( std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo info)
override

◆ handleDirectiveImmediately()

void alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::handleDirectiveImmediately ( std::shared_ptr< avsCommon::avs::AVSDirective directive)
override

◆ onConnectionStatusChanged()

void alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::onConnectionStatusChanged ( avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::Status  status,
avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::ChangedReason  reason 
)
overridevirtual

Called when the AVS connection state changes.

Parameters
statusThe current connection status.
reasonThe reason the status change occurred.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface.

◆ onFirmwareVersionAccepted()

void alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::onFirmwareVersionAccepted ( avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion  firmwareVersion)
overridevirtual

Notification that the firmware version has been accepted by AVS.

Parameters
Thefirmware version that was accepted.

Implements alexaClientSDK::avsCommon::sdkInterfaces::SoftwareInfoSenderObserverInterface.

◆ preHandleDirective()

void alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::preHandleDirective ( std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo info)
override

◆ setFirmwareVersion()

bool alexaClientSDK::capabilityAgents::system::SoftwareInfoSender::setFirmwareVersion ( avsCommon::sdkInterfaces::softwareInfo::FirmwareVersion  firmwareVersion)

Specify the firmwareVersion to send to AVS via SoftwareInfo events.

If the firmware version changes while the client is already connected to AVS, it should call setFirmwareVersion() immediately with the new version. If the version is new it will trigger sending a SoftwareInfo event to AVS.

Parameters
firmwareVersionThe firmware version to report to AVS.
Returns
Whether the new firmware version was accepted.

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

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