device

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: AGPL-3.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func LoadDt

func LoadDt()

* * 加载系统内支持的设备类型 *

func NewAISDeviceMaster added in v0.6.3

func NewAISDeviceMaster(e typex.RuleX) typex.XDevice

* * AIS 数据解析服务器 *

func NewCustomProtocolDevice

func NewCustomProtocolDevice(e typex.RuleX) typex.XDevice

func NewGenericBacnetIpDevice added in v0.6.1

func NewGenericBacnetIpDevice(e typex.RuleX) typex.XDevice

func NewGenericHttpDevice added in v0.6.5

func NewGenericHttpDevice(e typex.RuleX) typex.XDevice

* * 通用串口透传 *

func NewGenericModbusDevice

func NewGenericModbusDevice(e typex.RuleX) typex.XDevice

* * 温湿度传感器 *

func NewGenericOpcuaDevice

func NewGenericOpcuaDevice(e typex.RuleX) typex.XDevice

func NewGenericSnmpDevice

func NewGenericSnmpDevice(e typex.RuleX) typex.XDevice

Example: 0x02 0x92 0xFF 0x98

* * 温湿度传感器 *

func NewGenericUartDevice

func NewGenericUartDevice(e typex.RuleX) typex.XDevice

* * 通用串口透传 *

func NewHNC8_CNC added in v0.6.7

func NewHNC8_CNC(e typex.RuleX) typex.XDevice

func NewIRDevice added in v0.6.3

func NewIRDevice(e typex.RuleX) typex.XDevice

func NewIcmpSender

func NewIcmpSender(e typex.RuleX) typex.XDevice

Example: 0x02 0x92 0xFF 0x98

* * 温湿度传感器 *

func NewKDN_CNC added in v0.6.7

func NewKDN_CNC(e typex.RuleX) typex.XDevice

func NewSIEMENS_PLC added in v0.6.5

func NewSIEMENS_PLC(e typex.RuleX) typex.XDevice

* * 西门子 S1200 系列 PLC *

func NewVideoCamera

func NewVideoCamera(e typex.RuleX) typex.XDevice

func NewWSStdInOut added in v0.6.4

func NewWSStdInOut() wsInOut

func Parse_AIVDM_VDO_PayloadInfo added in v0.6.6

func Parse_AIVDM_VDO_PayloadInfo(GwID, Type string, Payload []byte) string

Types

type AISDeviceMaster added in v0.6.3

type AISDeviceMaster struct {
	typex.XStatus

	RuleEngine typex.RuleX

	// session
	DevicesSessionMap map[string]*__AISDeviceSession
	// contains filtered or unexported fields
}

func (*AISDeviceMaster) Details added in v0.6.3

func (aism *AISDeviceMaster) Details() *typex.Device

真实设备

func (*AISDeviceMaster) Driver added in v0.6.3

func (aism *AISDeviceMaster) Driver() typex.XExternalDriver

驱动

func (*AISDeviceMaster) Init added in v0.6.3

func (aism *AISDeviceMaster) Init(devId string, configMap map[string]interface{}) error

 初始化

func (*AISDeviceMaster) OnCtrl added in v0.6.3

func (aism *AISDeviceMaster) OnCtrl(cmd []byte, args []byte) ([]byte, error)

* * OnCtrl 接口可以用来向外广播数据 *

func (*AISDeviceMaster) OnDCACall added in v0.6.3

func (aism *AISDeviceMaster) OnDCACall(UUID string, Command string, Args interface{}) typex.DCAResult

func (*AISDeviceMaster) OnRead added in v0.6.3

func (aism *AISDeviceMaster) OnRead(cmd []byte, data []byte) (int, error)

从设备里面读数据出来

func (*AISDeviceMaster) OnWrite added in v0.6.3

func (aism *AISDeviceMaster) OnWrite(cmd []byte, _ []byte) (int, error)

把数据写入设备

func (*AISDeviceMaster) ParseAisToJson added in v0.6.6

func (aism *AISDeviceMaster) ParseAisToJson(rawAiSString string) error

