You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a message is now sent to the device - but on the topic /devices/{device-id}/commands (without wildcard or any subtopic), the function isTopicMatched() does not correctly identify the match.
OASIS spec 3.1.1 section 4.7.1.2 has the following non-normative comment: “sport/#” also matches the singular “sport”, since # includes the parent level.
This is not occurring. Since that is non-normative, and AFAIK Mosquitto and probably many other implementations also do the same, I suggest you also subscribe to '/devices/123-45/commands' if that is what you need. Perhaps you can also publish to '/devices/123-45/commands/cmdname', it's been a while since I played with GCP.
Mosquitto version 1.6.10 running on libmosquitto 1.6.10:
This can be observed for example with Google IoT Core, which requires the client to subscribe to the topic /devices/{device-id}/commands/# (see https://cloud.google.com/iot/docs/how-tos/commands#receiving_a_command).
When a message is now sent to the device - but on the topic /devices/{device-id}/commands (without wildcard or any subtopic), the function isTopicMatched() does not correctly identify the match.
A quick and dirty solution:
https://github.com/eclipse/paho.mqtt.embedded-c/blob/29ab2aa29c5e47794284376d7f8386cfd54c3eed/MQTTClient-C/src/MQTTClient.c#L175
=>
return (curn == curn_end) && ((*curf == '\0') || ((curf[0] == '/') && (curf[1] == '#') && (curf[2] == '\0')));
(I think this has been raised before: #117)
The text was updated successfully, but these errors were encountered: