-
• #2
If it is windows 10 then there is native API, if you can read c# then check https://github.com/fanoush/BLEConsole I only tested it and did few minor tunings to the code but the API did not look hard to use. The library/nuget used is here https://github.com/fanoush/BLEConsole/blob/master/BLEConsole/packages.config
Otherwise there are python and nodejs bindings but I did not test them and I think they mostly take over whole USB bluetooth device via custom driver and use HCI so the adapter is unusable for rest of the system.
-
• #3
Thanks, yep actually I'm looking for C# console app, so that's perfect. Have you tried to integrate bangle.js app with Windows?
-
• #4
No. but the code is there to do it, I got ble console to the point that you can send data and receive response even larger than MTU size
see this output
https://gist.github.com/fanoush/c17263e57e5ea204de7b2bb01d2a258f
if you would turn off verbose output it looks more sane - you send js command to nordic uart and get response (line 47) -
• #5
So if you would make it into some nordic uart communication dll so that you could connect and read/ write over simple calls, that would be nice. I actually wanted to do this and remove all that interactive stuff but never got the time.
-
• #6
You might want some inspiration from https://www.espruino.com/Interfacing
-
• #7
Thanks. There is noble-uwp listed there that looks a bit dated and does not install for me via npm but it refers noble-winrt https://github.com/Timeular/noble-winrt which looks more up to date and uses same winrt api as bleconsole.
It is not super updated, see https://github.com/Timeular/noble-winrt/pulls - the first PR would be nice to be merged, but just tested it on my win10 machine and it installs fine via npm and can scan for devices with built-in BLE adapter without breaking anything. My bluetooth audio headphones still play while scanning nearby BLE devices and printing device info :-)
-
• #8
Also just tried bleak https://pypi.org/project/bleak/ and seems to be usable too. Did not pull much dependencies
pip install bleak Collecting bleak Downloading bleak-0.16.0-py2.py3-none-any.whl (125 kB) |████████████████████████████████| 125 kB 6.8 MB/s Collecting typing-extensions>=4.2.0 Downloading typing_extensions-4.3.0-py3-none-any.whl (25 kB) Collecting async-timeout>=4.0.1 Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB) Collecting bleak-winrt>=1.1.1; platform_system == "Windows" Downloading bleak_winrt-1.1.1-cp39-cp39-win_amd64.whl (345 kB) |████████████████████████████████| 345 kB 6.4 MB/s Installing collected packages: typing-extensions, async-timeout, bleak-winrt, bleak Successfully installed async-timeout-4.0.2 bleak-0.16.0 bleak-winrt-1.1.1 typing-extensions-4.3.0
and simple discovery demo works :-)
Major improvement since I tried last time on windows!
Hi there,
I'm looking for a fast-implementing way of connecting and communicating with my bangle.js 2 and a windows app, do you have any suggestions on any .dll or library to use?
Thanks in advance