paypal / gatt

Gatt is a Go package for building Bluetooth Low Energy peripherals
BSD 3-Clause "New" or "Revised" License
1.14k stars 285 forks source link

central undefined #99

Open barustnt opened 6 years ago

barustnt commented 6 years ago

hello with go 1.10 and when i build server.go i have this message "undefined: central" any help please !!?

brunoterkaly commented 5 years ago

I have the proper GOPATH/GOROOT.

When I do a "go get github.com/paypal/gatt"

The output I get is:

github.com/paypal/gatt c:\go\src\github.com\paypal\gatt\central.go:118:11: undefined: central

Any tricks to getting golang to compile gatt?

brunoterkaly commented 5 years ago

The trick is to not use Windows. You can cross compile as needed. I went to Ubuntu and it just worked.

barustnt commented 5 years ago

So i am sorry because i have lessons so i can't answer

On Wed, Dec 5, 2018, 17:51 Bruno Terkaly notifications@github.com wrote:

Yes - it is a Windows issue. I went to Ubuntu and it just worked.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paypal/gatt/issues/99#issuecomment-444557880, or mute the thread https://github.com/notifications/unsubscribe-auth/Ammvu3TqCzlWd6_bJSbVgE5OX-b9qPXeks5u1_mggaJpZM4V1nOv .

brunoterkaly commented 5 years ago

I'm good - I cross-compiled on Linux for Raspberry PI arch and I hope it wall works.

barustnt commented 5 years ago

Good luck

On Wed, Dec 5, 2018, 18:45 Bruno Terkaly notifications@github.com wrote:

I'm good - I cross-compiled on Linux for Raspberry PI arch and I hope it wall works.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paypal/gatt/issues/99#issuecomment-444576970, or mute the thread https://github.com/notifications/unsubscribe-auth/Ammvu2CIu4OCVpr110wsQk8NXI-gTs7cks5u2AYqgaJpZM4V1nOv .

wz2b commented 4 years ago

What causes this, though?

type Central interface {
   ID() string   // ID returns platform specific ID of the remote central device.
   Close() error // Close disconnects the connection.
   MTU() int     // MTU returns the current connection mtu.
}
type notifier struct {
  central *central
   a       *attr
   maxlen  int
   donemu  sync.RWMutex
   done    bool
}

I'm not sure why that's central (the type) with a small c ... but even if you chagne that to Central it fails with the same error. From a language perspective I don't understand what's wrong.