FakeBacnetDevice constructor

FakeBacnetDevice(
  1. int deviceId, {
  2. String? name,
  3. int vendorId = 0,
  4. int maxApdu = 1476,
  5. BacnetSegmentation segmentation = BacnetSegmentation.both,
  6. String vendorName = 'bacnet_plugin',
  7. String modelName = 'FakeBacnetDevice',
})

Creates a device with its Device object.

Implementation

FakeBacnetDevice(
  this.deviceId, {
  String? name,
  this.vendorId = 0,
  this.maxApdu = 1476,
  this.segmentation = BacnetSegmentation.both,
  String vendorName = 'bacnet_plugin',
  String modelName = 'FakeBacnetDevice',
}) {
  final device = addObject(
    BacnetObjectType.device,
    deviceId,
    name: name ?? 'Device $deviceId',
  );
  device.properties.addAll({
    BacnetPropertyId.vendorIdentifier: BacnetUnsigned(vendorId),
    BacnetPropertyId.vendorName: BacnetCharacterString(vendorName),
    BacnetPropertyId.modelName: BacnetCharacterString(modelName),
    BacnetPropertyId.maxApduLengthAccepted: BacnetUnsigned(maxApdu),
    BacnetPropertyId.segmentationSupported: BacnetEnumerated(segmentation),
    BacnetPropertyId.protocolVersion: const BacnetUnsigned(1),
    BacnetPropertyId.protocolRevision: const BacnetUnsigned(22),
  });
}