From 557d24b9b38db33a7f430d872dc51955977762e0 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Tue, 8 Oct 2013 14:30:14 +0000 Subject: [PATCH] new meta events --- go/r3events/marshal_events.go | 10 ++++++++++ go/r3events/metaevents.go | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/go/r3events/marshal_events.go b/go/r3events/marshal_events.go index 212f9b1..6f087c8 100644 --- a/go/r3events/marshal_events.go +++ b/go/r3events/marshal_events.go @@ -101,6 +101,16 @@ func UnmarshalByteByte2Event(data [][]byte) (event interface{}, category string, err = json.Unmarshal(data[1], newevent) category = "movement" event = *newevent + case "TempSensorSpike": + newevent := new(TempSensorSpike) + err = json.Unmarshal(data[1], newevent) + category = "sensors" + event = *newevent + case "DustSensorSpike": + newevent := new(DustSensorSpike) + err = json.Unmarshal(data[1], newevent) + category = "sensors" + event = *newevent case "NetDHCPACK": newevent := new(NetDHCPACK) err = json.Unmarshal(data[1], newevent) diff --git a/go/r3events/metaevents.go b/go/r3events/metaevents.go index c22a79d..f57e954 100644 --- a/go/r3events/metaevents.go +++ b/go/r3events/metaevents.go @@ -9,5 +9,18 @@ type PresenceUpdate struct { type SomethingReallyIsMoving struct { Movement bool + Confidence uint8 + Ts int64 +} + +type TempSensorSpike struct { + Sensorindex int + Value float64 + Ts int64 +} + +type DustSensorSpike struct { + Sensorindex int + Value int64 Ts int64 } \ No newline at end of file -- 1.7.10.4