Alexa Auto SDK  2.3.0
Public Member Functions | List of all members
aace::apl::APL Class Referenceabstract

Public Member Functions

virtual std::string getVisualContext ()=0
 
virtual void renderDocument (const std::string &jsonPayload, const std::string &token, const std::string &windowId)=0
 
virtual void clearDocument ()=0
 
virtual void executeCommands (const std::string &jsonPayload, const std::string &token)=0
 
virtual void interruptCommandSequence ()=0
 
void clearCard ()
 
void clearAllExecuteCommands ()
 
void sendUserEvent (const std::string &payload)
 
void setAPLMaxVersion (const std::string &aplMaxVersion)
 
void setDocumentIdleTimeout (std::chrono::milliseconds documentIdleTimeout)
 
void renderDocumentResult (const std::string &token, const bool result, const std::string &error)
 
void executeCommandsResult (const std::string &token, const bool result, const std::string &error)
 
void processActivityEvent (const std::string &source, const ActivityEvent event)
 

Detailed Description

APL should be extended to handle receiving Alexa Presentation RenderDocument and ExecuteCommands directives from AVS. These directives contain metadata for rendering or operating on display cards for devices with GUI support. For more information about Alexa Presentation Language (APL) see the interface overview: https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/understand-apl.html

Member Function Documentation

◆ getVisualContext()

virtual std::string aace::apl::APL::getVisualContext ( )
pure virtual

Retrieve the visual context from the platform implementation.

Returns
the current VisualContext payload.

◆ renderDocument()

virtual void aace::apl::APL::renderDocument ( const std::string &  jsonPayload,
const std::string &  token,
const std::string &  windowId 
)
pure virtual

Notifies the platform implementation that a RenderDocument directive has been received. Once called, the client should render the document based on the APL specification in the payload in structured JSON format.

Note
The payload may contain customer sensitive information and should be used with utmost care. Failure to do so may result in exposing or mishandling of customer data.
Parameters
[in]jsonPayloadThe payload of the Alexa.Presentation.APL.RenderDocument directive which follows the APL specification.
[in]tokenThe APL presentation token associated with this payload.
[in]windowIdThe target windowId.

◆ clearDocument()

virtual void aace::apl::APL::clearDocument ( )
pure virtual

Notifies the platform implementation when the client should clear the APL display card. Once the card is cleared, the platform implementation should call clearCard().

◆ executeCommands()

virtual void aace::apl::APL::executeCommands ( const std::string &  jsonPayload,
const std::string &  token 
)
pure virtual

Notifies the platform implementation that an ExecuteCommands directive has been received.

Parameters
[in]jsonPayloadThe payload of the Alexa.Presentation.APL.ExecuteCommands directive in structured JSON format.
[in]tokenDirective token used to bind result processing.

◆ interruptCommandSequence()

virtual void aace::apl::APL::interruptCommandSequence ( )
pure virtual

Notifies the platform implementation that a command execution sequence should be interrupted.

◆ clearCard()

void aace::apl::APL::clearCard ( )

Notifies the Engine to clear the card from the screen and release any focus being held.

◆ clearAllExecuteCommands()

void aace::apl::APL::clearAllExecuteCommands ( )

Notifies the Engine to clear all pending ExecuteCommands directives and mark them as failed.

◆ sendUserEvent()

void aace::apl::APL::sendUserEvent ( const std::string &  payload)

Notifies the Engine to send UserEvent to AVS.

Parameters
[in]payloadThe UserEvent event payload. The caller of this function is responsible to pass the payload as it defined by AVS.

◆ setAPLMaxVersion()

void aace::apl::APL::setAPLMaxVersion ( const std::string &  aplMaxVersion)

Set the APL version supported by the runtime component.

Parameters
[in]aplMaxVersionThe APL version supported.

◆ setDocumentIdleTimeout()

void aace::apl::APL::setDocumentIdleTimeout ( std::chrono::milliseconds  documentIdleTimeout)

Set a custom document idle timeout.

Parameters
[in]documentIdleTimeoutThe timeout in milliseconds.
Note
Will be reset for every directive received from AVS.

◆ renderDocumentResult()

void aace::apl::APL::renderDocumentResult ( const std::string &  token,
const bool  result,
const std::string &  error 
)

Notifies the Engine with the result of a renderDocument notification.

Parameters
[in]tokenThe document presentation token.
[in]resultRendering result (true on executed, false on exception).
[in]errorError message provided in case result is false.

◆ executeCommandsResult()

void aace::apl::APL::executeCommandsResult ( const std::string &  token,
const bool  result,
const std::string &  error 
)

Notifies the Engine with the result of an executeCommands notification.

Parameters
[in]tokenThe document presentation token.
[in]resultRendering result (true on executed, false on exception).
[in]errorError message provided in case result is false.

◆ processActivityEvent()

void aace::apl::APL::processActivityEvent ( const std::string &  source,
const ActivityEvent  event 
)

Notifies the Engine of an activity change event.

Parameters
[in]sourceThe source of the activity event.
[in]eventThe activity change event.

Alexa Auto SDK 2.3.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0