ARMmbed / mbed-mqtt

Mbed-os MQTT and MQTT-SN library, based on Eclipse Paho project.
Other
47 stars 26 forks source link

Fix to allow MQTT wildcard subscriptions to work with root topic #26

Closed LukaB closed 2 years ago

LukaB commented 4 years ago

Fixing the MQTT wildcard subscriptions to work with the root topic.

More details can be found in this issue: #25

This fix assumes that subscribing to topic/# should receive messages from both topic and any wildcard subtopic topic/#. The original code comparison meant that messages delivered to topic would not be captured by the isTopicMatched() filter.

0xc0170 commented 2 years ago

@phlegx have you tested this fix? Tests are not active anymore due to internal infrastructure move. I am happy to merge this if confirmed it fixes the issue.

@LukaB Can you fix the formatting please (tabs used or why some lines are misaligned?) ?

Let's move this forward, I found this pull request just now.

LukaB commented 2 years ago

I can look into it at the end of this week if it's no rush? Have to brush up on my C/C++ skills after all this time away.

Also, sorry for the formatting was done in a quick rush in plain text editor.

LukaB commented 2 years ago

@0xc0170 tidied up formatting and also squished the commit.

Sorry have been out of the embedded scene for a while, so will have trouble verifying this still works, but I remember checking things through at the time of raising the PR.