question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bonding at initialize() or reading Char that requires bond

See original GitHub issue

Hello again!

Thanks for you last fix, it solved my issue. 😃 I’ve ran into another strange case. Let’s say you want to connect to a device and bond that device. What is the flow for this? I’ve tried several different ways but ran into different issues.

  • enqueue a bond in the initialization?
/** BleManagerGattCallback **/
        override fun initialize() {
            super.initialize()
            createBond().enqueue()
            readCharacteristic(bondCharacteristics).with(bondDataCallback).enqueue()            
            readCharacteristic(modeCharacteristics).with(modeCallback).enqueue()
            setNotificationCallback(modeCharacteristics).with(modeCallback)

        }
        ...

In the case above everything below createBond() will be ignored.

  • read a characteristic that require bonding, and handle onBondingRequired?
        override fun initialize() {
            super.initialize()
            readCharacteristic(bondCharacteristics).with(bondDataCallback).enqueue()           
        }
        ...

In this case I get:

E/BleManager: onCharacteristicRead error 8

It does not seem to match the BluetoothGatt.GATT_INSUFFICIENT_AUTHENTICATION, see https://github.com/NordicSemiconductor/Android-BLE-Library/blob/master/ble/src/main/java/no/nordicsemi/android/ble/BleManager.java#L1316 However, it will log in the nRF Logger: Error (0x8): GATT INSUF AUTHORIZATION.

Or is the right way to go to create a bond after connect done callback and then do additional reading for characteristics that require bond?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
philips77commented, Oct 15, 2018

2.0-beta6 released.

1reaction
philips77commented, Oct 17, 2018

Great! We are then almost ready with releasing it as 2.0-final. I’m just busy fixing bugs in DFU, I didn’t look there since long time… Thanks for the help with the library!

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Thorough Guide to Bond for C# - Microsoft Open Source
Bond provides a helper static API for applications that use schema types known at compile-time and don't need to manage lifetime of the...
Read more >
11.5. Error messages - LAMMPS documentation
Bonds read in from the data file were not assigned correctly to atoms. This means there is something invalid about the topology definitions....
Read more >
Payment and surety bonds on securing laborers and ...
Contract bonds are a type of surety bond that must be filed with the owner of a project (the “Obligee”) as a condition...
Read more >
drivers/net/bonding/bond_main.c - Linux source code (v6.0.12)
bonding.c: an Ethernet Bonding driver * * This is useful to talk to a Cisco ... bool bond_time_in_interval(struct bonding *bond, unsigned long last_act, ......
Read more >
WHAT IS THE FEDERAL BONDING PROGRAM?
Anyone else who needs the program's bond in order to get a job. WHY IS IT NEEDED? Q. SINCE EMPLOYERS BUY FIDELITY BOND...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found