bacnet

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 5 Imported by: 0

README

go-bacnet

Go Go Reference License CI Codecov Release

go-bacnet is a pure-Go BACnet/IP supervisory client and protocol foundation for OT Fabric. Horizon 1 targets ANSI/ASHRAE 135-2024 (Protocol Revision 31 baseline) over IPv4/UDP on port 47808 (0xBAC0).

New to BACnet? Start with PROTOCOL.md for a short primer on objects, BVLC/NPDU/APDU layering, discovery, and how those map to this library.

Status: early v0.x production-candidate — v0.2.4 pending release (pin bacnet-interop v0.7.0; Batches A–C live evidence + Who-Am-I/You-Are/LSO/TextMessage wire fixes). Prior tag: v0.2.3. Still not production-usable until the real-device gate (≥2 independent BACnet/IP devices).

Label Meaning
alpha Pre-hardening / incomplete evidence
production-candidate Current — wire/runtime + supervisory client services + reproducible pinned multi-peer evidence
production-usable Real-device gate met (≥2 independent BACnet/IP devices)

Public Address, Value, transaction and subscription APIs may still evolve.

Table of contents
Scope

In scope (Horizon 1):

  • BACnet/IP over IPv4/UDP (default port 47808 / 0xBAC0)
  • BVLC, NPDU and APDU codecs
  • Who-Is / I-Am and Who-Has / I-Have discovery
  • ReadProperty, ReadPropertyMultiple, WriteProperty (priority + NULL relinquish)
  • WritePropertyMultiple (first-failed Error model; outcome-unknown after send)
  • ReadRange (by position / sequence / time)
  • Confirmed-request transactions; segmented ComplexACK receive
  • Segmented confirmed-request send (windowed; when peer Segmentation is both/receive)
  • Routed BACnet networks; BBMD Forwarded-NPDU receive
  • Optional foreign-device registration
  • COV subscribe / notify / renew / cancel
  • EventNotification receive (typed common NotificationParameters); AcknowledgeAlarm; GetEventInformation
  • GetAlarmSummary / GetEnrollmentSummary; SubscribeCOVPropertyMultiple; COVNotificationMultiple receive
  • Bounded OpenEventStream / OpenAuditStream
  • AtomicReadFile / AtomicWriteFile; Add/RemoveListElement; CreateObject / DeleteObject
  • PrivateTransfer / TextMessage; TimeSynchronization / UTCTimeSynchronization; WriteGroup
  • AuditLogQuery / AuthRequest / Who-Am-I / You-Are; LifeSafetyOperation; VT-Open/Close/Data
  • ReadRange with typed Trend Log LogRecords when applicable
  • DeviceCommunicationControl / ReinitializeDevice (explicit opt-in)
  • bacnetctl for decode, discover, read and write
  • Runnable examples under examples/

Out of scope (later):

  • Convenience / supervisor package
  • Native MS/TP, BACnet/IPv6, BACnet/SC
  • Full BBMD server / multi-BBMD failover
  • Full BACnet server / device object model
  • Schedules; remaining proprietary/event CHOICEs without peer evidence
  • BTL certification itself
Install
go get github.com/otfabric/go-bacnet@latest

Requires Go 1.23 or newer.

Getting started
package main

import (
	"context"
	"fmt"
	"log"
	"time"

	"github.com/otfabric/go-bacnet"
	"github.com/otfabric/go-bacnet/bip"
	"github.com/otfabric/go-bacnet/client"
)

func main() {
	c, err := client.New(client.WithPort(bip.DefaultPort)) // 47808 / 0xBAC0
	if err != nil {
		log.Fatal(err)
	}
	defer c.Close()

	ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
	defer cancel()

	devices, err := c.Discover(ctx, client.DiscoveryOptions{})
	// Discover returns when ctx ends; results are still useful.
	_ = err
	for _, d := range devices {
		fmt.Printf("device %d at %s (%s)\n", d.Instance, d.Address, d.Origin)
	}

	if len(devices) == 0 {
		return
	}
	d := devices[0]
	target := client.Target{
		Address:  d.Address,
		Endpoint: d.ImmediatePeer,
		Origin:   d.Origin,
	}
	obj := bacnet.ObjectIdentifier{Type: bacnet.ObjectTypeDevice, Instance: d.Instance}
	prop := bacnet.PropertyReference{Identifier: bacnet.PropertyObjectName}
	val, err := c.ReadProperty(context.Background(), target, obj, prop)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("object-name: %+v\n", val)
}

