Closed narada85 closed 6 years ago
@beaufortfrancois device UUID and name wont help?
Since electron doesn't have popup available to show device list, somehow i need to connect to device and read the data, Do you have any thoughts on this matter? Tx!
I believe* you should be able to see the popup according to https://github.com/aalhaimi/electron-web-bluetooth
@beaufortfrancois i'm doing angular2 web app and going to convert it to electron. So this proposed plugin doesn't support, since angular2 supports only typescript.
this ' https://github.com/aalhaimi/electron-web-bluetooth' plugin doesn't show popup, but it takes around 1 min to send the response.
@beaufortfrancois i'm doing angular2 web app and going to convert it to electron. So this proposed plugin doesn't support, since angular2 supports only typescript.
@narada85 what do you mean by that? typescript is just javascript. What are you trying to accomplish?
@manekinekko i need to convert this ' https://github.com/aalhaimi/electron-web-bluetooth' code to ng2, but how do i do that without typings?
The electron app is just a shell app. You don't have to convert it to typescript. You can for instance, use this project starter and launch it with the electron app by calling the URL like in this line: https://github.com/aalhaimi/electron-web-bluetooth/blob/master/main.js#L21
@manekinekko It worked, tx!, it didn't show up device popup list. but shows battery level after 1min.
@beaufortfrancois do you know what could cause that delay? Does it depends on the device specs?
@narada85 Did you read battery level or did you wait for a BLE GATT notification? Can I see the code? https://github.com/aalhaimi/electron-web-bluetooth does not seem to show "battery level" but "heart rate"
@beaufortfrancois, i did read the battery level.
Can you share code and logs with timestamps? 1 minute is a long time ;)
Can you reproduce with https://googlechrome.github.io/samples/web-bluetooth/battery-level.html?
Here is the output: https://drive.google.com/file/d/0B-qW8Onx1jDfNkUta2l2U0t3SXc/view?usp=sharing
@beaufortfrancois
myBluetoothDevice.gatt.connected
. See https://googlechrome.github.io/samples/web-bluetooth/device-info.html and https://googlechrome.github.io/samples/web-bluetooth/device-disconnect.htmlCan you share timestamps when device is actually connected?
@beaufortfrancois pls mention line numbers on following file that you want to put logs. Then i will send you a output.
https://github.com/manekinekko/angular-web-bluetooth-starter/blob/master/src/app/battery-level.service.ts#L37 https://github.com/manekinekko/angular-web-bluetooth-starter/blob/master/src/app/battery-level.service.ts#L46 https://github.com/manekinekko/angular-web-bluetooth-starter/blob/master/src/app/battery-level.service.ts#L49 https://github.com/manekinekko/angular-web-bluetooth-starter/blob/master/src/app/battery-level.service.ts#L52
FYI. Delay on electron is due to their bluetooth_chooser implementation. Basically, they scan the devices and only choose the device once the scan timeout reach. Electron BT Chooser
I'm closing this issue. Please reopen if needed.
You can't for now as the Permissions API has not been integrated to the Web Bluetooth API. See https://github.com/WebBluetoothCG/web-bluetooth/blob/master/implementation-status.md#gatt-communication-api and https://webbluetoothcg.github.io/web-bluetooth/#permission-api-integration