2015-09-04 12:05:56

by Nazmul Alam

[permalink] [raw]
Subject: DBus WriteValue is failing for bluez 5.31 with kernel 4.1+

Hello,
I am unable to write to atrribute value to a characteristics exposed
via dbus on the new 4.1 kernel.

Before upgrading to kernel 4.1 the same application can write
attribute value to the characteristics via dbus without any issue.

Following is the log collected from bluetoothd -

org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1
matched rules; type="method_call", sender=":1.24" (uid=0 pid=4112
comm="bluez-5.31/src/bluetoothd -ndE ")
interface="org.bluez.GattCharacteristic1" member="WriteValue" error
name="(unset)" requested_reply="0" destination=":1.25" (uid=0 pid=4114
comm="./test ")

Any suggestions?
Thanks in advance.


2015-09-05 17:58:17

by Szymon Janc

[permalink] [raw]
Subject: Re: DBus WriteValue is failing for bluez 5.31 with kernel 4.1+

Hi,

On Friday 04 September 2015 18:05:56 Nazmul Alam wrote:
> Hello,
> I am unable to write to atrribute value to a characteristics exposed
> via dbus on the new 4.1 kernel.
>
> Before upgrading to kernel 4.1 the same application can write
> attribute value to the characteristics via dbus without any issue.
>
> Following is the log collected from bluetoothd -
>
> org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1
> matched rules; type="method_call", sender=":1.24" (uid=0 pid=4112
> comm="bluez-5.31/src/bluetoothd -ndE ")
> interface="org.bluez.GattCharacteristic1" member="WriteValue" error
> name="(unset)" requested_reply="0" destination=":1.25" (uid=0 pid=4114
> comm="./test ")
>
> Any suggestions?
> Thanks in advance.

This error doesn't seem to be related to kernel change but to outdated
bluetoothd D-Bus policy file. (src/bluetooth.conf)

--
pozdrawiam
Szymon Janc

2015-09-05 14:42:45

by Neil Martin

[permalink] [raw]
Subject: Re: DBus WriteValue is failing for bluez 5.31 with kernel 4.1+

Nazmul,

On Fri, Sep 4, 2015 at 7:05 AM, Nazmul Alam <[email protected]> wrote:
> Hello,
> I am unable to write to atrribute value to a characteristics exposed
> via dbus on the new 4.1 kernel.
>
> Before upgrading to kernel 4.1 the same application can write
> attribute value to the characteristics via dbus without any issue.
>
> Following is the log collected from bluetoothd -
>
> org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1
> matched rules; type="method_call", sender=":1.24" (uid=0 pid=4112
> comm="bluez-5.31/src/bluetoothd -ndE ")
> interface="org.bluez.GattCharacteristic1" member="WriteValue" error
> name="(unset)" requested_reply="0" destination=":1.25" (uid=0 pid=4114
> comm="./test ")
>
> Any suggestions?
> Thanks in advance.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

Caveat, I'm not a bluez developer, but since you haven't had any
replies I figured it wouldn't hurt to give you a few data points that
might help you narrow down the problem. I am running 5.33 on a
raspberry pi with a 4.1 kernel. I am able to write values to a
characteristic without any problems.

I'm a newbie with DBus and bluez, but doesn't the error suggest this
is DBus saying you don't have access, not bluez saying the
characteristic isn't writable? Possibly this is a DBus security
issue. I'd try googling for that error and see if you get any hints.

Is this the only part of your application that's running into problems
after upgrading to 4.1?

Neil