Open JyHu opened 1 year ago
Hi. I don't think the bug is here. Because the fixed header is 1 byte. Does the demo have this issue? Or It cold be a bug from another location.😄
Hi. I don't think the bug is here. Because the fixed header is 1 byte. Does the demo have this issue? Or It cold be a bug from another location.😄
I used the Eclipse Paho framework to integrate it into the project and conducted some testing. The results were fine. Upon comparing the binary data, I did notice that the pos
value was missing one byte. However, I apologize that I don't have a deep understanding of the MQTT protocol, so I am unable to investigate the specific cause of the issue. 😢
It seems that there is a missing byte in the offset calculation. In my actual testing, when sending a message to the backend using the publish method and receiving the data back, the received data cannot be parsed correctly. The following image shows the issue:
The data should have been a JSON object, but there is an extra byte in the received binary data, causing the conversion to fail. After changing the offset of 'pos' from 1 to 2, the received data can be parsed correctly.
The following is the
publish
code :