41 lines
1.1 KiB
Dart
41 lines
1.1 KiB
Dart
// ignore_for_file: constant_identifier_names
|
|
|
|
import 'parser.dart';
|
|
import 'sentence.dart';
|
|
|
|
const TypeACN = "ACN";
|
|
|
|
class ACN {
|
|
Object time; // Assuming Time is a custom type
|
|
String manufacturerMnemonicCode;
|
|
int alertIdentifier;
|
|
int alertInstance;
|
|
String command;
|
|
String state;
|
|
|
|
ACN(
|
|
{required this.time,
|
|
required this.manufacturerMnemonicCode,
|
|
required this.alertIdentifier,
|
|
required this.alertInstance,
|
|
required this.command,
|
|
required this.state});
|
|
|
|
static ACN newACN(BaseSentence s) {
|
|
var p = Parser(s);
|
|
return ACN(
|
|
time: p.time(0, 'time'),
|
|
manufacturerMnemonicCode: p.string(1, 'manufacturer mnemonic code'),
|
|
alertIdentifier: p.int64(2, 'alert identifier'),
|
|
alertInstance: p.int64(3, 'alert instance'),
|
|
command: p.enumString(4, 'alert command', [
|
|
'A',
|
|
'Q',
|
|
'O',
|
|
'S'
|
|
]), // Assuming AlertCommandAcknowledge, AlertCommandRequestRepeatInformation, AlertCommandResponsibilityTransfer, AlertCommandSilence are represented as 'A', 'Q', 'O', 'S' respectively
|
|
state: p.string(5, 'alarm state'),
|
|
);
|
|
}
|
|
}
|