Skip to content

jobDocumentParser is broken #124

@marchingband

Description

@marchingband

in ota_over_mqtt_demo.c
the function jobDocumentParser does not parse the JSON correctly.
after jobDocLength = Jobs_GetJobDocument( message, messageLength, &jobDoc );
I call ESP_LOGE(TAG, "job doc: %s", jobDoc);
but the result is E (13504) ota_over_mqtt_demo: job doc: {"afr_ota":{"protocols":["MQTT"],"streamname":"AFR_OTA-bf707e32-11f9-4b40-a406-6989b1af799f","files":[{"filepath":"/","filesize":1449840,"fileid":0,"certfile":"Code Verify Key","sig-sha256-ecdsa":"MEUCIQCBhWhsLLGmI8LSiX85mk90bdBStqj8bnuHCVlcKedlCwIge6N8hS6y+S90W7RopIo8oC9sXj9uXU8mksKCxEA9dDk="}]}}}}
Which is not valid JSON.
So when I later try to query jobFields.filepath I get the wrong path E (16984) ota_over_mqtt_demo: Path is /","filesize":1449840,"fileid":0,"certfile":"Code Verify Key","sig-sha256-ecdsa":"MEUCIQCBhWhsLLGmI8LSiX85mk90bdBStqj8bnuHCVlcKedlCwIge6N8hS6y+S90W7RopIo8oC9sXj9uXU8mksKCxEA9dDk="}]}}}}

I am using these features to download non-firmware files, so I need to detect the path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions