Comments (2)
Thank you for the very good debug information as this allowed me to quickly narrow down the issue.
One of the recognised issues with dbus-python is that it "guesses" at types. It is guessing at INT32
wrapped as a VARIANT
. My assumption is that somewhere in the stack there is a better job being done on checking if that is the signature for the property is correct. And of course it isn't. It should be a UINT32
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/adapter-api.txt?h=5.53#n283
The quick fix is to set the dbus type when setting the property e.g.
adapter.discoverabletimeout = dbus.UInt32(130, variant_level=1)
Longer term, it is to go through the code and update the property setters.
For this particular property it would need to go from:
@discoverabletimeout.setter
def discoverabletimeout(self, new_timeout):
self.adapter_props.Set(constants.ADAPTER_INTERFACE,
'DiscoverableTimeout', new_timeout)
to
@discoverabletimeout.setter
def discoverabletimeout(self, new_timeout):
dbus_value = dbus.UInt32(new_timeout, variant_level=1)
self.adapter_props.Set(constants.ADAPTER_INTERFACE,
'DiscoverableTimeout', dbus_value)
from python-bluezero.
Great that works, thanks!
from python-bluezero.
Related Issues (20)
- create 2 services from the same source? HOT 3
- Force disconnect clients from peripheral HOT 2
- How best to get extra information like RSSI and tx_power during scan HOT 2
- Disabling BlueZ request to pair with central on connect. HOT 5
- AttributeError: module 'bluezero.async_tools' has no attribute 'EventLoop' HOT 9
- Tests failing and blocking release HOT 1
- Can't install dbus-python to use bluezero HOT 3
- Error "dbus.exceptions.DBusException: org.bluez.Error.NotAvailable: Operation currently not available" on central HOT 8
- using class methods as callbacks fails for writes HOT 2
- Method to determinate current/negotiated MTU for connection HOT 7
- Documentation about PIN on pairing HOT 6
- Name a service and a characteristic HOT 1
- Method to retrieve remote device path in StartNotify and StopNotify HOT 9
- Advertisment of peripheral HOT 3
- What is srv_id 0 zero? HOT 1
- Enable services changed on Generic Attribute service HOT 1
- Wait notification functionality feature HOT 2
- Setting Manufacturer data in Advertiser only works if data is less than 3 bytes long HOT 4
- How to show Txpower in advertisement data HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-bluezero.