encoding

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ArrayAll uint32 = ^uint32(0)

ArrayAll is an argument typically passed during a read to signify where to read

View Source
const InstanceBits = 22
View Source
const MaxAPDU = MaxAPDUOverIP
View Source
const MaxAPDUOverIP = 1476
View Source
const MaxInstance = 0x3FFFFF
View Source
const MaxObject = 0x3FF
View Source
const MaxPropertyID = 4194303

Variables

Functions

func IsEvenDayOfMonth

func IsEvenDayOfMonth(day int) bool

func IsEvenMonth

func IsEvenMonth(month int) bool

func IsLastDayOfMonth

func IsLastDayOfMonth(day int) bool

func IsOddDayOfMonth

func IsOddDayOfMonth(day int) bool

func IsOddMonth

func IsOddMonth(month int) bool

Types

type APDUMetadata

type APDUMetadata byte

func (*APDUMetadata) DataType

func (meta *APDUMetadata) DataType() btypes.PDUType

type Decoder

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

Decoder used

func NewDecoder

func NewDecoder(b []byte) *Decoder

func (*Decoder) APDU

func (d *Decoder) APDU(a *btypes.APDU) error

func (*Decoder) Address

func (d *Decoder) Address(a *btypes.Address)

func (*Decoder) AppData

func (d *Decoder) AppData() (interface{}, error)

func (*Decoder) AppDataOfTag

func (d *Decoder) AppDataOfTag(tag uint8, len int) (interface{}, error)

func (*Decoder) BVLC

func (d *Decoder) BVLC(b *btypes.BVLC) error

func (*Decoder) Bytes

func (d *Decoder) Bytes() []byte

func (*Decoder) Error

func (d *Decoder) Error() error

func (*Decoder) IAm

func (d *Decoder) IAm(id *btypes.IAm) error

func (*Decoder) NPDU

func (d *Decoder) NPDU(n *btypes.NPDU) (addr []btypes.Address, err error)

NPDU encodes the network layer control message

func (*Decoder) Read

func (d *Decoder) Read(data []byte) (int, error)

func (*Decoder) ReadByte

func (d *Decoder) ReadByte() (byte, error)

func (*Decoder) ReadMultiplePropertyAck

func (d *Decoder) ReadMultiplePropertyAck(data *btypes.MultiplePropertyData) error

func (*Decoder) ReadProperty

func (d *Decoder) ReadProperty(data *btypes.PropertyData) error

func (*Decoder) Skip

func (d *Decoder) Skip(n uint32) error

func (*Decoder) UnreadByte

func (d *Decoder) UnreadByte() error

func (*Decoder) WhoIs

func (d *Decoder) WhoIs(low, high *int32) error

type Encoder

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

func NewEncoder

func NewEncoder() *Encoder

func (*Encoder) APDU

func (e *Encoder) APDU(a btypes.APDU) error

func (*Encoder) AppData

func (e *Encoder) AppData(i interface{}, typeBVBO bool) error

func (*Encoder) BVLC

func (e *Encoder) BVLC(b btypes.BVLC) error

func (*Encoder) Bytes

func (e *Encoder) Bytes() []byte

func (*Encoder) Error

func (e *Encoder) Error() error

func (*Encoder) IAm

func (e *Encoder) IAm(id btypes.IAm) error

func (*Encoder) NPDU

func (e *Encoder) NPDU(n *btypes.NPDU)

NPDU encodes the network layer control message

func (*Encoder) ReadMultipleProperty

func (e *Encoder) ReadMultipleProperty(invokeID uint8, data btypes.MultiplePropertyData) error

func (*Encoder) ReadMultiplePropertyAck

func (e *Encoder) ReadMultiplePropertyAck(invokeID uint8, data btypes.MultiplePropertyData) error

func (*Encoder) ReadProperty

func (e *Encoder) ReadProperty(invokeID uint8, data btypes.PropertyData) error

ReadProperty is a service request to read a property that is passed.

func (*Encoder) ReadPropertyAck

func (e *Encoder) ReadPropertyAck(invokeID uint8, data btypes.PropertyData) error

ReadPropertyAck is the response made to a ReadProperty service request.

func (*Encoder) WhoIs

func (e *Encoder) WhoIs(low, high int32) error

func (*Encoder) WriteMultiProperty

func (e *Encoder) WriteMultiProperty(invokeID uint8, data btypes.MultiplePropertyData) error

WriteMultiProperty encodes a writes property request

func (*Encoder) WriteProperty

func (e *Encoder) WriteProperty(invokeID uint8, data btypes.PropertyData) error

WriteProperty encodes a write request

type ErrorIncorrectTag

type ErrorIncorrectTag struct {
	Expected uint8
	Given    uint8
}

func (*ErrorIncorrectTag) Error

func (e *ErrorIncorrectTag) Error() string

type ErrorWrongTagType

type ErrorWrongTagType struct {
	Type TagType
}

ErrorWrongTagType is given when a certain tag type is expected but not given when encoding/decoding

func (*ErrorWrongTagType) Error

func (e *ErrorWrongTagType) Error() string

type NPDUMetadata

type NPDUMetadata byte

NPDUMetadata includes additional metadata about npdu message

func (*NPDUMetadata) ExpectingReply

func (n *NPDUMetadata) ExpectingReply() bool

func (*NPDUMetadata) HasDestination

func (n *NPDUMetadata) HasDestination() bool

func (*NPDUMetadata) HasSource

func (n *NPDUMetadata) HasSource() bool

func (*NPDUMetadata) IsNetworkLayerMessage

func (n *NPDUMetadata) IsNetworkLayerMessage() bool

IsNetworkLayerMessage returns true if it is a network layer message

func (*NPDUMetadata) Priority

func (n *NPDUMetadata) Priority() btypes.NPDUPriority

Priority returns priority

func (*NPDUMetadata) SetDestination

func (n *NPDUMetadata) SetDestination(b bool)

func (*NPDUMetadata) SetExpectingReply

func (n *NPDUMetadata) SetExpectingReply(b bool)

func (*NPDUMetadata) SetNetworkLayerMessage

func (n *NPDUMetadata) SetNetworkLayerMessage(b bool)

func (*NPDUMetadata) SetPriority

func (n *NPDUMetadata) SetPriority(p btypes.NPDUPriority)

SetPriority for NPDU

func (*NPDUMetadata) SetSource

func (n *NPDUMetadata) SetSource(b bool)

type RouterToNetworkList

type RouterToNetworkList struct {
	Source []btypes.Address
}

type TagType

type TagType string
const (
	ContextTag TagType = "context"
	OpeningTag TagType = "opening"
	ClosingTag TagType = "closing"
)

Jump to

Keyboard shortcuts

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