Always check the error from client.New before defer c.Close(). BACnet/IP peers use bip.Endpoint (not a root type).

Documentation
Document Contents
PROTOCOL.md BACnet primer for newcomers (objects, layers, discovery)
API.md Address/MAC/Value, lifecycle, discovery, routing, FD, RPM, COV
ERRORS.md Sentinels, remote PDUs, outcome-unknown
SECURITY.md Trust model and vulnerability reporting
INTEROP.md Peer/topology scenarios and -tags=interop
RELEASE.md Versioning policy and history
CONTRIBUTING.md Local checks and import boundaries
PLAN.md Evidence batches and forward plan
examples/ Runnable samples (ReadRange, WPM, Who-Has, events)
docs/PACKAGE_DESIGN.md Package dependency rules
docs/STANDARD_BASELINE.md Normative baseline
docs/CAPABILITY_MATRIX.md Client capability matrix
docs/COMPATIBILITY.md Peer/device evidence matrix and positioning
docs/REAL_DEVICE_GATE.md Production-usable evidence bar
License

MIT — see LICENSE.

Documentation

Overview

Package bacnet provides transport-neutral BACnet leaf types and helpers.

This package holds addresses, object/property identifiers, application values, decode limits and error sentinels. It does not open sockets and does not import BVLC, NPDU, APDU, service or client packages.

Wire codecs live in sibling packages (bvlc, npdu, apdu). The client runtime composes those layers. BACnet/IP endpoints live in package bip.

Horizon 1 targets a BACnet/IP IPv4 supervisory client developed against ANSI/ASHRAE 135-2024 (Protocol Revision 31 baseline). The client adapts to known remote capabilities and does not require Revision 31 features from remote devices.

Out of scope for Horizon 1:

  • native MS/TP, BACnet/IPv6, BACnet/SC
  • full BBMD server / multi-BBMD failover
  • full BACnet server/device object model
  • alarms, schedules, trends, WritePropertyMultiple

Status: early v0.x production-candidate — Horizon 1 wire/runtime P0 closed with software-oracle interop evidence. Not production-usable until the real-device gate (≥2 independent devices) is closed.

Index

Examples

Constants

View Source
const ArrayAll uint32 = 0xFFFFFFFF

ArrayAll selects all array elements.

View Source
const MaxMACLength = 7

MaxMACLength is the maximum BACnet MAC length retained for Horizon 1 addressing (covers BACnet/IP 6-octet MAC and common shorter MACs).

View Source
const MaxObjectInstance = 0x3FFFFF

MaxObjectInstance is the largest valid object instance (22 bits).

Variables

View Source
var (
	ErrClosed                 = errors.New("bacnet: client closed")
	ErrTimeout                = errors.New("bacnet: request timeout")
	ErrTransactionCapacity    = errors.New("bacnet: transaction capacity exhausted")
	ErrMalformed              = errors.New("bacnet: malformed encoding")
	ErrUnsupported            = errors.New("bacnet: unsupported")
	ErrResponseSourceMismatch = errors.New("bacnet: response source mismatch")
	ErrProtocolViolation      = errors.New("bacnet: protocol violation")
	ErrAPDUTooLarge           = errors.New("bacnet: APDU exceeds remote capability")
	ErrTrailingData           = errors.New("bacnet: unexpected trailing data")
	ErrLimitExceeded          = errors.New("bacnet: decode limit exceeded")
	ErrDeliveryDropped        = errors.New("bacnet: delivery dropped")
	// ErrDeviceManagementDisabled is returned when DeviceCommunicationControl
	// or ReinitializeDevice is called without WithDeviceManagementEnabled.
	ErrDeviceManagementDisabled = errors.New("bacnet: device management API disabled")
)

Local/runtime sentinels.

Functions

