http://bugzilla.moblin.org/show_bug.cgi?id=9216
--- Comment #13 from pohly <patrick.ohly(a)intel.com> 2010-02-22 06:04:12 PST ---
(In reply to comment #12)
(In reply to comment #10)
> update it. please get the latest code.
> 1) getConfigs querys bluez synchronously if not done.
Since querying devices is done immediately after dbus server start up, I leave
it unchanged.
> 2) Signals of property changed are not listened. I'll do this in the next step.
The code is ready on the branch 'mb9216'. Patrick, please review and merge it.
The "usual" kind of remarks apply ;-}
/**
* Query bluetooth devices from bluez
*/
class BluezManager : public DBusRemoteObject {
...
/** callback of 'GetProperties' method */
void getPropertiesCb(const PropDict &props, const string &error);
/** callback of 'PropertyChanged' signal */
void propertyChanged(const string &name, const
boost::variant<vector<string>, string> &prop);
The source code comments hardly add any additional information. This would be a
good point to explain not just the purpose of the items, but also the overall
architecture (BluezManager) or what the individual callbacks do.
I know that several other existing comments are also not more verbose:
/** Server.SessionChanged */
EmitSignal2<const DBusObject_t &,
bool> sessionChanged;
But in those cases we have a full description elsewhere of what that signal
does.
Conceptually, the BluezManager::BluezAdapter::m_syncDevices might be in the
wrong place. What if there is more than one adapter or we need a similar
mechanism for other transports? IMHO m_syncDevices should be in DBusServer.
To implement Server.TemplatesChanged, I have to make make the emitter for that
signal public and trust that the relevant class (BluezManager) knows what to do
with it. To me that means that the current design doesn't pass the "smell
test". I'll let it stand as it is, but we might want to refactor at some point.
boost::shared_ptr<SignalWatch1<DBusObject_t> > m_deviceRemoved;
boost::shared_ptr<SignalWatch1<DBusObject_t> > m_deviceAdded;
...
boost::shared_ptr<PropertySignal> m_propertyChanged;
What is the reason for making these pointers rather than normal members?
Initialization order perhaps, because of the virtual methods? In that case we
might be going on about solving this the wrong way and should rather get rid of
the virtual methods.
I've added the TemplatesChanged on the mb9216_pohly branch. Jussi, does this
work for you? Untested, see below :-/
-------------------------------------------------------------------------
While testing the code, I found a problem: my K750i doesn't show up in the list
of device templates. I think I tracked it down to GetProperties() returning an
empty UUIDs list. From d-feet:
dbus.Dictionary({dbus.String(u'Name'): dbus.String(u'K750i',
variant_level=1),
dbus.String(u'Paired'): dbus.Boolean(True, variant_level=1),
dbus.String(u'Adapter'): dbus.ObjectPath('/hci0', variant_level=1),
dbus.String(u'Alias'): dbus.String(u'K750i', variant_level=1),
dbus.String(u'Connected'): dbus.Boolean(False, variant_level=1),
dbus.String(u'UUIDs'): dbus.Array([], signature=dbus.Signature('s'),
variant_level=1), dbus.String(u'Address'):
dbus.String(u'00:0E:07:B1:90:17',
variant_level=1), dbus.String(u'Class'): dbus.UInt32(5374468L,
variant_level=1), dbus.String(u'Trusted'): dbus.Boolean(False,
variant_level=1)}, signature=dbus.Signature('sv'))
Here's the corresponding output from sdptool:
$ sdptool search --bdaddr 00:0E:07:B1:90:17 SYNCML
Searching for SYNCML on 00:0E:07:B1:90:17 ...
Service Name: OBEX SyncML Client
Service RecHandle: 0x10007
Service Class ID List:
UUID 128: 00000002-0000-1000-8000-0002ee000002
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 7
"OBEX" (0x0008)
This is the UUID that BluezManager::BluezDevice::checkSyncService() looks for.
This is with bluez-utils 3.36-3 and bluez-gnome 0.27-1. Is my Bluez too old?
--
Configure bugmail:
http://bugzilla.moblin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching someone on the CC list of the bug.