Closed
Description
Support for macOS was broken with the addition of the SetConnectedHandler
and SetDisconnectedHandler
methods to the ble.DeviceOption
interface.
I’m aware that macOS isn’t actively maintained, but I thought it might be a good idea for it to at least compile.
(By doing something along these lines)
diff --git a/darwin/option.go b/darwin/option.go
index 1d86b7c..27d324f 100644
--- a/darwin/option.go
+++ b/darwin/option.go
@@ -5,8 +5,19 @@ import (
"time"
"github.com/go-ble/ble/linux/hci/cmd"
+ "github.com/go-ble/ble/linux/hci/evt"
)
+// SetConnectedHandler sets handler to be called when new connection is established.
+func (d *Device) SetConnectedHandler(f func(evt.LEConnectionComplete)) error {
+ return errors.New("Not supported")
+}
+
+// SetDisconnectedHandler sets handler to be called on disconnect.
+func (d *Device) SetDisconnectedHandler(f func(evt.DisconnectionComplete)) error {
+ return errors.New("Not supported")
+}
+
// SetPeripheralRole configures the device to perform Peripheral tasks.
func (d *Device) SetPeripheralRole() error {
d.role = 1
Unfortunately it seem like this doesn’t actually make this project work under macOS, so another idea would be to just remove the darwin
package from this repo.
Metadata
Metadata
Assignees
Labels
No labels