Documentation ¶
Overview ¶
Package packet implements getters and setters for Davis Instruments packets.
Index ¶
- Constants
- func Crc(p []byte) (c uint16)
- func GetBarTrend(p []byte, i uint) string
- func GetDate16(p []byte, i uint) time.Time
- func GetDateTime32(p []byte, i uint) time.Time
- func GetDateTime48(p []byte, i uint) time.Time
- func GetFloat16(p []byte, i uint) float64
- func GetFloat16_10(p []byte, i uint) float64
- func GetForecast(p []byte, i uint) string
- func GetForecastIcons(p []byte, i uint) (icons []string)
- func GetMPH16(p []byte, i uint) float64
- func GetMPH8(p []byte, i uint) int
- func GetPressure(p []byte, i uint) float64
- func GetRain(p []byte, i uint) float64
- func GetTemp8(p []byte, i uint) int
- func GetTime16(p []byte, i uint) time.Time
- func GetTransStatus(p []byte, i uint) (low []int)
- func GetUFloat8(p []byte, i uint) float64
- func GetUInt16(p []byte, i uint) int
- func GetUInt8(p []byte, i uint) int
- func GetUVIndex(p []byte, i uint) float64
- func GetVoltage(p []byte, i uint) float64
- func GetWindDir(p []byte, i uint) int
- func SetCrc(p *[]byte)
- func SetDateTime32(p *[]byte, i uint, t time.Time)
- func SetDateTime48(p *[]byte, i uint, t time.Time)
- func SetFloat16(p *[]byte, i uint, v float64)
- func SetFloat16_10(p *[]byte, i uint, v float64)
- func SetMPH16(p *[]byte, i uint, v float64)
- func SetMPH8(p *[]byte, i uint, v int)
- func SetPressure(p *[]byte, i uint, v float64)
- func SetRain(p *[]byte, i uint, v float64)
- func SetTemp8(p *[]byte, i uint, v int)
- func SetUInt16(p *[]byte, i uint, v int)
- func SetUInt8(p *[]byte, i uint, v int)
- func SetVoltage(p *[]byte, i uint, v float64)
Constants ¶
const ( Dash = "-" FallingRapid = "Falling Rapidly" FallingSlow = "Falling Slowly" Steady = "Steady" RisingSlow = "Rising Slowly" RisingRapid = "Rising Rapidly" )
Barometer trends.
Variables ¶
This section is empty.
Functions ¶
func GetBarTrend ¶
GetBarTrend gets a barometer trend from a given packet at the specified index.
func GetDate16 ¶
GetDate16 gets a 2-byte date (no time) value from a given packet at the specified index.
func GetDateTime32 ¶
GetDateTime32 gets a 4-byte date and time value from a given packet at the specified index.
func GetDateTime48 ¶
GetDateTime48 gets a 6-byte date and time value from a given packet at the specified index.
func GetFloat16 ¶
GetFloat16 gets a 2-byte signed two's complement float value from a given packet at the specified index.
func GetFloat16_10 ¶
GetFloat16_10 gets a 2-byte signed two's complement float value in tenths in a given packet at the specified index.
func GetForecast ¶
GetForecast gets a forecast string from a given packet at the specified index.
func GetForecastIcons ¶
GetForecastIcons gets a forecast icon bit map from a given packet at the specified index.
func GetPressure ¶
GetPressure gets a pressure value from a given packet at the specified index.
func GetRain ¶
GetRain gets a rain rate or accumulation value from a given packet at the specified index.
func GetTime16 ¶
GetTime16 gets a 2-byte time (no date) value in a given packet at the specified index.
func GetTransStatus ¶
GetTransStatus gets the transmitter status from the given packet at the specified index and returns a slice of the ID's/channels that have low battery indicators.
func GetUFloat8 ¶
GetUFloat8 gets a 1-byte unsigned float value from a given packet at the specified index.
func GetUInt16 ¶
GetUInt16 gets a 2-byte unsigned integer value from a given packet at the specified index.
func GetUInt8 ¶
GetUInt8 gets a 1-byte unsigned integer value from a given packet at the specified index.
func GetUVIndex ¶
GetUVIndex gets a Ultraviolet index value from a given packet at the specified index.
func GetVoltage ¶
GetVoltage gets a battery voltage value from a given packet at the specified index.
func GetWindDir ¶
GetWindDir gets a wind direction value in degrees from a given packet at the specified index.
func SetCrc ¶
func SetCrc(p *[]byte)
SetCrc sets the last 2-bytes of a given packet to the proper CRC value based on the rest of content.
func SetDateTime32 ¶
SetDateTime32 sets a 4-byte date and time value in a given packet at the specified index.
func SetDateTime48 ¶
SetDateTime48 sets a 6-byte date and time value in a given packet at the specified index.
func SetFloat16 ¶
SetFloat16 sets a 2-byte signed two's complement float value in a given packet at the specified index.
func SetFloat16_10 ¶
SetFloat16_10 sets a 2-byte signed two's complement float value in tenths in a given packet at the specified index.
func SetPressure ¶
SetPressure sets a pressure value in a given packet at the specified index.
func SetRain ¶
SetRain sets a rain rate or accumulation value in a given packet at the specified index.
func SetUInt16 ¶
SetUInt16 sets a 2-byte unsigned integer value in a given packet at the specified index.
func SetUInt8 ¶
SetUInt8 sets a 1-byte unsigned integer value in a given packet at the specified index.
func SetVoltage ¶
SetVoltage sets a battery voltage value in a given packet at the specified index.
Types ¶
This section is empty.