-
Notifications
You must be signed in to change notification settings - Fork 169
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
Topic name includes payload #10
Comments
I have the same error - I need to check the topicName as I'm subscribing to multiple topics. Did you find a solution? |
Found a solution - in your callbackhander, add the following:
EDIT: Correction - this doesn't work, because the length of the topicName doesn't get truncated, so it remains the size of the first submission. |
The original handler
topicNameLen parameter which is very important. However, the custom handler does not have this one.You should edit the the library and add this field for custome handler. One other note, the library supports only one subscription. If you make another subscription, it will override the old one. |
@HumamHelfawi : Thx for the hint! I changed AWS_IOT.cpp as follows, so that the correct topicname is passed to the custom-function:
|
@OllisGit Thank you for your answer but the shortTopic Contains some Junk Characters at the end which can be avoided by adding following line after strncpy(shortTopic, topicName, topicNameLen); |
@OllisGit Good spotting! I have also implemented your fix |
When checking the topic name in the callback, it also includes the full payload. Is this expected?
The text was updated successfully, but these errors were encountered: