Coder Social home page Coder Social logo

Comments (3)

hypfvieh avatar hypfvieh commented on August 14, 2024

The member internalDiscover is only used when startDiscovery() / stopDiscovery() is used.
The method isDiscovering() will return true if internalDiscovery is true (when startDiscovery() was called and stopDiscovery() was not yet called), or if the DBus-Response says discovery is active.

The internal member does not need to be initialized with false, because that is the default for primitive boolean members in Java.

The exception might occur because internalDiscovery was not set correctly when startDiscovery() / stopDiscovery() was called due to exception catched in these methods. Therefore isDiscovering() still returns true/false and the start/stop method will be executed instead of being omitted.

Setting the member and calling start/stopDiscovery on DBus is not atomic, so in the current code, DBus is called first, then the member is changed. If DBus throws an exception, setting the member to true/false is never called, so the internalDiscovery flag has the wrong state.

I change the code to first set the member, then call DBus.

from bluez-dbus.

srware avatar srware commented on August 14, 2024

Thanks for the explanation @hypfvieh

Is there a timeline for a new release incorporating some of the recent fixes?

from bluez-dbus.

hypfvieh avatar hypfvieh commented on August 14, 2024

no there is no timeline

from bluez-dbus.

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.