package bluetooth import ( "github.com/go-ole/go-ole" "github.com/saltosystems/winrt-go/windows/devices/bluetooth/advertisement" ) type Adapter struct { watcher *advertisement.BluetoothLEAdvertisementWatcher connectHandler func(device Addresser, connected bool) } // DefaultAdapter is the default adapter on the system. // // Make sure to call Enable() before using it to initialize the adapter. var DefaultAdapter = &Adapter{ connectHandler: func(device Addresser, connected bool) { return }, } // Enable configures the BLE stack. It must be called before any // Bluetooth-related calls (unless otherwise indicated). func (a *Adapter) Enable() error { return ole.RoInitialize(1) // initialize with multithreading enabled }