-
Notifications
You must be signed in to change notification settings - Fork 4
/
gateway.go
47 lines (33 loc) · 1.16 KB
/
gateway.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
// 网关更新子设备状态
UpdateSubDeviceState(subDevicesStatus SubDevicesStatus) AsyncResult
// 网关删除子设备
DeleteSubDevices(deviceIds []string) AsyncResult
// 网关添加子设备
AddSubDevices(deviceInfos []DeviceInfo) AsyncResult
// 网关同步子设备列表,默认实现不指定版本
SyncAllVersionSubDevices() AsyncResult
// 网关同步特定版本子设备列表
SyncSubDevices(version int) AsyncResult
}