func (*AISDeviceMaster) Property added in v0.6.3

func (aism *AISDeviceMaster) Property() []iotschema.IoTSchema

设备属性,是一系列属性描述

func (*AISDeviceMaster) SetState added in v0.6.3

func (aism *AISDeviceMaster) SetState(status typex.DeviceState)

状态

func (*AISDeviceMaster) Start added in v0.6.3

func (aism *AISDeviceMaster) Start(cctx typex.CCTX) error

启动

func (*AISDeviceMaster) Status added in v0.6.3

func (aism *AISDeviceMaster) Status() typex.DeviceState

设备当前状态

func (*AISDeviceMaster) Stop added in v0.6.3

func (aism *AISDeviceMaster) Stop()

停止设备

type AuthType

type AuthType string

Auth 认证模式 枚举

const (
	AUTH_ANONYMOUS AuthType = "Anonymous"
	AUTH_USERNAME  AuthType = "UserName"
)

type BacnetIpConfig added in v0.6.1

type BacnetIpConfig struct {
	CommonConfig bacnetIpCommonConfig `json:"commonConfig"`
	NodeConfig   []bacnetIpNodeConfig `json:"nodeConfig"`
}

type CustomProtocolDevice

type CustomProtocolDevice struct {
	typex.XStatus

	RuleEngine typex.RuleX
	// contains filtered or unexported fields
}

func (*CustomProtocolDevice) Details

func (mdev *CustomProtocolDevice) Details() *typex.Device

真实设备

func (*CustomProtocolDevice) Driver

驱动

func (*CustomProtocolDevice) Init

func (mdev *CustomProtocolDevice) Init(devId string, configMap map[string]interface{}) error

初始化

func (*CustomProtocolDevice) OnCtrl

func (mdev *CustomProtocolDevice) OnCtrl(cmd []byte, _ []byte) ([]byte, error)

* * 外部指令交互, 常用来实现自定义协议等 *

func (*CustomProtocolDevice) OnDCACall

func (mdev *CustomProtocolDevice) OnDCACall(_ string, Command string,
	Args interface{}) typex.DCAResult

* * 设备服务调用 *

func (*CustomProtocolDevice) OnRead

func (mdev *CustomProtocolDevice) OnRead(cmd []byte, data []byte) (int, error)

* * 数据读出来,对数据结构有要求, 其中Key必须是个数字或者数字字符串, 例如 1 or "1" *

func (*CustomProtocolDevice) OnWrite

func (mdev *CustomProtocolDevice) OnWrite(cmd []byte, data []byte) (int, error)

把数据写入设备

func (*CustomProtocolDevice) Property

func (mdev *CustomProtocolDevice) Property() []iotschema.IoTSchema

设备属性,是一系列属性描述

func (*CustomProtocolDevice) SetState

func (mdev *CustomProtocolDevice) SetState(status typex.DeviceState)

状态

func (*CustomProtocolDevice) Start

func (mdev *CustomProtocolDevice) Start(cctx typex.CCTX) error

启动

func (*CustomProtocolDevice) Status

func (mdev *CustomProtocolDevice) Status() typex.DeviceState

设备当前状态

func (*CustomProtocolDevice) Stop

func (mdev *CustomProtocolDevice) Stop()

停止设备

type Date added in v0.6.4

type Date struct {
	Valid bool `json:"valid"`
	DD    int  `json:"dd"`
	MM    int  `json:"mm"`
	YY    int  `json:"yy"`
}

Date type

func (Date) String added in v0.6.4

func (d Date) String() string

String representation of date

type GNS added in v0.6.4

type GNS struct {
	Type       string   `json:"type"`
	GwID       string   `json:"gwid"`
	Latitude   float64  `json:"latitude"`
	Longitude  float64  `json:"longitude"`
	Mode       []string `json:"mode"`
	SVs        int64    `json:"s_vs"`
	HDOP       float64  `json:"hdop"`
	Altitude   float64  `json:"altitude"`
	Separation float64  `json:"separation"`
	Age        float64  `json:"age"`
	Station    int64    `json:"station"`
	NavStatus  string   `json:"nav_status"`
}

