service

package
v0.0.0-...-180a93b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriverService

type DriverService struct {
	// contains filtered or unexported fields
}

func NewDriverService

func NewDriverService(serviceName string, iotPlatform commons.IotPlatform, configFile string) (ds *DriverService, err error)

func (*DriverService) CreateDevice

func (d *DriverService) CreateDevice(device model.AddDevice) (model.Device, error)

CreateDevice 创建设备

func (*DriverService) DeleteCustomStorage

func (d *DriverService) DeleteCustomStorage(keys []string) error

DeleteCustomStorage 根据key值删除驱动存储的自定义内容

func (*DriverService) EventReport

func (d *DriverService) EventReport(deviceId string, data model.EventReport) (model.CommonResponse, error)

EventReport 物模型事件上报

func (*DriverService) GetAllCustomStorage

func (d *DriverService) GetAllCustomStorage() (map[string][]byte, error)

GetAllCustomStorage 获取所有驱动存储的自定义内容

func (*DriverService) GetConnectStatus

func (d *DriverService) GetConnectStatus(deviceId string) (commons.DeviceConnectStatus, error)

GetConnectStatus 获取设备连接状态

func (*DriverService) GetCustomParam

func (d *DriverService) GetCustomParam() string

GetCustomParam 获取自定义参数

func (*DriverService) GetCustomStorage

func (d *DriverService) GetCustomStorage(keys []string) (map[string][]byte, error)

GetCustomStorage 根据key值获取驱动存储的自定义内容

func (*DriverService) GetDeviceById

func (d *DriverService) GetDeviceById(deviceId string) (model.Device, bool)

GetDeviceById 通过设备id获取设备详情

func (*DriverService) GetDeviceList

func (d *DriverService) GetDeviceList() []model.Device

GetDeviceList 获取所有的设备

func (*DriverService) GetLogger

func (d *DriverService) GetLogger() logger.Logger

GetLogger 获取日志接口

func (*DriverService) GetProductById

func (d *DriverService) GetProductById(productId string) (model.Product, bool)

GetProductById 根据产品id获取产品信息

func (*DriverService) GetProductEventByCode

func (d *DriverService) GetProductEventByCode(productId, code string) (model.Event, bool)

GetProductEventByCode 根据产品id与code获取事件信息

func (*DriverService) GetProductEvents

func (d *DriverService) GetProductEvents(productId string) (map[string]model.Event, bool)

GetProductEvents 根据产品id获取产品所有事件信息

func (*DriverService) GetProductProperties

func (d *DriverService) GetProductProperties(productId string) (map[string]model.Property, bool)

GetProductProperties 根据产品id获取产品所有属性信息

func (*DriverService) GetProductPropertyByCode

func (d *DriverService) GetProductPropertyByCode(productId, code string) (model.Property, bool)

GetProductPropertyByCode 根据产品id与code获取属性信息

func (*DriverService) GetProductServiceByCode

func (d *DriverService) GetProductServiceByCode(productId, code string) (model.Service, bool)

GetProductServiceByCode 根据产品id与code获取服务信息

func (*DriverService) GetProductServices

func (d *DriverService) GetProductServices(productId string) (map[string]model.Service, bool)

GetProductServices 根据产品id获取产品所有服务信息

func (*DriverService) Offline

func (d *DriverService) Offline(deviceId string) error

Offline 设备与平台断开连接

func (*DriverService) Online

func (d *DriverService) Online(deviceId string) error

Online 设备与平台建立连接

func (*DriverService) ProductList

func (d *DriverService) ProductList() map[string]model.Product

ProductList 获取当前实例下的所有产品

func (*DriverService) PropertyGetResponse

func (d *DriverService) PropertyGetResponse(deviceId string, data model.PropertyGetResponse) error

PropertyGetResponse 设备属性查询响应

func (*DriverService) PropertyReport

func (d *DriverService) PropertyReport(deviceId string, data model.PropertyReport) (model.CommonResponse, error)

PropertyReport 物模型属性上报 如果data参数中的Sys.Ack设置为1,则该方法会同步阻塞等待云端返回结果。

func (*DriverService) PropertySetResponse

func (d *DriverService) PropertySetResponse(deviceId string, data model.PropertySetResponse) error

PropertySetResponse 设备属性下发响应

func (*DriverService) PutCustomStorage

func (d *DriverService) PutCustomStorage(kvs map[string][]byte) error

PutCustomStorage 存储驱动的自定义内容

func (*DriverService) ServiceExecuteResponse

func (d *DriverService) ServiceExecuteResponse(deviceId string, data model.ServiceExecuteResponse) error

ServiceExecuteResponse 设备动作执行响应

func (*DriverService) Start

func (d *DriverService) Start(driver interfaces.Driver) error

Start 启动驱动

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL