summaryrefslogtreecommitdiffstats
path: root/meta-ivi-common/recipes-automotive/automotive-message-broker/automotive-message-broker/0007-WORKAROUND-Allow-amb-qt-binding-to-work-in-case-of-m.patch
blob: 14717a99a16efa3f6f49fa772cff48f66caa3180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
From 5de4c1f8e0d5fb22a6d2927d3526498de2b21cbe Mon Sep 17 00:00:00 2001
From: Petr Nechaev <petr.nechaev@cogentembedded.com>
Date: Fri, 31 Jul 2015 20:22:36 +0300
Subject: [PATCH 7/9] [WORKAROUND] Allow amb-qt binding to work in case of
 multiple properties

---
 docs/amb.in.fidl                   |  21 ++++
 plugins/dbus/amb-qt/CMakeLists.txt |   2 +-
 plugins/dbus/amb-qt/ambqt.cpp      | 237 ++++++++++++++++++++++++++-----------
 plugins/dbus/amb-qt/ambqt.h        |  59 ++++-----
 plugins/dbus/amb-qt/ambqtquick.cpp |  22 +++-
 plugins/dbus/amb-qt/ambqtquick.h   |  22 +++-
 plugins/dbus/amb-qt/qmldir         |   1 +
 plugins/dbus/amb-qt/test.cpp       |  26 +++-
 plugins/dbus/automotivemanager.cpp |  65 ++++++++++
 9 files changed, 350 insertions(+), 105 deletions(-)

