AlexaClientSDK  1.26.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
}
 The type of error when calling sendErrorResponseEvent(). More...
 

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 ErrorResponseType alexaResponseTypeToErrorType (const avsCommon::avs::AlexaResponseType responseType)
 

Detailed Description

Messaging interface to allow CapabilityAgents to send common AlexaInterface events.

Member Enumeration Documentation

◆ ErrorResponseType

The type of error when calling sendErrorResponseEvent().

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.

◆ 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 1.26.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0