protocol

package
v4.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(proto *Protocol)

Types

type Adapter

type Adapter interface {
	Tunnel() connect.Tunnel

	Mount(device string) error
	Unmount(device string) error

	Get(device, point string) (any, error)
	Set(device, point string, value any) error
	Sync(device string) (map[string]any, error)
}

func Create

func Create(conn connect.Tunnel, name string, opts types.Options) (Adapter, error)

type Factory

type Factory func(conn connect.Tunnel, opts types.Options) (Adapter, error)

type Protocol

type Protocol struct {
	Name    string  `json:"name"`
	Label   string  `json:"label"`
	Factory Factory `json:"-"`

	//通道参数
	OptionForm []types.FormItem `json:"-"`

	//设备参数
	StationForm []types.FormItem `json:"-"`

	//轮询器
	PollersForm []types.FormItem `json:"-"`

	//映射表
	MapperForm []types.FormItem `json:"-"`
}

func Get

func Get(name string) (*Protocol, error)

func Protocols

func Protocols() []*Protocol

Jump to

Keyboard shortcuts

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