FakeBacnetRouter constructor
FakeBacnetRouter(})
Creates a router at ipAddress (an IPv4 address) and port.
The routing table defaults to one port per network.
Implementation
FakeBacnetRouter(
this.ipAddress, {
required List<int> networks,
this.port = 47808,
List<BacnetRoutingTableEntry>? routingTable,
}) : networks = List.unmodifiable(networks),
routingTable = List.unmodifiable(
routingTable ??
[
for (final (index, network) in networks.indexed)
BacnetRoutingTableEntry(network: network, portId: index + 1),
],
),
mac = List.unmodifiable([..._ipv4(ipAddress), port >> 8, port & 0xFF]) {
RangeError.checkValueInInterval(port, 0, 0xFFFF, 'port');
}