smartbus

package
Version: v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Line     string        `json:"line"`
	Device   string        `json:"device"`
	Baud     int           `json:"baud"`
	StopBits int           `json:"stop_bits"`
	Sleep    int64         `json:"sleep"`
	Timeout  time.Duration `json:"timeout"`
	Command  []byte        `json:"command"`
	Result   bool          `json:"result"`
}

type Result

type Result struct {
	Command   []byte `json:"command"`
	Device    string `json:"device"`
	Result    string `json:"result"`
	Error     string `json:"error"`
	ErrorCode string `json:"error_code"`
}

type Smartbus

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

func NewSmartbus

func NewSmartbus(respFunc func(deviceId int64, data []byte), requestMessage *common.MessageRequest) *Smartbus

func (*Smartbus) DeviceId

func (s *Smartbus) DeviceId() int64

func (*Smartbus) Exec

func (s *Smartbus) Exec(t common.Thread) (resp *common.MessageResponse, err error)

func (*Smartbus) Send

func (s *Smartbus) Send(deviceId int64, item interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL