[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Behavior of pyqtProperties in a QDBusAbstractAdapter
From:       Mark Locascio <malocascio () hotmail ! com>
Date:       2021-08-06 20:01:50
Message-ID: DM5PR1001MB2412FB039045D73BB467789BD4F39 () DM5PR1001MB2412 ! namprd10 ! prod ! outlook ! com
[Download RAW message or body]

Hi all,

I'm seeing some odd behavior from a QDBusAbstractAdapter, and I think it's because I \
don't fully understand all the ins and outs of DBus types. Here's an example I put \
together on github: https://github.com/maldata/qt-dbus-bluez/blob/main/qt-example.py

If you look at the documentation for the Bluez advertising API \
(https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/advertising-api.txt?h=5.60#n16), \
you'll see that there are several properties like Type, ServiceUUIDs, \
ManufacturerData, Appearance, and so on. In my code around line 47 \
(https://github.com/maldata/qt-dbus-bluez/blob/1b9d00a30a393b25dc35d0267b85599af390aaae/qt-example.py#L47), \
I implement that interface in a class that extends QDBusAbstractAdaptor, and I add a \
pyqtProperty for each of the Bluez properties. When I look at the object in D-feet, \
some properties are properly listed. Others, however, are not listed (nor are they \
listed in the BLE advertisement). The ones that ARE present are Type, ServiceUUIDs, \
Includes, and LocalName. Values like Appearance (a uint16), ManufacturerData (a dict \
with uint8 keys), and ServiceData (a dict with string keys) are not. I assume because \
I'm doing something with the more complicated types that it doesn't like, but I'm not \
certain.

Can anyone help clear this up?

Thanks!
-Mark


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} \
</style> </head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);"> Hi all,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);"> <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);"> I'm seeing some odd behavior from a&nbsp;QDBusAbstractAdapter, and I \
think it's because I don't fully&nbsp;understand all the ins&nbsp;and&nbsp;outs of \
DBus types. Here's an example I put together on github:&nbsp;<a \
href="https://github.com/maldata/qt-dbus-bluez/blob/main/qt-example.py" \
id="LPlnk">https://github.com/maldata/qt-dbus-bluez/blob/main/qt-example.py</a></div> \
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div> \
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);"> <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);"> If you look at the documentation for the Bluez advertising API (<a \
href="https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/advertising-api.txt?h=5.60#n16" \
id="LPlnk869782">https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/advertising-api.txt?h=5.60#n16</a>),
  you'll see that there are several properties like Type, ServiceUUIDs, \
ManufacturerData,&nbsp;Appearance, and so on. In my code around line 47 (<a \
href="https://github.com/maldata/qt-dbus-bluez/blob/1b9d00a30a393b25dc35d0267b85599af390aaae/qt-example.py#L47" \
id="LPlnk">https://github.com/maldata/qt-dbus-bluez/blob/1b9d00a30a393b25dc35d0267b85599af390aaae/qt-example.py#L47</a>),
  I implement that interface in a class that extends QDBusAbstractAdaptor, and I add \
a pyqtProperty for each of the Bluez properties. When I look at the object in D-feet, \
some properties are properly listed. Others, however, are not listed (nor are they \
listed  in the BLE advertisement). The ones that ARE present are Type, ServiceUUIDs, \
Includes, and LocalName. Values like Appearance (a uint16),&nbsp;ManufacturerData (a \
dict with uint8 keys), and&nbsp;ServiceData (a dict with string keys) are not. I \
assume because I'm doing  something with the more complicated types that it doesn't \
like, but I'm not certain.</div> <div style="font-family: Calibri, Helvetica, \
sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"> <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);"> Can anyone help clear this up?</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);"> <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);"> Thanks!</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
                rgb(0, 0, 0);">
-Mark</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview_1 _EReadonly_1"></div>
<br>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic