public GetObject ( string bus_name, NDesk.DBus.ObjectPath path ) : object | ||
bus_name | string | |
path | NDesk.DBus.ObjectPath | |
return | object |
private static bool DeviceIsOnUsbBus(Connection conn, string halNameOnDbus, HalDevice device) { bool deviceIsOnUsbSubsystem; bool thereIsAPathToParent; do { string subsystem = TryGetDevicePropertyString(device, "info.subsystem"); deviceIsOnUsbSubsystem = subsystem.Contains("usb"); string pathToParent = TryGetDevicePropertyString(device, "info.parent"); thereIsAPathToParent = String.IsNullOrEmpty(pathToParent); device = conn.GetObject<HalDevice>(halNameOnDbus, new ObjectPath(pathToParent)); } while (!deviceIsOnUsbSubsystem && !thereIsAPathToParent); return deviceIsOnUsbSubsystem; }
public GPS() { DbusConnection = Bus.System; gps = DbusConnection.GetObject<Gpsd> ("org.gpsd", new ObjectPath ("/org/gpsd")); gps.fix += HandleGpsfix; }