45 lines
1.3 KiB
Dart
45 lines
1.3 KiB
Dart
|
// ignore_for_file: constant_identifier_names
|
||
|
|
||
|
import 'sentence.dart';
|
||
|
|
||
|
import 'parser.dart';
|
||
|
|
||
|
const TypeARC = "ARC";
|
||
|
const AlertCommandAcknowledge = "A";
|
||
|
// AlertCommandRequestRepeatInformation means request/repeat information
|
||
|
const AlertCommandRequestRepeatInformation = "Q";
|
||
|
// AlertCommandResponsibilityTransfer means responsibility transfer
|
||
|
const AlertCommandResponsibilityTransfer = "O";
|
||
|
// AlertCommandSilence means silence
|
||
|
const AlertCommandSilence = "S";
|
||
|
|
||
|
class ARC {
|
||
|
Time time;
|
||
|
String manufacturerMnemonicCode;
|
||
|
int alertIdentifier;
|
||
|
int alertInstance;
|
||
|
String command;
|
||
|
|
||
|
ARC(
|
||
|
{required this.time,
|
||
|
required this.manufacturerMnemonicCode,
|
||
|
required this.alertIdentifier,
|
||
|
required this.alertInstance,
|
||
|
required this.command});
|
||
|
static ARC newARC(BaseSentence s) {
|
||
|
var p = Parser(s);
|
||
|
return ARC(
|
||
|
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, "refused alert command", [
|
||
|
AlertCommandAcknowledge,
|
||
|
AlertCommandRequestRepeatInformation,
|
||
|
AlertCommandResponsibilityTransfer,
|
||
|
AlertCommandSilence
|
||
|
]),
|
||
|
);
|
||
|
}
|
||
|
}
|