Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this pastie is invalid now...problem was fixed in SVN
- using GLib;
- using DBus;
- public class TestClass : GLib.Object
- {
- private DBus.Connection connection;
- private dynamic DBus.Object proxy;
- private bool ConnectToBus(DBus.BusType busType)
- {
- try {
- connection = DBus.Bus.get(busType);
- return true;
- } catch (DBus.Error err) {
- return false;
- }
- }
- private int run()
- {
- if (!ConnectToBus(DBus.BusType.SYSTEM))
- if (!ConnectToBus(DBus.BusType.SESSION))
- return 1;
- proxy = connection.get_object("net.sf.cdemu.CDEMUD_Daemon",
- "/CDEMUD_Daemon",
- "net.sf.cdemu.CDEMUD_Daemon");
- string sr, sg;
- try {
- proxy.DeviceGetMapping(0u, out sr, out sg);
- // this generates wrong Ccode...getting new pointers to param2 and
- // param3 instead of just passing them in the dbus_g_proxy_call...
- //
- // void _dynamic_DeviceGetMapping0 (DBusGProxy* obj, guint param1,
- // char** param2, char** param3,
- // GError** error) {
- // dbus_g_proxy_call (obj, "DeviceGetMapping", error, G_TYPE_UINT,
- // param1, G_TYPE_INVALID, G_TYPE_STRING, ¶m2,
- // G_TYPE_STRING, ¶m3, G_TYPE_INVALID);
- // if ((*error)) {
- // return;
- // }
- // }
- } catch (DBus.Error err) {
- stderr.printf("Error calling DeviceGetMapping: %s\n", err.message);
- }
- stdout.printf("sr: %s, sg: %s\n", sr, sg);
- return 0;
- }
- public static int main(string[] args)
- {
- TestClass tc = new TestClass();
- return tc.run();
- }
- }
Add Comment
Please, Sign In to add comment