From db6096af35c81fac74bacda38c734a76b7bdf9c1 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Thu, 3 Oct 2013 07:37:43 +0000 Subject: [PATCH] re-parse r3events from possible external mash. not best design --- go/r3-eventbroker_zmq/sockettoevent.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/go/r3-eventbroker_zmq/sockettoevent.go b/go/r3-eventbroker_zmq/sockettoevent.go index 8e202da..34454cc 100644 --- a/go/r3-eventbroker_zmq/sockettoevent.go +++ b/go/r3-eventbroker_zmq/sockettoevent.go @@ -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")} } } -- 1.7.10.4