hardware

package
v0.0.0-...-c4bdd08 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogTemperatures

func LogTemperatures(messages chan string)

LogTemperatures -> Write the Temperatures to standard output

func ReadAddresses

func ReadAddresses(oneBus *netlink.OneWire, messages *chan string)

ReadAddresses -> Update the TemperatureProbes with the current value from the device

func ReadTemperatures

func ReadTemperatures(m *chan string, quit chan struct{})

ReadTemperatures Read the temperatures on an infinite ticker loop

func SetProbe

func SetProbe(probe *TemperatureProbe)

SetProbe -> Used to set a probe in the master list

Types

type TemperatureProbe

type TemperatureProbe struct {
	PhysAddr   string
	Address    onewire.Address
	ReadingRaw physic.Temperature
	Updated    time.Time
}

TemperatureProbe holds data that represents a physical temperature probe PhysAddr -> The Hex address of the probe on the filesystem Address -> The unsigned int value for the readings Reading -> The actual reading as a Physic.Temperature

func GetProbes

func GetProbes() []*TemperatureProbe

GetProbes -> Get all the probes

func GetTemperature

func GetTemperature(physAddr string) *TemperatureProbe

GetTemperature -> Get the probe object for a physical address

func (*TemperatureProbe) Reading

func (t *TemperatureProbe) Reading() string

Reading The current temperature reading for the probe

func (*TemperatureProbe) UpdateTemperature

func (t *TemperatureProbe) UpdateTemperature(newTemp string) error

UpdateTemperature Set the temperature on the Temperature Probe from a string

Jump to

Keyboard shortcuts

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