Skip to content

Commit

Permalink
ble: updates for compatability with bluetooth 0.10 dev branch
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <ron@hybridgroup.com>
  • Loading branch information
deadprogram committed Jun 14, 2024
1 parent e606aa5 commit 567fc2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion platforms/bleclient/btwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type bluetoothExtAdapterer interface {
Enable() error
Scan(callback func(*bluetooth.Adapter, bluetooth.ScanResult)) error
StopScan() error
Connect(address bluetooth.Address, params bluetooth.ConnectionParams) (*bluetooth.Device, error)
Connect(address bluetooth.Address, params bluetooth.ConnectionParams) (bluetooth.Device, error)
}

type bluetoothExtCharacteristicer interface {
Expand Down
11 changes: 6 additions & 5 deletions platforms/bleclient/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ func (bta *btTestAdapter) StopScan() error {
return nil
}

func (bta *btTestAdapter) Connect(_ bluetooth.Address, _ bluetooth.ConnectionParams) (*bluetooth.Device, error) {
func (bta *btTestAdapter) Connect(_ bluetooth.Address, _ bluetooth.ConnectionParams) (bluetooth.Device, error) {
if bta.simulateConnectErr {
return nil, fmt.Errorf("adapter connect error")
return bluetooth.Device{}, fmt.Errorf("adapter connect error")
}

//nolint:nilnil // for this test we can not return a *bluetooth.Device
return nil, nil
return bluetooth.Device{}, nil
}

type btTestPayload struct {
Expand All @@ -72,7 +71,9 @@ func (*btTestPayload) HasServiceUUID(bluetooth.UUID) bool { return true }

func (*btTestPayload) Bytes() []byte { return nil }

func (*btTestPayload) ManufacturerData() map[uint16][]byte { return nil }
func (*btTestPayload) ManufacturerData() []bluetooth.ManufacturerDataElement { return nil }

func (*btTestPayload) ServiceData() []bluetooth.ServiceDataElement { return nil }

type btTestDevice struct {
simulateDiscoverServicesErr bool
Expand Down

0 comments on commit 567fc2f

Please sign in to comment.