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

JSON_OBJECT_SIZE(Helper::getOccurences(reinterpret_cast<char *>(payload), COLON)) is inaccurate to calculate jsonBuffer size #225

Closed
majidahmadov opened this issue Sep 20, 2024 · 2 comments · Fixed by #223

Comments

@majidahmadov
Copy link

Problem:
I was testing OTA for ESP32 device. I realized when I delete assigned firmware of my device, I am receving [TB] Unable to de-serialize received json data with error (DeserializationError::NoMemory).
THINGSBOARD_ENABLE_DYNAMIC is enabled.
After printing output I realized calculated Json object size is not correct. This is the payload sent when assigned firmware cleared for device.
{
"deleted": [
"fw_checksum_algorithm",
"fw_version",
"fw_ts",
"fw_tag",
"fw_checksum",
"fw_title",
"fw_state",
"fw_size",
"fw_url"
]
}

And JSON_OBJECT_SIZE(Helper::getOccurences(reinterpret_cast<char *>(payload), COLON)) is returning 16 to deserialize this payload

@MathewHDYT
Copy link
Contributor

Has been mentioned in this Pull Request and fixed in this Pull Request.

@majidahmadov
Copy link
Author

Oh, thank you

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

Successfully merging a pull request may close this issue.

2 participants