dbus

selective D-BUS signal emitting from ObServer (unicast signal)

流过昼夜 提交于 2019-12-01 08:07:36
问题 I have a situation where I have a single ObServer object and a set of Clients. ObServer and clients connected through D-BUS (IPC). ObServer has generic interface for all clients. But, time to time ObServer needs to notify clients about some events. Clients listen for a ObServer Generic interface signal OnNotify(). Question: How to emit D-BUS signal (OnNotify()) from ObServer to specified client (instead of broadcast to all) ? p.s Qt D-BUS used for wrapping but any approach are welcome. 回答1:

How to use Qt-Dbus bindings without blocking the main thread

那年仲夏 提交于 2019-12-01 00:52:45
问题 My goal is to create a library using the Qt's DBus bindings. I tried to create a Qt application without launching the QEventLoop (provided by the QCoreApplication class) in the main thread. Here is a minimalistic application sample, working fine using QT-4.6.2 version but blocking on introspection using QT-4.8 or higher. DBusHandler.hpp #pragma once #include <iostream> #include <QtCore/QThread> #include <QtCore/QtCore> #include <QtDBus/QDBusInterface> class DBusHandler : public QThread { Q

dbus_bus_request_name (): Connections are not allowed to own the service

ε祈祈猫儿з 提交于 2019-11-30 21:48:50
问题 I built a root filesystem on arm. It should run dbus-daemon and avahi-daemon, but when I try to run avahi-daemon $ dbus-daemon --system $ avahi-daemon I get this message: Found user 'avahi' (UID 4) and group 'avahi' (GID 4). Successfully dropped root privileges. avahi-daemon 0.6.28 starting up. WARNING: No NSS support for mDNS detected, consider installing nss-mdns! dbus_bus_request_name(): Connection ":1.0" is not allowed to own the service "org.freedesktop.Avahi" due to security policies in

Passing a large data structure over dbus

不羁岁月 提交于 2019-11-30 21:01:23
I'm using dbus to communicate two programs. One creates a large image and it later sends it other program for further processing. I'm passing the image as ByteArray. With 2000x2000 images my program works, but with 4000x4000 it crasses with: process 2283: arguments to dbus_message_iter_append_fixed_array() were incorrect,assertion "n_elements <= DBUS_MAXIMUM_ARRAY_LENGTH / _dbus_type_get_alignment (element_type)" failed in file dbus-message.c line 2628. I understand that this means that I'm passing an array larger than allowed. Is there other way of passing large data strucutures in dbus? This

what dbus performance issue could prevent it from embedded system?

﹥>﹥吖頭↗ 提交于 2019-11-30 20:04:48
From my reading dbus performance should be twice slower than other messaging ipc mechanisms due to existence of a daemon. In the discussion of the so question which Linux IPC technique to use someones mention performance issues. Do you see performance issues other than the twice slower factor? Do you see the issue that prevent dbus from being used in embedded system? To my understanding if dbus is intended for small messages. If large amount of data need to be passed around, one of the solution is to put the data into shared memory or a pile, and then use dbus to notify. Other ipc mechanisms

System D-Bus does not allow punching out ownership with conf files

本小妞迷上赌 提交于 2019-11-30 19:31:46
I am trying to create a daemon service that runs on the system bus where the permissions for sending and receiving from this service should be completely open to anybody. (Security is not a concern for this service). When I attempt to register the service using QtDbus (using the PyQt for it) I get this error: Connection ":1.0" is not allowed to own the service "org.dbus.arduino" due to security policies in the configuration file . This other stack overflow has the same error, but does not help at all in this situation for some reason. dbus_bus_request_name () : Connections are not allowed to

How to write a functional test for a DBUS service written in Python?

自作多情 提交于 2019-11-30 14:48:49
问题 (Title was: "How to write a unit test for a DBUS service written in Python?") I've started to write a DBUS service using dbus-python, but I'm having trouble writing a test case for it. Here is an example of the test I am trying to create. Notice that I have put a GLib event loop in the setUp(), this is where the problem hits: import unittest import gobject import dbus import dbus.service import dbus.glib class MyDBUSService(dbus.service.Object): def __init__(self): bus_name = dbus.service

Start systemd service from C/C++ application or call a D-Bus service

大城市里の小女人 提交于 2019-11-30 14:06:01
I have a .service for a process that i don't want to start at boot-time, but to call it somehow from another already running application, at a given time. The other option would be to put a D-Bus (i'm using glib dbus in my apps ) service file in /usr/share/dbus-1/services and somehow call it from my application. Also, i don't manage to do this either. Let's say that my dbus service file from /usr/share/dbus-1/services is com.callThis.service and my main service file from /lib/systemd/system is com.startThis.service If i run a simple introspect from command line: /home/root # dbus-send -

DBus Finch/Pidgin without X11

随声附和 提交于 2019-11-30 10:30:36
I want to do some Python scripting on my server where I can communicate with finch (A console interface of pidgin , with the interface looking like links2 ) through the DBus Python library to send messages or check for buddy online status. This works if you do it in X. Run finch in an X terminal and run the Python script in another terminal with no errors/exceptions. But if you do it without X , you have to run finch in TTY1 (ctrl+alt+f1) and the python script in TTY2 (ctrl+alt+f2) but the python script will fail . The following is the first few lines of the script: import dbus bus = dbus

How do I extract the returned data from QDBusMessage in a Qt DBus call?

蓝咒 提交于 2019-11-30 07:52:55
I'm trying to call WPA supplicant's DBus interface using Qt's QDBus class library. In particular, I'm trying to use the "Get" property call to retrieve the "Interfaces" property value. The DBus specification (via introspection) for "Get" is: <interface name="org.freedesktop.DBus.Properties"> <method name="Get"> <arg name="interface" type="s" direction="in"/> <arg name="propname" type="s" direction="in"/> <arg name="value" type="v" direction="out"/> </method> ... </interface> Seems simple enough. Two strings input and the output is a variant (these are DBus types). For the "Interfaces" property