in sdk/src/azure/iot/az_iot_hub_client_properties.c [272:322]
static az_result skip_metadata_if_needed(
az_json_reader* jr,
az_iot_hub_client_properties_message_type message_type)
{
while (true)
{
// Within the "root" or "component name" section
if ((message_type == AZ_IOT_HUB_CLIENT_PROPERTIES_MESSAGE_TYPE_WRITABLE_UPDATED
&& jr->current_depth == 1)
|| (message_type == AZ_IOT_HUB_CLIENT_PROPERTIES_MESSAGE_TYPE_GET_RESPONSE
&& jr->current_depth == 2))
{
if ((az_json_token_is_text_equal(&jr->token, iot_hub_properties_desired_version)))
{
// Skip version property name and property value
_az_RETURN_IF_FAILED(az_json_reader_next_token(jr));
_az_RETURN_IF_FAILED(az_json_reader_next_token(jr));
continue;
}
else
{
return AZ_OK;
}
}
// Within the property value section
else if (
(message_type == AZ_IOT_HUB_CLIENT_PROPERTIES_MESSAGE_TYPE_WRITABLE_UPDATED
&& jr->current_depth == 2)
|| (message_type == AZ_IOT_HUB_CLIENT_PROPERTIES_MESSAGE_TYPE_GET_RESPONSE
&& jr->current_depth == 3))
{
if (az_json_token_is_text_equal(&jr->token, component_properties_label_name))
{
// Skip label property name and property value
_az_RETURN_IF_FAILED(az_json_reader_next_token(jr));
_az_RETURN_IF_FAILED(az_json_reader_next_token(jr));
continue;
}
else
{
return AZ_OK;
}
}
else
{
return AZ_OK;
}
}
}