* Fixed a stupid error in util.h
* Added a --system command line option to dbusxx-introspect (to use the system bus) * Added a simple client-side example using HAL to demonstrate how to receive signals git-svn-id: http://dev.openwengo.org/svn/openwengo/wengophone-ng/branches/wengophone-dbus-api/libs/dbus@8519 30a43799-04e7-0310-8b2b-ea0d24f86d0e
This commit is contained in:
parent
a9e3429b9e
commit
cb5ba80633
19 changed files with 885 additions and 374 deletions
44
examples/hal/hal-listen.h
Normal file
44
examples/hal/hal-listen.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
#ifndef __DEMO_HAL_LISTEN_H
|
||||
#define __DEMO_HAL_LISTEN_H
|
||||
|
||||
#include <dbus-c++/dbus.h>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
class HalDeviceProxy;
|
||||
|
||||
class HalManagerProxy
|
||||
: public DBus::InterfaceProxy,
|
||||
public DBus::ObjectProxy
|
||||
{
|
||||
public:
|
||||
|
||||
HalManagerProxy( DBus::Connection& connection );
|
||||
|
||||
std::vector< DBus::String > GetAllDevices();
|
||||
|
||||
private:
|
||||
|
||||
void DeviceAddedCb( const DBus::SignalMessage& sig );
|
||||
|
||||
void DeviceRemovedCb( const DBus::SignalMessage& sig );
|
||||
|
||||
std::map< DBus::String, DBus::RefPtr< HalDeviceProxy > > _devices;
|
||||
};
|
||||
|
||||
class HalDeviceProxy
|
||||
: public DBus::InterfaceProxy,
|
||||
public DBus::ObjectProxy
|
||||
{
|
||||
public:
|
||||
|
||||
HalDeviceProxy( DBus::Connection& connection, DBus::Path& udi );
|
||||
|
||||
private:
|
||||
|
||||
void PropertyModifiedCb( const DBus::SignalMessage& sig );
|
||||
|
||||
void ConditionCb( const DBus::SignalMessage& sig );
|
||||
};
|
||||
|
||||
#endif//__DEMO_HAL_LISTEN_H
|
Loading…
Add table
Add a link
Reference in a new issue