diff --git a/db/src/mqtt/mqtt.go b/db/src/mqtt/mqtt.go index 05d8e46..c6e6968 100644 --- a/db/src/mqtt/mqtt.go +++ b/db/src/mqtt/mqtt.go @@ -14,6 +14,8 @@ import ( mqtt "github.com/eclipse/paho.mqtt.golang" ) +const maxQoS = 2 + // A MqttParams is the abstracted MQTT gateway. // It provides the MQTT parameters to initialize the connection and the method to add data. type MqttParams struct { @@ -69,7 +71,7 @@ func NewMqttGateway(p MqttParams) (*MqttGateway, error) { return nil, errors.New("[MQTT Gateway] Invalid client id") } - if p.Qos > 2 { + if p.Qos > maxQoS { return nil, errors.New("[MQTT Gateway] Invalid QoS level") }