forked from adrianmo/go-nmea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arc.go
59 lines (50 loc) · 1.75 KB
/
arc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package nmea
const (
// TypeARC type of ARC sentence for alert command refused
TypeARC = "ARC"
)
const (
// AlertCommandAcknowledge means acknowledge
AlertCommandAcknowledge = "A"
// AlertCommandRequestRepeatInformation means request/repeat information
AlertCommandRequestRepeatInformation = "Q"
// AlertCommandResponsibilityTransfer means responsibility transfer
AlertCommandResponsibilityTransfer = "O"
// AlertCommandSilence means silence
AlertCommandSilence = "S"
)
// ARC - Alert command refused
// https://fcc.report/FCC-ID/ADB9ZWRTR100/2768717.pdf (page 7) FURUNO MARINE RADAR, model FAR-15XX manual
//
// Format: $--ARC,hhmmss.ss,aaa,x.x,x.x,c*hh<CR><LF>
// Example: $RAARC,220516,TCK,002,1,A*73
type ARC struct {
BaseSentence
// Time is UTC Time
Time Time // 0
// ManufacturerMnemonicCode is manufacturer mnemonic code
ManufacturerMnemonicCode string // 1
// AlertIdentifier is alert identifier (001 to 99999)
AlertIdentifier int64 // 2
// AlertInstance is alert instance
AlertInstance int64 // 3
// Command is Refused alert command
// A - acknowledge
// Q - request/repeat information
// O - responsibility transfer
// S - silence
Command string // 4
}
// newARC constructor
func newARC(s BaseSentence) (Sentence, error) {
p := NewParser(s)
p.AssertType(TypeARC)
return ARC{
BaseSentence: s,
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),
}, p.Err()
}