代码重构

This commit is contained in:
ctlove0523 2020-12-26 21:55:44 +08:00
parent 4120bf44f9
commit 78ee43d54d
2 changed files with 43 additions and 0 deletions

View File

@ -36,6 +36,7 @@ type Gateway interface {
type Device interface { type Device interface {
Gateway Gateway
Init() bool Init() bool
DisConnect()
IsConnected() bool IsConnected() bool
SendMessage(message Message) bool SendMessage(message Message) bool
ReportProperties(properties ServiceProperty) bool ReportProperties(properties ServiceProperty) bool
@ -64,6 +65,9 @@ type iotDevice struct {
fileUrls map[string]string fileUrls map[string]string
} }
func (device *iotDevice) DisConnect() () {
device.client.Disconnect(0)
}
func (device *iotDevice) SyncAllVersionSubDevices() { func (device *iotDevice) SyncAllVersionSubDevices() {
dataEntry := DataEntry{ dataEntry := DataEntry{
ServiceId: "$sub_device_manager", ServiceId: "$sub_device_manager",

File diff suppressed because one or more lines are too long