class

BACnet::DiscoveryStore::Store

Inherits JSON::Serializable < Reference < Object

Store for managing discovered devices during discovery

Constructors

from_json(json : String | IO) : Store

Deserialize from JSON

Source
load(path : String) : Store

Load from file

Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

add_device(device : Device)

Add or update a device

Source
all_devices

Get all devices (including sub-devices as top-level)

Source
clear

Clear all devices

Source
devices
Source
devices=(devices : Hash(UInt32, Device))
Source
get_device(device_instance : UInt32) : Device | Nil

Get a device by instance number

Source
has_device?(device_instance : UInt32) : Bool

Check if device exists

Source
mark_as_sub_device(device_instance : UInt32, parent_instance : UInt32)

Mark a device as a sub-device of a parent

Source
save(path : String)

Save to file

Source
size

Count of all devices (including sub-devices)

Source
sub_devices_of(parent_instance : UInt32) : Array(Device)

Get all sub-devices of a parent

Source
to_json(json : JSON::Builder)

Serialize to JSON

Source
top_level_count

Count of top-level devices only

Source
top_level_devices

Get only top-level devices (not sub-devices)

Source