commons

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PropertyReport = iota + 1
	PropertySetResponse
	PropertyGetResponse
	ServiceExecuteResponse
	EventReport
	BatchReport
	LogReport
	PropertyDesiredGet
	PropertyDesiredDelete
)

Variables

This section is empty.

Functions

func TransformToProtoMsg

func TransformToProtoMsg(deviceId string, t int, data interface{}, baseMsg BaseMessage) (*thingmodel.ThingModelMsg, error)

Types

type BaseMessage

type BaseMessage struct {
	UsePlatform      bool
	CloudServiceInfo *CloudServiceInfo
	DriverInstanceId string
}

func (BaseMessage) BuildBaseRequest

func (c BaseMessage) BuildBaseRequest() *drivercommon.BaseRequestMessage

func (BaseMessage) UseCloudPlatform

func (c BaseMessage) UseCloudPlatform() bool

type CloudPluginNotifyType

type CloudPluginNotifyType string
const (
	CloudPluginStartNotify CloudPluginNotifyType = "start"
	CloudPluginStopNotify  CloudPluginNotifyType = "stop"
)

type CloudServiceInfo

type CloudServiceInfo struct {
	CloudInstanceId   string
	Address           string
	CloudInstanceName string
	Status            CloudServiceStatus
	Platform          IotPlatform
}

type CloudServiceStatus

type CloudServiceStatus string
const (
	Start CloudServiceStatus = "start"
	Stop  CloudServiceStatus = "stop"
)

func (CloudServiceStatus) TransformToRpcCloudInstanceStatus

func (i CloudServiceStatus) TransformToRpcCloudInstanceStatus() cloudinstance.CloudInstanceStatus

type DeviceConnectStatus

type DeviceConnectStatus string
const (
	Online  DeviceConnectStatus = "online"  //在线
	Offline DeviceConnectStatus = "offline" //离线
)

type DeviceNotifyType

type DeviceNotifyType string
const (
	DeviceAddNotify    DeviceNotifyType = "add"
	DeviceUpdateNotify DeviceNotifyType = "update"
	DeviceDeleteNotify DeviceNotifyType = "delete"
)

type DeviceStatus

type DeviceStatus string
const (
	DeviceUnKnow   DeviceStatus = "unknow"
	DeviceOnline   DeviceStatus = "online"   //在线
	DeviceOffline  DeviceStatus = "offline"  //离线
	DeviceUnActive DeviceStatus = "unactive" //未激活
	DeviceDisable  DeviceStatus = "disable"  //禁用
)

func TransformRpcDeviceStatusToModel

func TransformRpcDeviceStatusToModel(deviceStatus driverdevice.DeviceStatus) DeviceStatus

type IotPlatform

type IotPlatform string
const (
	HummingbirdIot IotPlatform = "蜂鸟物联网平台"     //蜂鸟平台
	WinCLinkIot    IotPlatform = "赢创物联网平台"     //赢创万联
	AliIot         IotPlatform = "阿里物联网平台"     //阿里
	HuaweiIot      IotPlatform = "华为物联网平台"     //华为
	TencentIot     IotPlatform = "腾讯物联网平台"     //腾讯
	OneNetIot      IotPlatform = "OneNET物联网平台" //中国移动
)

func TransformRpcPlatformToModel

func TransformRpcPlatformToModel(p drivercommon.IotPlatform) IotPlatform

func (IotPlatform) TransformModelToRpcPlatform

func (i IotPlatform) TransformModelToRpcPlatform() drivercommon.IotPlatform

type MsgAckChan

type MsgAckChan struct {
	Mu       sync.Mutex
	Id       string
	IsClosed bool
	DataChan chan interface{}
}

func (*MsgAckChan) TryCloseChan

func (mac *MsgAckChan) TryCloseChan()

func (*MsgAckChan) TrySendDataAndCloseChan

func (mac *MsgAckChan) TrySendDataAndCloseChan(data interface{}) bool

type ProductNetType

type ProductNetType string
const (
	NetTypeOther    ProductNetType = "other"
	NetTypeCellular ProductNetType = "cellular"
	NetTypeWifi     ProductNetType = "wifi"
	NetTypeEthernet ProductNetType = "ethernet"
	NetTypeNB       ProductNetType = "nb"
)

func TransformRpcNetTypeToModel

func TransformRpcNetTypeToModel(netType driverproduct.ProductNetType) ProductNetType

type ProductNodeType

type ProductNodeType string
const (
	NodeTypeUnKnow    ProductNodeType = "unKnow"
	NodeTypeGateway   ProductNodeType = "gateway"
	NodeTypeDevice    ProductNodeType = "device"
	NodeTypeSubDevice ProductNodeType = "subDevice"
)

func TransformRpcNodeTypeToModel

func TransformRpcNodeTypeToModel(nodeType driverproduct.ProductNodeType) ProductNodeType

type ProductNotifyType

type ProductNotifyType string
const (
	ProductAddNotify    ProductNotifyType = "add"
	ProductUpdateNotify ProductNotifyType = "update"
	ProductDeleteNotify ProductNotifyType = "delete"
)

Jump to

Keyboard shortcuts

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