AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Types | Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface Class Referenceabstract

#include <AlexaInterfaceMessageSenderInterface.h>

Inheritance diagram for alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface:
Inheritance graph
[legend]

Public Types

enum  ErrorResponseType {
  ErrorResponseType::ALREADY_IN_OPERATION, ErrorResponseType::BRIDGE_UNREACHABLE, ErrorResponseType::ENDPOINT_BUSY, ErrorResponseType::ENDPOINT_LOW_POWER,
  ErrorResponseType::ENDPOINT_UNREACHABLE, ErrorResponseType::EXPIRED_AUTHORIZATION_CREDENTIAL, ErrorResponseType::FIRMWARE_OUT_OF_DATE, ErrorResponseType::HARDWARE_MALFUNCTION,
  ErrorResponseType::INSUFFICIENT_PERMISSIONS, ErrorResponseType::INTERNAL_ERROR, ErrorResponseType::INVALID_AUTHORIZATION_CREDENTIAL, ErrorResponseType::INVALID_DIRECTIVE,
  ErrorResponseType::INVALID_VALUE, ErrorResponseType::NO_SUCH_ENDPOINT, ErrorResponseType::NOT_CALIBRATED, ErrorResponseType::NOT_SUPPORTED_IN_CURRENT_MODE,
  ErrorResponseType::NOT_IN_OPERATION, ErrorResponseType::POWER_LEVEL_NOT_SUPPORTED, ErrorResponseType::RATE_LIMIT_EXCEEDED, ErrorResponseType::TEMPERATURE_VALUE_OUT_OF_RANGE,
  ErrorResponseType::VALUE_OUT_OF_RANGE
}
 
enum  AlexaVideoErrorResponseType {
  AlexaVideoErrorResponseType::ACTION_NOT_PERMITTED_FOR_CONTENT, AlexaVideoErrorResponseType::CONFIRMATION_REQUIRED, AlexaVideoErrorResponseType::CONTENT_NOT_RECORDABLE, AlexaVideoErrorResponseType::NOT_SUBSCRIBED,
  AlexaVideoErrorResponseType::RECORDING_EXISTS, AlexaVideoErrorResponseType::STORAGE_FULL, AlexaVideoErrorResponseType::TITLE_DISAMBIGUATION_REQUIRED, AlexaVideoErrorResponseType::TUNER_OCCUPIED,
  AlexaVideoErrorResponseType::NONE
}
 

Public Member Functions

virtual ~AlexaInterfaceMessageSenderInterface ()=default
 
virtual bool sendResponseEvent (const std::string &instance, const std::string &correlationToken, const avsCommon::avs::AVSMessageEndpoint &endpoint, const std::string &jsonPayload="{}")=0
 
virtual bool sendResponseEvent (const std::string &instance, const std::string &correlationToken, const avsCommon::avs::AVSMessageEndpoint &endpoint, const std::string &responseNamespace, const std::string &responseName, const std::string &jsonPayload="{}")=0
 
virtual bool sendErrorResponseEvent (const std::string &instance, const std::string &correlationToken, const avsCommon::avs::AVSMessageEndpoint &endpoint, const ErrorResponseType errorType, const std::string &errorMessage="")=0
 
virtual bool sendErrorResponseEvent (const std::string &instance, const std::string &correlationToken, const avsCommon::avs::AVSMessageEndpoint &endpoint, const std::string &responseNamespace, const std::string &jsonPayload="{}")=0
 
virtual bool sendDeferredResponseEvent (const std::string &instance, const std::string &correlationToken, const int estimatedDeferralInSeconds=0)=0
 

Static Public Member Functions

static std::string alexaVideoErrorResponseToString (AlexaVideoErrorResponseType responseType)
 
static ErrorResponseType alexaResponseTypeToErrorType (const avsCommon::avs::AlexaResponseType responseType)
 

Detailed Description

Messaging interface to allow CapabilityAgents to send common AlexaInterface events.

Member Enumeration Documentation

◆ AlexaVideoErrorResponseType

The type of video error when calling sendErrorResponseEvent() with Alexa.Video.ErrorResponse event. https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-video-errorresponse.html

Enumerator
ACTION_NOT_PERMITTED_FOR_CONTENT 

Indicates the content does not allow the action requested. For example, if the user tries to delete a recording that is marked as not deletable.

CONFIRMATION_REQUIRED 

Indicates an additional confirmation must occur before the requested action can be completed.

CONTENT_NOT_RECORDABLE 

Indicates the record operation failed due to restrictions on the content.

NOT_SUBSCRIBED 

The user is not subscribed to the content for a channel or other subscription-based content.

RECORDING_EXISTS 

Indicates that a recording request failed because the recording already exists.

STORAGE_FULL 

Indicates that a recording request failed because the DVR storage is full.

TITLE_DISAMBIGUATION_REQUIRED 

Indicates the title specified yielded multiple results, and disambiguation is required to determine the program to record. This value should be used to indicate that the target device will provide a mechanism for disambiguation. For example, this error could indicate that there are multiple airings of a program or that the entity requested for recording has multiple programs associated with it.

TUNER_OCCUPIED 

Indicates that a recording request failed because of a scheduling conflict with another recording.

NONE 

Indicates an invalid error type.

◆ ErrorResponseType

The type of error when calling sendErrorResponseEvent() with Alexa.ErrorResponse event. https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-errorresponse.html

Enumerator
ALREADY_IN_OPERATION 

The operation can't be performed because the endpoint is already in operation.

BRIDGE_UNREACHABLE 

The bridge is unreachable or offline.

ENDPOINT_BUSY 

The endpoint can't handle the directive because it is performing another action.

ENDPOINT_LOW_POWER 

The endpoint can't handle the directive because the battery power is too low.

ENDPOINT_UNREACHABLE 

The endpoint is unreachable or offline.

EXPIRED_AUTHORIZATION_CREDENTIAL 

The authorization credential provided by Alexa has expired.

FIRMWARE_OUT_OF_DATE 

The endpoint can't handle the directive because it's firmware is out of date.

HARDWARE_MALFUNCTION 

The endpoint can't handle the directive because it has experienced a hardware malfunction.

INSUFFICIENT_PERMISSIONS 

AVS does not have permissions to perform the specified action on the endpoint.

INTERNAL_ERROR 

An error occurred that can't be described by one of the other error types.

INVALID_AUTHORIZATION_CREDENTIAL 

The authorization credential provided by Alexa is invalid.

INVALID_DIRECTIVE 

The directive is not supported or is malformed.

INVALID_VALUE 

The directive contains a value that is not valid for the target endpoint.

NO_SUCH_ENDPOINT 

The endpoint does not exist, or no longer exists.

NOT_CALIBRATED 

The endpoint can't handle the directive because it is in a calibration phase, such as warming up.

NOT_SUPPORTED_IN_CURRENT_MODE 

The endpoint can't be set to the specified value because of its current mode of operation.

NOT_IN_OPERATION 

The endpoint is not in operation.

POWER_LEVEL_NOT_SUPPORTED 

The endpoint can't handle the directive because it doesn't support the requested power level.

RATE_LIMIT_EXCEEDED 

The maximum rate at which an endpoint or bridge can process directives has been exceeded.

TEMPERATURE_VALUE_OUT_OF_RANGE 

The endpoint can't be set to the specified value because it's outside the acceptable temperature range.

VALUE_OUT_OF_RANGE 

The endpoint can't be set to the specified value because it's outside the acceptable range.

Constructor & Destructor Documentation

◆ ~AlexaInterfaceMessageSenderInterface()

virtual alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface::~AlexaInterfaceMessageSenderInterface ( )
virtualdefault

Destructor.

Member Function Documentation

◆ alexaResponseTypeToErrorType()

AlexaInterfaceMessageSenderInterface::ErrorResponseType alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface::alexaResponseTypeToErrorType ( const avsCommon::avs::AlexaResponseType  responseType)
inlinestatic

Convert an AlexaResponseType to its corresponding ErrorResponseType. Note that any AlexaResponseType that does not map to ErrorResponseType will return INTERNAL_ERROR.

Parameters
responseTypethe response type to convert.
Returns
the corresponding ErrorResponseType.

◆ alexaVideoErrorResponseToString()

std::string alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface::alexaVideoErrorResponseToString ( AlexaVideoErrorResponseType  responseType)
inlinestatic

