![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <ContextManager.h>
Static Public Member Functions | |
static std::shared_ptr< ContextManagerInterface > | createContextManagerInterface (const std::shared_ptr< avsCommon::utils::DeviceInfo > &deviceInfo, const std::shared_ptr< avsCommon::utils::timing::MultiTimer > &multiTimer=std::make_shared< avsCommon::utils::timing::MultiTimer >(), const std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > &metricRecorder=nullptr) |
static std::shared_ptr< ContextManager > | create (const avsCommon::utils::DeviceInfo &deviceInfo, std::shared_ptr< avsCommon::utils::timing::MultiTimer > multiTimer=std::make_shared< avsCommon::utils::timing::MultiTimer >(), std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder=nullptr) |
Class manages the requests for getting context from ContextRequesters
and updating the state from StateProviders
.
|
override |
Destructor.
|
override |
|
override |
|
static |
Create a new ContextManager
instance.
deviceInfo | Structure used to retrieve the default endpoint id. |
multiTimer | Object used to schedule request timeout. |
metricRecorder | The metric recorder. |
ContextManager
.
|
static |
Create a new ContextManager
instance.
deviceInfo | Structure used to retrieve the default endpoint id. |
multiTimer | Object used to schedule request timeout. |
metricRecorder | The metric recorder. |
ContextManager
.
|
override |
|
override |
|
overridevirtual |
Provides the capability state information as a response to provideState
request.
When a provideState
request is sent to a StateProviderInterface
, the ContextManager
will provide a stateRequestToken
. The same token needs to be sent on a provideState
in response to the provideState
. If the token sent in the provideState
request does not match the token in the ContextManager
, the response will be dropped.
capabilityIdentifier | Identifies which capability state is being provided. |
capabilityState | The new state being provided. |
stateRequestToken | The token that was provided in a provideState request. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::ContextManagerInterface.
|
overridevirtual |
Response method used to inform that the capability state is not available.
The same token needs to be sent on a setState
in response to the provideState
. If the token sent in the setState
request does not match the token in the ContextManager
, setState
will return an error.
capabilityIdentifier | The capability message identifier of the StateProviderInterface whose state is not available. |
stateRequestToken | The token that was provided in a provideState request. |
isEndpointUnreachable | Whether the failure was due to the endpoint being unreachable. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::ContextManagerInterface.
|
override |
|
overridevirtual |
Remove the state provider for the given capability with the ContextManager
.
capabilityIdentifier | The capability message identifier of the StateProviderInterface . |
Implements alexaClientSDK::avsCommon::sdkInterfaces::ContextManagerInterface.
|
overridevirtual |
Function used to proactively notify the context manager that the state of a capability has changed.
capabilityIdentifier | Identifies which capability has an updated state. |
capabilityState | The new state being reported. |
cause | The reason for the state change. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::ContextManagerInterface.
|
overridevirtual |
Sets the state information. The refresh policy indicates to the ContextManager
whether on a getContext
request the state needs to be updated. If the refreshPolicy
is ALWAYS
, then the StateProviderInterface
needs to be registered with the ContextManager
, else setState
returns an error.
For the states for which the refresh policy is ALWAYS
, the ContextManager
requests for provideStates
from the StateProviderInterfaces
. When a provideState
request is sent to a StateProviderInterface
, the ContextManager
will provide a stateRequestToken
. The same token needs to be sent on a setState
in response to the provideState
. If the token sent in the setState
request does not match the token in the ContextManager
, setState
will return an error.
provideState
request and reportStateChange
to proactively report to the ContextManager that the state has changed.setState
is in response to a provideState
request. Setting the token to 0 is equivalent to no token.The jsonState
is the json value that is associated with the key "payload".
capabilityIdentifier | The capability message identifier of the StateProviderInterface whose state is being updated. |
jsonState | The state of the StateProviderInterface . The StateProviderInterface with a refreshPolicy of SOMETIMES can pass in an empty string to indicate no contexts needs to be sent by the provider. |
refreshPolicy | The refresh policy for the state. |
stateRequestToken | The token that was provided in a provideState request. Defaults to 0. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::ContextManagerInterface.
|
override |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0