tinygo-org / bluetooth

Cross-platform Bluetooth API for Go and TinyGo. Supports Linux, macOS, Windows, and bare metal using Nordic SoftDevice or HCI
https://tinygo.org
Other
708 stars 134 forks source link

bluetooth.DefaultAdapter UndeclaredImportedName #240

Closed dnlwgnd closed 5 months ago

dnlwgnd commented 5 months ago

Hi, I am trying out this wonderful package. I am on Linux building for an Nrf52840 unsing tinygo. I followed the readme for the example. Now the example does compile fine and works on my device using tinygo flash -target=nicenano. However VSCode (with Go and Tinygo Extensions) does not properly resolve

var adapter = bluetooth.DefaultAdapter
// undefined: bluetooth.DefaultAdaptercompiler[UndeclaredImportedName] (https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#UndeclaredImportedName)

Thus vscodes tools like intellisense dont make the correct suggestions on adapter (it seems like it falls back to another package ithub.com/muka/go-bluetooth).

Is this to be expected?

I saw #129 but it did not help me.

dnlwgnd commented 5 months ago

resolved by including

    "go.buildTags": "softdevice"

in .vscode/settings.json it now seems to pickup the version of stuff that I want in my nrf envrionment. sry for the noise.