diff --git a/platforms/leap/leap_motion_adaptor.go b/platforms/leap/leap_motion_adaptor.go index 2067b2b5..2b9995d3 100644 --- a/platforms/leap/leap_motion_adaptor.go +++ b/platforms/leap/leap_motion_adaptor.go @@ -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) diff --git a/platforms/leap/leap_motion_driver.go b/platforms/leap/leap_motion_driver.go index e0113810..8ca38454 100644 --- a/platforms/leap/leap_motion_driver.go +++ b/platforms/leap/leap_motion_driver.go @@ -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)) } }()