BlackZork / mqmgateway

MQTT gateway for modbus networks
GNU Affero General Public License v3.0
44 stars 20 forks source link

Commands are not found in topic that have a slash in their name #14

Closed molnarg closed 1 year ago

molnarg commented 1 year ago

So, I have a topic named x/y, and I define a command name z within that topic. The gateway subscribes to that topic and gets the messages sent (x/y/z), but then fails to process the command with an exception. This is because the command lookup fn assumes that the command name comes after the first slash in the topic name: https://github.com/BlackZork/mqmgateway/blob/54b47a32c70cc39de991d3e0766ade62402b4f6d/libmodmqttsrv/mqttclient.cpp#L257

molnarg commented 1 year ago

It should find the command after the last slash instead.