static JSONStatus_t populateOptionalCommonFields()

in source/otaJobParser/job_parser.c [306:327]


static JSONStatus_t populateOptionalCommonFields( const char * jobDoc,
                                                  const size_t jobDocLength,
                                                  int32_t fileIndex,
                                                  AfrOtaJobDocumentFields_t * result )
{
    JSONStatus_t jsonResult = JSONNotFound;
    char queryString[ 33 ];
    size_t queryStringLength;

    buildIndexedFileQueryString( fileIndex,
                                 "fileType",
                                 8U,
                                 queryString,
                                 &queryStringLength );
    jsonResult = searchUintValue( jobDoc,
                                  jobDocLength,
                                  queryString,
                                  queryStringLength,
                                  &( result->fileType ) );

    return ( jsonResult == JSONBadParameter ) ? jsonResult : JSONSuccess;
}