Ts int64
}
+type DustSensorUpdate struct {
+ Sensorindex int
+ Value int64
+ Ts int64
+}
+
+type RelativeHumiditySensorUpdate struct {
+ Sensorindex int
+ Percent int
+ Ts int64
+}
+
+type NetDHCPACK struct {
+ Mac String
+ IP String
+ Name String
+ Ts int64
+}
+
+type NetGWStatUpdate struct {
+ WifiRX int32
+ WifiTX int32
+ EthernetRX int32
+ EthernetTX int32
+ InternetRX int32
+ InternetTX int32
+ NumNeigh int32
+ Ts int64
+}
+
type TimeTick struct {
Ts int64
}
event := IlluminationSensorUpdate{}
err = json.Unmarshal(data[1], &event)
category = "sensors"
+ case "DustSensorUpdate":
+ event := DustSensorUpdate{}
+ err = json.Unmarshal(data[1], &event)
+ category = "sensors"
+ case "RelativeHumiditySensorUpdate":
+ event := RelativeHumiditySensorUpdate{}
+ err = json.Unmarshal(data[1], &event)
+ category = "sensors"
case "TimeTick":
event := TimeTick{}
err = json.Unmarshal(data[1], &event)
event := SomethingReallyIsMoving{}
err = json.Unmarshal(data[1], &event)
category = "movement"
+ case "NetDHCPACK":
+ event := NetDHCPACK{}
+ err = json.Unmarshal(data[1], &event)
+ category = "network"
+ case "NetGWStatUpdate":
+ event := NetGWStatUpdate{}
+ err = json.Unmarshal(data[1], &event)
+ category = "network"
default:
event = nil
err = errors.New("cannot unmarshal unknown type")