func AppendApplicationValue

func AppendApplicationValue(dst []byte, v ApplicationValue) ([]byte, error)

AppendApplicationValue appends a deterministic application-tagged encoding.

func AppendContextBitString added in v0.2.0

func AppendContextBitString(dst []byte, tagNumber uint8, v BitString) ([]byte, error)

AppendContextBitString appends a context-tagged bit string.

func AppendContextBool

func AppendContextBool(dst []byte, tagNumber uint8, v bool) ([]byte, error)

AppendContextBool appends a context-tagged BOOLEAN as one value octet (0 or 1).

func AppendContextCharacterString added in v0.2.0

func AppendContextCharacterString(dst []byte, tagNumber uint8, v CharacterString) ([]byte, error)

AppendContextCharacterString appends a context-tagged character string.

func AppendContextNull

func AppendContextNull(dst []byte, tagNumber uint8) ([]byte, error)

AppendContextNull appends a context-tagged Null.

func AppendContextObjectID

func AppendContextObjectID(dst []byte, tagNumber uint8, id ObjectIdentifier) ([]byte, error)

AppendContextObjectID appends a context-tagged object identifier.

func AppendContextSigned added in v0.2.0

func AppendContextSigned(dst []byte, tagNumber uint8, v int64) ([]byte, error)

AppendContextSigned appends a context-tagged signed integer.

func AppendContextTagged

func AppendContextTagged(dst []byte, tagNumber uint8, body []Element) ([]byte, error)

AppendContextTagged appends opening tag, body tags, and closing tag.

func AppendContextTime added in v0.2.0

func AppendContextTime(dst []byte, tagNumber uint8, t Time) ([]byte, error)

AppendContextTime appends a context-tagged Time (4 octets).

func AppendContextUnsigned

func AppendContextUnsigned(dst []byte, tagNumber uint8, v uint64) ([]byte, error)

AppendContextUnsigned appends a context-tagged unsigned integer.

func AppendObjectIdentifier

func AppendObjectIdentifier(dst []byte, id ObjectIdentifier) ([]byte, error)

AppendObjectIdentifier appends the 4-octet encoding to dst.

func AppendTag

func AppendTag(dst []byte, el Element) ([]byte, error)

AppendTag appends a deterministic encoding of el to dst.

func AsBool

func AsBool(v ApplicationValue) (bool, error)

AsBool converts a Boolean value.

func AsEnumerated

func AsEnumerated(v ApplicationValue) (uint32, error)

AsEnumerated converts an Enumerated value to uint32.

func AsReal

func AsReal(v ApplicationValue) (float32, error)

AsReal converts a Real or Double value to float32.

func AsUnsigned

func AsUnsigned(v ApplicationValue) (uint64, error)

AsUnsigned converts an Unsigned or Enumerated value to uint64.

func ContextBool

func ContextBool(el Element) (bool, error)

ContextBool extracts a context-tagged BOOLEAN (exactly one octet 0 or 1).

func ContextSigned added in v0.2.0

func ContextSigned(el Element) (int64, error)

ContextSigned extracts a signed integer from a context primitive element.

func ContextUnsigned

func ContextUnsigned(el Element) (uint64, error)

ContextUnsigned extracts an unsigned from a context primitive element.

func DecodeBACnetError

func DecodeBACnetError(elements []Element) (class, code uint16, err error)

DecodeBACnetError parses a BACnet-Error structure.

Two encodings appear on the wire:

  1. Context [0] class / [1] code (unsigned or enumerated content) — used by this library's encoder and some goldens;
  2. Application ENUMERATED class then ENUMERATED code — used by bacnet-stack and BACpypes3 Error PDUs and RPM propertyAccessError.

func EncodeBACnetError

func EncodeBACnetError(dst []byte, class, code uint16) ([]byte, error)

EncodeBACnetError encodes Error Class/Code as context [0]/[1].

func EncodeObjectIdentifier

func EncodeObjectIdentifier(id ObjectIdentifier) (uint32, error)

EncodeObjectIdentifier packs type and instance into a 4-octet value.

func IsContextConstructed

func IsContextConstructed(el Element) bool

