Coder Social home page Coder Social logo

Comments (1)

WebFreak001 avatar WebFreak001 commented on June 14, 2024

Get isn't actually implemented in ddbus, it's a standard dbus interface, see https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties

The .Get method you are trying to call is actually just syntactic sugar for obj.call!ObjectPath("Get", device, "Device")

I believe device isn't the correct parameter you want to pass because it's a ObjectPath but in the documentation it says it should be an interface name.

Maybe you want to actually call .Get on another PathIface with your object path as path? Something like

	Connection conn = connectToBus(DBusBusType.DBUS_BUS_SYSTEM);
	PathIface obj = new PathIface(conn, busName("org.freedesktop.UDisks2"),
			ObjectPath("/org/freedesktop/UDisks2/Manager"),
			interfaceName("org.freedesktop.UDisks2.Manager"));

	Variant!DBusAny[string] arg;
	foreach (devicePath; obj.call!(ObjectPath[])("GetBlockDevices", arg))
	{
		PathIface device = new PathIface(conn,
			busName("org.freedesktop.UDisks2"),
			devicePath,
			interfaceName("org.freedesktop.DBus.Properties"));
		///org/freedesktop/UDisks2/block_devices/sda3
		writeln(device.Get("", "Drive").to!ObjectPath());
	}

from ddbus.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.