* *经纬度 *

type GenericBacnetIpDevice added in v0.6.1

type GenericBacnetIpDevice struct {
	typex.XStatus

	RuleEngine typex.RuleX
	// contains filtered or unexported fields
}

func (*GenericBacnetIpDevice) Details added in v0.6.1

func (dev *GenericBacnetIpDevice) Details() *typex.Device

func (*GenericBacnetIpDevice) Driver added in v0.6.1

func (*GenericBacnetIpDevice) Init added in v0.6.1

func (dev *GenericBacnetIpDevice) Init(devId string, configMap map[string]interface{}) error

func (*GenericBacnetIpDevice) OnCtrl added in v0.6.1

func (dev *GenericBacnetIpDevice) OnCtrl(cmd []byte, args []byte) ([]byte, error)

func (*GenericBacnetIpDevice) OnDCACall added in v0.6.1

func (dev *GenericBacnetIpDevice) OnDCACall(UUID string, Command string, Args interface{}) typex.DCAResult

func (*GenericBacnetIpDevice) OnRead added in v0.6.1

func (dev *GenericBacnetIpDevice) OnRead(cmd []byte, data []byte) (int, error)

func (*GenericBacnetIpDevice) OnWrite added in v0.6.1

func (dev *GenericBacnetIpDevice) OnWrite(cmd []byte, data []byte) (int, error)

func (*GenericBacnetIpDevice) Property added in v0.6.1

func (dev *GenericBacnetIpDevice) Property() []iotschema.IoTSchema

func (*GenericBacnetIpDevice) SetState added in v0.6.1

func (dev *GenericBacnetIpDevice) SetState(state typex.DeviceState)

func (*GenericBacnetIpDevice) Start added in v0.6.1

func (dev *GenericBacnetIpDevice) Start(cctx typex.CCTX) error

func (*GenericBacnetIpDevice) Status added in v0.6.1

func (dev *GenericBacnetIpDevice) Status() typex.DeviceState

func (*GenericBacnetIpDevice) Stop added in v0.6.1

func (dev *GenericBacnetIpDevice) Stop()

type GenericHttpDevice added in v0.6.5

type GenericHttpDevice struct {
	typex.XStatus

	RuleEngine typex.RuleX
	// contains filtered or unexported fields
}

func (*GenericHttpDevice) Details added in v0.6.5

func (hd *GenericHttpDevice) Details() *typex.Device

真实设备

func (*GenericHttpDevice) Driver added in v0.6.5

驱动

func (*GenericHttpDevice) Init added in v0.6.5

func (hd *GenericHttpDevice) Init(devId string, configMap map[string]interface{}) error

 初始化

func (*GenericHttpDevice) OnCtrl added in v0.6.5

func (hd *GenericHttpDevice) OnCtrl(cmd []byte, args []byte) ([]byte, error)

func (*GenericHttpDevice) OnDCACall added in v0.6.5

func (hd *GenericHttpDevice) OnDCACall(UUID string, Command string, Args interface{}) typex.DCAResult

func (*GenericHttpDevice) OnRead added in v0.6.5

func (hd *GenericHttpDevice) OnRead(cmd []byte, data []byte) (int, error)

func (*GenericHttpDevice) OnWrite added in v0.6.5

func (hd *GenericHttpDevice) OnWrite(cmd []byte, b []byte) (int, error)

把数据写入设备

func (*GenericHttpDevice) Property added in v0.6.5

func (hd *GenericHttpDevice) Property() []iotschema.IoTSchema

设备属性,是一系列属性描述

func (*GenericHttpDevice) SetState added in v0.6.5

func (hd *GenericHttpDevice) SetState(status typex.DeviceState)

状态

func (*GenericHttpDevice) Start added in v0.6.5

func (hd *GenericHttpDevice) Start(cctx typex.CCTX) error

启动

func (*GenericHttpDevice) Status added in v0.6.5

