Closed vovagorodok closed 2 years ago
With the ble_uart.py
example it is setup that you should not need to do pairing. Are you using a generic Bluetooth Low Energy scanning and exploration tool?
On a phone I tend to use nRF Connect. On a windows PC, I use the chrome browser with chrome://bluetooth-internals
the same for cpu_temperature.py
?
Yes
It means that for LE devices, each android application should have implementation of connecting functionality instead of pairing integrated in OS?
I am not sure I understand your question.
How are you trying to connect to these devices from your Android phone?
I'm c++/python embedded developer. It's my first experience with bluetooth and android. It's my free time project
The goal is to add bluetooth functionality for https://github.com/lichess-org/lichobile. In order to connect physical chess boards to application. The best typescript library that i found for that is bluetooth-le
: https://github.com/capacitor-community/bluetooth-le#usage.
Will be nice to integrate this functionality simple as possible. Now in settings I implement only boolean option, and I'm not sure if it enough.
And then when move is making than function move from here should be called:
import { BleClient } from '@capacitor-community/bluetooth-le'
import settings from './settings'
let useBluetooth: boolean = settings.general.useBluetoothDevice()
export default {
move() {
if (useBluetooth) {
console.log("move")
BleClient.isEnabled()
// BleClient.write()
}
},
onSettingChange(v: boolean) {
useBluetooth = v
}
}
Should be here some device scan and connect functionality? Or settings should contain scan/connect functionality? Or can it be done externally outside application?
There is a lot to unpick with those questions and beyond the scope of this library.... As some general points; The first thing to think about is if your situation needs the security of pairing. Your app will need to know about what it is going to connect to. This can be by knowing the address, name, or service it is advertising. Trying to develop both ends of the Bluetooth link is typically quite a tricky thing to do especially if it is your first project with BLE. Doing the peripheral first while testing with nRF Connect probably the way to go in most situations. Then develop the central (app) after that.
I've not done anything with TypeScript. My only experience is a talk from https://github.com/thegecko at our local node meetup.
Can I assume that you have the two examples in Bluezero working and I can close this issue?
Let's close this issue. Thanks for help. For me it's misleading that there no parring. And now I understand that for LE there no parring because each app should have own filter in order to find proper service.
When I'm trying to connect using phone or laptop, pairing started and after a while (~2s) disconnects.
sudo btmon
shows: