Adafruit Library
|
#include "Wippersnapper.h"
Functions | |
bool | cbDecodePinConfigMsg (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Decodes a repeated ConfigurePinRequests messages. More... | |
bool | cbDecodeDigitalPinWriteMsg (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Decodes repeated PinEvents (digital pin write) messages. More... | |
bool | cbSignalMsg (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Sets payload callbacks inside the signal message's submessage. More... | |
void | cbSignalTopic (char *data, uint16_t len) |
Called when signal topic receives a new message. Fills shared buffer with data from payload. More... | |
void | publishI2CResponse (wippersnapper_signal_v1_I2CResponse *msgi2cResponse) |
Publishes an I2C response signal message to the broker. More... | |
bool | encodeI2CResponse (wippersnapper_signal_v1_I2CResponse *msgi2cResponse) |
Encodes an wippersnapper_signal_v1_I2CResponse message. More... | |
bool | initializeI2CBus (wippersnapper_i2c_v1_I2CBusInitRequest msgInitRequest) |
Initializes an I2C bus component. More... | |
bool | cbDecodeI2CDeviceInitRequestList (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Decodes a list of I2C Device Initialization messages. More... | |
bool | cbDecodeSignalRequestI2C (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Decodes an I2C signal request message and executes the callback based on the message's tag. If successful, publishes an I2C signal response back to the broker. More... | |
void | cbSignalI2CReq (char *data, uint16_t len) |
Called when i2c signal sub-topic receives a new message and attempts to decode a signal request message. More... | |
bool | cbDecodeServoMsg (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Decodes a servo message and dispatches to the servo component. More... | |
void | cbServoMsg (char *data, uint16_t len) |
Called when the device recieves a new message from the /servo/ topic. More... | |
bool | cbPWMDecodeMsg (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Decodes a servo message and dispatches to the servo component. More... | |
void | cbPWMMsg (char *data, uint16_t len) |
Called when the device recieves a new message from the /pwm/ topic. More... | |
bool | cbDecodeDs18x20Msg (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Decodes a Dallas Sensor (ds18x20) signal request message and executes the callback based on the message's tag. More... | |
void | cbSignalDSReq (char *data, uint16_t len) |
Called when DallasSensor (DS) signal sub-topic receives a new message and attempts to decode the message. More... | |
bool | cbDecodePixelsMsg (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Decodes a pixel strand request message and executes the callback based on the message's tag. More... | |
void | cbPixelsMsg (char *data, uint16_t len) |
Called when the device recieves a new message from the /pixels/ topic. More... | |
bool | cbDecodeUARTMessage (pb_istream_t *stream, const pb_field_t *field, void **arg) |
Decodes a UART message and executes the callback based on the message's tag. More... | |
void | cbSignalUARTReq (char *data, uint16_t len) |
Called when the signal UART sub-topic receives a new message. Performs decoding. More... | |
void | cbRegistrationStatus (char *data, uint16_t len) |
Called when broker responds to a device's publish across the registration topic. More... | |
void | cbErrorTopic (char *errorData, uint16_t len) |
Called when client receives a message published across the Adafruit IO MQTT /error special topic. More... | |
void | cbThrottleTopic (char *throttleData, uint16_t len) |
Called when client receives a message published across the Adafruit IO MQTT /throttle special topic. Delays until throttle is released. More... | |
void | print_reset_reason (int reason) |
Prints last reset reason of ESP32. More... | |
void | printDeviceInfo () |
Prints information about the WS device to the serial monitor. | |
Variables | |
Wippersnapper | WS |
Global member variable for callbacks. More... | |
bool cbDecodePinConfigMsg | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Decodes a repeated ConfigurePinRequests messages.
stream | Input stream to read from. |
field | Message descriptor, usually autogenerated. |
arg | Stores any information the decoding callback may need. |
bool cbDecodeDigitalPinWriteMsg | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Decodes repeated PinEvents (digital pin write) messages.
stream | Input stream to read from. |
field | Message descriptor, usually autogenerated. |
arg | Stores any information the decoding callback may need. |
bool cbSignalMsg | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Sets payload callbacks inside the signal message's submessage.
stream | Input stream to read from. |
field | Message descriptor, usually autogenerated. |
arg | Stores any information the decoding callback may need. |
void cbSignalTopic | ( | char * | data, |
uint16_t | len | ||
) |
Called when signal topic receives a new message. Fills shared buffer with data from payload.
data | Data from MQTT broker. |
len | Length of data received from MQTT broker. |
void publishI2CResponse | ( | wippersnapper_signal_v1_I2CResponse * | msgi2cResponse | ) |
Publishes an I2C response signal message to the broker.
msgi2cResponse | A pointer to an I2C response message typedef. |
bool encodeI2CResponse | ( | wippersnapper_signal_v1_I2CResponse * | msgi2cResponse | ) |
Encodes an wippersnapper_signal_v1_I2CResponse message.
msgi2cResponse | A pointer to an wippersnapper_signal_v1_I2CResponse. |
bool initializeI2CBus | ( | wippersnapper_i2c_v1_I2CBusInitRequest | msgInitRequest | ) |
Initializes an I2C bus component.
msgInitRequest | A pointer to an i2c bus initialization message. |
bool cbDecodeI2CDeviceInitRequestList | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Decodes a list of I2C Device Initialization messages.
stream | Incoming data stream from buffer. |
field | Protobuf message's tag type. |
arg | Optional arguments from pb_decode calling function. |
bool cbDecodeSignalRequestI2C | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Decodes an I2C signal request message and executes the callback based on the message's tag. If successful, publishes an I2C signal response back to the broker.
stream | Incoming data stream from buffer. |
field | Protobuf message's tag type. |
arg | Optional arguments from decoder calling function. |
void cbSignalI2CReq | ( | char * | data, |
uint16_t | len | ||
) |
Called when i2c signal sub-topic receives a new message and attempts to decode a signal request message.
data | Incoming data from MQTT broker. |
len | Length of incoming data. |
bool cbDecodeServoMsg | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Decodes a servo message and dispatches to the servo component.
stream | Incoming data stream from buffer. |
field | Protobuf message's tag type. |
arg | Optional arguments from decoder calling function. |
void cbServoMsg | ( | char * | data, |
uint16_t | len | ||
) |
Called when the device recieves a new message from the /servo/ topic.
data | Incoming data from MQTT broker. |
len | Length of incoming data. |
bool cbPWMDecodeMsg | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Decodes a servo message and dispatches to the servo component.
stream | Incoming data stream from buffer. |
field | Protobuf message's tag type. |
arg | Optional arguments from decoder calling function. |
void cbPWMMsg | ( | char * | data, |
uint16_t | len | ||
) |
Called when the device recieves a new message from the /pwm/ topic.
data | Incoming data from MQTT broker. |
len | Length of incoming data. |
bool cbDecodeDs18x20Msg | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Decodes a Dallas Sensor (ds18x20) signal request message and executes the callback based on the message's tag.
stream | Incoming data stream from buffer. |
field | Protobuf message's tag type. |
arg | Optional arguments from decoder calling function. |
void cbSignalDSReq | ( | char * | data, |
uint16_t | len | ||
) |
Called when DallasSensor (DS) signal sub-topic receives a new message and attempts to decode the message.
data | Incoming data from MQTT broker. |
len | Length of incoming data. |
bool cbDecodePixelsMsg | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Decodes a pixel strand request message and executes the callback based on the message's tag.
stream | Incoming data stream from buffer. |
field | Protobuf message's tag type. |
arg | Optional arguments from decoder calling function. |
void cbPixelsMsg | ( | char * | data, |
uint16_t | len | ||
) |
Called when the device recieves a new message from the /pixels/ topic.
data | Incoming data from MQTT broker. |
len | Length of incoming data. |
bool cbDecodeUARTMessage | ( | pb_istream_t * | stream, |
const pb_field_t * | field, | ||
void ** | arg | ||
) |
Decodes a UART message and executes the callback based on the message's tag.
stream | Incoming data stream from buffer. |
field | Protobuf message's tag type. |
arg | Optional arguments from decoder calling function. |
void cbSignalUARTReq | ( | char * | data, |
uint16_t | len | ||
) |
Called when the signal UART sub-topic receives a new message. Performs decoding.
data | Incoming data from MQTT broker. |
len | Length of incoming data. |
void cbRegistrationStatus | ( | char * | data, |
uint16_t | len | ||
) |
Called when broker responds to a device's publish across the registration topic.
data | Data from MQTT broker. |
len | Length of data received from MQTT broker. |
void cbErrorTopic | ( | char * | errorData, |
uint16_t | len | ||
) |
Called when client receives a message published across the Adafruit IO MQTT /error special topic.
errorData | Data from MQTT broker. |
len | Length of data received from MQTT broker. |
void cbThrottleTopic | ( | char * | throttleData, |
uint16_t | len | ||
) |
Called when client receives a message published across the Adafruit IO MQTT /throttle special topic. Delays until throttle is released.
throttleData | Throttle message from Adafruit IO. |
len | Length of data received from MQTT broker. |
void print_reset_reason | ( | int | reason | ) |
Prints last reset reason of ESP32.
reason | The return code of rtc_get_reset_reason(coreNum) |
<1, Vbat power on reset
<3, Software reset digital core
<4, Legacy watch dog reset digital core
<5, Deep Sleep reset digital core
<6, Reset by SLC module, reset digital core
<7, Timer Group0 Watch dog reset digital core
<8, Timer Group1 Watch dog reset digital core
<9, RTC Watch dog Reset digital core
<10, Instrusion tested to reset CPU
<11, Time Group reset CPU
<12, Software reset CPU
<13, RTC Watch dog Reset CPU
<14, for APP CPU, reseted by PRO CPU
<15, Reset when the vdd voltage is not stable
<16, RTC Watch dog reset digital core and rtc module
Global member variable for callbacks.
Wippersnapper variable.