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

Windows: Fixed null entries in DiscoveredDevices #828 #848

Merged

Conversation

AskBojesen
Copy link
Contributor

@AskBojesen AskBojesen commented May 8, 2024

To fix #828

@AskBojesen AskBojesen changed the title Fixed AdvertisementReceived Windows: Fixed AdvertisementReceived May 8, 2024
@AskBojesen AskBojesen changed the title Windows: Fixed AdvertisementReceived Windows: Fixed null entries in DiscoveredDevices #828 May 8, 2024
@janusw
Copy link
Member

janusw commented May 8, 2024

@axa88 Can you confirm that this fixes the bug?

@axa88
Copy link

axa88 commented May 10, 2024

@janusw
Surely this isn't a question exclusive for this repo, but its the repo i find myself messing around with lots of bleeding edge versions...
So how can i ensure i get a new installation of a package if the build version doesnt change, without wiping away my package cache?
I caught myself again thinking my package had updated where it didnt... and im pretty sure its due to using the same version as i had installed previously

Or is there a way to build these things with semantic versioning... Perhaps rolling that last digit with each build?

I now see there is a build number added to the interface, probably a VS problem... I just have to figure out how to properly clean and rebuild i guess

@axa88
Copy link

axa88 commented May 10, 2024

seems to fixed WinUI. But would you believe it Scanning on Android, badly. good thing i tried it first.

I cant even keep the debugger open long enough to investigate...
Did something with advertisements change?

18:45:23:471	[BluetoothLeScanner] Start Scan with callback
18:45:23:471	[BluetoothLeScanner] onScannerRegistered() - status=0 scannerId=12 mScannerId=0
18:45:23:532	[BluetoothAdapter] BluetoothAdapter() : com.companyname.testsmaui
18:45:24:578	herehherehere
18:45:26:734	**System.ArgumentException:** 'An item with the same key has already been added. Key: ManufacturerSpecificData'
18:45:26:734	
18:45:34:696	Thread started: <Thread Pool> #6
18:45:34:696	The vm is not suspended.
18:45:34:696	Mono.Debugger.Soft.VMNotSuspendedException: The vm is not suspended.
18:45:34:696	   at Mono.Debugger.Soft.VirtualMachine.ErrorHandler(Object sender, ErrorHandlerEventArgs args) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\VirtualMachine.cs:line 369
18:45:34:696	   at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\Connection.cs:line 1894
18:45:34:696	   at Mono.Debugger.Soft.VirtualMachine.Resume() in D:\a\_work\1\s\External\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft\VirtualMachine.cs:line 139
18:45:34:696	   at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es) in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1903
18:45:34:696	   at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler() in D:\a\_work\1\s\External\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1801

Do not commit.
cc @janusw

@janusw
Copy link
Member

janusw commented May 10, 2024

@janusw Surely this isn't a question exclusive for this repo, but its the repo i find myself messing around with lots of bleeding edge versions... So how can i ensure i get a new installation of a package if the build version doesnt change, without wiping away my package cache? I caught myself again thinking my package had updated where it didnt... and im pretty sure its due to using the same version as i had installed previously

Or is there a way to build these things with semantic versioning... Perhaps rolling that last digit with each build?

I now see there is a build number added to the interface, probably a VS problem... I just have to figure out how to properly clean and rebuild i guess

Actually for testing PRs, there is no need to build things yourself (you can, but I don't recommend it). Instead, you can use the nuget packages that are built from the GitHub Actions CI. Just go to "Checks" in the tab bar of the PR, and then select artifacts and download the nupkg (which is uniquely versioned via git describe). For this PR, the direct link to the package is https://github.com/dotnet-bluetooth-le/dotnet-bluetooth-le/actions/runs/9001637781/artifacts/1484044786

@janusw
Copy link
Member

janusw commented May 10, 2024

seems to fixed WinUI. But would you believe it Scanning on Android, badly. good thing i tried it first.

Do not commit. cc @janusw

This PR touches Windows only. If there is a problem with Android, it's already there on master / 3.1.0-rc.1.

Do you have a proper backtrace for the exception you see? If it is really a problem with the library (and not with the way you use it), then please open a new issue for it.

@axa88
Copy link

axa88 commented May 10, 2024

@janusw Surely this isn't a question exclusive for this repo, but its the repo i find myself messing around with lots of bleeding edge versions... So how can i ensure i get a new installation of a package if the build version doesnt change, without wiping away my package cache? I caught myself again thinking my package had updated where it didnt... and im pretty sure its due to using the same version as i had installed previously
Or is there a way to build these things with semantic versioning... Perhaps rolling that last digit with each build?
I now see there is a build number added to the interface, probably a VS problem... I just have to figure out how to properly clean and rebuild i guess

Actually for testing PRs, there is no need to build things yourself (you can, but I don't recommend it). Instead, you can use the nuget packages that are built from the GitHub Actions CI. Just go to "Checks" in the tab bar of the PR, and then select artifacts and download the nupkg (which is uniquely versioned via git describe). For this PR, the direct link to the package is https://github.com/dotnet-bluetooth-le/dotnet-bluetooth-le/actions/runs/9001637781/artifacts/1484044786

ya i figured it out thanks

@axa88
Copy link

axa88 commented May 10, 2024

seems to fixed WinUI. But would you believe it Scanning on Android, badly. good thing i tried it first.
Do not commit. cc @janusw

This PR touches Windows only. If there is a problem with Android, it's already there on master / 3.0.0-rc.1.

Do you have a proper backtrace for the exception you see? If it is really a problem with the library (and not with the way you use it), then please open a new issue for it.

@janusw
do you mean 3.1 rc1?
Either way ya perhaps it traces back to something or the way im using it. Ill investigate

@janusw
Copy link
Member

janusw commented May 10, 2024

@janusw do you mean 3.1 rc1?

Yes, sorry, I meant 3.1.0-rc.1 of course.

Either way ya perhaps it traces back to something or the way im using it. Ill investigate

In fact I have tested receiving advertisements with 3.1.0-rc.1 on Android (plus the latest changes in that release were basically all Windows-related), so I'd be rather surprised if something is seriously broken on Android (but it's not completely impossible, of course 😜).

@AskBojesen
Copy link
Contributor Author

But, @janusw: Can we then get this approved to keep this PR on track?

@axa88
Copy link

axa88 commented May 10, 2024

ok this addresses the given issue.
@janusw
Any other problems Im having is due to my broken implementation

Copy link
Member

@janusw janusw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, if it fixes the problem, this is certainly ok with me. It seems the relevant parts of the problematic commit are simply reverted.

Thanks for the fix, @AskBojesen, and thanks for the bug report and testing, @axa88 !

@janusw janusw merged commit 18d5e3f into dotnet-bluetooth-le:master May 11, 2024
3 checks passed
@AskBojesen AskBojesen deleted the 828_null_in_devicelist_windows branch May 21, 2024 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WinUI] [3.1.0-beta.1] introduces null IDevice(s) to device lists
3 participants