re-parse r3events from possible external mash. not best design
authorBernhard Tittelbach <xro@realraum.at>
Thu, 3 Oct 2013 07:37:43 +0000 (07:37 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Thu, 3 Oct 2013 07:37:43 +0000 (07:37 +0000)
go/r3-eventbroker_zmq/sockettoevent.go

index 8e202da..34454cc 100644 (file)
@@ -89,6 +89,18 @@ func ParseSocketInputLine(lines [][]byte, ps *pubsub.PubSub, keylookup_socket *z
                 // brn.Oboite("photo0", newphoto)
                 ps.Pub(r3events.IlluminationSensorUpdate{0, newphoto, ts}, "sensors")
             }
+        case "IlluminationSensorUpdate","TempSensorUpdate":
+            //try decode r3event
+            evnt, err := r3events.UnmarshalByteByte2Event(lines)
+            if err == nil {ps.Pub(evnt, "sensors")}
+        case "MovementSensorUpdate" :
+            //try decode r3event
+            evnt, err := r3events.UnmarshalByteByte2Event(lines)
+            if err == nil {ps.Pub(evnt, "movement")}
+        case "ButtonPressUpdate" :
+            //try decode r3event
+            evnt, err := r3events.UnmarshalByteByte2Event(lines)
+            if err == nil {ps.Pub(evnt, "buttons")}
     }
 }