D21584: Add LE Advertising and GATT APIs

David Rosca noreply at phabricator.kde.org
Fri Jun 7 09:10:41 BST 2019


drosca requested changes to this revision.
drosca added a comment.
This revision now requires changes to proceed.


  After this, it should be good to go.

INLINE COMMENTS

> drosca wrote in gattapplication.h:47
> Maybe it would be best to add constructor that uses default object path. Also please add better documentation as to what object path prefix is.
> 
> `explicit GattApplication(QObject *parent = nullptr);`

Here I meant adding new constructor, because as you did it now, if you want to set parent from constructor you would need to copy the default value for the objectPathPrefix.

  GattApplication(QObject *parent = nullptr);
  GattApplication(const QString &objectPathPrefix, QObject *parent = nullptr);

> mweichselbaumer wrote in objectmanager.h:47
> QDbusAdaptors can only realize one single DBUS interface.
> This is the base class the org.freedesktop.DBus.ObjectManager adaptor is handling.
> Sure, this could (and should) be reused if other DBUS/BlueZ objects shall realize this interface.
> GattApplication is meant to realize the org.freedesktop.DBus.ObjectManager interface (see gatt-api.txt).

I don't really like this class at all. This is implementation detail, and is of no use for the users of the library, so it shouldn't be exported. On top of it, there is actually no code, it is just interface class.

Another issue here, although minor, is that the bluezqt_dbustypes.h is not installed, so you can't use it. Yes, you could install it, but we don't need it.

As I can see, the only reason for this class is so you can pass it to ObjectManagerAdaptor, but there are other ways to achieve the same thing without adding `ObjectManager` and deriving from it in GattApplication. If we really need it in generic way, we can do it later.

Something like this would work:

  ObjectManagerAdaptor(QObject *parent)
  {
      GattApplication *app = qobject_cast<GattApplication*>(parent);
  }
  
  DBusManagerStruct GetManagedObjects()
  {
      return app->d->getManagedObjects();
  }

Or for now just make it work only with GattApplication, as this is the only one we have now.

Yes, it will not work in the autotest, since you won't have the hook anymore, but you can just remove that test.

REPOSITORY
  R269 BluezQt

REVISION DETAIL
  https://phabricator.kde.org/D21584

To: mweichselbaumer, drosca
Cc: kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190607/1c912c2c/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list