Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jobDocumentParser is broken #124

Closed
marchingband opened this issue Dec 21, 2024 · 2 comments
Closed

jobDocumentParser is broken #124

marchingband opened this issue Dec 21, 2024 · 2 comments

Comments

@marchingband
Copy link

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.

@marchingband
Copy link
Author

possibly I am overlooking filepathlen, sorry if that is the bug

@marchingband
Copy link
Author

indeed it was, apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant