From 2181695565df80a9063e53dbd1c66d6cd04f8207 Mon Sep 17 00:00:00 2001 From: ctlove0523 <478309639@qq.com> Date: Fri, 26 Feb 2021 18:59:35 +0800 Subject: [PATCH] #1 support client define qos --- iot_device.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iot_device.go b/iot_device.go index 365e488..31a8e6d 100644 --- a/iot_device.go +++ b/iot_device.go @@ -636,6 +636,10 @@ func (device *iotDevice) SetPropertyQueryHandler(handler DevicePropertyQueryHand } func CreateIotDevice(id, password, servers string) Device { + return CreateIotDeviceWithQos(id, password, servers, 0) +} + +func CreateIotDeviceWithQos(id, password, servers string, qos byte) Device { device := &iotDevice{} device.Id = id device.Password = password @@ -645,7 +649,7 @@ func CreateIotDevice(id, password, servers string) Device { device.fileUrls = map[string]string{} - device.qos = 0 + device.qos = qos return device }