func (hd *GenericHttpDevice) Status() typex.DeviceState

设备当前状态

func (*GenericHttpDevice) Stop added in v0.6.5

func (hd *GenericHttpDevice) Stop()

停止设备

type GroupedTags added in v0.6.6

type GroupedTags struct {
	Function  int    `json:"function"`
	SlaverId  byte   `json:"slaverId"`
	Address   uint16 `json:"address"`
	Frequency int64  `json:"frequency"`
	Quantity  uint16 `json:"quantity"`
	Registers map[string]*common.RegisterRW
}

func (*GroupedTags) String added in v0.6.6

func (g *GroupedTags) String() string

type HNC8_CNC added in v0.6.7

type HNC8_CNC struct {
	typex.XStatus
	// contains filtered or unexported fields
}

* * 凯帝恩CNC *

func (*HNC8_CNC) Details added in v0.6.7

func (hnc8Cnc *HNC8_CNC) Details() *typex.Device

真实设备

func (*HNC8_CNC) Driver added in v0.6.7

func (hnc8Cnc *HNC8_CNC) Driver() typex.XExternalDriver

驱动

func (*HNC8_CNC) Init added in v0.6.7

func (hnc8Cnc *HNC8_CNC) Init(devId string, configMap map[string]interface{}) error

 初始化

func (*HNC8_CNC) OnCtrl added in v0.6.7

func (hnc8Cnc *HNC8_CNC) OnCtrl(cmd []byte, args []byte) ([]byte, error)

func (*HNC8_CNC) OnDCACall added in v0.6.7

func (hnc8Cnc *HNC8_CNC) OnDCACall(UUID string, Command string, Args interface{}) typex.DCAResult

func (*HNC8_CNC) OnRead added in v0.6.7

func (hnc8Cnc *HNC8_CNC) OnRead(cmd []byte, data []byte) (int, error)

func (*HNC8_CNC) OnWrite added in v0.6.7

func (hnc8Cnc *HNC8_CNC) OnWrite(cmd []byte, b []byte) (int, error)

把数据写入设备

func (*HNC8_CNC) Property added in v0.6.7

func (hnc8Cnc *HNC8_CNC) Property() []iotschema.IoTSchema

设备属性,是一系列属性描述

func (*HNC8_CNC) SetState added in v0.6.7

func (hnc8Cnc *HNC8_CNC) SetState(status typex.DeviceState)

状态

func (*HNC8_CNC) Start added in v0.6.7

func (hnc8Cnc *HNC8_CNC) Start(cctx typex.CCTX) error

启动

func (*HNC8_CNC) Status added in v0.6.7

func (hnc8Cnc *HNC8_CNC) Status() typex.DeviceState

设备当前状态

func (*HNC8_CNC) Stop added in v0.6.7

func (hnc8Cnc *HNC8_CNC) Stop()

停止设备

type IR added in v0.6.3

type IR struct {
	typex.XStatus

	// irFd       syscall.Handle windows
	RuleEngine typex.RuleX
	// contains filtered or unexported fields
}

func (*IR) Details added in v0.6.3

func (ird *IR) Details() *typex.Device

真实设备

func (*IR) Driver added in v0.6.3

func (ird *IR) Driver() typex.XExternalDriver

驱动

func (*IR) Init added in v0.6.3

func (ird *IR) Init(devId string, configMap map[string]interface{}) error

 初始化

func (*IR) OnCtrl added in v0.6.3

func (ird *IR) OnCtrl(cmd []byte, args []byte) ([]byte, error)

func (*IR) OnDCACall added in v0.6.3

func (ird *IR) OnDCACall(UUID string, Command string, Args interface{}) typex.DCAResult

func (*IR) OnRead added in v0.6.3

func (ird *IR) OnRead(cmd []byte, data []byte) (int, error)

* * 不支持读, 仅仅是个数据透传 *

func (*IR) OnWrite added in v0.6.3

func (ird *IR) OnWrite(cmd []byte, b []byte) (int, error)

