Go SDK
Online
功能说明
设备连接物联网平台(上线)
方法原型
go
func (d *DriverService) Online (deviceId string) error
云平台支持
Offline
功能说明
设备与物联网平台断开连接(离线)
方法原型
go
func (d *DriverService) Offline (deviceId string) error
云平台支持
GetConnectStatus
功能说明
获取设备连接状态
方法原型
go
func (d *DriverService) GetConnectStatus(deviceId string) (commons.DeviceConnectStatus, error)
云平台支持
CreateDevice
功能说明
创建设备
方法原型
go
func (d *DriverService) CreateDevice(device model.AddDevice) (model.Device, error)
云平台支持
-
GetDeviceList
功能说明
获取所有的设备
方法原型
go
func (d *DriverService) GetDeviceList() map[string]model.Device
云平台支持
GetDeviceById
功能说明
通过设备id获取设备详
方法原型
go
func (d *DriverService) GetDeviceById(deviceId string) (model.Device, bool)
云平台支持
ProductList
功能说明
获取当前实例下的所有产品
方法原型
go
func (d *DriverService) ProductList() map[string]model.Product
云平台支持
GetProductById
功能说明
根据产品id获取产品信息
方法原型
go
func (d *DriverService) GetProductById(productId string) (model.Product, bool)
云平台支持
GetProductProperties
功能说明
根据产品id获取产品所有属性信息
方法原型
go
func (d *DriverService) GetProductProperties(productId string) (map[string]model.Property, bool)
云平台支持
GetProductPropertyByCode
功能说明
根据产品id与code获取属性信息
方法原型
go
func (d *DriverService) GetProductPropertyByCode(productId, code string) (model.Property, bool)
云平台支持
GetProductEvents
功能说明
根据产品id获取产品所有事件信息
方法原型
go
func (d *DriverService) GetProductEvents(productId string) (map[string]model.Event, bool)
云平台支持
GetProductEventByCode
功能说明
根据产品id与code获取事件信息
方法原型
go
func (d *DriverService) GetProductEventByCode(productId, code string) (model.Event, bool)
云平台支持
GetPropertyServices
功能说明
根据产品id获取产品所有服务信息
方法原型
go
func (d *DriverService) GetProductServices(productId string) (map[string]model.Service, bool)
云平台支持
GetProductServices
功能说明
根据产品id与code获取服务信息
方法原型
go
func (d *DriverService) GetProductServiceByCode(productId, code string) (model.Service, bool)
云平台支持
PropertyReport
功能说明
物模型属性上报 如果data参数中的Sys.Ack设置为1,则该方法会同步阻塞等待云端返回结果。
方法原型
go
func (d *DriverService) PropertyReport(deviceId string, data model.PropertyReport) (model.CommonResponse, error)
云平台支持
EventReport
功能说明
物模型事件上报
方法原型
go
func (d *DriverService) EventReport(deviceId string, data model.EventReport) (model.CommonResponse, error)
云平台支持
PropertySetResponse
功能说明
设备属性下发响应
方法原型
go
func (d *DriverService) PropertySetResponse(deviceId string, data model.PropertySetResponse) error
云平台支持
PropertyGetResponse
功能说明
设备属性查询响应
方法原型
go
func (d *DriverService) PropertyGetResponse(deviceId string, data model.PropertyGetResponse) error
云平台支持
ServiceExecuteResponse
功能说明
设备动作执行响应
方法原型
go
func (d *DriverService) ServiceExecuteResponse(deviceId string, data model.ServiceExecuteResponse) error
云平台支持
GetCustomParam
功能说明
值获自定义参数内容
方法原型
go
func (d *DriverService) GetCustomParam() string
云平台支持
-
GetCustomStorage
功能说明
根据key值获取驱动存储的自定义内容
方法原型
go
func (d *DriverService) GetCustomStorage(keys []string) (map[string][]byte, error)
云平台支持
-
PutCustomStorage
功能说明
存储驱动的自定义内容
方法原型
go
func (d *DriverService) PutCustomStorage(kvs map[string][]byte) error
云平台支持
-
DeleteCustomStorage
功能说明
根据key值删除驱动存储的自定义内容
方法原型
go
func (d *DriverService) DeleteCustomStorage(keys []string) error
云平台支持
-
GetAllCustomStorage
功能说明
获取所有驱动存储的自定义内容
方法原型
go
func (d *DriverService) GetAllCustomStorage() (map[string][]byte, error)
云平台支持
-