Convert AlexaVideoErrorResponseType type to its corresponding string. Note that any invalid AlexaVideoErrorResponseType will return an empty string.

Parameters
responseTypethe response type to convert.
Returns
the corresponding string for video error response type

◆ sendDeferredResponseEvent()

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface::sendDeferredResponseEvent ( const std::string &  instance,
const std::string &  correlationToken,
const int  estimatedDeferralInSeconds = 0 
)
pure virtual

Send an Alexa.DeferredResponse event. The message is enqueued for sending and this method returns immediately (non-blocking).

Parameters
instanceThe instance ID of the responding capability.
correlationTokenThe correlation token from the directive to which we are responding.
estimatedDeferralInSecondsnumber of seconds until the response is expected.
Returns
true if the message was sent successfully, false otherwise.

Implemented in alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceMessageSender.

◆ sendErrorResponseEvent() [1/2]

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface::sendErrorResponseEvent ( const std::string &  instance,
const std::string &  correlationToken,
const avsCommon::avs::AVSMessageEndpoint endpoint,
const ErrorResponseType  errorType,
const std::string &  errorMessage = "" 
)
pure virtual

Send an Alexa.ErrorResponse event. The message is enqueued for sending and this method returns immediately (non-blocking).

Parameters
instanceThe instance ID of the responding capability.
correlationTokenThe correlation token from the directive to which we are responding.
endpointThe AVSMessageEndpoint to identify the endpoint related to this event.
errorTypethe error type.
errorMessagea string containing the error message (optional).
Returns
true if the message was enqueued successfully, false otherwise.

Implemented in alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceMessageSender.

◆ sendErrorResponseEvent() [2/2]

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface::sendErrorResponseEvent ( const std::string &  instance,
const std::string &  correlationToken,
const avsCommon::avs::AVSMessageEndpoint endpoint,
const std::string &  responseNamespace,
const std::string &  jsonPayload = "{}" 
)
pure virtual

Send an error response event for namespace and name. The message is enqueued for sending and this method returns immediately (non-blocking).

Parameters
instanceThe instance ID of the responding capability.
correlationTokenThe correlation token from the directive to which we are responding.
endpointThe AVSMessageEndpoint to identify the endpoint related to this event.
responseNamespacea string containing the namespace for this response.
jsonPayloada payload containing the error type and message (optional).
Returns
true if the message was enqueued successfully, false otherwise.

Implemented in alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceMessageSender.

◆ sendResponseEvent() [1/2]

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface::sendResponseEvent ( const std::string &  instance,
const std::string &  correlationToken,
const avsCommon::avs::AVSMessageEndpoint endpoint,
const std::string &  jsonPayload = "{}" 
)
pure virtual

Send an Alexa.Response event. Since these events require context, the event will be enqueued and this method will return immediately (non-blocking). The message will be sent once context has been received from ContextManager.

Parameters
instanceThe instance ID of the responding capability.
correlationTokenThe correlation token from the directive to which we are responding.
endpointThe AVSMessageEndpoint to identify the endpoint related to this event.
jsonPayloada JSON string representing the payload for the response event (optional).
Returns
true if the event was successfuly enqueued, false on failure.

Implemented in alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceMessageSender.

◆ sendResponseEvent() [2/2]

virtual bool alexaClientSDK::avsCommon::sdkInterfaces::AlexaInterfaceMessageSenderInterface::sendResponseEvent ( const std::string &  instance,
const std::string &  correlationToken,
const avsCommon::avs::AVSMessageEndpoint endpoint,
const std::string &  responseNamespace,
const std::string &  responseName,
const std::string &  jsonPayload = "{}" 
)
pure virtual

Send an Response event. Since these events require context, the event will be enqueued and this method will return immediately (non-blocking). The message will be sent once context has been received from ContextManager.

Parameters
instanceThe instance ID of the responding capability.
correlationTokenThe correlation token from the directive to which we are responding.
endpointThe AVSMessageEndpoint to identify the endpoint related to this event.
responseNamespaceThe namespace of response event
responseNameThe name of response event
jsonPayloada JSON string representing the payload for the response event (optional).
Returns
true if the event was successfuly enqueued, false on failure.

Implemented in alexaClientSDK::capabilityAgents::alexa::AlexaInterfaceMessageSender.


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

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