configmap

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(path string,
	devices map[string]*globals.ModbusDev,
	dms map[string]common.DeviceModel,
	protocols map[string]common.Protocol) error

Parse parse the configmap.

Types

type COMStruct

type COMStruct struct {
	SerialPort string `json:"serialPort"`
	BaudRate   int64  `json:"baudRate"`
	DataBits   int64  `json:"dataBits"`
	Parity     string `json:"parity"`
	StopBits   int64  `json:"stopBits"`
}

COMStruct is the serial configuration.

type CustomizedValue

type CustomizedValue map[string]interface{}

CustomizedValue is the customized part for modbus protocol.

type ModbusProtocolCommonConfig

type ModbusProtocolCommonConfig struct {
	COM              COMStruct       `json:"com,omitempty"`
	TCP              TCPStruct       `json:"tcp,omitempty"`
	CustomizedValues CustomizedValue `json:"customizedValues,omitempty"`
}

ModbusProtocolCommonConfig is the modbus protocol configuration.

type ModbusProtocolConfig

type ModbusProtocolConfig struct {
	SlaveID int16 `json:"slaveID,omitempty"`
}

ModbusProtocolConfig is the protocol configuration.

type ModbusVisitorConfig

type ModbusVisitorConfig struct {
	Register       string  `json:"register"`
	Offset         uint16  `json:"offset"`
	Limit          int     `json:"limit"`
	Scale          float64 `json:"scale,omitempty"`
	IsSwap         bool    `json:"isSwap,omitempty"`
	IsRegisterSwap bool    `json:"isRegisterSwap,omitempty"`
}

ModbusVisitorConfig is the modbus register configuration.

type TCPStruct

type TCPStruct struct {
	IP   string `json:"ip"`
	Port int64  `json:"port"`
}

TCPStruct is the TCP configuration.

Jump to

Keyboard shortcuts

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