AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Static Public Member Functions | List of all members
alexaClientSDK::diagnostics::DeviceProtocolTracer Class Reference

#include <DeviceProtocolTracer.h>

Inheritance diagram for alexaClientSDK::diagnostics::DeviceProtocolTracer:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::diagnostics::DeviceProtocolTracer:
Collaboration graph
[legend]

Public Member Functions

ProtocolTracerInterface Functions
unsigned int getMaxMessages () override
 
bool setMaxMessages (unsigned int limit) override
 
void setProtocolTraceFlag (bool enabled) override
 
std::string getProtocolTrace () override
 
void clearTracedMessages () override
 
EventTracerInterface Functions
void traceEvent (const std::string &messageContent) override
 
MessageObserverInterface Functions
void receive (const std::string &contextId, const std::string &message) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::ProtocolTracerInterface
virtual ~ProtocolTracerInterface ()=default
 Destructor. More...
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::MessageObserverInterface
virtual ~MessageObserverInterface ()=default
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::EventTracerInterface
virtual ~EventTracerInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< DeviceProtocolTracercreate ()
 

Detailed Description

Utility class to record directives and events processed by the SDK.

Member Function Documentation

◆ clearTracedMessages()

void alexaClientSDK::diagnostics::DeviceProtocolTracer::clearTracedMessages ( )
overridevirtual

This method acquires a mutex and clears the trace messages that are recorded.

Implements alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::ProtocolTracerInterface.

◆ create()

static std::shared_ptr<DeviceProtocolTracer> alexaClientSDK::diagnostics::DeviceProtocolTracer::create ( )
static

Creates a new instance of DeviceProtocolTracer.

Returns
a new DeviceProtocolTracer.

◆ getMaxMessages()

unsigned int alexaClientSDK::diagnostics::DeviceProtocolTracer::getMaxMessages ( )
overridevirtual

◆ getProtocolTrace()

std::string alexaClientSDK::diagnostics::DeviceProtocolTracer::getProtocolTrace ( )
overridevirtual

Returns the recorded protocol trace string. Sample output: { "trace" : [ <Directive 1>, <Directive 2>, <Event 1>, <Directive 3> ] }

Returns
the protocol trace as a string.

Implements alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::ProtocolTracerInterface.

◆ receive()

void alexaClientSDK::diagnostics::DeviceProtocolTracer::receive ( const std::string &  contextId,
const std::string &  message 
)
overridevirtual

A function that a client must implement to receive Messages from AVS.

Parameters
contextIdThe context for the message, which in this case reflects the logical HTTP/2 stream the message arrived on.
messageThe AVS message that has been received.

Implements alexaClientSDK::avsCommon::sdkInterfaces::MessageObserverInterface.

◆ setMaxMessages()

bool alexaClientSDK::diagnostics::DeviceProtocolTracer::setMaxMessages ( unsigned int  limit)
overridevirtual

Change the max messages that can be stored. If limit is lower than the number of currently stored messages, then this function should fail and leave the limit unchanged.

Parameters
limitThe maximum number of messages that will be stored.
Returns
Whether this function succeeded in changing the limit.

Implements alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::ProtocolTracerInterface.

◆ setProtocolTraceFlag()

void alexaClientSDK::diagnostics::DeviceProtocolTracer::setProtocolTraceFlag ( bool  enabled)
overridevirtual

Set the protocol trace flag.

Parameters
enabledindicating if the flag should be true/false.

Implements alexaClientSDK::avsCommon::sdkInterfaces::diagnostics::ProtocolTracerInterface.

◆ traceEvent()

void alexaClientSDK::diagnostics::DeviceProtocolTracer::traceEvent ( const std::string &  messageContent)
overridevirtual

This method is called when an event is sent to AVS.

Parameters
messageContentThe content of the message sent to AVS.

Implements alexaClientSDK::avsCommon::sdkInterfaces::EventTracerInterface.


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