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
Bluetooth Low-Energy Samples #402
Comments
Hi there! Thank you for the request. Yes -- you're very welcome to submit an example of this, but I have very little knowledge of implementing Bluetooth LE myself, so unfortunately I can't give you much in the way of pointers. My focus with this project is projecting the underlying Win32 / COM APIs to Dart, but there are too many different subsystems for me to myself be an expert in all of them. You might look for a C/C++ example that you can port over, whether in the Microsoft documentation or elsewhere. If you submit something that is based on another example, please include a link to the original example in your pull request, and make sure that it's OSS-licensed, so that I can include the relevant acknowledgements in the readme. |
Thanks for that Tim. I think I've found some doco here which I can consult: https://docs.microsoft.com/en-us/samples/microsoft/windows-universal-samples/bluetoothle/ Frustratingly, a lot of links on the page are returning "access denied". But there's still a sample I can reference, which I can try to make work. I think @Sunbreak is trying to implement this as well for his quick_blue package, so I'll keep an eye on that repository as well. |
It is an example of UWP APIs of BluetoothLE, which I have done some examples on win32 APIs of BluetoothLE. But I wouldn't recommand using them It is quite cumbersome to find nearby BluetoothLE devices via win32 APIs: https://stackoverflow.com/questions/54912411/detecting-ble-device-in-range-on-win32 If you're interesting in handling Or you could reference Chromium project: https://chromium.googlesource.com/chromium/src/+/HEAD/device/base/device_monitor_win.cc |
So, before this, I was creating a WPF app with BLE functionality but I much prefer using Flutter for the UI and other reasons. The reason why I have begun this journey is because I really want to use (and contribute) to a stable and reliable BLE solution for Flutter because I have a hobby app that uses BLE quite significantly. So, to that end (and this might not be the best place for these questions, but I'll ask anyway...). These may be really stupid questions so I appreciate the patience. I'm really blazing the trail with Flutter on Windows here because I really want to create desktop apps with native functionality.
@Sunbreak I currently use quick_blue in my project and it works well, but it crashes occasionally and when it does it doesn't produce usable errors. Android Studio just says "Lost connection to device" and nothing is logged that I could even create a GitHub issue with. I've cloned quick_blue and attached it to the running app but I've not been able to work out why my crash is happening or what to do about it. Some disclosure: I'm a C#/.NET developer and I understand that C++ is a totally different beast. But I really want to understand it so I can contribute to BLE functionality with Flutter on Windows. |
https://github.com/woodemi/quick_breakpad may help. We'd better open another issue on |
Hey,
I saw that BTLE is now part of win32 and that's super exciting. From reading the documentation though, it seems like there isn't an example on how to subscribe to characteristics or equivalent.
Is this possible with the existing implementation, and if so, would you accept a PR with an example that shows how to subscribe to BTLE characteristic notifications? If so, I might need some rough notes on how this works so I can do a sample up.
The text was updated successfully, but these errors were encountered: