Namespace CayenneLPP
Classes
| Type | Name |
|---|---|
| struct | AcceleroVal_t |
| class | CayenneLPP <static_size> |
| struct | GPSCoord_t |
| struct | GyroVal_t |
| struct | Measurement_t |
Public Types
| Type | Name |
|---|---|
| typedef uint16_t | AnalogGPIOVal_t |
| typedef uint16_t | BarometricPressure_t |
| union | MeasurementData_t |
| enum | CayenneMeasurementType_t |
| typedef uint8_t | DigitalGPIOVal_t |
| typedef float | Float32Val_t |
| typedef uint16_t | LuminosityVal_t |
| typedef uint8_t | PresenceVal_t |
| typedef uint8_t | RawBitVal_t |
| typedef uint8_t | RawByteVal_t |
| typedef uint16_t | RelativeHumidity_t |
| typedef uint16_t | TemperatureVal_t |
| typedef uint16_t | Word16Val_t |
| typedef uint32_t | Word32Val_t |
Public Static Functions
| Type | Name |
|---|---|
| Measurement_t | ResetMeasurement () Clears currently used Measurement struct with invalid data. |
| Measurement_t | SetAcceleration (const float x, const float y, const float z) Sets the acceleration values for the x, y, and z axes. |
| Measurement_t | SetAnalogInput (const float analog_input_val) Sets the analog input value. |
| Measurement_t | SetAnalogOutput (const float analog_output_val) Sets the analog output value. |
| Measurement_t | SetBarometricPressure (const float barometric_pressure_val) Sets the barometric pressure value. |
| Measurement_t | SetDigitalInput (const uint8_t digital_input_val) Sets the digital input value. |
| Measurement_t | SetDigitalOutput (const uint8_t digital_output_val) Sets the digital output value. |
| Measurement_t | SetFloat32 (const float float32_val) Sets a 32-bit floating-point value in a measurement. |
| Measurement_t | SetGPS (const float latitude, const float longitude, const float altitude) Sets the GPS coordinates and altitude. |
| Measurement_t | SetGyro (const float x, const float y, const float z) Sets the gyroscopic values for the x, y, and z axes. |
| Measurement_t | SetLuminosity (const float luminosity_val) Sets the luminosity value. |
| Measurement_t | SetPresence (const uint8_t presence_val) Sets the presence value. |
| void | SetRawBit (const uint8_t raw_bit_val, Measurement_t * prevMeasurement) Sets a raw bit value in a measurement. |
| Measurement_t | SetRawByte (const uint8_t raw_byte_val) Sets a raw byte value in a measurement. |
| Measurement_t | SetRelativeHumidity (const float humidity_val) Sets the relative humidity value. |
| Measurement_t | SetTemperature (const float temperature_val) Sets the temperature value. |
| Measurement_t | SetWord16 (const uint16_t word16_val) Sets a 16-bit word value in a measurement. |
| Measurement_t | SetWord32 (const uint32_t word32_val) Sets a 32-bit word value in a measurement. |
Public Types Documentation
typedef AnalogGPIOVal_t
typedef BarometricPressure_t
union MeasurementData_t
enum CayenneMeasurementType_t
enum CayenneLPP::CayenneMeasurementType_t {
MEASUREMENT_TYPE_INVALID = 255,
MEASUREMENT_TYPE_DIGITAL_OUTPUT = 1,
MEASUREMENT_TYPE_DIGITAL_INPUT = 0,
MEASUREMENT_TYPE_RAWBIT_1 = 116,
MEASUREMENT_TYPE_RAWBIT_2 = 117,
MEASUREMENT_TYPE_RAWBIT_3 = 118,
MEASUREMENT_TYPE_RAWBIT_4 = 119,
MEASUREMENT_TYPE_RAWBIT_5 = 120,
MEASUREMENT_TYPE_RAWBIT_6 = 121,
MEASUREMENT_TYPE_RAWBIT_7 = 122,
MEASUREMENT_TYPE_RAWBIT_8 = 123,
MEASUREMENT_TYPE_RAWBYTE = 5,
MEASUREMENT_TYPE_RAWWORD16 = 6,
MEASUREMENT_TYPE_RAWWORD32 = 7,
MEASUREMENT_TYPE_RAWFLOAT32 = 8,
MEASUREMENT_TYPE_PRESENCE = 102,
MEASUREMENT_TYPE_LUMINOSITY = 101,
MEASUREMENT_TYPE_ANALOG_OUTPUT = 3,
MEASUREMENT_TYPE_ANALOG_INPUT = 2,
MEASUREMENT_TYPE_TEMPERATURE = 103,
MEASUREMENT_TYPE_RELATIVE_HUMIDITY = 104,
MEASUREMENT_TYPE_BAROMETRIC_PRESSURE = 115,
MEASUREMENT_TYPE_ACCELERATION = 113,
MEASUREMENT_TYPE_GYRO = 134,
MEASUREMENT_TYPE_GPS = 136
};
typedef DigitalGPIOVal_t
typedef Float32Val_t
typedef LuminosityVal_t
typedef PresenceVal_t
typedef RawBitVal_t
Represents a single bit value, often used in bit manipulation or status indication.
typedef RawByteVal_t
Represents a raw byte value, typically used for byte-oriented data operations.
typedef RelativeHumidity_t
typedef TemperatureVal_t
typedef Word16Val_t
typedef Word32Val_t
Public Static Functions Documentation
function ResetMeasurement
Clears currently used Measurement struct with invalid data.
Returns:
Measurement_t A Measurement_t structure initialized with invalid data
function SetAcceleration
Sets the acceleration values for the x, y, and z axes.
static inline Measurement_t CayenneLPP::SetAcceleration (
const float x,
const float y,
const float z
)
This function initializes a Measurement_t structure with scaled acceleration values and sets the measurement type to MEASUREMENT_TYPE_ACCELERATION. The acceleration values are scaled by a factor of 1000 to convert them from floats to uint16_t, providing milli-g precision in their digital representation. It is used for capturing or simulating acceleration in various axes, typically in motion or orientation detection applications.
Parameters:
xThe acceleration value along the x-axis.yThe acceleration value along the y-axis.zThe acceleration value along the z-axis. These values are scaled by 1000 for precise milli-g representation.
Returns:
Measurement_t A Measurement_t structure initialized with the scaled acceleration values and the type set to MEASUREMENT_TYPE_ACCELERATION.
function SetAnalogInput
Sets the analog input value.
This function initializes a Measurement_t structure with a scaled analog input value and sets the measurement type to MEASUREMENT_TYPE_ANALOG_INPUT. The analog input value is scaled by a factor of 100 to convert it from a float to a uint16_t for digital representation. It is used for capturing or simulating analog sensor readings.
Parameters:
analog_input_valThe analog input value to set, as a floating-point number. This value is scaled by 100 to facilitate digital representation without losing precision.
Returns:
Measurement_t A Measurement_t structure initialized with the scaled analog input value and the type set to MEASUREMENT_TYPE_ANALOG_INPUT.
function SetAnalogOutput
Sets the analog output value.
This function initializes a Measurement_t structure with a scaled analog output value and sets the measurement type to MEASUREMENT_TYPE_ANALOG_OUTPUT. The analog output value is scaled by a factor of 100 to convert it from a float to a uint16_t for digital representation. It is designed for controlling analog output devices or interfaces.
Parameters:
analog_output_valThe analog output value to set, as a floating-point number. This value is scaled by 100 to facilitate digital representation without losing precision.
Returns:
Measurement_t A Measurement_t structure initialized with the scaled analog output value and the type set to MEASUREMENT_TYPE_ANALOG_OUTPUT.
function SetBarometricPressure
Sets the barometric pressure value.
static inline Measurement_t CayenneLPP::SetBarometricPressure (
const float barometric_pressure_val
)
This function initializes a Measurement_t structure with a scaled barometric pressure value and sets the measurement type to MEASUREMENT_TYPE_BAROMETRIC_PRESSURE. The pressure value is scaled by a factor of 10 to convert it from a float to a uint16_t, providing a precision of 0.1 hPa (hectopascals) in its digital representation. It is used for atmospheric pressure monitoring in weather stations or environmental monitoring systems.
Parameters:
barometric_pressure_valThe barometric pressure value to set, as a floating-point number. This value is scaled by 10 to provide a precision of 0.1 hPa.
Returns:
Measurement_t A Measurement_t structure initialized with the scaled barometric pressure value and the type set to MEASUREMENT_TYPE_BAROMETRIC_PRESSURE.
function SetDigitalInput
Sets the digital input value.
This function initializes a Measurement_t structure with the given digital input value and sets the measurement type to MEASUREMENT_TYPE_DIGITAL_INPUT. It is primarily used for capturing or simulating the state of digital input pins in hardware abstraction layers.
Parameters:
digital_input_valThe digital input value to set. This value is typically used to represent the state of a digital input, such as reading a pin as high (1) or low (0).
Returns:
Measurement_t A Measurement_t structure initialized with the digital input value and the type set to MEASUREMENT_TYPE_DIGITAL_INPUT.
function SetDigitalOutput
Sets the digital output value.
This function initializes a Measurement_t structure with the given digital output value and sets the measurement type to MEASUREMENT_TYPE_DIGITAL_OUTPUT. It is designed to be used for configuring or controlling digital output pins in hardware abstraction layers.
Parameters:
digital_output_valThe digital output value to set. This value is typically used to control a digital output, such as setting a pin high (1) or low (0).
Returns:
Measurement_t A Measurement_t structure initialized with the digital output value and the type set to MEASUREMENT_TYPE_DIGITAL_OUTPUT.
function SetFloat32
Sets a 32-bit floating-point value in a measurement.
This function initializes a Measurement_t structure with a 32-bit floating-point value and sets the measurement type to MEASUREMENT_TYPE_RAWFLOAT32. It is particularly used for handling floating-point data in scenarios where precise numerical values are essential, such as in scientific measurements or complex data processing tasks.
Parameters:
float32_valThe 32-bit floating-point value to set.
Returns:
Measurement_t A Measurement_t structure initialized with the 32-bit floating-point value and the type set to MEASUREMENT_TYPE_RAWFLOAT32.
function SetGPS
Sets the GPS coordinates and altitude.
static inline Measurement_t CayenneLPP::SetGPS (
const float latitude,
const float longitude,
const float altitude
)
This function initializes a Measurement_t structure with scaled GPS coordinate and altitude values and sets the measurement type to MEASUREMENT_TYPE_GPS. The latitude and longitude values are scaled by a factor of 10000, and the altitude by 100, converting them from floats to uint32_t for precise geographic positioning. It is used for tracking and navigation applications.
Parameters:
latitudeThe latitude value in degrees.longitudeThe longitude value in degrees.altitudeThe altitude value in meters. The latitude and longitude are scaled by 10000, and altitude by 100, for precise representation.
Returns:
Measurement_t A Measurement_t structure initialized with the scaled GPS values and the type set to MEASUREMENT_TYPE_GPS.
function SetGyro
Sets the gyroscopic values for the x, y, and z axes.
This function initializes a Measurement_t structure with scaled gyroscopic values and sets the measurement type to MEASUREMENT_TYPE_GYRO. The gyro values are scaled by a factor of 100 to convert them from floats to uint16_t, aiming to maintain precision for angular velocity measurements. It is typically used in orientation and rotation detection systems.
Parameters:
xThe gyro value along the x-axis.yThe gyro value along the y-axis.zThe gyro value along the z-axis. These values are scaled by 100 for digital representation.
Returns:
Measurement_t A Measurement_t structure initialized with the scaled gyro values and the type set to MEASUREMENT_TYPE_GYRO.
function SetLuminosity
Sets the luminosity value.
This function initializes a Measurement_t structure with the given luminosity value and sets the measurement type to MEASUREMENT_TYPE_LUMINOSITY. It is primarily used for monitoring or simulating light intensity levels in various applications, ranging from environmental sensing to smart lighting control.
Parameters:
luminosity_valThe luminosity value to set. This value typically represents the intensity of light measured, using a specific unit such as lux.
Returns:
Measurement_t A Measurement_t structure initialized with the luminosity value and the type set to MEASUREMENT_TYPE_LUMINOSITY.
function SetPresence
Sets the presence value.
This function initializes a Measurement_t structure with the given presence value and sets the measurement type to MEASUREMENT_TYPE_PRESENCE. It is designed to be used for representing the presence or absence of an object or entity, typically detected through sensors.
Parameters:
presence_valThe presence value to set. This value is typically used to indicate the detection of presence (1) or absence (0) of an entity.
Returns:
Measurement_t A Measurement_t structure initialized with the presence value and the type set to MEASUREMENT_TYPE_PRESENCE.
function SetRawBit
Sets a raw bit value in a measurement.
static inline void CayenneLPP::SetRawBit (
const uint8_t raw_bit_val,
Measurement_t * prevMeasurement
)
This function updates the provided measurement with a new bit value, setting or appending it based on the previous measurement's type. It is used to incrementally build up a raw bit measurement from individual bits.
Parameters:
raw_bit_valThe raw bit value to set or append. Only the least significant bit is used.prevMeasurementReference to the previous measurement which will be updated with the new bit value.
Returns:
void
function SetRawByte
Sets a raw byte value in a measurement.
This function initializes a Measurement_t structure with a raw byte value and sets the measurement type to MEASUREMENT_TYPE_RAWBYTE. It is used for handling raw byte data in various data communication or storage scenarios.
Parameters:
raw_byte_valThe raw byte value to set.
Returns:
Measurement_t A Measurement_t structure initialized with the raw byte value and the type set to MEASUREMENT_TYPE_RAWBYTE.
function SetRelativeHumidity
Sets the relative humidity value.
This function initializes a Measurement_t structure with a scaled relative humidity value and sets the measurement type to MEASUREMENT_TYPE_RELATIVE_HUMIDITY. The humidity value is scaled by a factor of 2 to convert it from a float to a uint16_t, aiming to maintain precision while accommodating the data type. It is used for humidity monitoring in environmental control systems.
Parameters:
humidity_valThe relative humidity value to set, as a floating-point number. This value is scaled by 2 to adjust for the digital representation.
Returns:
Measurement_t A Measurement_t structure initialized with the scaled relative humidity value and the type set to MEASUREMENT_TYPE_RELATIVE_HUMIDITY.
function SetTemperature
Sets the temperature value.
This function initializes a Measurement_t structure with a scaled temperature value and sets the measurement type to MEASUREMENT_TYPE_TEMPERATURE. The temperature value is scaled by a factor of 10 to convert it from a float to a uint16_t, allowing for a fraction of a degree precision in digital representation. It is used for temperature monitoring applications.
Parameters:
temperature_valThe temperature value to set, as a floating-point number. This value is scaled by 10 to provide a precision of 0.1 degrees in its digital form.
Returns:
Measurement_t A Measurement_t structure initialized with the scaled temperature value and the type set to MEASUREMENT_TYPE_TEMPERATURE.
function SetWord16
Sets a 16-bit word value in a measurement.
This function initializes a Measurement_t structure with a 16-bit word value and sets the measurement type to MEASUREMENT_TYPE_RAWWORD16. It is used for handling 16-bit data in various scenarios, such as digital communication or sensor data encoding.
Parameters:
word16_valThe 16-bit word value to set.
Returns:
Measurement_t A Measurement_t structure initialized with the 16-bit word value and the type set to MEASUREMENT_TYPE_RAWWORD16.
function SetWord32
Sets a 32-bit word value in a measurement.
This function initializes a Measurement_t structure with a 32-bit word value and sets the measurement type to MEASUREMENT_TYPE_RAWWORD32. It is used for handling 32-bit data in various applications, including data communication and sensor data processing.
Parameters:
word32_valThe 32-bit word value to set.
Returns:
Measurement_t A Measurement_t structure initialized with the 32-bit word value and the type set to MEASUREMENT_TYPE_RAWWORD32.
The documentation for this class was generated from the following file src/CayenneLPP.hpp