AlexaClass Class

AlexaClass Class

Description
A class to use Alexa on Ameba.

Syntax
class AlexaClass

Members

Public Constructors 
AlexaClass::AlexaClassConstructs an AlexaClass object.
AlexaClass::~AlexaClassDestructs the AlexaClass object.
Public Methods 
AlexaClass::beginInitialize Alexa service.
AlexaClass::setAvsRefreshTokenSet the Alexa Voice Service (AVS) refresh token.
AlexaClass::setAvsClientIdSet the AVS client ID.
AlexaClass::setAvsClientSecretSet the AVS client secret.
AlexaClass::setAvsHttp2HostSet the AVS host for http2.

AlexaClass::begin

Description
Initialize Alexa service.

Syntax
void begin(void);

Parameters
NA

Returns
NA

Example Code
Example: alexa_basic
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Audio/examples/alexa_basic/alexa_basic.ino)

Notes and Warnings
“Alexa.h” must be included to use the class function.

AlexaClass::setAvsRefreshToken

Description
Set the Alexa Voice Service (AVS) refresh token.

Syntax
void setAvsRefreshToken(char *avs_refresh_token, int len);

Parameters
avs_refresh_token: The AVS refresh token in char.
len: The length of the token.

Returns
NA

Example Code
Example: alexa_basic
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Audio/examples/alexa_basic/alexa_basic.ino)

Notes and Warnings
This function need to be set up before running Alexa service. “Alexa.h” must be included to use the class function.

AlexaClass::setAvsClientId

Description
Set the AVS client ID.

Syntax
void setAvsClientId(char *avs_client_id, int len);

Parameters
avs_client_id: The AVS client ID in char.
len: The length of the ID.

Returns
NA

Example Code
Example: alexa_basic
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Audio/examples/alexa_basic/alexa_basic.ino)

Notes and Warnings
This function need to be set up before running Alexa service. “Alexa.h” must be included to use the class function.

AlexaClass::setAvsClientSecret

Description
Set the AVS client secret.

Syntax
void setAvsClientSecret(char *avs_client_secret, int len);

Parameters
avs_client_ secret: The AVS client secret in char.
len: The length of the secret.

Returns
NA

Example Code
Example: alexa_basic
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Audio/examples/alexa_basic/alexa_basic.ino)

Notes and Warnings
This function need to be set up before running Alexa service. “Alexa.h” must be included to use the class function.

AlexaClass::setAvsHttp2Host

Description
Set the AVS host for http2.

Syntax
void setAvsHttp2Host(char *avs_http2_host, int len);

Parameters
avs_ http2_host: The AVS http2 host in char.
len: The length of the host name.

Returns
NA

Example Code
Example: alexa_basic
(https://github.com/ambiot/amb1_arduino/blob/dev/Arduino_package/hardware/libraries/Audio/examples/alexa_basic/alexa_basic.ino)

Notes and Warnings
This function need to be set up before running Alexa service. “Alexa.h” must be included to use the class function.

Please confirm that QQ communication software is installed