FakeBacnetDevice class final
An in-memory BACnet device for FakeBacnetClient.
final device = FakeBacnetDevice(1234, name: 'AHU-1')
..addObject(
BacnetObjectType.analogInput,
1,
name: 'Supply Air Temperature',
presentValue: const BacnetReal(21.5),
units: BacnetEngineeringUnits.degreesCelsius,
);
final client = FakeBacnetClient(devices: [device]);
Constructors
- FakeBacnetDevice(int deviceId, {String? name, int vendorId = 0, int maxApdu = 1476, BacnetSegmentation segmentation = BacnetSegmentation.both, String vendorName = 'bacnet_plugin', String modelName = 'FakeBacnetDevice'})
- Creates a device with its Device object.
Properties
- backupState → BacnetBackupState
-
Backup_And_Restore_State.
no setter
- communication → BacnetCommunicationState
-
Communication state set by DeviceCommunicationControl: while
disabled the device answers only DeviceCommunicationControl and
ReinitializeDevice; while disabled or with initiation disabled it
sends no COV or event notifications (and no I-Am while disabled).
no setter
-
configurationFiles
↔ List<
int> -
Instances of the File objects of Configuration_Files: with files the
device takes part in backup and restore (ReinitializeDevice
START_BACKUP .. ABORT_RESTORE, Backup_And_Restore_State), without it
refuses them.
getter/setter pair
- deviceId → int
-
Device instance.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- latency ↔ Duration
-
Extra response time of this device.
getter/setter pair
- maxApdu → int
-
Maximum APDU announced in I-Am.
final
-
messages
→ List<
TextMessageEvent> -
Text messages received, oldest first.
final
-
objects
→ Iterable<
FakeBacnetObject> -
Objects of the device, the Device object first.
no setter
- online ↔ bool
-
While false, requests to the device time out and it ignores Who-Is.
getter/setter pair
- onPrivateTransfer ↔ BacnetValue? Function(int vendorId, int serviceNumber, BacnetValue? parameters)?
-
Answers ConfirmedPrivateTransfer with its result block; without it
the device rejects the service. Throw a BacnetProtocolException
for an error answer.
getter/setter pair
- password ↔ String?
-
Password DeviceCommunicationControl and ReinitializeDevice require
(null: none).
getter/setter pair
-
reinitializations
→ List<
BacnetReinitializedState> -
ReinitializeDevice requests received, oldest first.
final
- restores ↔ int
-
Restores completed with ReinitializeDevice END_RESTORE.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- segmentation → BacnetSegmentation
-
Segmentation support announced in I-Am.
final
-
unsupportedServices
→ Set<
BacnetConfirmedService> -
Services the device rejects as unrecognized, e.g.
BacnetConfirmedService.addListElement to test the fallbacks of an
application for devices that lack them.
final
- vendorId → int
-
Vendor identifier announced in I-Am.
final
Methods
-
addFile(
int instance, {List< int> content = const [], String? name, String fileType = 'application/octet-stream', bool readOnly = false}) → FakeBacnetObject -
Adds a File object with
content(stream access). -
addNotificationClass(
int instance, {String? name, BacnetEventPriorities priorities = const BacnetEventPriorities(toOffNormal: 100, toFault: 100, toNormal: 200), BacnetEventTransitionBits ackRequired = const BacnetEventTransitionBits(toOffNormal: true, toFault: true), List< BacnetDestination> recipients = const []}) → FakeBacnetObject - Adds a Notification Class object. Clients receive the notifications of its objects after adding themselves to its Recipient_List (FakeBacnetClient.addListElements); every destination delivers one notification to the client.
-
addObject(
BacnetObjectType type, int instance, {String? name, BacnetValue? presentValue, BacnetEngineeringUnits? units, bool? commandable, Map< BacnetPropertyId, BacnetValue> properties = const {}}) → FakeBacnetObject -
Adds an object. Outputs are commandable unless
commandablesays otherwise; theirpresentValuebecomes the relinquish default. WithoutpresentValuethe object starts at 0, inactive or state 1. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
object(
BacnetObjectType type, int instance) → FakeBacnetObject? -
The object
type:instance, or null. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited