AzureMXChip/MXCHIPAZ3166/core/lib/netxduo/addons/azure_iot/samples/sample_azure_iot_embedded_sdk_pnp.c
static UINT sample_json_child_token_move(NX_AZURE_IOT_JSON_READER *json_reader,
                                         UCHAR *property_name_ptr, UINT property_name_len)
{
    while (nx_azure_iot_json_reader_next_token(json_reader) == NX_AZURE_IOT_SUCCESS)
    {
        if ((nx_azure_iot_json_reader_token_type(json_reader) == NX_AZURE_IOT_READER_TOKEN_PROPERTY_NAME) &&
            nx_azure_iot_json_reader_token_is_text_equal(json_reader,
                                                         property_name_ptr,
                                                         property_name_len))
        {
           if (nx_azure_iot_json_reader_next_token(json_reader))
           {
               printf("Failed to read next token\r\n");
               return(NX_NOT_SUCCESSFUL);
           }

           return(NX_AZURE_IOT_SUCCESS);
        }
        else if (nx_azure_iot_json_reader_token_type(json_reader) == NX_AZURE_IOT_READER_TOKEN_BEGIN_OBJECT)
        {
            if (nx_azure_iot_json_reader_skip_children(json_reader))
            {
                printf("Failed to skip child of complex object\r\n");
                return(NX_NOT_SUCCESSFUL);
            }
        }
        else if (nx_azure_iot_json_reader_token_type(json_reader) == NX_AZURE_IOT_READER_TOKEN_END_OBJECT)
        {
            return(NX_AZURE_IOT_NOT_FOUND);
        }
    }

    return(NX_AZURE_IOT_NOT_FOUND);
}
/* Move reader to the value of property name.  */
Move reader to the value of property name.
Move reader to the value of property name .
static UINT sample_json_child_token_move(NX_AZURE_IOT_JSON_READER *json_reader,
                                         UCHAR *property_name_ptr, UINT property_name_len)
{
    while (nx_azure_iot_json_reader_next_token(json_reader) == NX_AZURE_IOT_SUCCESS)
    {
        if ((nx_azure_iot_json_reader_token_type(json_reader) == NX_AZURE_IOT_READER_TOKEN_PROPERTY_NAME) &&
            nx_azure_iot_json_reader_token_is_text_equal(json_reader,
                                                         property_name_ptr,
                                                         property_name_len))
        {
           if (nx_azure_iot_json_reader_next_token(json_reader))
           {
               printf("Failed to read next token\r\n");
               return(NX_NOT_SUCCESSFUL);
           }
           return(NX_AZURE_IOT_SUCCESS);
        }
        else if (nx_azure_iot_json_reader_token_type(json_reader) == NX_AZURE_IOT_READER_TOKEN_BEGIN_OBJECT)
        {
            if (nx_azure_iot_json_reader_skip_children(json_reader))
            {
                printf("Failed to skip child of complex object\r\n");
                return(NX_NOT_SUCCESSFUL);
            }
        }
        else if (nx_azure_iot_json_reader_token_type(json_reader) == NX_AZURE_IOT_READER_TOKEN_END_OBJECT)
        {
            return(NX_AZURE_IOT_NOT_FOUND);
        }
    }
    return(NX_AZURE_IOT_NOT_FOUND);
}
static UINT sample_json_child_token_move ( NX_AZURE_IOT_JSON_READER * json_reader , UCHAR * property_name_ptr , UINT property_name_len ) { while ( nx_azure_iot_json_reader_next_token ( json_reader ) == NX_AZURE_IOT_SUCCESS ) { if ( ( nx_azure_iot_json_reader_token_type ( json_reader ) == NX_AZURE_IOT_READER_TOKEN_PROPERTY_NAME ) && nx_azure_iot_json_reader_token_is_text_equal ( json_reader , property_name_ptr , property_name_len ) ) { if ( nx_azure_iot_json_reader_next_token ( json_reader ) ) { printf ( " \r \n " ) ; return ( NX_NOT_SUCCESSFUL ) ; } return ( NX_AZURE_IOT_SUCCESS ) ; } else if ( nx_azure_iot_json_reader_token_type ( json_reader ) == NX_AZURE_IOT_READER_TOKEN_BEGIN_OBJECT ) { if ( nx_azure_iot_json_reader_skip_children ( json_reader ) ) { printf ( " \r \n " ) ; return ( NX_NOT_SUCCESSFUL ) ; } } else if ( nx_azure_iot_json_reader_token_type ( json_reader ) == NX_AZURE_IOT_READER_TOKEN_END_OBJECT ) { return ( NX_AZURE_IOT_NOT_FOUND ) ; } } return ( NX_AZURE_IOT_NOT_FOUND ) ; }
Move reader to the value of property name.
Move reader to the value of property name .