Skip to content

Commit

Permalink
In case of Azure the command is not always in the suffix.
Browse files Browse the repository at this point in the history
  • Loading branch information
brocaar committed May 16, 2019
1 parent 71b098c commit 1e8be14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/integration/mqtt/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,10 @@ func (b *Backend) handleGatewayConfiguration(c paho.Client, msg paho.Message) {
}

func (b *Backend) handleCommand(c paho.Client, msg paho.Message) {
if strings.HasSuffix(msg.Topic(), "down") {
if strings.HasSuffix(msg.Topic(), "down") || strings.Contains(msg.Topic(), "command=down") {
mqttCommandCounter("down")
b.handleDownlinkFrame(c, msg)
} else if strings.HasSuffix(msg.Topic(), "config") {
} else if strings.HasSuffix(msg.Topic(), "config") || strings.Contains(msg.Topic(), "command=config") {
mqttCommandCounter("config")
b.handleGatewayConfiguration(c, msg)
} else {
Expand Down

0 comments on commit 1e8be14

Please sign in to comment.