AWS IoT Firmware
Firmware code for AWS IoT Devices
Public Member Functions | Static Public Member Functions | List of all members
SpeakerCtrlHandler Class Reference
Inheritance diagram for SpeakerCtrlHandler:
Inheritance graph
[legend]
Collaboration diagram for SpeakerCtrlHandler:
Collaboration graph
[legend]

Public Member Functions

HandlerError handleRequest (struct mg_connection *mgCon, struct mg_str *message, char *commandName, char *response)
 function to handle request passed by aws mqtt Depending on the reques type, the handler will either mute the device, adjust volume or set new volume entirely More...
 
HandlerError handleReport (char *stateReport)
 handle preparing report for the speaker handler used when the handler needs to respond to the , will report whether the speaker is muted and what the volume is More...
 
 SpeakerCtrlHandler (void)
 Construct a new Speaker Ctrl Handler:: Speaker Ctrl Handler object create a new spekaer handler, intialize the namespace argument, prepare analog, and interrupt pins, set speaker to mute.
 
void checkPotVoltage (void)
 called by the main polling function to check and update the pot voltage if necessary read the adc voltage and if the voltage changes over a certain threshold, which indicates that the user has moved the pot, then the volume will be adjusted accordingly
 
- Public Member Functions inherited from ParentHandler
HandlerError createReport (char *report, const char *fmt, uint8_t totalArg,...)
 used for generating a json report string based on the format given, usually child handler uses this to prepare replies to the aws lambda server More...
 
bool canHandleRequest (char *requestNameSpace)
 used to check if a handler object can handle a request with a specific namespace More...
 
char * getNameSpace (void)
 return the command namespace that the handler support More...
 

Static Public Member Functions

static void pwrInputIntHandler (int pin, void *arg)
 handler function for when the user turn on/off the physical pot on the speaker This function will either turn on/off the speaker based on the user interaction with the physical potentiometer More...
 

Additional Inherited Members

- Protected Attributes inherited from ParentHandler
char _nameSpace [MAX_NAMESPACE_LEN]
 namespace that the handler supports, all child classes must initialize this variable to let the master handler know which namespace it supports
 

The documentation for this class was generated from the following files: