read<T> method
Future<T>
read<T>(
- int deviceId,
- BacnetObject object,
- BacnetProperty<
T> property, { - Duration? timeout,
- bool background = false,
- 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);