projects
/
svn42.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date in graph
[svn42.git]
/
go
/
r3-netstatus
/
main.go
diff --git
a/go/r3-netstatus/main.go
b/go/r3-netstatus/main.go
index
afebd58
..
563f94d
100644
(file)
--- a/
go/r3-netstatus/main.go
+++ b/
go/r3-netstatus/main.go
@@
-9,7
+9,7
@@
import (
"time"
"fmt"
//~ "./brain"
"time"
"fmt"
//~ "./brain"
- r3events "svn.spreadspace.org/realraum/go.svn/r3-eventbroker_zmq/r3events"
+ r3events "svn.spreadspace.org/realraum/go.svn/r3events"
)
type SpaceState struct {
)
type SpaceState struct {
@@
-40,7
+40,7
@@
func init() {
flag.StringVar(&r3eventssub_port_, "eventsubport", "tcp://wuzzler.realraum.at:4244", "zmq address to subscribe r3events")
flag.StringVar(&brain_connect_addr_, "brainconnect", "tcp://wuzzler.realraum.at:4245", "address to ask about most recent stored events")
flag.BoolVar(&enable_syslog_, "syslog", false, "enable logging to syslog")
flag.StringVar(&r3eventssub_port_, "eventsubport", "tcp://wuzzler.realraum.at:4244", "zmq address to subscribe r3events")
flag.StringVar(&brain_connect_addr_, "brainconnect", "tcp://wuzzler.realraum.at:4245", "address to ask about most recent stored events")
flag.BoolVar(&enable_syslog_, "syslog", false, "enable logging to syslog")
- flag.BoolVar(&enable_debug_, "debug", false, "enable debug logging")
+ flag.BoolVar(&enable_debug_, "debug", false, "enable debug output")
flag.Parse()
}
flag.Parse()
}
@@
-64,7
+64,7
@@
func EventToXMPP(ps *pubsub.PubSub, xmpp_presence_events_chan_ chan <- interface
defer func() {
if x := recover(); x != nil {
defer func() {
if x := recover(); x != nil {
- Debug_.Printf("handleIncomingXMPPStanzas: run time panic: %v", x)
+ Syslog_.Printf("handleIncomingXMPPStanzas: run time panic: %v", x)
ps.Unsub(events, "presence","door","buttons","updateinterval")
close(xmpp_presence_events_chan_)
}
ps.Unsub(events, "presence","door","buttons","updateinterval")
close(xmpp_presence_events_chan_)
}
@@
-81,7
+81,7
@@
func EventToXMPP(ps *pubsub.PubSub, xmpp_presence_events_chan_ chan <- interface
xmpp_presence_events_chan_ <- r3xmppbot.XMPPStatusEvent{r3xmppbot.ShowNotAvailabe, "Nobody is here"}
for eventinterface := range(events) {
xmpp_presence_events_chan_ <- r3xmppbot.XMPPStatusEvent{r3xmppbot.ShowNotAvailabe, "Nobody is here"}
for eventinterface := range(events) {
- Debug_.Println("event2xmpp", eventinterface)
+ Debug_.Printf("event2xmpp: %T %+v", eventinterface, eventinterface)
switch event := eventinterface.(type) {
case r3events.PresenceUpdate:
present = event.Present
switch event := eventinterface.(type) {
case r3events.PresenceUpdate:
present = event.Present
@@
-117,6
+117,13
@@
func EventToXMPP(ps *pubsub.PubSub, xmpp_presence_events_chan_ chan <- interface
}
}
}
}
+func ParseZMQr3Event(lines [][]byte, ps *pubsub.PubSub) {
+ evnt, pubsubcat, err := r3events.UnmarshalByteByte2Event(lines)
+ Debug_.Printf("ParseZMQr3Event: %s %s %s", evnt, pubsubcat, err)
+ if err != nil { return }
+ ps.Pub(evnt, pubsubcat)
+}
+
func main() {
if enable_syslog_ { LogEnableSyslog(); r3xmppbot.LogEnableSyslog() }
if enable_debug_ { LogEnableDebuglog(); r3xmppbot.LogEnableDebuglog() }
func main() {
if enable_syslog_ { LogEnableSyslog(); r3xmppbot.LogEnableSyslog() }
if enable_debug_ { LogEnableDebuglog(); r3xmppbot.LogEnableDebuglog() }