Skip to main content

parse_report_data

Function parse_report_data 

Source
pub fn parse_report_data(bytes: &[u8]) -> Result<ReportData, ImError>
Expand description

Parse a ReportDataMessage into concrete (path, value) pairs.

Walks the AttributeReports array; for each AttributeReportIB that carries AttributeData [1], extracts the path (AttributePathIB [1]) and the data value ([2]). AttributeStatus error reports are skipped. A message with no AttributeReports yields an empty result.

ยงErrors

Returns ImError if the message is not a struct, a present AttributeData is missing its path or data, or a path value is out of range.