Add timestamp to mk2info

This commit is contained in:
Hendrik van Wyk
2017-09-16 15:36:24 +02:00
parent 33ad6b8d1d
commit dd8ee443e2
2 changed files with 5 additions and 0 deletions

View File

@@ -130,6 +130,7 @@ func (mk2 *mk2Ser) addError(err error) {
func (mk2 *mk2Ser) updateReport() {
mk2.Lock()
defer mk2.Unlock()
mk2.info.Timestamp = time.Now()
mk2.report = mk2.info
select {
case mk2.infochan <- mk2.info:

View File

@@ -1,5 +1,7 @@
package mk2if
import "time"
const (
LED_TEMPERATURE = 128
LED_LOW_BATTERY = 64
@@ -51,6 +53,8 @@ type Mk2Info struct {
LedListBlink []int
Errors []error
Timestamp time.Time
}
type Mk2If interface {