flutter_blue icon indicating copy to clipboard operation
flutter_blue copied to clipboard

BLE Pair feature

Open shruti-techindustan opened this issue 4 years ago • 28 comments

can you please add a pin pairing feature in the library? Actually, I want to pair the BLE devices in-app not from the Bluetooth setting.

shruti-techindustan avatar Jul 22 '20 10:07 shruti-techindustan

What kind of device you wanted to pair? Usually you don't pair BLE devices, just connect.

ekuleshov avatar Jul 22 '20 15:07 ekuleshov

@shruti-techindustan when you ask device to pair and try to connect, the box to input pin will appear.

manoelsrs avatar Jul 23 '20 00:07 manoelsrs

With most ble devices you don't need to pair. Scan and then connect. The Bluetooth ones are different story. They aren't supported by flutter_blue

ekuleshov avatar Jul 23 '20 00:07 ekuleshov

I agree with you, but I'm using a BLE device that needs to pair: https://shop.accu-chek.com/eShop/accu-chek-guide-meter-M005_us.html?cgid=Meters-Shop#start=1

manoelsrs avatar Jul 23 '20 00:07 manoelsrs

Pairing process is usually handled by the OS of the phone. During the pairing/bonding, OS will show a prompt with a pin input. Device can request the phone to initiate pairing, but if it does not, then as soon as you will try to access a Characteristic that requires encrypted link or MITM protection, then the phone will request pairing/bonding and you should get the system level prompt.

eriknorth avatar Jul 23 '20 10:07 eriknorth

In My use case also BLE pairing is required. Like to provide the access of ANCS (Apple notification center service) of my iOS device (where I am running flutter app with flutter_blue lib) to other device ( say a smart watch).

rankush avatar Aug 05 '20 09:08 rankush

Pairing process is usually handled by the OS of the phone. During the pairing/bonding, OS will show a prompt with a pin input. Device can request the phone to initiate pairing, but if it does not, then as soon as you will try to access a Characteristic that requires encrypted link or MITM protection, then the phone will request pairing/bonding and you should get the system level prompt.

Can we wrap the bond request and bond consent of OS to this flutter lib, so that flutter app will use that wrapper to listen OS specific callbacks for bonding/pairing

rankush avatar Aug 05 '20 09:08 rankush

Can we wrap the bond request and bond consent of OS to this flutter lib, so that flutter app will use that wrapper to listen OS specific callbacks for bonding/pairing

As far as I know, this is not possible with iOS. Not sure about Android.

gumbypp avatar Aug 05 '20 20:08 gumbypp

@manoelsrs did you have any success in reading data from Accu-Chek device ?

sudheer-palaparambil avatar Sep 11 '20 06:09 sudheer-palaparambil

I have tried to read accu-check guide. Actually, Flutter Blue, Android, the device requires us to choose the wireless > pair device option in the glucose device.. only then, the device name iis listed in the available ble devices, with connect button. Though the Glucose meter shows the PIN to share, we don't need to pai from our app.

I could read lists with different headers. Charactertics With read button option.. While I read, I am able to get the device name, manufacturer name , version name etc. I.e. this is achieved after print String.fromCharcodes

However, I am not able to the glucose logbook data, like 100 mm/dL.

I see a lengthy value in int array form.

Example [229, 42,42, 9, 9, ...]

Numbers are displayed but, when I convert, this I see only encrypted data?. Is there any decryption required ? From where could find the table for these numbers and field conversion.?

thoughts and guidance will be appreciated

Thanks in advance. Deva

Secondly, I am not able to get the reference information for splitting these number to fields or to read the required data.

devaski avatar Jun 09 '21 22:06 devaski

Not sure where to look for the specs on glucose meters. You can pick at the Nordic code at:

https://github.com/NordicSemiconductor/Android-BLE-Library/blob/master/ble-common/src/main/java/no/nordicsemi/android/ble/common/data/cgm/CGMSpecificOpsControlPointData.java

Some more info is at: https://github.com/NordicSemiconductor/Android-BLE-Library/blob/master/BLE-COMMON.md

https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.glucose_measurement.xml

ekuleshov avatar Jun 10 '21 15:06 ekuleshov

Thank you.

devaski avatar Jun 10 '21 16:06 devaski

This is how I read the value. Source attached. SensorPage.dart.txt

sudheer-palaparambil avatar Jun 13 '21 08:06 sudheer-palaparambil

Thank yo Mr.Sudheer

On Sun, Jun 13, 2021 at 2:27 PM sudheer-palaparambil < @.***> wrote:

This is how I read the value. Source attached. SensorPage.dart.txt https://github.com/pauldemarco/flutter_blue/files/6643580/SensorPage.dart.txt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pauldemarco/flutter_blue/issues/638#issuecomment-860177328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEEKT7MJSP2TZBPDTRVRADTSRXJPANCNFSM4PERX2WA .

devaski avatar Jun 14 '21 04:06 devaski

Lack of BLE pairing is a real show stopper for secure BLE communication. In addition many applications would benefit from bonding. Without pairing and bonding the use of flutter_blue is very limited and I would even claim the attractiveness of flutter for my company becomes questionable.

ivan2angelov avatar Sep 27 '21 10:09 ivan2angelov

Were you able to figure it out ? @devaski @sudheer-palaparambil ?

I tried with @sudheer-palaparambil code, but, that doesn't seem to work for me.

kiranruth avatar Mar 23 '22 09:03 kiranruth

Dear Kiran

flutter_blue code work, however the BLE device Glucose test device i used seems to be having their encryption. So beyond identifying the device, data could not be read.

https://github.com/pauldemarco/flutter_blue/issues/638#issuecomment-858131233

