Skip to content

Namespace CayenneLPP

Namespace List > 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 uint16_t CayenneLPP::AnalogGPIOVal_t;

typedef BarometricPressure_t

typedef uint16_t CayenneLPP::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 uint8_t CayenneLPP::DigitalGPIOVal_t;

typedef Float32Val_t

typedef float CayenneLPP::Float32Val_t;

typedef LuminosityVal_t

typedef uint16_t CayenneLPP::LuminosityVal_t;

typedef PresenceVal_t

typedef uint8_t CayenneLPP::PresenceVal_t;

typedef RawBitVal_t

typedef uint8_t CayenneLPP::RawBitVal_t;

Represents a single bit value, often used in bit manipulation or status indication.

typedef RawByteVal_t

typedef uint8_t CayenneLPP::RawByteVal_t;

Represents a raw byte value, typically used for byte-oriented data operations.

typedef RelativeHumidity_t

typedef uint16_t CayenneLPP::RelativeHumidity_t;

typedef TemperatureVal_t

typedef uint16_t CayenneLPP::TemperatureVal_t;

typedef Word16Val_t

typedef uint16_t CayenneLPP::Word16Val_t;

typedef Word32Val_t

typedef uint32_t CayenneLPP::Word32Val_t;

Public Static Functions Documentation

function ResetMeasurement

Clears currently used Measurement struct with invalid data.

static inline Measurement_t CayenneLPP::ResetMeasurement () 

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:

  • x The acceleration value along the x-axis.
  • y The acceleration value along the y-axis.
  • z The 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.

static inline Measurement_t CayenneLPP::SetAnalogInput (
    const float analog_input_val
) 

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_val The 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.

static inline Measurement_t CayenneLPP::SetAnalogOutput (
    const float analog_output_val
) 

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_val The 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_val The 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.

static inline Measurement_t CayenneLPP::SetDigitalInput (
    const uint8_t digital_input_val
) 

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_val The 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.

static inline Measurement_t CayenneLPP::SetDigitalOutput (
    const uint8_t digital_output_val
) 

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_val The 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.

static inline Measurement_t CayenneLPP::SetFloat32 (
    const float float32_val
) 

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_val The 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:

  • latitude The latitude value in degrees.
  • longitude The longitude value in degrees.
  • altitude The 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.

static inline Measurement_t CayenneLPP::SetGyro (
    const float x,
    const float y,
    const float z
) 

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:

  • x The gyro value along the x-axis.
  • y The gyro value along the y-axis.
  • z The 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.

static inline Measurement_t CayenneLPP::SetLuminosity (
    const float luminosity_val
) 

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_val The 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.

static inline Measurement_t CayenneLPP::SetPresence (
    const uint8_t presence_val
) 

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_val The 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_val The raw bit value to set or append. Only the least significant bit is used.
  • prevMeasurement Reference 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.

static inline Measurement_t CayenneLPP::SetRawByte (
    const uint8_t raw_byte_val
) 

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_val The 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.

static inline Measurement_t CayenneLPP::SetRelativeHumidity (
    const float humidity_val
) 

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_val The 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.

static inline Measurement_t CayenneLPP::SetTemperature (
    const float temperature_val
) 

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_val The 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.

static inline Measurement_t CayenneLPP::SetWord16 (
    const uint16_t word16_val
) 

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_val The 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.

static inline Measurement_t CayenneLPP::SetWord32 (
    const uint32_t word32_val
) 

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_val The 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