Skip to main content
Header: utils/inc/qshPbSensorUtils.h

Structures

qshPb::suid_list

Output context passed to the decode_suids() nanopb callback. Members
std::vector< suid > *
Destination vector for decoded SUIDs.
std::string *
Destination for the sensor datatype string.

qshPb::attribute

Holds a single decoded sns_std_attr_value_data value. Members
bool
True if the value is a nested subtype.
std::vector< float >
Decoded float subtype values.
bool
True if the value is a string.
std::string
Decoded string value.
bool
True if the value is a float.
float
Decoded float value.
bool
True if the value is a signed integer.
int64_t
Decoded signed integer value.
bool
True if the value is a boolean.
bool
Decoded boolean value.

Functions

get_msg_id

Extract the message ID from a client event stream. Decodes only the msg_id field of the first sns_client_event_msg_sns_client_event in stream.
Parameters
pb_istream_t
A copy of the nanopb input stream positioned at the event.
Returns The decoded message ID, or 0 on failure.

decode_suids

Nanopb repeated-field callback that decodes SUID lookup events. Expects the stream to contain sns_client_event_msg_sns_client_event records carrying SNS_SUID_MSGID_SNS_SUID_EVENT payloads. Appends each discovered SUID to suid_list::suids and stores the datatype string in suid_list::datatype.
Parameters
pb_istream_t *
Nanopb input stream.
const pb_field_t *
Field descriptor (unused).
void **
Pointer to a suid_list output context.
Returns true on success, false on decode error.

decode_attribute

Nanopb repeated-field callback that decodes a single sns_std_attr. Appends the decoded attribute and its values to the sensor_attributes map passed via arg.
Parameters
pb_istream_t *
Nanopb input stream.
const pb_field_t *
Field descriptor (unused).
void **
Pointer to a sensor_attributes output map.
Returns true on success, false on decode error.

decode_attributes

Nanopb repeated-field callback that decodes attribute events. Expects the stream to contain sns_client_event_msg_sns_client_event records carrying SNS_STD_MSGID_SNS_STD_ATTR_EVENT payloads. Populates the sensor_attributes map passed via arg.
Parameters
pb_istream_t *
Nanopb input stream.
const pb_field_t *
Field descriptor (unused).
void **
Pointer to a sensor_attributes output map.
Returns true on success, false on decode error.

Type Definitions

suid

Convenience alias for the public session SUID type.

attributes

A list of attribute values for a single attribute ID.

sensor_attributes

Map from attribute ID (sns_std_attr_id) to its decoded values.