class
BACnet::DiscoveryStore::Store
- BACnet::DiscoveryStore::Store
- Reference
- Object
Overview
Store for managing discovered devices during discovery
Included Modules
- JSON::Serializable
Defined in:
bacnet/discovery_store.crConstructors
-
.from_json(json : String | IO) : Store
Deserialize from JSON
-
.load(path : String) : Store
Load from file
- .new(pull : JSON::PullParser)
- .new
Instance Method Summary
-
#add_device(device : Device)
Add or update a device
-
#all_devices : Array(Device)
Get all devices (including sub-devices as top-level)
-
#clear
Clear all devices
- #devices : Hash(UInt32, Device)
- #devices=(devices : Hash(UInt32, Device))
-
#get_device(device_instance : UInt32) : Device | Nil
Get a device by instance number
-
#has_device?(device_instance : UInt32) : Bool
Check if device exists
-
#mark_as_sub_device(device_instance : UInt32, parent_instance : UInt32)
Mark a device as a sub-device of a parent
-
#save(path : String)
Save to file
-
#size : Int32
Count of all devices (including sub-devices)
-
#sub_devices_of(parent_instance : UInt32) : Array(Device)
Get all sub-devices of a parent
-
#to_json(json : JSON::Builder)
Serialize to JSON
-
#top_level_count : Int32
Count of top-level devices only
-
#top_level_devices : Array(Device)
Get only top-level devices (not sub-devices)
Constructor Detail
Instance Method Detail
Get all devices (including sub-devices as top-level)
Get a device by instance number
def mark_as_sub_device(device_instance : UInt32, parent_instance : UInt32)
#
Mark a device as a sub-device of a parent
Get all sub-devices of a parent