* 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:
pdurante 2006-11-23 12:17:44 +00:00
parent a9e3429b9e
commit cb5ba80633
19 changed files with 885 additions and 374 deletions

View file

@ -27,12 +27,13 @@
#include "introspect.h"
DBus::BusDispatcher dispatcher;
static bool systembus;
static char* path;
static char* service;
void niam( int sig )
{
DBus::Connection conn = DBus::Connection::SessionBus();
DBus::Connection conn = systembus ? DBus::Connection::SystemBus() : DBus::Connection::SessionBus();
IntrospectedObject io(conn, path, service);
@ -49,12 +50,22 @@ int main( int argc, char** argv )
if(argc == 1)
{
std::cerr << std::endl << "Usage: " << argv[0] << " <object_path> [<destination>]" << std::endl << std::endl;
std::cerr << std::endl << "Usage: " << argv[0] << " [--system] <object_path> [<destination>]" << std::endl << std::endl;
}
else
{
path = argv[1];
service = argc > 1 ? argv[2] : 0;
if(strcmp(argv[1], "--system"))
{
systembus = false;
path = argv[1];
service = argc > 1 ? argv[2] : 0;
}
else
{
systembus = true;
path = argv[2];
service = argc > 2 ? argv[3] : 0;
}
DBus::default_dispatcher = &dispatcher;