dpt

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLength = errors.New("Given application data has invalid length")

ErrInvalidLength is returned when the application data has unexpected length.

Functions

func ListSupportedTypes

func ListSupportedTypes() []string

ListSupportedTypes returns the name all known datapoint-types (DPTs).

Types

type DPT_1001

type DPT_1001 bool

DPT_1001 represents DPT 1.001 / Switch.

func (DPT_1001) Pack

func (d DPT_1001) Pack() []byte

func (DPT_1001) String

func (d DPT_1001) String() string

func (DPT_1001) Unit

func (d DPT_1001) Unit() string

func (*DPT_1001) Unpack

func (d *DPT_1001) Unpack(data []byte) error

type DPT_1002

type DPT_1002 bool

DPT_1002 represents DPT 1.002 / Bool.

func (DPT_1002) Pack

func (d DPT_1002) Pack() []byte

func (DPT_1002) String

func (d DPT_1002) String() string

func (DPT_1002) Unit

func (d DPT_1002) Unit() string

func (*DPT_1002) Unpack

func (d *DPT_1002) Unpack(data []byte) error

type DPT_1003

type DPT_1003 bool

DPT_1003 represents DPT 1.003 / Enable.

func (DPT_1003) Pack

func (d DPT_1003) Pack() []byte

func (DPT_1003) String

func (d DPT_1003) String() string

func (DPT_1003) Unit

func (d DPT_1003) Unit() string

func (*DPT_1003) Unpack

func (d *DPT_1003) Unpack(data []byte) error

type DPT_1009

type DPT_1009 bool

DPT_1009 represents DPT 1.009 / OpenClose.

func (DPT_1009) Pack

func (d DPT_1009) Pack() []byte

func (DPT_1009) String

func (d DPT_1009) String() string

func (DPT_1009) Unit

func (d DPT_1009) Unit() string

func (*DPT_1009) Unpack

func (d *DPT_1009) Unpack(data []byte) error

type DPT_1010

type DPT_1010 bool

DPT_1010 represents DPT 1.010 / Start.

func (DPT_1010) Pack

func (d DPT_1010) Pack() []byte

func (DPT_1010) String

func (d DPT_1010) String() string

func (DPT_1010) Unit

func (d DPT_1010) Unit() string

func (*DPT_1010) Unpack

func (d *DPT_1010) Unpack(data []byte) error

type DPT_12001

type DPT_12001 uint32

DPT_12001 represents DPT 12.001 / Unsigned counter.

func (DPT_12001) Pack

func (d DPT_12001) Pack() []byte

func (DPT_12001) String

func (d DPT_12001) String() string

func (DPT_12001) Unit

func (d DPT_12001) Unit() string

func (*DPT_12001) Unpack

func (d *DPT_12001) Unpack(data []byte) error

type DPT_13001

type DPT_13001 int32

DPT_13001 represents DPT 13.001 / counter value.

func (DPT_13001) Pack

func (d DPT_13001) Pack() []byte

func (DPT_13001) String

func (d DPT_13001) String() string

func (DPT_13001) Unit

func (d DPT_13001) Unit() string

func (*DPT_13001) Unpack

func (d *DPT_13001) Unpack(data []byte) error

type DPT_13002

type DPT_13002 int32

DPT_13002 represents DPT 13.002 / flow rate.

func (DPT_13002) Pack

func (d DPT_13002) Pack() []byte

func (DPT_13002) String

func (d DPT_13002) String() string

func (DPT_13002) Unit

func (d DPT_13002) Unit() string

func (*DPT_13002) Unpack

func (d *DPT_13002) Unpack(data []byte) error

type DPT_13010

type DPT_13010 int32

DPT_13010 represents DPT 13.010 / active energy.

func (DPT_13010) Pack

func (d DPT_13010) Pack() []byte

func (DPT_13010) String

func (d DPT_13010) String() string

func (DPT_13010) Unit

func (d DPT_13010) Unit() string

func (*DPT_13010) Unpack

func (d *DPT_13010) Unpack(data []byte) error

type DPT_13011

type DPT_13011 int32

DPT_13011 represents DPT 13.011 / apparant energy.

func (DPT_13011) Pack

func (d DPT_13011) Pack() []byte

func (DPT_13011) String

func (d DPT_13011) String() string

func (DPT_13011) Unit

func (d DPT_13011) Unit() string

func (*DPT_13011) Unpack

func (d *DPT_13011) Unpack(data []byte) error

type DPT_13012

type DPT_13012 int32

DPT_13012 represents DPT 13.012 / reactive energy.

func (DPT_13012) Pack

func (d DPT_13012) Pack() []byte

func (DPT_13012) String

func (d DPT_13012) String() string

func (DPT_13012) Unit

func (d DPT_13012) Unit() string

func (*DPT_13012) Unpack

func (d *DPT_13012) Unpack(data []byte) error

