GithubHelp home page GithubHelp logo

Comments (10)

philips77 avatar philips77 commented on August 22, 2024 1

This is a different issue. You get 133 after a timeout, so your device with this address is not reachable:

  • can be out of range,
  • can be non-connectable
  • can be bonded to another phone, or this phone may think it's bonded to it (i.e. you had a previous app on this DK, bonded it to your phone and then flagged the dfu, boy phone still tries security)
  • is advertising but you didn't scan for it since Bluetooth was enabled on the phone, so the connect request is sent to the same address, but with type 'public'
  • something else.

from android-dfu-library.

philips77 avatar philips77 commented on August 22, 2024

Thanks for the bug report! I'm really sorry for the enormous delay, but this issue got lost somewhere in my head.
I finally understand now where the "Device got disconnected before service discovery finished" #35 may come from. Those ACTION_ACL_ events are very unreliable. They are called in random order, sometimes before gatt callback, sometimes much after. You are correct that receiving this event in wrong time may do much more bad than good. It was added there long time ago as some devices failed to deliver onConnectionStateChanged with state 0 (disconnected).

Ill look into this deeply now.

from android-dfu-library.

philips77 avatar philips77 commented on August 22, 2024

OK, few observations:

  1. With handling this ACL_DISCONNECTED event I was calling gatt.close() on an object that didn't yet get onConnectionStateChanged(DISCONNECTED). That might have caused some troubles. After cleaning up the old gatt object and trying to connect again to the device we get those weird status 8, newState 0 followed by status 0, newState 2. A closed gatt should not get any callbacks, but it appears as there are some race conditions there, or something not correctly handled.

I'll check with removing setting state to disconnected in ACL receiver for the next release. The app should base on gatt callbacks after all. ACL receiver was a hack.

from android-dfu-library.

philips77 avatar philips77 commented on August 22, 2024

I'll leave it open so that you could verify if the next release has fixed/improved stability.

from android-dfu-library.

philips77 avatar philips77 commented on August 22, 2024

Please check version 1.4.0.

from android-dfu-library.

nikithalakshmanan avatar nikithalakshmanan commented on August 22, 2024

I'm still seeing this issue with v2.5.1

from android-dfu-library.

philips77 avatar philips77 commented on August 22, 2024

Could you paste logcat here?

from android-dfu-library.

philips77 avatar philips77 commented on August 22, 2024

I've fixed the reason why it was failing because of the race conditions, but perhaps there is something else causing it.

from android-dfu-library.

nikithalakshmanan avatar nikithalakshmanan commented on August 22, 2024

Hi,

This is the logcat:

11-13 09:31:42.136 3001-3001/com.example.nikitha.run_2 D/ContentValues: onStop
11-13 09:31:42.137 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: stopLeScan()
11-13 09:31:42.138 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: scan not started yet
11-13 09:31:42.139 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: stopLeScan()
11-13 09:31:42.140 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: scan not started yet
11-13 09:31:44.191 3001-3612/com.example.nikitha.run_2 I/DfuBaseService: Connecting to the device...
11-13 09:31:44.192 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: connect() - device: EA:D0:81:80:D9:E0, auto: false
11-13 09:31:44.192 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: registerApp()
11-13 09:31:44.192 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: registerApp() - UUID=e66a3079-6b62-4657-ad09-87cf3c81b786
11-13 09:31:44.194 3001-3014/com.example.nikitha.run_2 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
11-13 09:31:46.955 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: stopLeScan()
11-13 09:31:46.956 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: scan not started yet
11-13 09:32:14.197 3001-3014/com.example.nikitha.run_2 D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=5 device=EA:D0:81:80:D9:E0
11-13 09:32:14.197 3001-3014/com.example.nikitha.run_2 E/DfuBaseService: Connection state change error: 133 newState: 0
11-13 09:32:14.197 3001-3612/com.example.nikitha.run_2 E/DfuBaseService: Device got disconnected before service discovery finished
11-13 09:32:14.199 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: refresh() - device: EA:D0:81:80:D9:E0
11-13 09:32:14.200 3001-3612/com.example.nikitha.run_2 I/DfuBaseService: Refreshing result: true
11-13 09:32:14.200 3001-3612/com.example.nikitha.run_2 I/DfuBaseService: Cleaning up...
11-13 09:32:14.201 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: close()
11-13 09:32:14.201 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: unregisterApp() - mClientIf=5

from android-dfu-library.

nikithalakshmanan avatar nikithalakshmanan commented on August 22, 2024

This was fixed! Thank you so much! @philips77

from android-dfu-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.