AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Functions | Variables
alexaClientSDK::capabilitiesDelegate::utils Namespace Reference

Namespaces

 test
 

Functions

bool validateCapabilityConfiguration (const avsCommon::avs::CapabilityConfiguration &capabilityConfig)
 
bool validateEndpointAttributes (const avsCommon::avs::AVSDiscoveryEndpointAttributes &endpointAttributes)
 
bool compareEndpointConfigurations (const std::string &firstEndpointConfigJson, const std::string &secondEndpointConfigJson)
 
std::string getEndpointConfigJson (const avsCommon::avs::AVSDiscoveryEndpointAttributes &endpointAttributes, const std::vector< avsCommon::avs::CapabilityConfiguration > &capabilities)
 
std::pair< std::string, std::string > getAddOrUpdateReportEventJson (const std::vector< std::string > &endpointConfigurations, const std::string &authToken)
 
std::string getDeleteReportEndpointConfigJson (const std::string &endpointId)
 
std::string getDeleteReportEventJson (const std::vector< std::string > &endpointConfigurations, const std::string &authToken)
 
size_t getMaxEndpoints ()
 
size_t getMaxCapabilitiesPerEndpoint ()
 

Variables

static constexpr int MAX_DISCOVERY_PAYLOAD_SIZE = 256 * 1024
 Maximum size of the Discovery event (256 KB) More...
 
static constexpr int MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE = 10 * 1024
 Maximum size of header and scope fields in the Discovery event (Choosing a sufficiently large size of 10KB). More...
 
static constexpr int MAX_ENDPOINTS_SIZE_IN_PAYLOAD = MAX_DISCOVERY_PAYLOAD_SIZE - MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE
 Maximum size of endpoint configurations in Event payload. More...
 

Function Documentation

◆ compareEndpointConfigurations()

bool alexaClientSDK::capabilitiesDelegate::utils::compareEndpointConfigurations ( const std::string &  firstEndpointConfigJson,
const std::string &  secondEndpointConfigJson 
)

Compares given endpoint configuration JSONs and returns true if they are equal, else false. : RapidJSON's equal to operator compares elements of arrays in order. To overcome this, we always sort array entries before creating JSON strings.

Parameters
firstEndpointConfigJsonThe first endpoint config json string.
secondEndpointConfigJsonThe second endpoint config json string.
Returns
True if the json strings are same, else false.

◆ getAddOrUpdateReportEventJson()

std::pair<std::string, std::string> alexaClientSDK::capabilitiesDelegate::utils::getAddOrUpdateReportEventJson ( const std::vector< std::string > &  endpointConfigurations,
const std::string &  authToken 
)

Formats the Discovery.AddOrUpdateReport event.

Parameters
endpointConfigurationsThe endpointConfiguration jsons to be included in the event.
authTokenThe authorization token that needs to be included in the event.
Returns
The string pair containing the JSON formatted Discovery.AddOrUpdateReport event and the eventCorrelationToken.

◆ getDeleteReportEndpointConfigJson()

std::string alexaClientSDK::capabilitiesDelegate::utils::getDeleteReportEndpointConfigJson ( const std::string &  endpointId)

Formats the endpoint ID into endpointConfig JSON that will be sent in the payload of Discovery.DeleteReport event.

Parameters
endpointIdThe endpointId for which the endpoint config JSON will be created.
Returns
The string representing the individual endpointConfig JSON for the Discovery.DeleteReport event.

◆ getDeleteReportEventJson()

std::string alexaClientSDK::capabilitiesDelegate::utils::getDeleteReportEventJson ( const std::vector< std::string > &  endpointConfigurations,
const std::string &  authToken 
)

Formats the Discovery.DeleteReport event.

Parameters
endpointConfigurationsThe endpointConfiguration jsons to be included in the event.
authTokenThe authorization token that needs to be included in the event.
Returns
The string containing the JSON formatted Discovery.DeleteReport event.

◆ getEndpointConfigJson()

std::string alexaClientSDK::capabilitiesDelegate::utils::getEndpointConfigJson ( const avsCommon::avs::AVSDiscoveryEndpointAttributes endpointAttributes,
const std::vector< avsCommon::avs::CapabilityConfiguration > &  capabilities 
)

Formats the given EndpointAttributes and CapabilityConfigurations into a JSON required to send in the Discovery.AddOrUpdateReport event.

Parameters
endpointAttributesThe EndpointAttributes to format.
capabilitiesThe list of CapabilityConfigurations to format.
Returns
The JSON formatted Endpoint configuration.

◆ getMaxCapabilitiesPerEndpoint()

size_t alexaClientSDK::capabilitiesDelegate::utils::getMaxCapabilitiesPerEndpoint ( )

Get the maximum number of capabilities per endpoint.

Returns
The maximum number of capabilities an endpoint can have.

◆ getMaxEndpoints()

size_t alexaClientSDK::capabilitiesDelegate::utils::getMaxEndpoints ( )

Get the maximum number of supported endpoints.

Returns
The maximum number of endpoints.

◆ validateCapabilityConfiguration()

bool alexaClientSDK::capabilitiesDelegate::utils::validateCapabilityConfiguration ( const avsCommon::avs::CapabilityConfiguration capabilityConfig)

Validates if all the required fields are available for the given CapabilityConfiguration.

Parameters
capabilityConfigThe CapabilityConfiguration to validate.
Returns
True if the capabilityConfig is valid, else false.

◆ validateEndpointAttributes()

bool alexaClientSDK::capabilitiesDelegate::utils::validateEndpointAttributes ( const avsCommon::avs::AVSDiscoveryEndpointAttributes endpointAttributes)

Validates if the given EndpointAttributes contains all the required fields.

Parameters
endpointAttributesThe input EndpointAttributes to validate.
Returns
True if the endpointAttributes are valid, else false.

Variable Documentation

◆ MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE

constexpr int alexaClientSDK::capabilitiesDelegate::utils::MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE = 10 * 1024
static

Maximum size of header and scope fields in the Discovery event (Choosing a sufficiently large size of 10KB).

◆ MAX_DISCOVERY_PAYLOAD_SIZE

constexpr int alexaClientSDK::capabilitiesDelegate::utils::MAX_DISCOVERY_PAYLOAD_SIZE = 256 * 1024
static

Maximum size of the Discovery event (256 KB)

◆ MAX_ENDPOINTS_SIZE_IN_PAYLOAD

constexpr int alexaClientSDK::capabilitiesDelegate::utils::MAX_ENDPOINTS_SIZE_IN_PAYLOAD = MAX_DISCOVERY_PAYLOAD_SIZE - MAX_DISCOVERY_HEADER_AND_SCOPE_SIZE
static

Maximum size of endpoint configurations in Event payload.

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