1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-13 19:29:10 +08:00

fix Port calls in leap motion adapter

"Message" should be capitalized to match event in driver

fix capitalization again (in example)

last event capitalization fix: hands example
This commit is contained in:
Homer Strong 2014-07-14 13:13:07 -07:00 committed by Adrian Zankich
parent 167aa1091b
commit cdb26ad036
4 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ func main() {
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
work := func() {
gobot.On(l.Event("message"), func(data interface{}) {
gobot.On(l.Event("Message"), func(data interface{}) {
fmt.Println(data.(leap.Frame))
})
}

View File

@ -14,7 +14,7 @@ func main() {
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
work := func() {
gobot.On(l.Event("message"), func(data interface{}) {
gobot.On(l.Event("Message"), func(data interface{}) {
printHands(data.(leap.Frame))
})
}

View File

@ -30,7 +30,7 @@ func main() {
l := leap.NewLeapMotionDriver(leapMotionAdaptor, "leap")
work := func() {
gobot.On(l.Event("message"), func(data interface{}) {
gobot.On(l.Event("Message"), func(data interface{}) {
fmt.Println(data.(leap.Frame))
})
}

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)