|
From: Andreas V. <li...@br...> - 2009-09-08 20:40:12
|
Am Tue, 8 Sep 2009 18:34:11 +0500 schrieb Zoltan Bencik:
Hello Zoltan,
I suggest you should compile dbus-c++ with debug option (--configure
--enable-debug), your application with -O0 -ggdb and run it in gdb.
This would tell us all a lot of useful information.
regards
Andreas
> Hello All,
>
> I'm trying to mount and unmount devices through dbus-c++ binding,
> using DeviceKit.Disks.Device interface methods.
> While trying to unmount device, I get a 'SIGTRAP' signal.
> Can anybody show me what I'm doing wrong in this code?
>
> Thanks, any help is very appreciated.
>
>
> // Proxy implementation
> DisksDeviceProxy::DisksDeviceProxy(DBus::Connection &connection, const
> char *object_path)
> : DBus::InterfaceProxy("org.freedesktop.DeviceKit.Disks"),
> DBus::ObjectProxy(connection, object_path,
> "org.freedesktop.DeviceKit.Disks.Device")
> {
> }
>
> // Mount device
> void DisksDeviceProxy::MountDevice(const char *fstype,
> std::vector<std::string> &options)
> {
> ::DBus::CallMessage call;
> ::DBus::MessageIter wi = call.writer();
>
> wi << fstype;
> wi << options;
> call.member("FilesystemMount");
> ::DBus::Message ret = invoke_method (call);
> ::DBus::MessageIter ri = ret.reader();
> }
>
> // Unmount device
> void DisksDeviceProxy::UnMountDevice(std::vector<std::string>
> &options) {
> ::DBus::CallMessage call;
> ::DBus::MessageIter wi = call.writer();
>
> wi << options;
> call.member("FilesystemUnmount");
> ::DBus::Message ret = invoke_method (call); // Signaled
> SIGTRAP right here ::DBus::MessageIter ri = ret.reader();
> }
>
> And here is the code, how I'm trying to unmount device:
> //-- START
> DBus::BusDispatcher dispatcher;
> DBus::default_dispatcher = &dispatcher;
>
> DBus::Connection conn = DBus::Connection::SystemBus();
>
> DisksDeviceProxy devkit(conn,
> "/org/freedesktop/DeviceKit/Disks/devices/sdb1"); // for now, just
> hard coded value of my USB device
> std::vector<std::string>options;
> devkit.UnMountDevice(options);
> //-- END
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day trial. Simplify your report design, integration and deployment
> - and focus on what you do best, core application coding. Discover
> what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> dbus-cplusplus-devel mailing list
> dbu...@li...
> https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel
>
|