2021-03-28 17:00:03 +08:00
|
|
|
package iot
|
|
|
|
|
|
|
|
type baseGateway interface {
|
|
|
|
// 设置平台添加子设备回调函数
|
|
|
|
SetSubDevicesAddHandler(handler SubDevicesAddHandler)
|
|
|
|
|
|
|
|
// 设置平台删除子设备回调函数
|
|
|
|
SetSubDevicesDeleteHandler(handler SubDevicesDeleteHandler)
|
|
|
|
}
|
|
|
|
|
|
|
|
type Gateway interface {
|
|
|
|
baseGateway
|
|
|
|
|
|
|
|
// 网关更新子设备状态
|
|
|
|
UpdateSubDeviceState(subDevicesStatus SubDevicesStatus) bool
|
|
|
|
|
|
|
|
// 网关删除子设备
|
|
|
|
DeleteSubDevices(deviceIds []string) bool
|
|
|
|
|
|
|
|
// 网关添加子设备
|
|
|
|
AddSubDevices(deviceInfos []DeviceInfo) bool
|
|
|
|
|
|
|
|
// 网关同步子设备列表,默认实现不指定版本
|
|
|
|
SyncAllVersionSubDevices()
|
|
|
|
|
|
|
|
// 网关同步特定版本子设备列表
|
|
|
|
SyncSubDevices(version int)
|
|
|
|
}
|
|
|
|
|
|
|
|
type AsyncGateway interface {
|
|
|
|
baseGateway
|
|
|
|
|
|
|
|
// 网关更新子设备状态
|
2021-03-30 08:49:40 +08:00
|
|
|
UpdateSubDeviceState(subDevicesStatus SubDevicesStatus) AsyncResult
|
2021-03-28 17:00:03 +08:00
|
|
|
|
|
|
|
// 网关删除子设备
|
2021-03-30 08:49:40 +08:00
|
|
|
DeleteSubDevices(deviceIds []string) AsyncResult
|
2021-03-28 17:00:03 +08:00
|
|
|
|
|
|
|
// 网关添加子设备
|
2021-03-30 08:49:40 +08:00
|
|
|
AddSubDevices(deviceInfos []DeviceInfo) AsyncResult
|
2021-03-28 17:00:03 +08:00
|
|
|
|
|
|
|
// 网关同步子设备列表,默认实现不指定版本
|
2021-03-30 08:49:40 +08:00
|
|
|
SyncAllVersionSubDevices() AsyncResult
|
2021-03-28 17:00:03 +08:00
|
|
|
|
|
|
|
// 网关同步特定版本子设备列表
|
2021-03-30 08:49:40 +08:00
|
|
|
SyncSubDevices(version int) AsyncResult
|
2021-03-28 17:00:03 +08:00
|
|
|
}
|