known

package
v0.0.0-test-multiarch Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("not found")
	ErrUnknownDevice = fmt.Errorf("device %w", ErrNotFound)
)

Functions

This section is empty.

Types

type Context

type Context interface {
	ListObjects(device bactypes.Device) ([]bactypes.Object, error)
	LookupDeviceByID(id bactypes.ObjectInstance) (bactypes.Device, error)
	LookupDeviceByName(name string) (bactypes.Device, error)
	LookupObjectByID(device bactypes.Device, id bactypes.ObjectID) (bactypes.Object, error)
	LookupObjectByName(device bactypes.Device, name string) (bactypes.Object, error)
	GetDeviceDefaultWritePriority(id bactypes.ObjectInstance) uint
}

Context describes what we know about a bacnet system.

func SyncContext

func SyncContext(mu sync.Locker, ctx Context) Context

SyncContext returns a Context that is safe for concurrent use. If the Context allows mutation, maybe because it is really a Map then mu should be used to protect the mutation.

type Map

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

Map holds information about devices and objects. Map implements Context.

func NewMap

func NewMap() *Map

func (*Map) Clear

func (m *Map) Clear()

func (*Map) DeleteDevice

func (m *Map) DeleteDevice(device bactypes.Device)

func (*Map) DeleteDeviceByID

func (m *Map) DeleteDeviceByID(id bactypes.ObjectInstance)

func (*Map) DeleteDeviceByName

func (m *Map) DeleteDeviceByName(name string)

func (*Map) DeleteObject

func (m *Map) DeleteObject(device bactypes.Device, object bactypes.Object)

func (*Map) DeleteObjectByID

func (m *Map) DeleteObjectByID(device bactypes.Device, id bactypes.ObjectID)

func (*Map) DeleteObjectByName

func (m *Map) DeleteObjectByName(device bactypes.Device, name string)

func (*Map) GetDeviceDefaultWritePriority

func (m *Map) GetDeviceDefaultWritePriority(id bactypes.ObjectInstance) uint

func (*Map) ListObjects

func (m *Map) ListObjects(device bactypes.Device) ([]bactypes.Object, error)

func (*Map) LookupDeviceByID

func (m *Map) LookupDeviceByID(id bactypes.ObjectInstance) (bactypes.Device, error)

func (*Map) LookupDeviceByName

func (m *Map) LookupDeviceByName(name string) (bactypes.Device, error)

func (*Map) LookupObjectByID

func (m *Map) LookupObjectByID(device bactypes.Device, id bactypes.ObjectID) (bactypes.Object, error)

func (*Map) LookupObjectByName

func (m *Map) LookupObjectByName(device bactypes.Device, name string) (bactypes.Object, error)

func (*Map) StoreDevice

func (m *Map) StoreDevice(name string, d bactypes.Device, defaultWritePriority uint)

func (*Map) StoreObject

func (m *Map) StoreObject(d bactypes.Device, name string, o bactypes.Object) error

Jump to

Keyboard shortcuts

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