dbus message not received at client from server

Anitha Chandrasekar anitha.chandrasekar at sasken.com
Wed Nov 22 08:26:26 UTC 2017


Hi All,

Thanks for the detailed explanation,
Basically I am using gdbus library of bluez stack , It perfectly works on 64bit processor, this issue is seen in 32bit processor.This issue is not seen when device is in connected state, but seen when a ble device is disconnected.

1) We have verified through dbus-monitor --system and the dbus has sent the message as "Not connected", but this is not reached to gdbus client.
dbus-monitor logs->
error time=1509954378.310314 sender=:1.3 -> destination=:1.12 error_name=org.bluez.Error.Failed reply_serial=52
   string "Not connected"

2) It perfectly works fine on a 64th bit processor , but not working on 32bit processor.

3) The dbus version used is 1.10.10. Using x86, 32 bit processor.

sample reference to these files ,https://kernel.googlesource.com/pub/scm/bluetooth/bluez/+/5.9/gdbus

Here I see that in mainloop.c , Using gdb , suppose I place the breakpoint in dbus_connection_dispatch(conn),
then it perfectly works fine, which in turn calls method_call_reply(..) of gdbus/client.c
But when I place the breakpoint just in method_call_reply(..) of gdbus/client.c, then this callback is not called.

Basically I am seeing the message is not dispatched via dbus to the gdbus/client.c

Please let me know if any additional information is required.

Regards,
Anitha
________________________________________
From: dbus [dbus-bounces at lists.freedesktop.org] on behalf of Simon McVittie [smcv at collabora.com]
Sent: Tuesday, November 21, 2017 11:15 PM
To: dbus at lists.freedesktop.org
Subject: Re: dbus message not received at client from server

On Tue, 21 Nov 2017 at 12:49:06 +0000, Anitha Chandrasekar wrote:
> We are working on BLE devices using bluez stack. These are list of steps which
> are happening,
> 1) The dbus_connection_set_dispatch_status_function is used to register a
> function, to display the status.
> 2) We see that during one of our operation (i.e read), we see that the message
> sent from server(verified via dbus-monitor --system) but not dispatched to
> client.

You appear to be using libdbus, the low-level reference implementation
of the D-Bus protocol. The front page of the libdbus API documentation says:

    This manual documents the *low-level* D-Bus C API. **If you use this
    low-level API directly, you're signing up for some pain.**

libdbus is designed to be used by the reference dbus-daemon and by
language bindings. The unusual requirements imposed by those uses make
it rather unpleasant to use for application code. I would strongly
recommend considering alternatives. The popular and maintained ones for
C-based languages are:

* GDBus, part of the Gio library in GLib
  <https://developer.gnome.org/gio/stable/gdbus-convenience.html>
  <https://developer.gnome.org/gio/stable/gdbus-lowlevel.html>
  (Thread-safe, GObject/C, full reimplementation)

* QtDBus, part of Qt
  <https://doc.qt.io/qt-5/qtdbus-index.html>
  (Believed to be thread-safe, Qt/C++, wrapper around libdbus)

* sd-bus, part of systemd
  <http://0pointer.net/blog/the-new-sd-bus-api-of-systemd.html>
  (Not thread-safe, C, full reimplementation)

If you have to use libdbus and you are not able to switch to something
more user-friendly, I would recommend connecting it to an event
loop implementation like the ones in GLib, Qt, libsystemd or libevent,
preferably using code maintained by someone who is familiar with the
requirements of both that event loop implementation and libdbus.
<https://sources.debian.net/src/pyqt5/5.7%2Bdfsg-5/dbus/dbus.cpp/> and
<https://sources.debian.net/src/avahi/0.6.32-2/avahi-common/simple-watch.c/>
are examples of what this would typically look like.

Regards,
    smcv
_______________________________________________
dbus mailing list
dbus at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dbus

________________________________

SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Technologies Limited ( formerly known as "Sasken Communication Technologies Limited" ) unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email.
Read Disclaimer at http://www.sasken.com/mail-disclaimer/

________________________________


More information about the dbus mailing list