protocol

package
v0.0.0-...-3eac474 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hop

type Hop struct {
	Freq     int
	Dwell    time.Duration
	HopIndex int
}

func (Hop) String

func (h Hop) String() string

type ProtocolHandler

type ProtocolHandler struct {
	crc.CRC
	// contains filtered or unexported fields
}

func NewProtocolHandler

func NewProtocolHandler(stationNumber int) (ph ProtocolHandler)

func (*ProtocolHandler) CurrentChannel

func (ph *ProtocolHandler) CurrentChannel() (freq int)

func (*ProtocolHandler) HandlePacket

func (ph *ProtocolHandler) HandlePacket(pkt radios.Packet, timedout bool) (hop bool, rd Reading)

func (*ProtocolHandler) NextHop

func (ph *ProtocolHandler) NextHop() (hop Hop)

type Reading

type Reading struct {
	StationID  int
	Sensor     Sensor
	SensorName string
	Value      float64
	RawValue   uint32
	Valid      bool

	WindSpeed float64
	WindDir   float64

	StationBatLow bool
}

func ParsePacket

func ParsePacket(pkt radios.Packet) (rd Reading)

func (Reading) String

func (r Reading) String() string

type Sensor

type Sensor byte
const (
	SuperCapVoltage Sensor = 2
	UVIndex         Sensor = 4
	RainRate        Sensor = 5
	SolarRadiation  Sensor = 6
	Light           Sensor = 7
	Temperature     Sensor = 8
	WindGustSpeed   Sensor = 9
	Humidity        Sensor = 0xA
	RainClicks      Sensor = 0xE
)

func (Sensor) String

func (r Sensor) String() string

Jump to

Keyboard shortcuts

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