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

You can no longer set Client.InquiryLength on Android #400

Open
snydesc opened this issue Feb 28, 2024 · 1 comment
Open

You can no longer set Client.InquiryLength on Android #400

snydesc opened this issue Feb 28, 2024 · 1 comment

Comments

@snydesc
Copy link

snydesc commented Feb 28, 2024

On Android we have been setting the client's Inquiry Length to 30 seconds. It appears with the a recent update the
Inquiry length no longer works on Android. Looking at the AndroidBluetoothClient code it appears the Get for InquiryLength always returns 0 and the Set for InquiryLength throws Operation is not supported on this platform

How can we set the InquiryLength on Android ?

Operation is not supported on this platform.
[DOTNET] 
[DOTNET]    at InTheHand.Net.Sockets.AndroidBluetoothClient.InTheHand.Net.Sockets.IBluetoothClient.set_InquiryLength(TimeSpan value)
[DOTNET]    at InTheHand.Net.Sockets.BluetoothClient.set_InquiryLength(TimeSpan value)
@peterfoot
Copy link
Member

While it didn't used to throw an exception, InquiryLength was never supported on Android and was a no-op. You can use the newer DiscoverDevicesAsync method on .NET 6.0 and above which allows you to pass a cancellation token so that you can stop discovery once you have the required device or after a set time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants