canonical / bluez.dart

Mozilla Public License 2.0
52 stars 20 forks source link

Bluetooth Pin Pairing #68

Closed SkyDev125 closed 2 years ago

SkyDev125 commented 2 years ago

How can I pair with a specific code?....

I have been trying to figure out... no examples exist for connecting to a device and using a pin code or something...

I need to connect my phone with my raspberry pi, and this library seemed to be the unique one capable of assisting me in linux... But If i cant use a code (the one that appears on my phone) to verify and pair it... then I really wont be able to do anything with it...

I don't know if this library can / cant do this.... at this point in time... but I really wish there is a way... that at least I'm unaware of, otherwise i don't know what to do.

Functionalities I'm wondering if they exist:

SkyDev125 commented 2 years ago

Oh, and

if a device tries to pair, be able to listen to it and execute a function (I have no idea if this exists or not..)

robert-ancell commented 2 years ago

This requires https://github.com/canonical/bluez.dart/issues/41 to be implemented. So should be possible, but not yet supported.

SkyDev125 commented 2 years ago

Alright, well, Till then, I have no idea of any other library to use than to be able to proceed with the making of my application with Flutter - dart.

Is this library able to send and receive data over Bluetooth aswell? I have been having a really hard time to understand it's current capabilities. what it can and cant do...

SkyDev125 commented 2 years ago

for example, am I able to send HID commands like I would with a Bluetooth keyboard? or is it possible to send and receive any data at all?

SkyDev125 commented 2 years ago

thank you very much for your time in any situation! its really appreciated!

robert-ancell commented 2 years ago

There is basic sending and receiving of data. The BlueZ GATT documentation might help you see how to use BlueZ to do this.

You best current options are probably:

Hope this helps!

Feichtmeier commented 2 years ago

@robert-ancell to understand this better

it is disabled by default here https://github.com/canonical/bluez.dart/blob/main/lib/src/bluez_client.dart#L906 because the bluez demon itself does not have this feature yet?

Is GCC sending the dbus method rather than using the bluez client? Thanks in advance

robert-ancell commented 2 years ago

@Feichtmeier allowInteractiveAuthorization refers to BlueZ being allowed to use Polkit to authorize requests. That probably should be true by default - it is only useful as false if you are making some script that can't be interactive.

Feichtmeier commented 2 years ago

@Feichtmeier allowInteractiveAuthorization refers to BlueZ being allowed to use Polkit to authorize requests. That probably should be true by default - it is only useful as false if you are making some script that can't be interactive.

woops, sorry for misunderstooding. I was looking into the Gatt service thing but I guess I need some more time. I think I got the rest of the API in settings now

robert-ancell commented 2 years ago

Closing duplicate of https://github.com/canonical/bluez.dart/issues/41