class BACnet::DiscoveryStore::Store

Overview

Store for managing discovered devices during discovery

Included Modules

Defined in:

bacnet/discovery_store.cr

Constructors

Instance Method Summary

Constructor Detail

def self.from_json(json : String | IO) : Store #

Deserialize from JSON


[View source]
def self.load(path : String) : Store #

Load from file


[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.new #

[View source]

Instance Method Detail

def add_device(device : Device) #

Add or update a device


[View source]
def all_devices : Array(Device) #

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


[View source]
def clear #

Clear all devices


[View source]
def devices : Hash(UInt32, Device) #

[View source]
def devices=(devices : Hash(UInt32, Device)) #

[View source]
def get_device(device_instance : UInt32) : Device | Nil #

Get a device by instance number


[View source]
def has_device?(device_instance : UInt32) : Bool #

Check if device exists


[View source]
def mark_as_sub_device(device_instance : UInt32, parent_instance : UInt32) #

Mark a device as a sub-device of a parent


[View source]
def save(path : String) #

Save to file


[View source]
def size : Int32 #

Count of all devices (including sub-devices)


[View source]
def sub_devices_of(parent_instance : UInt32) : Array(Device) #

Get all sub-devices of a parent


[View source]
def to_json(json : JSON::Builder) #

Serialize to JSON


[View source]
def top_level_count : Int32 #

Count of top-level devices only


[View source]
def top_level_devices : Array(Device) #

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


[View source]