IsContextConstructed reports a context-tagged constructed (open/close) value.

Types

type APDUTooLargeError

type APDUTooLargeError struct {
	EncodedSize           int
	RemoteMax             int
	SegmentationSupported bool
}

APDUTooLargeError reports a request that would exceed the remote max APDU without permitted segmentation.

func (*APDUTooLargeError) Error

func (e *APDUTooLargeError) Error() string

func (*APDUTooLargeError) Unwrap

func (e *APDUTooLargeError) Unwrap() error

type AbortError

type AbortError struct {
	InvokeID uint8
	Server   bool
	Reason   uint8
}

AbortError is a remote BACnet Abort PDU.

func (*AbortError) Error

func (e *AbortError) Error() string

type Address

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

Address is a data-link-independent BACnet network address.

Example
package main

import (
	"fmt"

	"github.com/otfabric/go-bacnet"
)

func main() {
	mac := bacnet.MustMAC([]byte{192, 168, 1, 10, 0xBA, 0xC0})
	local := bacnet.LocalStation(mac)
	remote := bacnet.RemoteStation(2, mac)
	fmt.Println(local.Scope() == bacnet.AddressLocalStation)
	fmt.Println(remote.Network())
	fmt.Println(bacnet.GlobalBroadcast().IsBroadcast())
}
Output:
true
2
true

func GlobalBroadcast

func GlobalBroadcast() Address

GlobalBroadcast returns the BACnet global broadcast address.

func LocalBroadcast

func LocalBroadcast() Address

LocalBroadcast returns a local broadcast address.

func LocalStation

func LocalStation(mac MAC) Address

LocalStation returns a local unicast BACnet address.

func RemoteBroadcast

func RemoteBroadcast(network uint16) Address

RemoteBroadcast returns a remote broadcast on network.

func RemoteStation

func RemoteStation(network uint16, mac MAC) Address

RemoteStation returns a remote unicast address on network.

func (Address) Equal

func (a Address) Equal(o Address) bool

Equal reports whether a and o denote the same BACnet address.

func (Address) IsBroadcast

func (a Address) IsBroadcast() bool

IsBroadcast reports whether the address is any broadcast form.

func (Address) MAC

func (a Address) MAC() MAC

MAC returns the station MAC when applicable.

func (Address) Network

func (a Address) Network() uint16

Network returns the BACnet network number when applicable.

func (Address) Scope

func (a Address) Scope() AddressScope

Scope returns the address scope.

func (Address) String

func (a Address) String() string

String returns a human-readable form.

type AddressScope

type AddressScope uint8

AddressScope classifies a BACnet network address.

const (
	AddressLocalStation AddressScope = iota
	AddressLocalBroadcast
	AddressRemoteStation
	AddressRemoteBroadcast
	AddressGlobalBroadcast
)

type ApplicationTag

type ApplicationTag uint8

ApplicationTag numbers for BACnet application-tagged values.

const (
	TagNull ApplicationTag = iota
	TagBoolean
	TagUnsigned
	TagSigned
	TagReal
	TagDouble
	TagOctetString
	TagCharacterString
	TagBitString
	TagEnumerated
	TagDate
	TagTime
	TagObjectIdentifier
	TagReserved13
	TagReserved14
	TagReserved15
)

type ApplicationValue

type ApplicationValue struct {
	Kind ValueKind

	Boolean     bool
	Unsigned    uint64
	Signed      int64
	Real        float32
	Double      float64
	OctetString []byte
	Character   CharacterString
	BitString   BitString
	Enumerated  uint32
	Date        Date
	Time        Time
	ObjectID    ObjectIdentifier

	// Constructed / context nesting.
	Elements []Element
}

ApplicationValue is a generic decoded BACnet application value.

OctetString and BitString.Bytes may alias parse input unless Clone is used. Runtime storage beyond packet processing must call Clone.

Example (Helpers)
package main

import (
	"fmt"

	"github.com/otfabric/go-bacnet"
)

