1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-29 13:49:14 +08:00

Merge pull request #79 from strongh/leap-fix

Leap examples and adaptor fix
This commit is contained in:
Adrian Zankich 2014-07-15 09:35:15 -10:00
commit 5a15fb3198
2 changed files with 4 additions and 4 deletions

View File

@ -20,8 +20,8 @@ func NewLeapMotionAdaptor(name string, port string) *LeapMotionAdaptor {
port,
),
connect: func(l *LeapMotionAdaptor) {
origin := fmt.Sprintf("http://%v", l.Port)
url := fmt.Sprintf("ws://%v/v3.json", l.Port)
origin := fmt.Sprintf("http://%v", l.Port())
url := fmt.Sprintf("ws://%v/v3.json", l.Port())
ws, err := websocket.Dial(url, "", origin)
if err != nil {
panic(err)

View File

@ -20,7 +20,7 @@ func NewLeapMotionDriver(a *LeapMotionAdaptor, name string) *LeapMotionDriver {
),
}
l.AddEvent("Message")
l.AddEvent("message")
return l
}
@ -39,7 +39,7 @@ func (l *LeapMotionDriver) Start() bool {
for {
var msg []byte
websocket.Message.Receive(l.adaptor().ws, &msg)
gobot.Publish(l.Event("Message"), l.ParseFrame(msg))
gobot.Publish(l.Event("message"), l.ParseFrame(msg))
}
}()