Skip to main content

parse_read_response

Function parse_read_response 

Source
pub fn parse_read_response(json: &[u8]) -> Result<Vec<((u64, u64), CharValue)>>
Expand description

Parse a GET /characteristics response body into ((aid,iid), CharValue) pairs for the successful entries.

When meta=1 was requested the accessory echoes each characteristic’s format, which is used to decode the value. If format is absent the JSON value is inferred (bool→Bool, integer→Uint/Int, real→Float, string→Str); base64 strings cannot be distinguished from plain strings without a format, so callers needing tlv8/data must request meta=1.

§Errors