func (*IR) Property added in v0.6.3

func (ird *IR) Property() []iotschema.IoTSchema

设备属性,是一系列属性描述

func (*IR) SetState added in v0.6.3

func (ird *IR) SetState(status typex.DeviceState)

状态

func (*IR) Start added in v0.6.3

func (ird *IR) Start(cctx typex.CCTX) error

启动

func (*IR) Status added in v0.6.3

func (ird *IR) Status() typex.DeviceState

设备当前状态

func (*IR) Stop added in v0.6.3

func (ird *IR) Stop()

停止设备

type IcmpSender

type IcmpSender struct {
	typex.XStatus

	RuleEngine typex.RuleX
	// contains filtered or unexported fields
}

func (*IcmpSender) Details

func (sender *IcmpSender) Details() *typex.Device

真实设备

func (*IcmpSender) Driver

func (sender *IcmpSender) Driver() typex.XExternalDriver

驱动

func (*IcmpSender) Init

func (sender *IcmpSender) Init(devId string, configMap map[string]interface{}) error

 初始化

func (*IcmpSender) OnCtrl

func (sender *IcmpSender) OnCtrl(cmd []byte, args []byte) ([]byte, error)

func (*IcmpSender) OnDCACall

func (sender *IcmpSender) OnDCACall(UUID string, Command string, Args interface{}) typex.DCAResult

func (*IcmpSender) OnRead

func (sender *IcmpSender) OnRead(cmd []byte, data []byte) (int, error)

从设备里面读数据出来

func (*IcmpSender) OnWrite

func (sender *IcmpSender) OnWrite(cmd []byte, _ []byte) (int, error)

把数据写入设备

func (*IcmpSender) Property

func (sender *IcmpSender) Property() []iotschema.IoTSchema

设备属性,是一系列属性描述

func (*IcmpSender) SetState

func (sender *IcmpSender) SetState(status typex.DeviceState)

状态

func (*IcmpSender) Start

func (sender *IcmpSender) Start(cctx typex.CCTX) error

启动

func (*IcmpSender) Status

func (sender *IcmpSender) Status() typex.DeviceState

设备当前状态

func (*IcmpSender) Stop

func (sender *IcmpSender) Stop()

停止设备

type KDN_CNC added in v0.6.7

type KDN_CNC struct {
	typex.XStatus
	// contains filtered or unexported fields
}

* * 凯帝恩CNC *

func (*KDN_CNC) Details added in v0.6.7

func (hd *KDN_CNC) Details() *typex.Device

真实设备

func (*KDN_CNC) Driver added in v0.6.7

func (hd *KDN_CNC) Driver() typex.XExternalDriver

驱动

func (*KDN_CNC) Init added in v0.6.7

func (hd *KDN_CNC) Init(devId string, configMap map[string]interface{}) error

 初始化

func (*KDN_CNC) OnCtrl added in v0.6.7

func (hd *KDN_CNC) OnCtrl(cmd []byte, args []byte) ([]byte, error)

func (*KDN_CNC) OnDCACall added in v0.6.7

func (hd *KDN_CNC) OnDCACall(UUID string, Command string, Args interface{}) typex.DCAResult

func (*KDN_CNC) OnRead added in v0.6.7

func (hd *KDN_CNC) OnRead(cmd []byte, data []byte) (int, error)

func (*KDN_CNC) OnWrite added in v0.6.7

func (hd *KDN_CNC) OnWrite(cmd []byte, b []byte) (int, error)

把数据写入设备

func (*KDN_CNC) Property added in v0.6.7

func (hd *KDN_CNC) Property() []iotschema.IoTSchema

设备属性,是一系列属性描述

func (*KDN_CNC) SetState added in v0.6.7

func (hd *KDN_CNC) SetState(status typex.DeviceState)

状态

func (*KDN_CNC) Start added in v0.6.7

func (hd *KDN_CNC) Start(cctx typex.CCTX) error

启动

func (*KDN_CNC) Status added in v0.6.7

func (hd *KDN_CNC) Status() typex.DeviceState

