Set "Maintenance Req'd" bit in GDL90 heartbeat when there exists a system error.

#567.
pull/585/merge
Christopher Young 2017-04-19 16:49:35 -04:00
rodzic b431187d7a
commit c0b6e9a93b
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -574,6 +574,11 @@ func makeHeartbeat() []byte {
}
msg[1] = msg[1] | 0x10 //FIXME: Addr talkback.
// "Maintenance Req'd". Add flag if there are any current critical system errors.
if len(globalStatus.Errors) > 0 {
msg[1] = msg[1] | 0x40
}
nowUTC := time.Now().UTC()
// Seconds since 0000Z.
midnightUTC := time.Date(nowUTC.Year(), nowUTC.Month(), nowUTC.Day(), 0, 0, 0, 0, time.UTC)