Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ble 0.10 #1084

Merged
merged 4 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ble: updates for compatability with bluetooth 0.10 dev branch
Signed-off-by: deadprogram <ron@hybridgroup.com>
  • Loading branch information
deadprogram committed Nov 3, 2024
commit d15f0625c7b9d94dce81a54f6ba24132c66456a1
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