Help us shape the future of Go! Take the 2026 Go Developer Survey

co2monitor

package module
v0.0.0-...-5604965 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

co2monitor

go package for the co2monitor (04d9:a052)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorCouldNotGenerateKey        = errors.New("could not generate key")
	ErrorDidNotFindDevice           = errors.New("did not find device")
	ErrorCouldNotOpenDevice         = errors.New("could not open device")
	ErrorCouldNotSendFeatureRequest = errors.New("could not send feature request")
)
View Source
var (
	CouldNotReadFromDevice = errors.New("could not read from device")
)

Functions

This section is empty.

Types

type CO2Monitor

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

func (*CO2Monitor) Close

func (cm *CO2Monitor) Close() error

func (*CO2Monitor) Open

func (cm *CO2Monitor) Open() error

Opens the CO2Monitor for reading, be sure to Close it Returns an error in case - it could not generate the decryption key - it did not find the device - it could not open the device for reading - it could not send the feature report to the device

func (*CO2Monitor) Read

func (cm *CO2Monitor) Read(r *Reading, buf *[8]byte) error

Reads a fresh reading into r Returns an error in case of a read error

type Reading

type Reading struct {
	TemperatureKelvin float64
	CO2PPM            int
}

func (Reading) TemperatureCelcius

func (r Reading) TemperatureCelcius() float64

func (Reading) TemperatureFahrenheit

func (r Reading) TemperatureFahrenheit() float64

Directories

Path Synopsis
cmd
co2monitor command
web
cmd/co2monitor command

Jump to

Keyboard shortcuts

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