设备当前状态 主要判别依据是获取CNC的基础信息

func (*KDN_CNC) Stop added in v0.6.7

func (hd *KDN_CNC) Stop()

停止设备

type ModbusPoint added in v0.6.5

type ModbusPoint struct {
	UUID      string  `json:"uuid,omitempty"` // 当UUID为空时新建
	Tag       string  `json:"tag"`
	Alias     string  `json:"alias"`
	Function  int     `json:"function"`
	SlaverId  byte    `json:"slaverId"`
	Address   uint16  `json:"address"`
	Frequency int64   `json:"frequency"`
	Quantity  uint16  `json:"quantity"`
	Value     string  `json:"value,omitempty"` // 运行时数据
	Type      string  `json:"type"`            // 运行时数据
	Order     string  `json:"order"`           // 运行时数据
	Weight    float64 `json:"weight"`          // 权重
}

* * 点位表 *

type OpcuaNode

type OpcuaNode struct {
	Tag         string `json:"tag" validate:"required" title:"数据Tag" info:""`
	Description string `json:"description" validate:"required"`
	NodeID      string `json:"nodeId" validate:"required" title:"NodeID" example:"ns=1;s=Test"`
	DataType    string `json:"dataType" title:"数据类型" tag:"String" info:""`
	Value       string `json:"value" title:"值" info:"从OPCUA获取的值"` //不需要配置
}

type PolicyFlag

type PolicyFlag string
const (
	POLICY_NONE           PolicyFlag = "None"
	POLICY_BASIC128RSA15  PolicyFlag = "Basic128Rsa15"
	POLICY_BASIC256       PolicyFlag = "Basic256"
	POLICY_BASIC256SHA256 PolicyFlag = "Basic256Sha256"
)

type RMC added in v0.6.4

type RMC struct {
	// Talker    string  `json:"talker"`     // The talker id (e.g GP)
	Type      string  `json:"type"` // The data type (e.g GSA)
	GwID      string  `json:"gwid"`
	Validity  string  `json:"validity"`   // validity - A-ok, V-invalid
	Latitude  float64 `json:"latitude"`   // Latitude
	Longitude float64 `json:"longitude"`  // Longitude
	Speed     float64 `json:"speed"`      // Speed in knots
	Course    float64 `json:"course"`     // True course
	DateTime  string  `json:"date"`       // Date
	Variation float64 `json:"variation"`  // Magnetic variation
	FFAMode   string  `json:"ffa_mode"`   // FAA mode indicator (filled in NMEA 2.3 and later)
	NavStatus string  `json:"nav_status"` // Nav Status (NMEA 4.1 and later)
}

func (RMC) String added in v0.6.4

func (s RMC) String() string

type RegJsonValue added in v0.6.6

type RegJsonValue struct {
	Tag           string `json:"tag"`
	Alias         string `json:"alias"`
	SlaverId      byte   `json:"slaverId"`
	LastFetchTime uint64 `json:"lastFetchTime"`
	Value         string `json:"value"`
}

* * 返回给Lua的数据结构,经过精简后的寄存器 *

type S1200CommonConfig added in v0.6.5

type S1200CommonConfig struct {
	Host        string `json:"host" validate:"required"`        // 127.0.0.1:502
	Model       string `json:"model" validate:"required"`       // s7-200 s7-1500
	Rack        *int   `json:"rack" validate:"required"`        // 0
	Slot        *int   `json:"slot" validate:"required"`        // 1
	Timeout     *int   `json:"timeout" validate:"required"`     // 5s
	IdleTimeout *int   `json:"idleTimeout" validate:"required"` // 5s
	AutoRequest *bool  `json:"autoRequest" validate:"required"` // false
}

https://cloudvpn.beijerelectronics.com/hc/en-us/articles/4406049761169-Siemens-S7

type S1200Config added in v0.6.5

type S1200Config struct {
	CommonConfig S1200CommonConfig `json:"commonConfig" validate:"required"` // 通用配置
}

type SIEMENS_PLC added in v0.6.5

