read<T> method

  1. @override
Future<T> read<T>(
  1. int deviceId,
  2. BacnetObject object,
  3. BacnetProperty<T> property, {
  4. Duration? timeout,
  5. bool background = false,
  6. BacnetCancelToken? cancelToken,
})
override

Reads property of object as its Dart type.

Throws a BacnetDecodeException if the device returned another datatype than the property defines, besides the errors of readProperty.

final name = await client.read(1234, sensor, BacnetProperties.objectName);
final schedule = await client.read(
    1234, schedule1, BacnetProperties.weeklySchedule);
print(schedule[DateTime.monday]);

Implementation

@override
Future<T> read<T>(
  int deviceId,
  BacnetObject object,
  BacnetProperty<T> property, {
  Duration? timeout,
  bool background = false,
  BacnetCancelToken? cancelToken,
}) => readProperty(
  deviceId,
  object.type,
  object.instance,
  property.id,
  cancelToken: cancelToken,
).then(property.decode);