func main() {
	v := bacnet.RealValue(21.5)
	f, err := bacnet.AsReal(v)
	if err != nil {
		fmt.Println("err", err)
		return
	}
	fmt.Println(v.Kind == bacnet.ValueReal)
	fmt.Printf("%.1f\n", f)

	id := bacnet.ObjectIdentifier{Type: bacnet.ObjectTypeAnalogInput, Instance: 1}
	oid := bacnet.ObjectIDValue(id)
	got, err := bacnet.AsObjectID(oid)
	if err != nil {
		fmt.Println("err", err)
		return
	}
	fmt.Println(got.String())
}
Output:
true
21.5
0:1

func BoolValue

func BoolValue(b bool) ApplicationValue

BoolValue returns a Boolean application value.

func DoubleValue

func DoubleValue(f float64) ApplicationValue

DoubleValue returns a Double application value.

func EnumValue

func EnumValue(e uint32) ApplicationValue

EnumValue returns an Enumerated application value.

func NullValue

func NullValue() ApplicationValue

NullValue returns a Null application value.

func ObjectIDValue

func ObjectIDValue(id ObjectIdentifier) ApplicationValue

ObjectIDValue returns an ObjectIdentifier application value.

func ParseApplicationValue

func ParseApplicationValue(data []byte, limits DecodeLimits) (ApplicationValue, int, error)

ParseApplicationValue parses a single application-tagged value.

func RealValue

func RealValue(f float32) ApplicationValue

RealValue returns a Real application value.

func SignedValue

func SignedValue(s int64) ApplicationValue

SignedValue returns a Signed application value.

func UnsignedValue

func UnsignedValue(u uint64) ApplicationValue

UnsignedValue returns an Unsigned application value.

func (ApplicationValue) Clone

Clone returns a deep copy that owns all byte slices.

func (ApplicationValue) TagNumber

func (v ApplicationValue) TagNumber() ApplicationTag

TagNumber returns the application tag for primitive kinds.

type BitString

type BitString struct {
	UnusedBits uint8
	Bytes      []byte
}

BitString holds a BACnet bit string.

func ContextBitString added in v0.2.0

func ContextBitString(el Element) (BitString, error)

ContextBitString extracts a bit string from a context primitive element.

type CharacterString

type CharacterString struct {
	Encoding uint8
	Value    string
}

CharacterString holds a BACnet character string with encoding byte.

func ContextCharacterString added in v0.2.0

func ContextCharacterString(el Element) (CharacterString, error)

ContextCharacterString extracts a character string from a context primitive.

type Date

type Date struct {
	Year    uint8 // years since 1900; 0xFF = unspecified
	Month   uint8
	Day     uint8
	Weekday uint8
}

Date is a BACnet date (year offset from 1900, month, day, weekday).

type DecodeLimits

type DecodeLimits struct {
	MaxDatagramSize      int
	MaxAPDUSize          int
	MaxConstructedDepth  int
	MaxElements          int
	MaxOctetStringLength int
	MaxCharacterLength   int
	MaxBitStringBits     int
	MaxSegments          int
	MaxReassembledAPDU   int
}

DecodeLimits bounds parser and reassembly allocations. Application-configured hard bounds win over peer-advertised maxima.

func DefaultDecodeLimits

func DefaultDecodeLimits() DecodeLimits

DefaultDecodeLimits returns conservative Horizon 1 defaults.

func (DecodeLimits) Normalize

func (l DecodeLimits) Normalize() DecodeLimits

Normalize returns limits with zeros replaced by defaults.

type Element

type Element struct {
	Context   bool
	TagNumber uint8
	Opening   bool
	Closing   bool
	Value     ApplicationValue
}

Element is a generic BACnet tag element (application or context).

func ParseSequence

func ParseSequence(data []byte, limits DecodeLimits, closeTag int) ([]Element, int, error)

ParseSequence parses a sequence of tags until data is exhausted or a closing tag matching closeTag is seen (if closeTag >= 0). Consumed length is returned. Nested opening/closing pairs become ValueConstructed elements (Opening=false).

func ParseTag

func ParseTag(data []byte, limits DecodeLimits) (Element, int, error)

ParseTag parses one BACnet tag from data and returns the element, bytes consumed, and error. Application primitive values may alias data.

type ErrorResponse

