AlexaClientSDK  3.0.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::settings::SettingConnectionObserver Class Reference

#include <SettingConnectionObserver.h>

Inheritance diagram for alexaClientSDK::settings::SettingConnectionObserver:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::settings::SettingConnectionObserver:
Collaboration graph
[legend]

Public Types

using ConnectionStatusCallback = std::function< void(bool isConnected)>
 
- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface
enum  Status { Status::DISCONNECTED, Status::PENDING, Status::CONNECTED }
 
enum  ChangedReason {
  ChangedReason::NONE, ChangedReason::SUCCESS, ChangedReason::UNRECOVERABLE_ERROR, ChangedReason::ACL_CLIENT_REQUEST,
  ChangedReason::ACL_DISABLED, ChangedReason::DNS_TIMEDOUT, ChangedReason::CONNECTION_TIMEDOUT, ChangedReason::CONNECTION_THROTTLED,
  ChangedReason::INVALID_AUTH, ChangedReason::PING_TIMEDOUT, ChangedReason::WRITE_TIMEDOUT, ChangedReason::READ_TIMEDOUT,
  ChangedReason::FAILURE_PROTOCOL_ERROR, ChangedReason::INTERNAL_ERROR, ChangedReason::SERVER_INTERNAL_ERROR, ChangedReason::SERVER_SIDE_DISCONNECT,
  ChangedReason::SERVER_ENDPOINT_CHANGED
}
 

Public Member Functions

 ~SettingConnectionObserver ()=default
 
ConnectionStatusObserverInterface Functions
void onConnectionStatusChanged (avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::Status status, avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::ChangedReason reason) override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface
virtual ~ConnectionStatusObserverInterface ()=default
 
virtual void onConnectionStatusChanged (const Status status, const std::vector< EngineConnectionStatus > &engineStatuses)
 

Static Public Member Functions

static std::shared_ptr< SettingConnectionObservercreate (ConnectionStatusCallback notifyCallback)
 

Detailed Description

An implementation of ConnectionStatusObserverInterface used to proxy connection status notifications used by the settings protocol.

Member Typedef Documentation

◆ ConnectionStatusCallback

Callback function type used for notifying connections status changes.

Parameters
isConnectedIf true, indicates that the device is connected to AVS, otherwise false.

Constructor & Destructor Documentation

◆ ~SettingConnectionObserver()

alexaClientSDK::settings::SettingConnectionObserver::~SettingConnectionObserver ( )
default

Destructor.

Member Function Documentation

◆ create()

static std::shared_ptr<SettingConnectionObserver> alexaClientSDK::settings::SettingConnectionObserver::create ( ConnectionStatusCallback  notifyCallback)
static

Creates a SettingConnectionObserver shared object instance.

Parameters
notifyCallbackThe function callback to be called whenever the connection status changes.
Returns
A pointer to the new SettingConnectionObserver object if it succeeds; nullptr otherwise.

◆ onConnectionStatusChanged()

void alexaClientSDK::settings::SettingConnectionObserver::onConnectionStatusChanged ( avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::Status  status,
avsCommon::sdkInterfaces::ConnectionStatusObserverInterface::ChangedReason  reason 
)
overridevirtual

Called when the AVS connection state changes.

Parameters
statusThe current connection status.
reasonThe reason the status change occurred.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ConnectionStatusObserverInterface.


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