acknowledgeAlarm method

  1. @override
Future<void> acknowledgeAlarm(
  1. int deviceId,
  2. BacnetObject object,
  3. BacnetEventState eventState,
  4. BacnetTimeStamp timeStamp, {
  5. required String source,
  6. int processId = 0,
  7. DateTime? time,
  8. Duration? timeout,
})
override

Acknowledges the transition of object into eventState that happened at timeStamp (AcknowledgeAlarm).

source names who acknowledges, e.g. the operator; time is the time of the acknowledgement (now by default). The device answers with an error if eventState or timeStamp is not the current transition.

Implementation

@override
Future<void> acknowledgeAlarm(
  int deviceId,
  BacnetObject object,
  BacnetEventState eventState,
  BacnetTimeStamp timeStamp, {
  required String source,
  int processId = 0,
  DateTime? time,
  Duration? timeout,
}) {
  requests.add(
    FakeBacnetRequest(
      'acknowledgeAlarm',
      deviceId: deviceId,
      object: object,
      value: BacnetEnumerated(eventState),
      time: time,
      source: source,
    ),
  );
  return _request(BacnetConfirmedService.acknowledgeAlarm, deviceId, null, (
    device,
  ) {
    final target = device.object(object.type, object.instance);
    if (target == null) {
      throw device._error(
        BacnetErrorClass.object,
        BacnetErrorCode.unknownObject,
      );
    }
    target._acknowledge(eventState, timeStamp);
  });
}