L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
CayenneLpp.h File Reference

Implements the Cayenne Low Power Protocol. More...

#include <stdint.h>
Include dependency graph for CayenneLpp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void CayenneLppInit (void)
void CayenneLppReset (void)
uint8_t CayenneLppGetSize (void)
uint8_t * CayenneLppGetBuffer (void)
uint8_t CayenneLppCopy (uint8_t *buffer)
uint8_t CayenneLppAddDigitalInput (uint8_t channel, uint8_t value)
uint8_t CayenneLppAddDigitalOutput (uint8_t channel, uint8_t value)
uint8_t CayenneLppAddAnalogInput (uint8_t channel, float value)
uint8_t CayenneLppAddAnalogOutput (uint8_t channel, float value)
uint8_t CayenneLppAddLuminosity (uint8_t channel, uint16_t lux)
uint8_t CayenneLppAddPresence (uint8_t channel, uint8_t value)
uint8_t CayenneLppAddTemperature (uint8_t channel, float celsius)
uint8_t CayenneLppAddRelativeHumidity (uint8_t channel, float rh)
uint8_t CayenneLppAddAccelerometer (uint8_t channel, float x, float y, float z)
uint8_t CayenneLppAddBarometricPressure (uint8_t channel, float hpa)
uint8_t CayenneLppAddGyrometer (uint8_t channel, float x, float y, float z)
uint8_t CayenneLppAddGps (uint8_t channel, float latitude, float longitude, float meters)
uint8_t CayenneLppMaxBuffer ()
uint8_t CayenneLppAddConcentration (uint8_t channel, uint16_t ppm)
 Add CO2 concentration data to the buffer.
uint8_t CayenneLppAddVoltage (uint8_t channel, float voltage)
 Add voltage data to the buffer.
uint8_t CayenneLppAddParticulateMatter_1_0 (uint8_t channel, float concentration_1_0)
 Add particulate matter of 1mm concentration data to the buffer.
uint8_t CayenneLppAddParticulateMatter_2_5 (uint8_t channel, float concentration_2_5)
 Add particulate matter 2.5mm concentration data to the buffer.
uint8_t CayenneLppAddTimeMeasureABS (uint8_t channel, uint32_t timeMeasure)
 Add UTC time of measuring to the buffer - absolute time of measure.
uint8_t CayenneLppAddTimeMeasureMIN8 (uint8_t channel, uint8_t timeOffsetMin8)
 Add the relative time of measuring - offset from previous measured data less than 255 minutes The time is in minutes, maximum 255 minutes about 4.25hour.
uint8_t CayenneLppAddTimeMeasureMIN16 (uint8_t channel, uint16_t timeOffsetMin16)
 Add the relative time of measuring - offset from previous measured data less than 65535 minutes (about 45.5days) The time is in minutes, maximum 65535 minutes about 45.5 of days.
uint8_t CayenneLppAddBatteryPerc (uint8_t channel, uint8_t perc)
 Add battery percent of voltage data to the buffer (1B).

Detailed Description

Implements the Cayenne Low Power Protocol.

