![]() |
Demo HCI Implementation for WiMOD-LR Devices
V2.0.3
|
A simple Cayenne LPP message builder class. More...
#include <Cayenne/CayenneLPP.h>
Public Member Functions | |
| CayenneLPP (uint8_t *buf, uint8_t size) | |
| Constructor of a simple Cayenne LPP wrapper. More... | |
| ~CayenneLPP () | |
| Destructor. | |
| void | reset (void) |
| reset all internal data. Should by called prior building a new message | |
| uint8_t | getSize (void) |
| get the current size of the build message in bytes More... | |
| uint8_t * | getBuffer (void) |
| get a pointer to the internal data buffer More... | |
| uint8_t | copy (uint8_t *buffer) |
| copy the build up message to an external buffer More... | |
| uint8_t | addDigitalInput (uint8_t channel, uint8_t value) |
| intert value of type "digital input" into the message More... | |
| uint8_t | addDigitalOutput (uint8_t channel, uint8_t value) |
| intert value of type "digital output" into the message More... | |
| uint8_t | addAnalogInput (uint8_t channel, float value) |
| intert value of type "analog input" into the message More... | |
| uint8_t | addAnalogOutput (uint8_t channel, float value) |
| intert value of type "digital output" into the message More... | |
| uint8_t | addLuminosity (uint8_t channel, uint16_t lux) |
| intert value of type "Luminosity" into the message More... | |
| uint8_t | addPresence (uint8_t channel, uint8_t value) |
| intert value of type "presence" into the message More... | |
| uint8_t | addTemperature (uint8_t channel, float celsius) |
| intert value of type "temperature" into the message More... | |
| uint8_t | addRelativeHumidity (uint8_t channel, float rh) |
| intert value of type "relative humidity" into the message More... | |
| uint8_t | addAccelerometer (uint8_t channel, float x, float y, float z) |
| intert value of type "accelerometer" into the message More... | |
| uint8_t | addBarometricPressure (uint8_t channel, float hpa) |
| intert value of type "barometric pressure" into the message More... | |
| uint8_t | addGyrometer (uint8_t channel, float x, float y, float z) |
| intert value of type "gyrometer" into the message More... | |
| uint8_t | addGPS (uint8_t channel, float latitude, float longitude, float meters) |
| intert value of type "GPS" into the message More... | |
| uint8_t | addCustomValue (uint8_t channel, uint8_t type, uint8_t valueSize, uint8_t *value) |
| function to add a generic value More... | |
A simple Cayenne LPP message builder class.
| CayenneLPP::CayenneLPP | ( | uint8_t * | buf, |
| uint8_t | size | ||
| ) |
Constructor of a simple Cayenne LPP wrapper.
| buf | Pointer to a buffer where to build up cayenne compliant messages |
| size | (max) size of the buffer in bytes |
Orginal code: Mydevices documentation
| uint8_t CayenneLPP::addAccelerometer | ( | uint8_t | channel, |
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
intert value of type "accelerometer" into the message
| channel | the number of the channel to use |
| x | the value of the x-axis |
| y | the value of the y-axis |
| z | the value of the z-axis |
| uint8_t CayenneLPP::addAnalogInput | ( | uint8_t | channel, |
| float | value | ||
| ) |
intert value of type "analog input" into the message
| channel | the number of the channel to use |
| value | the value of the analog input |
| uint8_t CayenneLPP::addAnalogOutput | ( | uint8_t | channel, |
| float | value | ||
| ) |
intert value of type "digital output" into the message
| channel | the number of the channel to use |
| value | the value of the digital output |
| uint8_t CayenneLPP::addBarometricPressure | ( | uint8_t | channel, |
| float | hpa | ||
| ) |
intert value of type "barometric pressure" into the message
| channel | the number of the channel to use |
| hpa | the value of the presure |
| uint8_t CayenneLPP::addCustomValue | ( | uint8_t | channel, |
| uint8_t | type, | ||
| uint8_t | valueSize, | ||
| uint8_t * | value | ||
| ) |
function to add a generic value
This function can be used to add a value of a "sensor" type that is currently not pre-defines as API function. The type of sensor can be manually defined here
| channel | the number of the channel to use |
| type | the type of sensor to add |
| valueSize | number of byte of the value to add |
| value | pointer to the sensor value itself |
| uint8_t CayenneLPP::addDigitalInput | ( | uint8_t | channel, |
| uint8_t | value | ||
| ) |
intert value of type "digital input" into the message
| channel | the number of the channel to use |
| value | the value of the digital input |
| uint8_t CayenneLPP::addDigitalOutput | ( | uint8_t | channel, |
| uint8_t | value | ||
| ) |
intert value of type "digital output" into the message
| channel | the number of the channel to use |
| value | the value of the digital output |
| uint8_t CayenneLPP::addGPS | ( | uint8_t | channel, |
| float | latitude, | ||
| float | longitude, | ||
| float | meters | ||
| ) |
intert value of type "GPS" into the message
| channel | the number of the channel to use |
| latitude | latitude infos |
| longitude | longitude infos |
| meters | hight |
| uint8_t CayenneLPP::addGyrometer | ( | uint8_t | channel, |
| float | x, | ||
| float | y, | ||
| float | z | ||
| ) |
intert value of type "gyrometer" into the message
| channel | the number of the channel to use |
| x | the value of the x-axis |
| y | the value of the y-axis |
| z | the value of the z-axis |
| uint8_t CayenneLPP::addLuminosity | ( | uint8_t | channel, |
| uint16_t | lux | ||
| ) |
intert value of type "Luminosity" into the message
| channel | the number of the channel to use |
| lux | the value of the luminosity |
| uint8_t CayenneLPP::addPresence | ( | uint8_t | channel, |
| uint8_t | value | ||
| ) |
intert value of type "presence" into the message
| channel | the number of the channel to use |
| value | the value of the presence |
| uint8_t CayenneLPP::addRelativeHumidity | ( | uint8_t | channel, |
| float | rh | ||
| ) |
intert value of type "relative humidity" into the message
| channel | the number of the channel to use |
| rh | the value of the relative humidity |
| uint8_t CayenneLPP::addTemperature | ( | uint8_t | channel, |
| float | celsius | ||
| ) |
intert value of type "temperature" into the message
| channel | the number of the channel to use |
| celsius | the value of the temperature |
| uint8_t CayenneLPP::copy | ( | uint8_t * | dst | ) |
copy the build up message to an external buffer
| dst | destination buffer where to copy the data to. WARNING: the destination must be big enough |
| uint8_t * CayenneLPP::getBuffer | ( | void | ) |
get a pointer to the internal data buffer
| uint8_t CayenneLPP::getSize | ( | void | ) |
get the current size of the build message in bytes