diff --git a/docs/amb.in.fidl b/docs/amb.in.fidl
index 398a33d..27d2827 100644
--- a/docs/amb.in.fidl
+++ b/docs/amb.in.fidl
@@ -220,6 +220,27 @@ interface org.automotive.Manager  {
   }
 
   /*!
+   * FindObjectsForZone
+   *  \brief find the DBus object path which matches "objectName" and "zone".  This has the same behavior as FindObject
+   * except that it takes an addition zone argument and only return the path for that zone.
+   *  \arg String property is the requested property to be retrieved.
+   *  \arg Zone zone is the zone which the object
+   *  \return list of object paths that provide the given object Name.
+   *  Possible errors:
+   * "org.automotive.Manager.InvalidZone"
+   * "org.automotive.Manager.ObjectNotFound"
+  */
+  method FindObjectsForZone {
+        in {
+          String objectName
+          Zone zone
+        }
+        out {
+          array of String objectPath
+        }
+  }
+
+  /*!
    * ZonesForObjectName
    *  \brief get a list of zones for a given objectName.
    *  \arg String objectName object name.
diff --git a/plugins/dbus/amb-qt/CMakeLists.txt b/plugins/dbus/amb-qt/CMakeLists.txt
index 2f2a2a8..42b7fb4 100644
--- a/plugins/dbus/amb-qt/CMakeLists.txt
+++ b/plugins/dbus/amb-qt/CMakeLists.txt
@@ -16,7 +16,7 @@ endif(Qt5Core_FOUND)
 
 set(ambqt_headers ambqt.h amb-qt_global.h)
 set(ambqt_sources ambqt.cpp)
-set(ambqtquick_sources ambqtquick.cpp)
+set(ambqtquick_sources ambqtquick.cpp qmldir)
 set(ambqtquick_headers ambqtquick.h)
 
 include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs} ${QT_INCLUDE_DIRS})
diff --git a/plugins/dbus/amb-qt/ambqt.cpp b/plugins/dbus/amb-qt/ambqt.cpp
index 6a3faeb..c8f1faf 100644
--- a/plugins/dbus/amb-qt/ambqt.cpp
+++ b/plugins/dbus/amb-qt/ambqt.cpp
@@ -1,92 +1,189 @@
+/*
+Copyright (C) 2012 Intel Corporation
+Copyright (C) 2015 Cogent Embedded Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 #include "ambqt.h"
 #include <QDBusConnection>
 #include <QDBusInterface>
 #include <QtDebug>
 #include <QDBusReply>
 
-AmbProperty::AmbProperty(QString op, QString iface, QString propName)
-	:QObject(), mPropertyName(propName),mInterfaceName(iface), mObjectPath(op),mDBusInterface(NULL),mZone(0)
+AmbProperty::AmbProperty(QString objectName, QString propName)
+    :QObject(), mObjectName(objectName), mPropertyName(propName), mZone(0), managerIface(NULL)
 {
-	connect();
+    // Automatically connect when all properties have been set
+    connect();
 }
 
 
-void AmbProperty::propertyChangedSlot(QString, QVariantMap values, QVariantMap )
+void AmbProperty::propertyChangedSlot(QString, QVariantMap values, QStringList )
 {
-	valueChanged(values);
+    // try to get value
+    mValue = values[mPropertyName];
+
+    // try to parse time
+    QVariant timeVariant = values["Time"];
+    bool ok = false;
+    double NewTime = 0;
+    if (timeVariant.isValid())
+        NewTime = timeVariant.toDouble(&ok);
+    if (ok)
+        mTime = NewTime;
+
+    // emit the signal
+    valueChanged(mValue);
 }
 
-void AmbProperty::propertyChanged1(QDBusVariant val, double t)
+void AmbProperty::connect()
 {
-	mTime = t;
-	mValue = val.variant();
-
-	signalChanged(mValue);
+    if (managerIface)
+        disconnect();
+
+    managerIface = new QDBusInterface("org.automotive.message.broker","/","org.automotive.Manager", QDBusConnection::systemBus(), this);
+
+    if(!managerIface->isValid())
+    {
+        qWarning()<<"Failed to create manager interface";
+        delete managerIface;
+        return;
+    }
+
+    QDBusReply<QList<QDBusObjectPath>> reply = managerIface->call("FindObjectsForZone", mObjectName, mZone);
+
+    if(reply.isValid())
+    {
+        for (int i=0; i < reply.value().size(); ++i)
+        {
+            QDBusInterface* mDBusInterface = new QDBusInterface("org.automotive.message.broker",
+                                                                reply.value().at(i).path(),
+                                                                "org.freedesktop.DBus.Properties",
+                                                                QDBusConnection::systemBus(),
+                                                                this);
+
+            if(!mDBusInterface->isValid())
+            {
+                qDebug()<<"Failed to create dbus interface for property "<<propertyName();
+                qDebug()<<"path: "<< reply.value().at(i).path();
+                qDebug()<<"object: "<< objectName();
+                qDebug()<<"property: "<< propertyName();
+                qDebug()<<"Error: "<<QDBusConnection::systemBus().lastError().message();
+            }
+
+            // store object interface for future use
+            ServerProperties.append(mDBusInterface);
+
+            if(!QDBusConnection::systemBus().connect("org.automotive.message.broker",
+                                                     reply.value().at(i).path(),
+                                                     "org.freedesktop.DBus.Properties",
+                                                     "PropertiesChanged",
+                                                     this,
+                                                     SLOT(propertyChangedSlot(QString,QVariantMap,QStringList))))
+            {
+                qDebug()<<"Failed to connect to signal";
+                qDebug()<<"path: "<< reply.value().at(i).path();
+                qDebug()<<"object: "<< objectName();
+                qDebug()<<"property: "<< propertyName();
+                qDebug()<<"Error: "<< QDBusConnection::systemBus().lastError().message();
+            }
+        }
+    }
+
+    //    if(mInterfaceName.isEmpty())
+    //        mInterfaceName = "org.automotive."+mPropertyName;
+
+    //    mDBusInterface = new QDBusInterface("org.automotive.message.broker",objectPath(), interfaceName(), QDBusConnection::systemBus(),this);
+
+    //    if(!mDBusInterface->isValid())
+    //    {
+    //        qDebug()<<"Failed to create dbus interface for property "<<propertyName();
+    //        qDebug()<<"Path: "<<objectPath();
+    //        qDebug()<<"Interface: "<<interfaceName();
+    //        qDebug()<<"Error: "<<QDBusConnection::systemBus().lastError().message();
+    //    }
+
+    //    QString signalName = propertyName() + "Changed";
+
+
+
+    //    ///TODO: only use PropertiesChanged...  treat AmbProperty like an object rather than a representation of just a single property in the object
+
+    //    if(!QDBusConnection::systemBus().connect("org.automotive.message.broker", objectPath(), mInterfaceName,
+    //                                             signalName, this, SLOT(propertyChanged1(QDBusVariant,double))))
+    //    {
+    //        qDebug()<<"Failed to connect to signal";
+    //        qDebug()<<"path: "<<objectPath();
+    //        qDebug()<<"interface: "<<interfaceName();
+    //        qDebug()<<"signal: "<<propertyName();
+    //        qDebug()<<"Error: "<<QDBusConnection::systemBus().lastError().message();
+    //    }
 }
 
-void AmbProperty::connect()
+void AmbProperty::disconnect()
 {
-	if(mDBusInterface)
-	{
-		delete mDBusInterface;
-	}
-
-	if(mObjectPath.isEmpty())
-		getObjectPath();
-
-	if(mInterfaceName.isEmpty())
-		mInterfaceName = "org.automotive."+mPropertyName;
-
-	mDBusInterface = new QDBusInterface("org.automotive.message.broker",objectPath(), interfaceName(), QDBusConnection::systemBus(),this);
-
-	if(!mDBusInterface->isValid())
-	{
-		qDebug()<<"Failed to create dbus interface for property "<<propertyName();
-		qDebug()<<"Path: "<<objectPath();
-		qDebug()<<"Interface: "<<interfaceName();
-		qDebug()<<"Error: "<<QDBusConnection::systemBus().lastError().message();
-	}
-
-	QString signalName = propertyName() + "Changed";
-
-
-	if(!QDBusConnection::systemBus().connect("org.automotive.message.broker", objectPath(), "org.freedesktop.DBus.Properties",
-											 "PropertiesChanged", this, SLOT(propertyChangedSlot(QString,QVariantMap,QVariantMap))))
-	{
-		qDebug()<<"Failed to connect to signal";
-		qDebug()<<"path: "<<objectPath();
-		qDebug()<<"interface: "<<interfaceName();
-		qDebug()<<"signal: "<<propertyName();
-		qDebug()<<"Error: "<<QDBusConnection::systemBus().lastError().message();
-	}
-
-	///TODO: only use PropertiesChanged...  treat AmbProperty like an object rather than a representation of just a single property in the object
-
-	if(!QDBusConnection::systemBus().connect("org.automotive.message.broker", objectPath(), mInterfaceName,
-											 signalName, this, SLOT(propertyChanged1(QDBusVariant,double))))
-	{
-		qDebug()<<"Failed to connect to signal";
-		qDebug()<<"path: "<<objectPath();
-		qDebug()<<"interface: "<<interfaceName();
-		qDebug()<<"signal: "<<propertyName();
-		qDebug()<<"Error: "<<QDBusConnection::systemBus().lastError().message();
-	}
+    delete managerIface;
+    managerIface = NULL;
+
+    QDBusReply<QList<QDBusObjectPath>> reply = managerIface->call("FindObjectsForZone", mObjectName, mZone);
+
+    if(reply.isValid())
+    {
+        for (int i=0; i < reply.value().size(); ++i)
+        {
+            QDBusConnection::systemBus().disconnect("org.automotive.message.broker",
+                                                    reply.value().at(i).path(),
+                                                    "org.freedesktop.DBus.Properties",
+                                                    "PropertiesChanged",
+                                                    this,
+                                                    SLOT(propertyChangedSlot(QString,QVariantMap,QStringList)));
+        }
+    }
+
+    for (int i = 0; i < ServerProperties.size(); ++i)
+        delete ServerProperties[i];
+
+    ServerProperties.clear();
 }
 
-void AmbProperty::getObjectPath()
+QVariant AmbProperty::updateValue()
 {
-	QDBusInterface managerIface("org.automotive.message.broker","/","org.automotive.Manager", QDBusConnection::systemBus(), this);
-
-	if(!managerIface.isValid())
-	{
-		qDebug()<<"Failed to create manager interface";
-		return;
-	}
-
-	QDBusReply<QDBusObjectPath> reply = managerIface.call("FindObjectForZone", mPropertyName, mZone);
+    for (int i = 0; i < ServerProperties.size(); ++i)
+    {
+        if (!ServerProperties[i]->isValid())
+        {
+            qDebug()<<"error Interface is not valid "<<ServerProperties[i]->objectName();
+        }
+
+        QVariant v = ServerProperties[i]->property(propertyName().toUtf8());
+
+        if (v.isValid())
+            return v;
+    }
+}
 
-	if(reply.isValid())
-	{
-		mObjectPath = reply.value().path();
-	}
+void AmbProperty::setValue(QVariant v)
+{
+    for (int i = 0; i < ServerProperties.size(); ++i)
+    {
+        if (!ServerProperties[i]->isValid())
+        {
+            qDebug()<<"error Interface is not valid "<<ServerProperties[i]->objectName();
+        }
+
+        ServerProperties[i]->setProperty(propertyName().toUtf8(), v);
+    }
 }
+
diff --git a/plugins/dbus/amb-qt/ambqt.h b/plugins/dbus/amb-qt/ambqt.h
index 3d7e793..6510daa 100644
--- a/plugins/dbus/amb-qt/ambqt.h
+++ b/plugins/dbus/amb-qt/ambqt.h
@@ -1,3 +1,21 @@
+/*
+Copyright (C) 2012 Intel Corporation
+Copyright (C) 2015 Cogent Embedded Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 #ifndef AMBQT_H
 #define AMBQT_H
 
@@ -17,57 +35,44 @@ class QDBusInterface;
 class AmbProperty: public QObject
 {
 	Q_OBJECT
-	Q_PROPERTY(QString propertyName READ propertyName WRITE setPropertyName)
+    Q_PROPERTY(QString objectName READ objectName WRITE setObjectName)
+    AUTOPROPERTY(QString, objectName, ObjectName)
+    Q_PROPERTY(QString propertyName READ propertyName WRITE setPropertyName)
 	AUTOPROPERTY(QString, propertyName, PropertyName)
-	Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged)
-	Q_PROPERTY(QString interfaceName READ interfaceName WRITE setInterfaceName)
-	AUTOPROPERTY(QString, interfaceName, InterfaceName)
-	Q_PROPERTY(QString objectPath READ objectPath WRITE setObjectPath)
-	AUTOPROPERTY(QString, objectPath, ObjectPath)
+    Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged)
 	Q_PROPERTY(int zone READ zone WRITE setZone)
 	AUTOPROPERTY(int, zone, Zone)
 	Q_PROPERTY(double time READ time)
 
 
-	public:
+public:
+    AmbProperty(): mPropertyName("Value"), mZone(0), mTime(0), managerIface(NULL) { }
 
-		AmbProperty():mDBusInterface(NULL),mZone(0),mTime(0) { }
-
-	AmbProperty(QString op, QString iface, QString propName);
+    AmbProperty(QString objectName, QString propName);
 
 	QVariant value()
 	{
 		return mValue;
 	}
 
-	void setValue(QVariant v)
-	{
-		if(!mDBusInterface || !mDBusInterface->isValid())
-		{
-			qDebug()<<"error Interface is not valid "<<interfaceName();
-		}
-
-		mDBusInterface->setProperty(propertyName().toUtf8(), v);
-	}
+    void setValue(QVariant v);
 
 	double time(){ return mTime; }
 
-Q_SIGNALS:	
+signals:
 	void valueChanged(QVariant val);
 
-	///TODO: remove
-	void signalChanged(QVariant val);
-
 public Q_SLOTS:
 	void connect();
+    QVariant updateValue();
+    void disconnect();
 
 private Q_SLOTS:
-	void propertyChangedSlot(QString, QVariantMap values, QVariantMap);
-	void propertyChanged1(QDBusVariant, double);
+    void propertyChangedSlot(QString, QVariantMap values, QStringList);
 
 private:
-	void getObjectPath();
-	QDBusInterface* mDBusInterface;
+    QList<QDBusInterface*> ServerProperties;
+    QDBusInterface* managerIface;
 	double mTime;
 	QVariant mValue;
 };
diff --git a/plugins/dbus/amb-qt/ambqtquick.cpp b/plugins/dbus/amb-qt/ambqtquick.cpp
index c5102a9..4362297 100644
--- a/plugins/dbus/amb-qt/ambqtquick.cpp
+++ b/plugins/dbus/amb-qt/ambqtquick.cpp
@@ -1,10 +1,28 @@
+/*
+Copyright (C) 2012 Intel Corporation
+Copyright (C) 2015 Cogent Embedded Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 #include "ambqtquick.h"
 #include <QtQml/qqml.h>
 
 void Components::registerTypes(const char *uri)
 {
-	qmlRegisterType<AmbProperty>(uri,0,1,"AutomotivePropertyItem");
-
+ Q_ASSERT(uri == QLatin1String("amb"));
+ int ret = qmlRegisterType<AmbProperty>(uri, 0, 1,"AutomotivePropertyItem");
 }
 
 void Components::initializeEngine(QQmlEngine *, const char *)
diff --git a/plugins/dbus/amb-qt/ambqtquick.h b/plugins/dbus/amb-qt/ambqtquick.h
index a48104a..74b3d6d 100644
--- a/plugins/dbus/amb-qt/ambqtquick.h
+++ b/plugins/dbus/amb-qt/ambqtquick.h
@@ -1,3 +1,21 @@
+/*
+Copyright (C) 2012 Intel Corporation
+Copyright (C) 2015 Cogent Embedded Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 #include <QQmlExtensionPlugin>
 #include "ambqt.h"
 
@@ -7,8 +25,6 @@ class Components : public QQmlExtensionPlugin
 	Q_PLUGIN_METADATA(IID "org.automotive.qmlplugin")
 public:
 
-
 	void registerTypes(const char *uri);
-	void initializeEngine(QQmlEngine *engine, const char *uri);
-
+    void initializeEngine(QQmlEngine *engine, const char *uri);
 };
diff --git a/plugins/dbus/amb-qt/qmldir b/plugins/dbus/amb-qt/qmldir
index a2d986c..49557ae 100644
--- a/plugins/dbus/amb-qt/qmldir
+++ b/plugins/dbus/amb-qt/qmldir
@@ -1 +1,2 @@
+module amb
 plugin ambqtquick
diff --git a/plugins/dbus/amb-qt/test.cpp b/plugins/dbus/amb-qt/test.cpp
index 6eb88eb..a11f5e4 100644
--- a/plugins/dbus/amb-qt/test.cpp
+++ b/plugins/dbus/amb-qt/test.cpp
@@ -1,3 +1,21 @@
+/*
+Copyright (C) 2012 Intel Corporation
+Copyright (C) 2015 Cogent Embedded Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 #include "ambqt.h"
 #include "timestamp.h"
 
@@ -15,7 +33,7 @@ int main(int argc, char** argv)
 	double totalLatency=0;
 	int numSamples=0;
 
-	QObject::connect(&speed, &AmbProperty::signalChanged,[&](QVariant val)
+	QObject::connect(&speed, &AmbProperty::valueChanged,[&](QVariant val)
 	{
 		double t1 = speed.time();
 		double t2 = amb::currentTime();
@@ -26,10 +44,14 @@ int main(int argc, char** argv)
 		totalLatency+=latency;
 		numSamples++;
 		DebugOut(0)<<"Average: "<<totalLatency / numSamples<<std::endl;
+		qDebug()<<"Value: "<<val;
 	});
 
-	speed.setPropertyName("VehicleSpeed");
+	speed.setObjectName("VehicleSpeed");
+	speed.setPropertyName("Speed");
 	speed.connect();
 
+	qDebug() << "Updated="<< speed.updateValue();
+
 	return app.exec();
 }
diff --git a/plugins/dbus/automotivemanager.cpp b/plugins/dbus/automotivemanager.cpp
index 64919e0..a164d11 100644
--- a/plugins/dbus/automotivemanager.cpp
+++ b/plugins/dbus/automotivemanager.cpp
@@ -14,6 +14,11 @@ static const gchar introspection_xml[] =
   "      <arg type='i' name='zone' direction='in'/>"
   "      <arg type='o' name='response' direction='out'/>"
   "    </method>"
+  "    <method name='FindObjectsForZone'>"
+  "      <arg type='s' name='searchstring' direction='in'/>"
+  "      <arg type='i' name='zone' direction='in'/>"
+  "      <arg type='ao' name='response' direction='out'/>"
+  "    </method>"
   "    <method name='FindObjectForSourceZone'>"
   "      <arg type='s' name='searchstring' direction='in'/>"
   "      <arg type='s' name='source' direction='in'/>"
@@ -168,6 +173,66 @@ static void handleMethodCall(GDBusConnection       *connection,
 		g_dbus_method_invocation_return_dbus_error(invocation,"org.automotive.Manager.InvalidZone", "zone not found");
 	}
 
+	else if(method == "FindObjectsForZone")
+	{
+		gchar* arg;
+		int zone;
+
+		g_variant_get(parameters,"(si)", &arg, &zone);
+
+		std::string propertyToFind = arg;
+
+		if(propertyToFind == "")
+		{
+			g_dbus_method_invocation_return_error(invocation,G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Invalid argument.");
+			return;
+		}
+
+		std::list<AbstractDBusInterface*> interfaces = AbstractDBusInterface::getObjectsForProperty(propertyToFind);
+
+		if(!interfaces.size())
+		{
+			g_dbus_method_invocation_return_dbus_error(invocation, "org.automotive.Manager.ObjectNotFound", "Property not found");
+			return;
+		}
+
+		GVariantBuilder params;
+		g_variant_builder_init(&params, G_VARIANT_TYPE_ARRAY);
+
+		bool hasItems = false;
+
+		for(auto itr = interfaces.begin(); itr != interfaces.end(); itr++)
+		{
+			AbstractDBusInterface* t = *itr;
+			if(!t->isSupported())
+				continue;
+
+			if(t->zone() == (Zone::Type)zone)
+			{
+				hasItems = true;
+
+				if(!t->isRegistered())
+					t->registerObject();
+
+				std::list<std::string> processes = manager->subscribedProcesses[t];
+
+				if(!contains(processes,sender))
+				{
+					DebugOut()<<"Referencing "<<t->objectPath()<<" with sender: "<<sender<<endl;
+					manager->subscribedProcesses[t].push_back(sender);
+				}
+
+				GVariant *newvar = g_variant_new("o",t->objectPath().c_str());
+				g_variant_builder_add_value(&params, newvar);
+			}
+		}
+
+		if(hasItems)
+			g_dbus_method_invocation_return_value(invocation, g_variant_new("(ao)",&params));
+		else
+			g_dbus_method_invocation_return_dbus_error(invocation,"org.automotive.Manager.ObjectNotFound", "Property not found");
+	}
+
 	else if (method == "ZonesForObjectName")
 	{
 		gchar* arg;
-- 
1.9.1