type ErrorResponse struct {
	InvokeID uint8
	Service  uint8
	Class    uint16
	Code     uint16
}

ErrorResponse is a remote BACnet Error PDU.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type MAC

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

MAC is an immutable, comparable BACnet MAC address.

func MustMAC

func MustMAC(b []byte) MAC

MustMAC panics if NewMAC fails.

func NewMAC

func NewMAC(b []byte) (MAC, error)

NewMAC copies b into a MAC. Empty input yields a zero MAC.

func (MAC) Bytes

func (m MAC) Bytes() []byte

Bytes returns a copy of the MAC octets.

func (MAC) IsZero

func (m MAC) IsZero() bool

IsZero reports whether the MAC is empty.

func (MAC) Len

func (m MAC) Len() int

Len returns the MAC length in octets.

func (MAC) String

func (m MAC) String() string

String returns a hex representation.

type ObjectIdentifier

type ObjectIdentifier struct {
	Type     ObjectType
	Instance uint32
}

ObjectIdentifier identifies a BACnet object.

func AsObjectID

func AsObjectID(v ApplicationValue) (ObjectIdentifier, error)

AsObjectID converts an ObjectIdentifier value.

func ContextObjectID

func ContextObjectID(el Element) (ObjectIdentifier, error)

ContextObjectID extracts an object identifier from a context primitive.

func DecodeObjectIdentifier

func DecodeObjectIdentifier(v uint32) ObjectIdentifier

DecodeObjectIdentifier unpacks a 4-octet object identifier.

func (ObjectIdentifier) String

func (id ObjectIdentifier) String() string

String returns Type:Instance.

type ObjectType

type ObjectType uint16

ObjectType is a BACnet object type (standard or proprietary).

const (
	ObjectTypeAnalogInput       ObjectType = 0
	ObjectTypeAnalogOutput      ObjectType = 1
	ObjectTypeAnalogValue       ObjectType = 2
	ObjectTypeBinaryInput       ObjectType = 3
	ObjectTypeBinaryOutput      ObjectType = 4
	ObjectTypeBinaryValue       ObjectType = 5
	ObjectTypeCalendar          ObjectType = 6
	ObjectTypeCommand           ObjectType = 7
	ObjectTypeDevice            ObjectType = 8
	ObjectTypeEventEnrollment   ObjectType = 9
	ObjectTypeFile              ObjectType = 10
	ObjectTypeGroup             ObjectType = 11
	ObjectTypeLifeSafetyPoint   ObjectType = 21
	ObjectTypeLifeSafetyZone    ObjectType = 22
	ObjectTypeMultiStateInput   ObjectType = 13
	ObjectTypeNotificationClass ObjectType = 15
	ObjectTypeMultiStateValue   ObjectType = 19
	ObjectTypeTrendLog          ObjectType = 20
	ObjectTypeAuditLog          ObjectType = 61
)

Common standard object types (ASHRAE 135).

type OutcomeUnknownError

type OutcomeUnknownError struct {
	Operation string
	Cause     error
}

OutcomeUnknownError indicates a request may have been executed remotely but no definitive response was observed (typical after a write send without ACK).

func (*OutcomeUnknownError) Error

func (e *OutcomeUnknownError) Error() string

func (*OutcomeUnknownError) Unwrap

func (e *OutcomeUnknownError) Unwrap() error

type PropertyIdentifier

type PropertyIdentifier uint32

PropertyIdentifier is a BACnet property identifier (standard or proprietary).

const (
	PropertyObjectIdentifier  PropertyIdentifier = 75
	PropertyObjectName        PropertyIdentifier = 77
	PropertyObjectType        PropertyIdentifier = 79
	PropertyPresentValue      PropertyIdentifier = 85
	PropertyPriorityArray     PropertyIdentifier = 87
	PropertyStatusFlags       PropertyIdentifier = 111
	PropertySystemStatus      PropertyIdentifier = 112
	PropertyVendorIdentifier  PropertyIdentifier = 120
	PropertyVendorName        PropertyIdentifier = 121
	PropertyModelName         PropertyIdentifier = 70
	PropertyProtocolVersion   PropertyIdentifier = 98
	PropertyProtocolRevision  PropertyIdentifier = 139
	PropertyMaxAPDULength     PropertyIdentifier = 62
	PropertySegmentation      PropertyIdentifier = 107
	PropertyDescription       PropertyIdentifier = 28
	PropertyUnits             PropertyIdentifier = 117
	PropertyRelinquishDefault PropertyIdentifier = 104
	PropertyLogBuffer         PropertyIdentifier = 131
)

