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 ¶
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 ¶
Close closes the handle to the 1-wire driver. It is not a requirement to close before process termination.
func (*OneWire) Search ¶
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) Tx ¶
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.