Header: utils/inc/qshPbSensorUtils.h
Structures
qshPb::suid_list
Output context passed to the decode_suids() nanopb callback.
Members
Destination vector for decoded SUIDs.
Destination for the sensor datatype string.
qshPb::attribute
Holds a single decoded sns_std_attr_value_data value.
Members
True if the value is a nested subtype.
Decoded float subtype values.
True if the value is a string.
True if the value is a float.
True if the value is a signed integer.
Decoded signed integer value.
True if the value is a boolean.
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
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
Field descriptor (unused).
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
Field descriptor (unused).
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
Field descriptor (unused).
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.