static JSONStatus_t populateMqttStreamingFields()

in source/otaJobParser/job_parser.c [329:354]


static JSONStatus_t populateMqttStreamingFields( const char * jobDoc,
                                                 const size_t jobDocLength,
                                                 AfrOtaJobDocumentFields_t * result )
{
    JSONStatus_t jsonResult = JSONNotFound;
    const char * jsonValue = NULL;
    size_t jsonValueLength = 0U;

    jsonResult = JSON_SearchConst( jobDoc,
                                   jobDocLength,
                                   "afr_ota.streamname",
                                   18U,
                                   &jsonValue,
                                   &jsonValueLength,
                                   NULL );
    result->imageRef = jsonValue;
    result->imageRefLen = ( uint32_t ) jsonValueLength;

    /* If the stream name is empty, consider this an error */
    if( jsonValueLength == 0U )
    {
        jsonResult = JSONNotFound;
    }

    return jsonResult;
}