Regards Devaski

On Wed, Mar 23, 2022 at 2:51 PM Kiran Ruth R @.***> wrote:

Were you able to figure it out ? @devaski https://github.com/devaski @sudheer-palaparambil https://github.com/sudheer-palaparambil ?

I tried with @sudheer-palaparambil https://github.com/sudheer-palaparambil code, but, that doesn't seem to work for me.

— Reply to this email directly, view it on GitHub https://github.com/pauldemarco/flutter_blue/issues/638#issuecomment-1076135607, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEEKT4RYVOPPDHPQUJJZWDVBLPANANCNFSM4PERX2WA . You are receiving this because you were mentioned.Message ID: @.***>

devaski avatar Oct 11 '22 07:10 devaski

I am using flutter blue plus pluggin After the selection of bluetooth name when we have to pair bluetooth we have to enter the passkey.. What is the process of this passkey and how it generates the passkey and how it paired is there any Api to call

padma-araksha avatar May 05 '23 12:05 padma-araksha

@padma-araksha any solution with the Flutter Blue plus Plugin. I encounter the same problem without knowing how to proceed!

AymenXD avatar Jul 17 '23 16:07 AymenXD

List value = await d.read();

With this read function directly it calls the passkey function

On Mon, Jul 17, 2023 at 10:07 PM Aymen Fayadhi @.***> wrote:

@padma-araksha https://github.com/padma-araksha any solution with the Flutter Blue plus Plugin. I encounter the same problem without knowing how to proceed!

— Reply to this email directly, view it on GitHub https://github.com/pauldemarco/flutter_blue/issues/638#issuecomment-1638491542, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7UEW57KG3VNJACTGW7EG7DXQVS4VANCNFSM4PERX2WA . You are receiving this because you were mentioned.Message ID: @.***>

padma-araksha avatar Jul 18 '23 06:07 padma-araksha

List value = await d.read(); With this read function directly it calls the passkey function On Mon, Jul 17, 2023 at 10:07 PM Aymen Fayadhi @.> wrote: @padma-araksha https://github.com/padma-araksha any solution with the Flutter Blue plus Plugin. I encounter the same problem without knowing how to proceed! — Reply to this email directly, view it on GitHub <#638 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7UEW57KG3VNJACTGW7EG7DXQVS4VANCNFSM4PERX2WA . You are receiving this because you were mentioned.Message ID: @.>

What do you mean by d.read()? Speciffically what is "d"?

ionutmurgu avatar Aug 03 '23 06:08 ionutmurgu

Hi Team, Any luck on connecting with Accu Chek Guide? Anyone able to get the data from device?

Gaurav-CareMonitor avatar Feb 09 '24 05:02 Gaurav-CareMonitor

**devaski ** c

@devaski Can you please share the code how you are able to get the encrypted data, it doesnt seem to be working for me.

Gaurav-CareMonitor avatar Feb 14 '24 08:02 Gaurav-CareMonitor

It has been some time Let me check the backups and update you. Thanks DG

On Wed, 14 Feb, 2024, 2:26 pm Gaurav Yadav, @.***> wrote:

**devaski http:///devaski ** c

@devaski https://github.com/devaski Can you please share the code how you are able to get the encrypted data, it doesnt seem to be working for me.

— Reply to this email directly, view it on GitHub https://github.com/pauldemarco/flutter_blue/issues/638#issuecomment-1943325202, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEEKT7NWUWKTBCIHXOJQATYTR32DAVCNFSM4PERX2WKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJUGMZTENJSGAZA . You are receiving this because you were mentioned.Message ID: @.***>

devaski avatar Feb 14 '24 11:02 devaski

Thanks @devaski , Would be a great help, Were you able to decode the readings as well?

Gaurav-CareMonitor avatar Feb 14 '24 11:02 Gaurav-CareMonitor

The limitation we have connecting OEM devices relates to kind of encryption issues, or custom specific protocols used by the OEM.

On Wed, Feb 14, 2024 at 4:33 PM Gaurav Yadav @.***> wrote:

Thanks @devaski https://github.com/devaski , Would be a great help, Were you able to decode the readings as well?

— Reply to this email directly, view it on GitHub https://github.com/pauldemarco/flutter_blue/issues/638#issuecomment-1943537678, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEEKTZ7UUZ4B6HYPUONWXDYTSKYZAVCNFSM4PERX2WKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJUGM2TGNZWG44A . You are receiving this because you were mentioned.Message ID: @.***>

devaski avatar Feb 14 '24 15:02 devaski

The limitation we have connecting OEM devices relates to kind of encryption issues, or custom specific protocols used by the OEM. On Wed, Feb 14, 2024 at 4:33 PM Gaurav Yadav @.> wrote: Thanks @devaski https://github.com/devaski , Would be a great help, Were you able to decode the readings as well? — Reply to this email directly, view it on GitHub <#638 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEEKTZ7UUZ4B6HYPUONWXDYTSKYZAVCNFSM4PERX2WKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJUGM2TGNZWG44A . You are receiving this because you were mentioned.Message ID: @.>

Seems like it, can you still share the code that you did, would love to check it out and try to decrypt the readings if possible

Gaurav-CareMonitor avatar Feb 14 '24 15:02 Gaurav-CareMonitor

Thanks @devaski , Would be a great help, Were you able to decode the readings as well?

You need to get the official specs from the manufacturer, generally it's proprietary info and not available on the internet for everyone. The specs contain all the info you'll need to communicate with the device as well as decode the readings. You can try to contact the manufacturer or your supplier, describe your use case and request for the specs. Easier if your company deals with them and has ordered the devices in question.

iamongit avatar Feb 14 '24 15:02 iamongit