* Fixed marshaling of D-Bus dictionary types

git-svn-id: http://dev.openwengo.org/svn/openwengo/wengophone-ng/branches/wengophone-dbus-api/libs/dbus@8808 30a43799-04e7-0310-8b2b-ea0d24f86d0e
This commit is contained in:
pdurante 2006-12-11 16:50:03 +00:00
parent 8484b18054
commit 0084392c53
7 changed files with 47 additions and 27 deletions

View file

@ -7,3 +7,5 @@ dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-r
dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Hello string:"world"
dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Sum array:int32:10,100,250
dbus-send --dest=org.freedesktop.DBus.Examples.Echo --type=method_call --print-reply /org/freedesktop/DBus/Examples/Echo org.freedesktop.DBus.EchoDemo.Info

View file

@ -19,5 +19,8 @@
<signal name="Echoed">
<arg type="v" name="value"/>
</signal>
<method name="Info">
<arg type="a{ss}" name="info" direction="out"/>
</method>
</interface>
</node>

View file

@ -1,4 +1,5 @@
#include "echo-server.h"
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
@ -36,6 +37,18 @@ DBus::Int32 EchoServer::Sum( const std::vector<DBus::Int32>& ints )
return sum;
}
std::map< DBus::String, DBus::String > EchoServer::Info()
{
std::map< DBus::String, DBus::String > info;
char hostname[HOST_NAME_MAX];
gethostname(hostname, sizeof(hostname));
info["hostname"] = hostname;
info["username"] = getlogin();
return info;
}
DBus::BusDispatcher dispatcher;

View file

@ -20,6 +20,8 @@ public:
DBus::Variant Echo( const DBus::Variant & value );
DBus::Int32 Sum( const std::vector<DBus::Int32> & ints );
std::map< DBus::String, DBus::String > Info();
};
#endif//__DEMO_ECHO_SERVER_H