all: fix bug that caused a copied DefaultAdapter

The DefaultAdapter was a regular value, not a pointer-to-struct. This
meant that simply copying bluetooth.DefaultAdapter caused a copy of the
object itself (instead of a copy of the reference, as intended). This
meant that write events did not arrive.
This commit is contained in:
Ayke van Laethem 2020-06-03 01:13:46 +02:00
parent 37eb64b519
commit f69df9d879
No known key found for this signature in database
GPG key ID: E97FF5335DFDFDED
2 changed files with 2 additions and 2 deletions

View file

@ -41,7 +41,7 @@ type Adapter struct {
// it will return the SoftDevice interface.
//
// Make sure to call Enable() before using it to initialize the adapter.
var DefaultAdapter = Adapter{isDefault: true}
var DefaultAdapter = &Adapter{isDefault: true}
// Enable configures the BLE stack. It must be called before any
// Bluetooth-related calls (unless otherwise indicated).

View file

@ -12,7 +12,7 @@ type Adapter struct {
// DefaultAdapter is the default adapter on the system.
//
// Make sure to call Enable() before using it to initialize the adapter.
var DefaultAdapter = Adapter{}
var DefaultAdapter = &Adapter{}
// Enable configures the BLE stack. It must be called before any
// Bluetooth-related calls (unless otherwise indicated).