Common property identifiers.

type PropertyReference

type PropertyReference struct {
	Identifier PropertyIdentifier
	ArrayIndex *uint32 // nil means the entire property; ArrayAll means all elements
}

PropertyReference identifies a property, optionally with an array index.

func (PropertyReference) Equal

Equal reports whether p and o identify the same property reference.

type RejectError

type RejectError struct {
	InvokeID uint8
	Reason   uint8
}

RejectError is a remote BACnet Reject PDU.

func (*RejectError) Error

func (e *RejectError) Error() string

type Time

type Time struct {
	Hour       uint8
	Minute     uint8
	Second     uint8
	Hundredths uint8
}

Time is a BACnet time.

func ContextTime added in v0.2.0

func ContextTime(el Element) (Time, error)

ContextTime extracts a Time from a context primitive element.

type ValueKind

type ValueKind uint8

ValueKind discriminates ApplicationValue contents.

const (
	ValueNull ValueKind = iota
	ValueBoolean
	ValueUnsigned
	ValueSigned
	ValueReal
	ValueDouble
	ValueOctetString
	ValueCharacterString
	ValueBitString
	ValueEnumerated
	ValueDate
	ValueTime
	ValueObjectID
	ValueConstructed
	ValueContext // context-tagged primitive or opening; Elements hold nested data
)

Directories

Path Synopsis
Package apdu implements BACnet Application Protocol Data Unit framing.
Package apdu implements BACnet Application Protocol Data Unit framing.
Package bip provides BACnet/IP data-link endpoint types.
Package bip provides BACnet/IP data-link endpoint types.
Package bvlc implements BACnet Virtual Link Control (BACnet/IP) framing.
Package bvlc implements BACnet Virtual Link Control (BACnet/IP) framing.
Package client implements a BACnet/IP supervisory client runtime.
Package client implements a BACnet/IP supervisory client runtime.
cmd
bacnetctl command
Command bacnetctl is a small BACnet/IP utility for decode, discover, read and write.
Command bacnetctl is a small BACnet/IP utility for decode, discover, read and write.
examples
events command
Command events listens for inbound EventNotification PDUs and prints typed NotificationParameters when recognized (for example change-of-state).
Command events listens for inbound EventNotification PDUs and prints typed NotificationParameters when recognized (for example change-of-state).
read-range command
Command read-range demonstrates Client.ReadRange against a Trend Log Log_Buffer, including typed BACnetLogRecord decode when the peer returns well-formed records.
Command read-range demonstrates Client.ReadRange against a Trend Log Log_Buffer, including typed BACnetLogRecord decode when the peer returns well-formed records.
who-has command
Command who-has demonstrates SendWhoHas / DiscoverObjects and the object observation registry.
Command who-has demonstrates SendWhoHas / DiscoverObjects and the object observation registry.
write-multiple command
Command write-multiple demonstrates Client.WritePropertyMultiple.
Command write-multiple demonstrates Client.WritePropertyMultiple.
internal
clock
Package clock provides an injectable clock for deterministic lifecycle tests.
Package clock provides an injectable clock for deterministic lifecycle tests.
diag
Package diag defines an optional diagnostic sink.
Package diag defines an optional diagnostic sink.
fixtures
Package fixtures loads bacnet-interop corpus metadata for unit tests.
Package fixtures loads bacnet-interop corpus metadata for unit tests.
virtual
Package virtual provides an in-memory BACnet/IP transport for deterministic tests.
Package virtual provides an in-memory BACnet/IP transport for deterministic tests.
Package npdu implements BACnet Network Layer Protocol Data Units.
Package npdu implements BACnet Network Layer Protocol Data Units.

Jump to

Keyboard shortcuts

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