co2mon

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// HumOps indicates relative humidity in units of 0.01%.
	HumOps ops
	// TempOps indicates temperature in Kelvin (unit of 1/16th K).
	TempOps
	// Co2Ops indicates CO₂ concentration in ppm.
	Co2Ops
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

func Open

func Open(setters ...OptionSetter) (*Device, error)

func (*Device) Close

func (d *Device) Close() error

func (*Device) ReadPacket

func (d *Device) ReadPacket() (*Packet, error)

ReadPacket reads one Packet from the monitor. An error will be returned on an I/O error or if a message could not be read or decoded.

type OptionSetter

type OptionSetter func(opts *options)

func WithKey

func WithKey(key [8]byte) OptionSetter

WithKey sets a static key.

func WithPath

func WithPath(path string) OptionSetter

WithPath sets a device file path. Default value is `/dev/hidraw0`.

func WithRandomKey

func WithRandomKey() OptionSetter

WithRandomKey sets a random key.

func WithoutDecrypt

func WithoutDecrypt() OptionSetter

WithoutDecrypt disables data decrypt.

type Packet

type Packet struct {
	Ops   ops
	Value int
}

Packet represents single operation/value pair from the monitor

Jump to

Keyboard shortcuts

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