type DPT_13013

type DPT_13013 int32

DPT_13013 represents DPT 13.010 / active energy (kWh).

func (DPT_13013) Pack

func (d DPT_13013) Pack() []byte

func (DPT_13013) String

func (d DPT_13013) String() string

func (DPT_13013) Unit

func (d DPT_13013) Unit() string

func (*DPT_13013) Unpack

func (d *DPT_13013) Unpack(data []byte) error

type DPT_13014

type DPT_13014 int32

DPT_13014 represents DPT 13.014 / apparant energy (kVAh).

func (DPT_13014) Pack

func (d DPT_13014) Pack() []byte

func (DPT_13014) String

func (d DPT_13014) String() string

func (DPT_13014) Unit

func (d DPT_13014) Unit() string

func (*DPT_13014) Unpack

func (d *DPT_13014) Unpack(data []byte) error

type DPT_13015

type DPT_13015 int32

DPT_13015 represents DPT 13.015 / reactive energy (kVARh).

func (DPT_13015) Pack

func (d DPT_13015) Pack() []byte

func (DPT_13015) String

func (d DPT_13015) String() string

func (DPT_13015) Unit

func (d DPT_13015) Unit() string

func (*DPT_13015) Unpack

func (d *DPT_13015) Unpack(data []byte) error

type DPT_5001

type DPT_5001 float32

DPT_5001 represents DPT 5.001 / Scaling.

func (DPT_5001) Pack

func (d DPT_5001) Pack() []byte

func (DPT_5001) String

func (d DPT_5001) String() string

func (DPT_5001) Unit

func (d DPT_5001) Unit() string

func (*DPT_5001) Unpack

func (d *DPT_5001) Unpack(data []byte) error

type DPT_5003

type DPT_5003 float32

DPT_5003 represents DPT 5.003 / Angle.

func (DPT_5003) Pack

func (d DPT_5003) Pack() []byte

func (DPT_5003) String

func (d DPT_5003) String() string

func (DPT_5003) Unit

func (d DPT_5003) Unit() string

func (*DPT_5003) Unpack

func (d *DPT_5003) Unpack(data []byte) error

type DPT_5004

type DPT_5004 uint8

DPT_5004 represents DPT 5.004 / Percent_U8.

func (DPT_5004) Pack

func (d DPT_5004) Pack() []byte

func (DPT_5004) String

func (d DPT_5004) String() string

func (DPT_5004) Unit

func (d DPT_5004) Unit() string

func (*DPT_5004) Unpack

func (d *DPT_5004) Unpack(data []byte) error

type DPT_9001

type DPT_9001 float32

DPT_9001 represents DPT 9.001 / Temperature.

func (DPT_9001) Pack

func (d DPT_9001) Pack() []byte

func (DPT_9001) String

func (d DPT_9001) String() string

func (DPT_9001) Unit

func (d DPT_9001) Unit() string

func (*DPT_9001) Unpack

func (d *DPT_9001) Unpack(data []byte) error

type DPT_9004

type DPT_9004 float32

DPT_9004 represents DPT 9.004 / Illumination.

func (DPT_9004) Pack

func (d DPT_9004) Pack() []byte

func (DPT_9004) String

func (d DPT_9004) String() string

func (DPT_9004) Unit

func (d DPT_9004) Unit() string

func (*DPT_9004) Unpack

func (d *DPT_9004) Unpack(data []byte) error

type DPT_9005

type DPT_9005 float32

DPT_9005 represents DPT 9.005 / Wind Speed.

func (DPT_9005) Pack

func (d DPT_9005) Pack() []byte

func (DPT_9005) String

func (d DPT_9005) String() string

func (DPT_9005) Unit

func (d DPT_9005) Unit() string

func (*DPT_9005) Unpack

func (d *DPT_9005) Unpack(data []byte) error

type DPT_9007

type DPT_9007 float32

DPT_9007 represents DPT 9.007 / Humidity

func (DPT_9007) Pack

func (d DPT_9007) Pack() []byte

func (DPT_9007) String

func (d DPT_9007) String() string

func (DPT_9007) Unit

func (d DPT_9007) Unit() string

func (*DPT_9007) Unpack

func (d *DPT_9007) Unpack(data []byte) error

type DatapointMeta

type DatapointMeta interface {
	// Unit returns the unit of this datapoint type or empty string if it doesn't have a unit.
	Unit() string
}

DatapointMeta gives meta information about a datapoint type.

type DatapointValue

type DatapointValue interface {
	// Pack the datapoint to a byte array.
	Pack() []byte

	// Unpack a the datapoint value from a byte array.
	Unpack(data []byte) error
}

A DatapointValue is a value of a datapoint.

func Produce

func Produce(name string) (d DatapointValue, ok bool)

Produce creates a new instance of the given datapoint-type name e.g. "1.001".

Jump to

Keyboard shortcuts

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