Git Product home page Git Product logo

Comments (2)

ukBaz avatar ukBaz commented on June 20, 2024

Thank you for the kind words about the library.

From the information you've shared, nothing is coming to mind as to where the issue is. So let me share some information about where to look to get more debug information. Hopefully that will be helpful and yield some results for you.

When the BLE peripheral is created, the following method is registered with D-Bus and is called when a write happens to that characteristic. The method is acting as an interface between D-Bus and your callback. The method takes the values from D-Bus and converts them into Python objects. It then calls the write_callback it was given.

def WriteValue(self, value, options): # pylint: disable=invalid-name
"""
DBus method for setting the characteristic value
:return: value
"""
if self.write_callback:
self.write_callback(dbus_tools.dbus_to_python(value),
dbus_tools.dbus_to_python(options))
self.Set(constants.GATT_CHRC_IFACE, 'Value', value)

Getting the Python debugger to stop in this function (or adding a print statement) might be useful to see what is happening in your situation.

sudo busctl monitor org.bluez will show you the messages on org.bluez D-Bus. This should show the calls to WriteValue so you can see what is coming from D-Bus.

Finally, it is not obvious to me why you have wrapped your call back in staticmethod. e.g.

write_callback=staticmethod(nodeMeshWifiSSIDChar.WriteValue),

In your method you are using self so I would have thought you needed the object instance passed in. I don't have the context you are using this in so I can't tell if this is a code smell or a bug.

from python-bluezero.

ukBaz avatar ukBaz commented on June 20, 2024

Closing because of inactivity.

from python-bluezero.

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.