type SIEMENS_PLC struct {
	typex.XStatus

	RuleEngine typex.RuleX
	// contains filtered or unexported fields
}

https://www.ad.siemens.com.cn/productportal/prods/s7-1200_plc_easy_plus/07-Program/02-basic/01-Data_Type/01-basic.html

func (*SIEMENS_PLC) Details added in v0.6.5

func (s1200 *SIEMENS_PLC) Details() *typex.Device

真实设备

func (*SIEMENS_PLC) Driver added in v0.6.5

func (s1200 *SIEMENS_PLC) Driver() typex.XExternalDriver

驱动

func (*SIEMENS_PLC) Init added in v0.6.5

func (s1200 *SIEMENS_PLC) Init(devId string, configMap map[string]interface{}) error

初始化

func (*SIEMENS_PLC) OnCtrl added in v0.6.5

func (s1200 *SIEMENS_PLC) OnCtrl(cmd []byte, args []byte) ([]byte, error)

func (*SIEMENS_PLC) OnDCACall added in v0.6.5

func (s1200 *SIEMENS_PLC) OnDCACall(UUID string, Command string, Args interface{}) typex.DCAResult

func (*SIEMENS_PLC) OnRead added in v0.6.5

func (s1200 *SIEMENS_PLC) OnRead(cmd []byte, data []byte) (int, error)

从设备里面读数据出来

func (*SIEMENS_PLC) OnWrite added in v0.6.5

func (s1200 *SIEMENS_PLC) OnWrite(cmd []byte, data []byte) (int, error)

func (*SIEMENS_PLC) Property added in v0.6.5

func (s1200 *SIEMENS_PLC) Property() []iotschema.IoTSchema

设备属性,是一系列属性描述

func (*SIEMENS_PLC) Read added in v0.6.5

func (s1200 *SIEMENS_PLC) Read(cmd []byte, data []byte) (int, error)

func (*SIEMENS_PLC) SetState added in v0.6.5

func (s1200 *SIEMENS_PLC) SetState(status typex.DeviceState)

状态

func (*SIEMENS_PLC) Start added in v0.6.5

func (s1200 *SIEMENS_PLC) Start(cctx typex.CCTX) error

启动

func (*SIEMENS_PLC) Status added in v0.6.5

func (s1200 *SIEMENS_PLC) Status() typex.DeviceState

设备当前状态

func (*SIEMENS_PLC) Stop added in v0.6.5

func (s1200 *SIEMENS_PLC) Stop()

停止设备

func (*SIEMENS_PLC) Write added in v0.6.5

func (s1200 *SIEMENS_PLC) Write(cmd []byte, data []byte) (int, error)

type SecurityMode

type SecurityMode string
const (
	MODE_NONE             SecurityMode = "None"
	MODE_SIGN             SecurityMode = "Sign"
	MODE_SIGN_AND_ENCRYPT SecurityMode = "SignAndEncrypt"
)

type SiemensJsonValue added in v0.6.6

type SiemensJsonValue struct {
	Tag           string `json:"tag"`
	Alias         string `json:"alias"`
	LastFetchTime uint64 `json:"lastFetchTime"`
	Value         string `json:"value"`
}

type Time added in v0.6.4

type Time struct {
	Valid       bool `json:"valid"`
	Hour        int  `json:"hour"`
	Minute      int  `json:"minute"`
	Second      int  `json:"second"`
	Millisecond int  `json:"millisecond"`
}

func (Time) String added in v0.6.4

func (t Time) String() string

String representation of Time

type VDMVDO added in v0.6.4

type VDMVDO struct {
	MessageID      int64  `json:"message_id"`
	GwID           string `json:"gwid"`
	Type           string `json:"type"` // The data type (e.g GSA)
	NumFragments   int64  `json:"numFragments"`
	FragmentNumber int64  `json:"fragmentNumber"`
	Channel        string `json:"channel"`
	Payload        []byte `json:"-"`
}

* * AIS消息结构体 *

Jump to

Keyboard shortcuts

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