netlink

package
v3.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package netlink implements host drivers based on the Linux netlink connector interface. See https://www.kernel.org/doc/Documentation/connector/connector.txt for details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OneWire

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

OneWire is a 1-wire bus via netlink.

It can be used to communicate with multiple devices from multiple goroutines.

func New

func New(masterID uint32) (*OneWire, error)

New opens a 1-wire bus via its netlink interface as described at https://www.kernel.org/doc/Documentation/w1/w1.netlink

masterID is the bus number reported by the netlink W1_LIST_MASTERS command. The resulting object is safe for concurrent use.

NOTE: the Linux 1-wire netlink API does not support strong pull-ups after write operations. Hence this driver does not support this feature either. The pull-up argument passed to Tx() is ignored. Devices may need to be powered externally to work with this driver.

func (*OneWire) Close

func (o *OneWire) Close() error

Close closes the handle to the 1-wire driver. It is not a requirement to close before process termination.

func (*OneWire) Search

func (o *OneWire) Search(alarmOnly bool) ([]onewire.Address, error)

Search performs a device search operation on the 1-wire bus. The resulting device addresses are returned. If alarmOnly is true, only devices in alarm state are returned.

func (*OneWire) String

func (o *OneWire) String() string

String returns the name of the OneWire instance.

func (*OneWire) Tx

func (o *OneWire) Tx(w, r []byte, _ onewire.Pullup) error

Tx performs reset, write and (if len(r) > 0) read operations on the 1-wire bus.

NOTE: the Linux 1-wire netlink API does not support requesting strong pull-ups after write operations. Hence this driver does not support this feature either. The pull-up argument passed to Tx() is ignored.

Jump to

Keyboard shortcuts

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