2021-03-30 08:49:40 +08:00
|
|
|
package samples
|
|
|
|
|
|
|
|
import iot "github.com/ctlove0523/huaweicloud-iot-device-sdk-go"
|
|
|
|
|
2021-04-17 08:20:20 +08:00
|
|
|
const deviceId = "5fdb75cccbfe2f02ce81d4bf_log"
|
2021-03-30 08:49:40 +08:00
|
|
|
const devicePassword = "123456789"
|
|
|
|
const Server = "tls://iot-mqtts.cn-north-4.myhuaweicloud.com:8883"
|
|
|
|
|
|
|
|
func CreateAsyncDevice() iot.AsyncDevice {
|
|
|
|
device := iot.CreateAsyncIotDevice(deviceId, devicePassword, Server)
|
|
|
|
|
|
|
|
return device
|
|
|
|
}
|
|
|
|
|
|
|
|
func CreateDevice() iot.Device {
|
|
|
|
device := iot.CreateIotDevice(deviceId, devicePassword, Server)
|
|
|
|
|
|
|
|
return device
|
|
|
|
}
|