static JSONStatus_t searchUintValue()

in source/otaJobParser/job_parser.c [425:453]


static JSONStatus_t searchUintValue( const char * jobDoc,
                                     const size_t jobDocLength,
                                     const char * query,
                                     const size_t queryLength,
                                     uint32_t * value )
{
    bool numConversionSuccess = true;
    JSONStatus_t jsonResult = JSONNotFound;
    const char * jsonValue = NULL;
    size_t jsonValueLength = 0U;

    jsonResult = JSON_SearchConst( jobDoc,
                                   jobDocLength,
                                   query,
                                   queryLength,
                                   &jsonValue,
                                   &jsonValueLength,
                                   NULL );

    if( jsonResult == JSONSuccess )
    {
        numConversionSuccess = uintFromString( jsonValue,
                                               ( const uint32_t )
                                               jsonValueLength,
                                               value );
    }

    return ( numConversionSuccess ) ? jsonResult : JSONBadParameter;
}