______ _
/ _____) _ | |
( (____ _____ ____ _| |_ _____ ____| |__
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
(C)2013-2018 Semtech
static struct @042147022327042232212126043022001043033342036075 _
Author
Miguel Luis ( Semtech )

Definition in file CayenneLpp.h.

Function Documentation

◆ CayenneLppAddAccelerometer()

uint8_t CayenneLppAddAccelerometer ( uint8_t channel,
float x,
float y,
float z )

◆ CayenneLppAddAnalogInput()

uint8_t CayenneLppAddAnalogInput ( uint8_t channel,
float value )

◆ CayenneLppAddAnalogOutput()

uint8_t CayenneLppAddAnalogOutput ( uint8_t channel,
float value )

◆ CayenneLppAddBarometricPressure()

uint8_t CayenneLppAddBarometricPressure ( uint8_t channel,
float hpa )

Definition at line 331 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_BAROMETRIC_PRESSURE, and LPP_BAROMETRIC_PRESSURE_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddBatteryPerc()

uint8_t CayenneLppAddBatteryPerc ( uint8_t channel,
uint8_t perc )

Add battery percent of voltage data to the buffer (1B).

Parameters
channelData channel
percpercentage of battery level, value 0-100
Returns
Current buffer position

Definition at line 543 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_BATTERY_PERC, and LPP_BATTERY_PERC_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddConcentration()

uint8_t CayenneLppAddConcentration ( uint8_t channel,
uint16_t ppm )

Add CO2 concentration data to the buffer.

Parameters
channelData channel
ppmCO2 concentration in parts per million (ppm)
Returns
Current buffer position

Definition at line 423 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_CONCENTRATION, and LPP_CONCENTRATION_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddDigitalInput()

uint8_t CayenneLppAddDigitalInput ( uint8_t channel,
uint8_t value )

◆ CayenneLppAddDigitalOutput()

uint8_t CayenneLppAddDigitalOutput ( uint8_t channel,
uint8_t value )

◆ CayenneLppAddGps()

uint8_t CayenneLppAddGps ( uint8_t channel,
float latitude,
float longitude,
float meters )

◆ CayenneLppAddGyrometer()

uint8_t CayenneLppAddGyrometer ( uint8_t channel,
float x,
float y,
float z )

◆ CayenneLppAddLuminosity()

uint8_t CayenneLppAddLuminosity ( uint8_t channel,
uint16_t lux )

Definition at line 229 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_LUMINOSITY, and LPP_LUMINOSITY_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddParticulateMatter_1_0()

uint8_t CayenneLppAddParticulateMatter_1_0 ( uint8_t channel,
float concentration_1_0 )

Add particulate matter of 1mm concentration data to the buffer.

Parameters
channelData channel
concentration_1_0Particle concentration of 1mm in μg/m³
Returns
Current buffer position

Definition at line 462 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_PARTICULATE_MATTER_1_0, and LPP_PARTICULATE_MATTER_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddParticulateMatter_2_5()

uint8_t CayenneLppAddParticulateMatter_2_5 ( uint8_t channel,
float concentration_2_5 )

Add particulate matter 2.5mm concentration data to the buffer.

Parameters
channelData channel
concentration_2_5Particle concentration of 2.5mm in μg/m³
Returns
Current buffer position

Definition at line 482 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_PARTICULATE_MATTER_2_5, and LPP_PARTICULATE_MATTER_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddPresence()

uint8_t CayenneLppAddPresence ( uint8_t channel,
uint8_t value )

◆ CayenneLppAddRelativeHumidity()

uint8_t CayenneLppAddRelativeHumidity ( uint8_t channel,
float rh )

Definition at line 286 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_RELATIVE_HUMIDITY, and LPP_RELATIVE_HUMIDITY_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddTemperature()

uint8_t CayenneLppAddTemperature ( uint8_t channel,
float celsius )

Definition at line 266 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_TEMPERATURE, and LPP_TEMPERATURE_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddTimeMeasureABS()

uint8_t CayenneLppAddTimeMeasureABS ( uint8_t channel,
uint32_t timeMeasure )

Add UTC time of measuring to the buffer - absolute time of measure.

Parameters
channelData channel
timeMeasureTime value in seconds (uint32_t) - Unix timestamp (seconds since epoch)
Returns
Current buffer position

Add UTC time of measuring to the buffer - absolute time of measure.

Parameters
channelData channel
timeMeasureTime value in seconds (uint32_t) - Unix timestamp (seconds since epoch)
Returns
Current buffer position

Definition at line 503 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_UNIX_TIME, and LPP_UNIX_TIME_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddTimeMeasureMIN16()

uint8_t CayenneLppAddTimeMeasureMIN16 ( uint8_t channel,
uint16_t timeOffsetMin16 )

Add the relative time of measuring - offset from previous measured data less than 65535 minutes (about 45.5days) The time is in minutes, maximum 65535 minutes about 45.5 of days.

Parameters
channelData channel
timeOffsetMin16time in minutes
Returns
Current buffer position

Definition at line 530 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_MIN16_TIME, and LPP_MIN16_TIME_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddTimeMeasureMIN8()

uint8_t CayenneLppAddTimeMeasureMIN8 ( uint8_t channel,
uint8_t timeOffsetMin8 )

Add the relative time of measuring - offset from previous measured data less than 255 minutes The time is in minutes, maximum 255 minutes about 4.25hour.

Parameters
channelData channel
timeOffsetMin8time in minutes
Returns
Current buffer position

Definition at line 519 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_MIN8_TIME, and LPP_MIN8_TIME_SIZE.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppAddVoltage()

uint8_t CayenneLppAddVoltage ( uint8_t channel,
float voltage )

Add voltage data to the buffer.

Parameters
channelData channel
voltageVoltage in volts
Returns
Current buffer position

Definition at line 442 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE, CayenneLppBuffer, CayenneLppCursor, LPP_VOLTAGE, and LPP_VOLTAGE_SIZE.

◆ CayenneLppCopy()

uint8_t CayenneLppCopy ( uint8_t * buffer)

Definition at line 140 of file CayenneLpp.c.

References CayenneLppBuffer, and CayenneLppCursor.

◆ CayenneLppGetBuffer()

uint8_t * CayenneLppGetBuffer ( void )

Definition at line 132 of file CayenneLpp.c.

References CayenneLppBuffer.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppGetSize()

uint8_t CayenneLppGetSize ( void )

Definition at line 124 of file CayenneLpp.c.

References CayenneLppCursor.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function:

◆ CayenneLppInit()

void CayenneLppInit ( void )

Definition at line 108 of file CayenneLpp.c.

References CayenneLppCursor.

◆ CayenneLppMaxBuffer()

uint8_t CayenneLppMaxBuffer ( )
Return values
themax number in bytes for CayenneLpp buffer

Definition at line 412 of file CayenneLpp.c.

References CAYENNE_LPP_MAXBUFFER_SIZE.

Referenced by myLoraWan_LastDataSend().

Here is the caller graph for this function:

◆ CayenneLppReset()

void CayenneLppReset ( void )

Definition at line 116 of file CayenneLpp.c.

References CayenneLppCursor.

Referenced by sensors_CayennelFromBckData().

Here is the caller graph for this function: