Linux bluetooth development
 help / color / mirror / Atom feed
* Re: Failed to connect: org.bluez.Error.NotReady
From: Bastien Nocera @ 2013-12-13 16:24 UTC (permalink / raw)
  To: Brian J. Murrell; +Cc: Anderson Lizardo, Szymon Janc, BlueZ development
In-Reply-To: <1386951737.23365.19.camel@pc.interlinx.bc.ca>

On Fri, 2013-12-13 at 11:22 -0500, Brian J. Murrell wrote:
<snip>
> > (assuming there is no UI applet running that should take care of
> > powering it up automatically.)
> 
> Which is an interesting point.  What is the UI applet for all of this
> supposed to be now in F20?

There's no "applet" in GNOME 3.10. Launch the Settings -> Bluetooth and
turn Bluetooth on there, in the titlebar.


^ permalink raw reply

* Re: Failed to connect: org.bluez.Error.NotReady
From: Brian J. Murrell @ 2013-12-13 16:22 UTC (permalink / raw)
  To: Anderson Lizardo; +Cc: Szymon Janc, Bastien Nocera, BlueZ development
In-Reply-To: <CAJdJm_POfMm8mtbRAWdG9W3F2PwT8kNYkiHYToVZeVz+D1F+TQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]

On Fri, 2013-12-13 at 14:17 -0200, Anderson Lizardo wrote:
> Hi,
> 
> On Fri, Dec 13, 2013 at 1:56 PM, Szymon Janc <szymon.janc@tieto.com> wrote:
> >> [bluetooth]# connect 7C:1E:52:6E:59:D2
> >> Attempting to connect to 7C:1E:52:6E:59:D2
> >> Failed to connect: org.bluez.Error.NotReady
> >>
> >> I have this same problem with my previously paired headset also.  Not
> >> connected and won't connect.
> >
> > Is your adapter powered?:)
> 
> I agree it looks like it's missing "power on" command on bluetoothctl
> here

Hrm.

[bluetooth]# power on
[CHG] Controller 00:02:72:1E:E0:12 Class: 0x0c0104
Changing power on succeeded
[CHG] Controller 00:02:72:1E:E0:12 Powered: yes
[CHG] Device 7C:1E:52:6E:59:D2 Connected: yes

And now the mouse works.  I wonder what happened in the first place to
make it stop running.  Certainly the unplugging/plugging in of the
dongle might have been enough to need it powering on so it's not clear
that it just spontaneously lost power or anything like that.

> (assuming there is no UI applet running that should take care of
> powering it up automatically.)

Which is an interesting point.  What is the UI applet for all of this
supposed to be now in F20?

b.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: Failed to connect: org.bluez.Error.NotReady
From: Brian J. Murrell @ 2013-12-13 16:18 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth
In-Reply-To: <1386950230.6234.2.camel@nuvo>

[-- Attachment #1: Type: text/plain, Size: 16769 bytes --]

On Fri, 2013-12-13 at 16:57 +0100, Bastien Nocera wrote:
> 
> Then use btmon

It doesn't report anything:

= New Index: 00:02:72:1E:E0:12 (BR/EDR,USB,hci0)                [hci0] 0.981520

That's it.  I tried turning the mouse off and on while running that.
Headset too.

>  to gather some debug information, or even use "journalctl
> -b | grep bluetooth"

Dec 11 11:51:57 pc.interlinx.bc.ca bluetoothd[1405]: Bluetooth daemon 5.11
Dec 11 11:51:57 pc.interlinx.bc.ca bluetoothd[1405]: Starting SDP server
Dec 11 11:51:57 pc.interlinx.bc.ca bluetoothd[1405]: Bluetooth management interface 1.3 initialized
Dec 11 11:52:36 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint registered: sender=:1.40 path=/MediaEndpoint/A2DPSource
Dec 11 11:52:36 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint registered: sender=:1.40 path=/MediaEndpoint/A2DPSink
Dec 11 15:06:51 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint unregistered: sender=:1.40 path=/MediaEndpoint/A2DPSource
Dec 11 15:06:51 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint unregistered: sender=:1.40 path=/MediaEndpoint/A2DPSink
Dec 11 15:06:51 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.40" (uid=1001 pid=1962 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.14" (uid=0 pid=1405 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 11 15:06:51 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.40" (uid=1001 pid=1962 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.14" (uid=0 pid=1405 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 11 15:06:51 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.40" (uid=1001 pid=1962 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.14" (uid=0 pid=1405 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 11 15:06:51 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.40" (uid=1001 pid=1962 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.14" (uid=0 pid=1405 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 11 15:06:51 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.40" (uid=1001 pid=1962 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.14" (uid=0 pid=1405 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 11 15:06:51 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.40" (uid=1001 pid=1962 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.14" (uid=0 pid=1405 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 11 15:06:52 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.40" (uid=1001 pid=1962 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.14" (uid=0 pid=1405 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 11 15:06:52 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.40" (uid=1001 pid=1962 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.14" (uid=0 pid=1405 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 11 15:07:05 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint registered: sender=:1.40 path=/MediaEndpoint/A2DPSource
Dec 11 15:07:05 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint registered: sender=:1.40 path=/MediaEndpoint/A2DPSink
Dec 11 15:07:07 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 11 15:07:07 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 11 15:11:06 pc.interlinx.bc.ca kernel: input: Microsoft Sculpt Touch Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/hci0:11/input15
Dec 11 15:11:07 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 11 18:51:38 pc.interlinx.bc.ca kernel: input: Microsoft Sculpt Touch Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/hci0:11/input16
Dec 11 18:51:40 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 12 05:49:53 pc.interlinx.bc.ca kernel: input: Microsoft Sculpt Touch Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/hci0:11/input17
Dec 12 05:49:55 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 12 06:44:22 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 12 06:44:25 pc.interlinx.bc.ca kernel: input: Microsoft Sculpt Touch Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/hci0:11/input18
Dec 12 11:23:37 pc.interlinx.bc.ca kernel: input: Microsoft Sculpt Touch Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/hci0:11/input19
Dec 12 11:23:42 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 12 13:53:30 pc.interlinx.bc.ca kernel: input: Microsoft Sculpt Touch Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/hci0:11/input20
Dec 12 13:53:32 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 12 15:32:47 pc.interlinx.bc.ca kernel: input: Microsoft Sculpt Touch Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/hci0:11/input21
Dec 12 15:32:49 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 13 05:46:01 pc.interlinx.bc.ca kernel: input: Microsoft Sculpt Touch Mouse as /devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.3/2-1.3:1.0/bluetooth/hci0/hci0:11/input22
Dec 13 05:46:02 pc.interlinx.bc.ca bluetoothd[1405]: No supported peripheral found
Dec 13 10:00:19 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint unregistered: sender=:1.40 path=/MediaEndpoint/A2DPSource
Dec 13 10:00:19 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint unregistered: sender=:1.40 path=/MediaEndpoint/A2DPSink
Dec 13 10:01:00 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint registered: sender=:1.243 path=/MediaEndpoint/A2DPSource
Dec 13 10:01:00 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint registered: sender=:1.243 path=/MediaEndpoint/A2DPSink
Dec 13 10:16:57 pc.interlinx.bc.ca bluetoothd[1405]: Terminating
Dec 13 10:16:59 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint unregistered: sender=:1.243 path=/MediaEndpoint/A2DPSource
Dec 13 10:16:59 pc.interlinx.bc.ca bluetoothd[1405]: Endpoint unregistered: sender=:1.243 path=/MediaEndpoint/A2DPSink
Dec 13 10:16:59 pc.interlinx.bc.ca bluetoothd[1405]: Stopping SDP server
Dec 13 10:16:59 pc.interlinx.bc.ca bluetoothd[1405]: Exit
Dec 13 10:17:01 pc.interlinx.bc.ca bluetoothd[27809]: Bluetooth daemon 5.12
Dec 13 10:17:02 pc.interlinx.bc.ca bluetoothd[27809]: Starting SDP server
Dec 13 10:17:02 pc.interlinx.bc.ca bluetoothd[27809]: Bluetooth management interface 1.3 initialized
Dec 13 10:17:05 pc.interlinx.bc.ca bluetoothd[27809]: Endpoint registered: sender=:1.243 path=/MediaEndpoint/A2DPSource
Dec 13 10:17:05 pc.interlinx.bc.ca bluetoothd[27809]: Endpoint registered: sender=:1.243 path=/MediaEndpoint/A2DPSink
Dec 13 10:21:11 pc.interlinx.bc.ca sudo[28307]: brian : TTY=pts/1 ; PWD=/home/brian ; USER=root ; COMMAND=/sbin/service bluetooth restart
Dec 13 10:21:12 pc.interlinx.bc.ca bluetoothd[27809]: Terminating
Dec 13 10:21:12 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.256" (uid=0 pid=27809 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:21:12 pc.interlinx.bc.ca bluetoothd[27809]: Endpoint unregistered: sender=:1.243 path=/MediaEndpoint/A2DPSource
Dec 13 10:21:12 pc.interlinx.bc.ca bluetoothd[27809]: Endpoint unregistered: sender=:1.243 path=/MediaEndpoint/A2DPSink
Dec 13 10:21:12 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.256" (uid=0 pid=27809 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:21:12 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.256" (uid=0 pid=27809 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:21:12 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.256" (uid=0 pid=27809 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:21:12 pc.interlinx.bc.ca bluetoothd[27809]: Stopping SDP server
Dec 13 10:21:12 pc.interlinx.bc.ca bluetoothd[27809]: Exit
Dec 13 10:21:12 pc.interlinx.bc.ca bluetoothd[28339]: Bluetooth daemon 5.12
Dec 13 10:21:12 pc.interlinx.bc.ca bluetoothd[28339]: Starting SDP server
Dec 13 10:21:13 pc.interlinx.bc.ca bluetoothd[28339]: Bluetooth management interface 1.3 initialized
Dec 13 10:21:13 pc.interlinx.bc.ca bluetoothd[28339]: Endpoint registered: sender=:1.243 path=/MediaEndpoint/A2DPSource
Dec 13 10:21:13 pc.interlinx.bc.ca bluetoothd[28339]: Endpoint registered: sender=:1.243 path=/MediaEndpoint/A2DPSink
Dec 13 10:21:14 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.256" (uid=0 pid=27809 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:21:14 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.256" (uid=0 pid=27809 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:21:14 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.256" (uid=0 pid=27809 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:21:14 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.256" (uid=0 pid=27809 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:24:03 pc.interlinx.bc.ca bluetoothd[28339]: Endpoint unregistered: sender=:1.243 path=/MediaEndpoint/A2DPSource
Dec 13 10:24:03 pc.interlinx.bc.ca bluetoothd[28339]: Endpoint unregistered: sender=:1.243 path=/MediaEndpoint/A2DPSink
Dec 13 10:24:03 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.261" (uid=0 pid=28339 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:24:03 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.261" (uid=0 pid=28339 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:24:03 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.261" (uid=0 pid=28339 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:24:03 pc.interlinx.bc.ca dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.261" (uid=0 pid=28339 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:24:03 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.261" (uid=0 pid=28339 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:24:03 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.261" (uid=0 pid=28339 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:24:03 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.261" (uid=0 pid=28339 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:24:03 pc.interlinx.bc.ca dbus-daemon[1232]: dbus[1232]: [system] Rejected send message, 4 matched rules; type="error", sender=":1.243" (uid=1001 pid=24392 comm="/usr/bin/pulseaudio --start --log-target=syslog ") interface="(unset)" member="(unset)" error name="org.bluez.MediaEndpoint1.Error.NotImplemented" requested_reply="0" destination=":1.261" (uid=0 pid=28339 comm="/usr/libexec/bluetooth/bluetoothd ")
Dec 13 10:24:03 pc.interlinx.bc.ca systemd[1]: Service bluetooth.target is not needed anymore. Stopping.
Dec 13 10:24:13 pc.interlinx.bc.ca bluetoothd[28339]: Endpoint registered: sender=:1.243 path=/MediaEndpoint/A2DPSource
Dec 13 10:24:13 pc.interlinx.bc.ca bluetoothd[28339]: Endpoint registered: sender=:1.243 path=/MediaEndpoint/A2DPSink

Earlier today I did a "service bluetooth restart" as well as
unplugging/plugging the dongle, so those are probably reflected in
there.

> to see if there's more debug output from the
> daemon.
> 
> The mouse should be trying to reconnect, no idea why it wouldn't be able
> to...

Indeed.  :-)

b.




[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: Failed to connect: org.bluez.Error.NotReady
From: Anderson Lizardo @ 2013-12-13 16:17 UTC (permalink / raw)
  To: Szymon Janc; +Cc: Brian J. Murrell, Bastien Nocera, BlueZ development
In-Reply-To: <1691350.CipnhsEWy0@uw000953>

Hi,

On Fri, Dec 13, 2013 at 1:56 PM, Szymon Janc <szymon.janc@tieto.com> wrote:
>> [bluetooth]# connect 7C:1E:52:6E:59:D2
>> Attempting to connect to 7C:1E:52:6E:59:D2
>> Failed to connect: org.bluez.Error.NotReady
>>
>> I have this same problem with my previously paired headset also.  Not
>> connected and won't connect.
>
> Is your adapter powered?:)

I agree it looks like it's missing "power on" command on bluetoothctl
here (assuming there is no UI applet running that should take care of
powering it up automatically.)

Best Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

^ permalink raw reply

* Re: Failed to connect: org.bluez.Error.NotReady
From: Bastien Nocera @ 2013-12-13 15:57 UTC (permalink / raw)
  To: Brian J. Murrell; +Cc: linux-bluetooth
In-Reply-To: <1386949827.23365.9.camel@pc.interlinx.bc.ca>

On Fri, 2013-12-13 at 10:50 -0500, Brian J. Murrell wrote:
> On Fri, 2013-12-13 at 16:42 +0100, Bastien Nocera wrote:
> > Looks like the mouse doesn't accept to be connected through remotely.
> 
> But why would it (a) all of a sudden become disconnected while I was
> using it and (b) a problem today, after having been using this mouse
> successfully for a few days now, including have it reconnect after being
> idle for long periods of time (i.e. overnight)?
> 
> > Turning it off an on should make it connect back to the machine
> 
> Unfortunately not.  After turning it off and then on again, still no
> connection and none possible:
> 
> # info 7C:1E:52:6E:59:D2
> Device 7C:1E:52:6E:59:D2
> 	Name: Microsoft Sculpt Touch Mouse
> 	Alias: Microsoft Sculpt Touch Mouse
> 	Class: 0x000580
> 	Icon: input-mouse
> 	Paired: yes
> 	Trusted: yes
> 	Blocked: no
> 	Connected: no
> 	LegacyPairing: no
> 	UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
> 	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
> 	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
> 	Modalias: usb:v045Ep077Cd011E
> [bluetooth]# connect 7C:1E:52:6E:59:D2
> Attempting to connect to 7C:1E:52:6E:59:D2
> Failed to connect: org.bluez.Error.NotReady
> 
> I have this same problem with my previously paired headset also.  Not
> connected and won't connect.

Then use btmon to gather some debug information, or even use "journalctl
-b | grep bluetooth" to see if there's more debug output from the
daemon.

The mouse should be trying to reconnect, no idea why it wouldn't be able
to...


^ permalink raw reply

* Re: Failed to connect: org.bluez.Error.NotReady
From: Szymon Janc @ 2013-12-13 15:56 UTC (permalink / raw)
  To: Brian J. Murrell; +Cc: Bastien Nocera, linux-bluetooth
In-Reply-To: <1386949827.23365.9.camel@pc.interlinx.bc.ca>

Hi Brian,

> On Fri, 2013-12-13 at 16:42 +0100, Bastien Nocera wrote:
> > Looks like the mouse doesn't accept to be connected through remotely.
> 
> But why would it (a) all of a sudden become disconnected while I was
> using it and (b) a problem today, after having been using this mouse
> successfully for a few days now, including have it reconnect after being
> idle for long periods of time (i.e. overnight)?
> 
> > Turning it off an on should make it connect back to the machine
> 
> Unfortunately not.  After turning it off and then on again, still no
> connection and none possible:
> 
> # info 7C:1E:52:6E:59:D2
> Device 7C:1E:52:6E:59:D2
> 	Name: Microsoft Sculpt Touch Mouse
> 	Alias: Microsoft Sculpt Touch Mouse
> 	Class: 0x000580
> 	Icon: input-mouse
> 	Paired: yes
> 	Trusted: yes
> 	Blocked: no
> 	Connected: no
> 	LegacyPairing: no
> 	UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
> 	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
> 	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
> 	Modalias: usb:v045Ep077Cd011E
> [bluetooth]# connect 7C:1E:52:6E:59:D2
> Attempting to connect to 7C:1E:52:6E:59:D2
> Failed to connect: org.bluez.Error.NotReady
> 
> I have this same problem with my previously paired headset also.  Not
> connected and won't connect.

Is your adapter powered?:)

-- 
BR
Szymon Janc



^ permalink raw reply

* Re: Failed to connect: org.bluez.Error.NotReady
From: Brian J. Murrell @ 2013-12-13 15:50 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth
In-Reply-To: <1386949351.6234.0.camel@nuvo>

[-- Attachment #1: Type: text/plain, Size: 1314 bytes --]

On Fri, 2013-12-13 at 16:42 +0100, Bastien Nocera wrote:
> Looks like the mouse doesn't accept to be connected through remotely.

But why would it (a) all of a sudden become disconnected while I was
using it and (b) a problem today, after having been using this mouse
successfully for a few days now, including have it reconnect after being
idle for long periods of time (i.e. overnight)?

> Turning it off an on should make it connect back to the machine

Unfortunately not.  After turning it off and then on again, still no
connection and none possible:

# info 7C:1E:52:6E:59:D2
Device 7C:1E:52:6E:59:D2
	Name: Microsoft Sculpt Touch Mouse
	Alias: Microsoft Sculpt Touch Mouse
	Class: 0x000580
	Icon: input-mouse
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v045Ep077Cd011E
[bluetooth]# connect 7C:1E:52:6E:59:D2
Attempting to connect to 7C:1E:52:6E:59:D2
Failed to connect: org.bluez.Error.NotReady

I have this same problem with my previously paired headset also.  Not
connected and won't connect.

Cheers,
b.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: Failed to connect: org.bluez.Error.NotReady
From: Bastien Nocera @ 2013-12-13 15:42 UTC (permalink / raw)
  To: Brian J. Murrell; +Cc: linux-bluetooth
In-Reply-To: <1386948800.23365.2.camel@pc.interlinx.bc.ca>

On Fri, 2013-12-13 at 10:33 -0500, Brian J. Murrell wrote:
> So I was happily chugging along using bluez5 on F20 with the previously
> mentioned mouse and all of a sudden it stopped working.  So to
> bluetoothctl I go:
> 
> $ bluetoothctl 
> [NEW] Controller 00:02:72:1E:E0:12 pc.interlinx.bc.ca-0 [default]
> [NEW] Device 00:0D:E6:68:B4:6F Samsung WEP850
> [NEW] Device 70:F3:95:3E:92:34 brian-laptop
> [NEW] Device 7C:1E:52:6E:59:D2 Microsoft Sculpt Touch Mouse
> [bluetooth]# info 7C:1E:52:6E:59:D2
> Device 7C:1E:52:6E:59:D2
> 	Name: Microsoft Sculpt Touch Mouse
> 	Alias: Microsoft Sculpt Touch Mouse
> 	Class: 0x000580
> 	Icon: input-mouse
> 	Paired: yes
> 	Trusted: yes
> 	Blocked: no
> 	Connected: no
> 	LegacyPairing: no
> 	UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
> 	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
> 	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
> 	Modalias: usb:v045Ep077Cd011E
> [bluetooth]# connect 7C:1E:52:6E:59:D2
> Attempting to connect to 7C:1E:52:6E:59:D2
> Failed to connect: org.bluez.Error.NotReady
> 
> I've tried unplugging and plugging in the dongle.  Not sure what else to
> do at this point.

Looks like the mouse doesn't accept to be connected through remotely.
Turning it off an on should make it connect back to the machine (that's
how it behaves with the MS Wireless presenter mouse).

Cheers


^ permalink raw reply

* Failed to connect: org.bluez.Error.NotReady
From: Brian J. Murrell @ 2013-12-13 15:33 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]

So I was happily chugging along using bluez5 on F20 with the previously
mentioned mouse and all of a sudden it stopped working.  So to
bluetoothctl I go:

$ bluetoothctl 
[NEW] Controller 00:02:72:1E:E0:12 pc.interlinx.bc.ca-0 [default]
[NEW] Device 00:0D:E6:68:B4:6F Samsung WEP850
[NEW] Device 70:F3:95:3E:92:34 brian-laptop
[NEW] Device 7C:1E:52:6E:59:D2 Microsoft Sculpt Touch Mouse
[bluetooth]# info 7C:1E:52:6E:59:D2
Device 7C:1E:52:6E:59:D2
	Name: Microsoft Sculpt Touch Mouse
	Alias: Microsoft Sculpt Touch Mouse
	Class: 0x000580
	Icon: input-mouse
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Service Discovery Serve.. (00001000-0000-1000-8000-00805f9b34fb)
	UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v045Ep077Cd011E
[bluetooth]# connect 7C:1E:52:6E:59:D2
Attempting to connect to 7C:1E:52:6E:59:D2
Failed to connect: org.bluez.Error.NotReady

I've tried unplugging and plugging in the dongle.  Not sure what else to
do at this point.

Any ideas?

Cheers,
b.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply

* Re: [PATCH BlueZ] android: Add initial Android Bluetooth Audio protocol API doc
From: Luiz Augusto von Dentz @ 2013-12-13 15:28 UTC (permalink / raw)
  To: Luiz Augusto von Dentz, linux-bluetooth@vger.kernel.org
In-Reply-To: <20131213144922.GE30037@x220.p-661hnu-f1>

Hi Johan,

On Fri, Dec 13, 2013 at 4:49 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi Luiz,
>
> On Fri, Dec 13, 2013, Luiz Augusto von Dentz wrote:
>> This IPC is used to communicate Android BlueZ daemon and AudioFlinger
>> plugin.
>> ---
>>  android/audio-ipc-api.txt | 50 +++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 50 insertions(+)
>>  create mode 100644 android/audio-ipc-api.txt
>
> This seems to be missing an addition to EXTRA_DIST. Once you've fixed
> that feel free to push this yourself.

Will fix it.

> Also, I assume you've got missing bits, like those for suspending and
> resuming streams planned for later patches?

It seems this is handled by upper layer, we just have to make sure the
events are propagated by using the audia state notification, anyway if
we latter find out it is still necessary to synchronize via Audio IPC
we can extend the IPC with some extra bits like you said.


-- 
Luiz Augusto von Dentz

^ permalink raw reply

* Re: [PATCH] android/bluetooth: Add support for getting remote device UUIDs property
From: Johan Hedberg @ 2013-12-13 14:54 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth
In-Reply-To: <1386944441-785-1-git-send-email-szymon.janc@tieto.com>

Hi Szymon,

On Fri, Dec 13, 2013, Szymon Janc wrote:
> This allows to query for remote device UUIDs property.
> ---
>  android/bluetooth.c | 91 ++++++++++++++++++++++++++---------------------------
>  1 file changed, 45 insertions(+), 46 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH v2 1/5] android/tester: Add property check and bdname set success test case
From: Johan Hedberg @ 2013-12-13 14:53 UTC (permalink / raw)
  To: Grzegorz Kolodziejczyk; +Cc: linux-bluetooth
In-Reply-To: <1386938665-7179-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

Hi Grzegorz,

On Fri, Dec 13, 2013, Grzegorz Kolodziejczyk wrote:
> This adds handling of property check, bdname set property success.
> ---
>  android/android-tester.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 75 insertions(+)

All five patches have been applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH BlueZ] android: Add initial Android Bluetooth Audio protocol API doc
From: Johan Hedberg @ 2013-12-13 14:49 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1386938480-12049-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Fri, Dec 13, 2013, Luiz Augusto von Dentz wrote:
> This IPC is used to communicate Android BlueZ daemon and AudioFlinger
> plugin.
> ---
>  android/audio-ipc-api.txt | 50 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 android/audio-ipc-api.txt

This seems to be missing an addition to EXTRA_DIST. Once you've fixed
that feel free to push this yourself.

Also, I assume you've got missing bits, like those for suspending and
resuming streams planned for later patches?

Johan

^ permalink raw reply

* Re: [PATCH] android/bluetooth: Fix missing property change notification
From: Johan Hedberg @ 2013-12-13 14:46 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth
In-Reply-To: <1386938291-26279-1-git-send-email-szymon.janc@tieto.com>

Hi Szymon,

On Fri, Dec 13, 2013, Szymon Janc wrote:
> After setting new discoverable timeout property change notification
> with new value should be send.
> ---
>  android/bluetooth.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH 1/2] bnep: Refactored bnep connect and disconnect calls
From: Johan Hedberg @ 2013-12-13 14:46 UTC (permalink / raw)
  To: Ravi kumar Veeramally; +Cc: linux-bluetooth
In-Reply-To: <1386938150-5683-1-git-send-email-ravikumar.veeramally@linux.intel.com>

Hi Ravi,

On Fri, Dec 13, 2013, Ravi kumar Veeramally wrote:
> Refactored bnep connect and disconnect calls to simply and
> keeping bnep related functionality behind curtains.
> Provided bnep_struct, bnep_new and bnep_free to intialize
> and free the bnep_stuct with basic parameters. bnep_connect
> calls takes care of bnep_setup until interface up then connect
> callback will be called, disconnect_cb is registered as watchdog
> and it will triggered by remote device on disconnect or any other
> I/O error. bnep_disconnect should be called only when iface is
> up/connected.
> ---
>  android/pan.c                 |  97 ++++++++++++-------------------
>  profiles/network/bnep.c       | 131 ++++++++++++++++++++++++++++++------------
>  profiles/network/bnep.h       |  14 +++--
>  profiles/network/connection.c |  50 ++++++++++------
>  4 files changed, 173 insertions(+), 119 deletions(-)

This is a bit too much stuff in a single patch which makes it hard to
follow exactly what the patch is doing. Could you please try to split
this up into multiple patches? Thanks.

Johan

^ permalink raw reply

* Re: [PATCH 1/8] android/tester: Add Socket test invalid params: chan and uuid
From: Johan Hedberg @ 2013-12-13 14:45 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1386861474-29524-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Thu, Dec 12, 2013, Andrei Emeltchenko wrote:
> For the socket listen() call parameters channel and uuid cannot be both
> zeroes.
> ---
>  android/android-tester.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)

All patches in this set have been applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH 5/8] android/socket: Do not close fd on unref
From: Johan Hedberg @ 2013-12-13 14:39 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1386861474-29524-5-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Thu, Dec 12, 2013, Andrei Emeltchenko wrote:
> We close file descriptors in cleanup_rfsock() and leaving the default
> value gives us glib warnings if we close fd already and got G_IO_NVAL in
> server_cb from bt_io.
> ---
>  android/socket.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/android/socket.c b/android/socket.c
> index 5e8f8e5..9d759be 100644
> --- a/android/socket.c
> +++ b/android/socket.c
> @@ -736,6 +736,7 @@ static void handle_listen(const void *buf, uint16_t len)
>  	rfsock->real_sock = g_io_channel_unix_get_fd(io);
>  
>  	g_io_channel_unref(io);
> +	g_io_channel_set_close_on_unref(io, FALSE);

Strictly speaking this function is not allowed to touch "io" after it
drops its own reference to it, i.e. these calls should be in the
opposite order. I fixed it up myself this time.

Johan

^ permalink raw reply

* [PATCH] android/bluetooth: Add support for getting remote device UUIDs property
From: Szymon Janc @ 2013-12-13 14:20 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

This allows to query for remote device UUIDs property.
---
 android/bluetooth.c | 91 ++++++++++++++++++++++++++---------------------------
 1 file changed, 45 insertions(+), 46 deletions(-)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index c60c9a2..97d4aae 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -75,6 +75,8 @@ struct device {
 
 	uint32_t class;
 	int32_t rssi;
+
+	GSList *uuids;
 };
 
 struct browse_req {
@@ -166,6 +168,7 @@ static void free_device(struct device *dev)
 {
 	g_free(dev->name);
 	g_free(dev->friendly_name);
+	g_slist_free_full(dev->uuids, g_free);
 	g_free(dev);
 }
 
@@ -383,40 +386,50 @@ static void set_device_bond_state(const bdaddr_t *addr, uint8_t status,
 	}
 }
 
-static void browse_req_free(struct browse_req *req)
+static  void send_device_property(const bdaddr_t *bdaddr, uint8_t type,
+						uint16_t len, const void *val)
 {
-	g_slist_free_full(req->uuids, g_free);
-	g_free(req);
+	uint8_t buf[BASELEN_REMOTE_DEV_PROP + len];
+	struct hal_ev_remote_device_props *ev = (void *) buf;
+
+	ev->status = HAL_STATUS_SUCCESS;
+	bdaddr2android(bdaddr, ev->bdaddr);
+	ev->num_props = 1;
+	ev->props[0].type = type;
+	ev->props[0].len = len;
+	memcpy(ev->props[0].val, val, len);
+
+	ipc_send_notif(HAL_SERVICE_ID_BLUETOOTH, HAL_EV_REMOTE_DEVICE_PROPS,
+							sizeof(buf), buf);
 }
 
-static void fill_uuids(GSList *list, void *buf)
+static void send_device_uuids_notif(struct device *dev)
 {
-	for (; list; list = g_slist_next(list)) {
-		memcpy(buf, list->data, sizeof(uint128_t));
-		buf += sizeof(uint128_t);
+	uint8_t buf[sizeof(uint128_t) * g_slist_length(dev->uuids)];
+	uint8_t *ptr = buf;
+	GSList *l;
+
+	for (l = dev->uuids; l; l = g_slist_next(l)) {
+		memcpy(ptr, l->data, sizeof(uint128_t));
+		ptr += sizeof(uint128_t);
 	}
+
+	send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_UUIDS, sizeof(buf),
+									buf);
 }
 
-static void remote_uuids_callback(struct browse_req *req)
+static void set_device_uuids(struct device *dev, GSList *uuids)
 {
-	struct hal_ev_remote_device_props *ev;
-	int len;
-
-	len = sizeof(*ev) + sizeof(struct hal_property) + (sizeof(uint128_t) *
-						g_slist_length(req->uuids));
-	ev = g_malloc(len);
+	g_slist_free_full(dev->uuids, g_free);
+	dev->uuids = uuids;
 
-	ev->status = HAL_STATUS_SUCCESS;
-	bdaddr2android(&req->bdaddr, &ev->bdaddr);
-	ev->num_props = 1;
-	ev->props[0].type = HAL_PROP_DEVICE_UUIDS;
-	ev->props[0].len = sizeof(uint128_t) * g_slist_length(req->uuids);
-	fill_uuids(req->uuids, ev->props[0].val);
-
-	ipc_send_notif(HAL_SERVICE_ID_BLUETOOTH, HAL_EV_REMOTE_DEVICE_PROPS,
-								len, ev);
+	send_device_uuids_notif(dev);
+}
 
-	g_free(ev);
+static void browse_req_free(struct browse_req *req)
+{
+	g_slist_free_full(req->uuids, g_free);
+	g_free(req);
 }
 
 static int uuid_128_cmp(gconstpointer a, gconstpointer b)
@@ -476,6 +489,7 @@ static void update_records(struct browse_req *req, sdp_list_t *recs)
 static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
 {
 	struct browse_req *req = user_data;
+	struct device *dev;
 	uuid_t uuid;
 
 	/* If we have a valid response and req->search_uuid == 2, then L2CAP
@@ -500,7 +514,11 @@ static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
 	}
 
 done:
-	remote_uuids_callback(req);
+	dev = find_device(&req->bdaddr);
+	if (dev) {
+		set_device_uuids(dev, req->uuids);
+		req->uuids = NULL;
+	}
 
 	browse_reqs = g_slist_remove(browse_reqs, req);
 	browse_req_free(req);
@@ -573,23 +591,6 @@ static void new_link_key_callback(uint16_t index, uint16_t length,
 	browse_remote_sdp(&addr->bdaddr);
 }
 
-static  void send_device_property(const bdaddr_t *bdaddr, uint8_t type,
-						uint16_t len, const void *val)
-{
-	uint8_t buf[BASELEN_REMOTE_DEV_PROP + len];
-	struct hal_ev_remote_device_props *ev = (void *) buf;
-
-	ev->status = HAL_STATUS_SUCCESS;
-	bdaddr2android(bdaddr, ev->bdaddr);
-	ev->num_props = 1;
-	ev->props[0].type = type;
-	ev->props[0].len = len;
-	memcpy(ev->props[0].val, val, len);
-
-	ipc_send_notif(HAL_SERVICE_ID_BLUETOOTH, HAL_EV_REMOTE_DEVICE_PROPS,
-							sizeof(buf), buf);
-}
-
 static uint8_t get_device_name(struct device *dev)
 {
 	send_device_property(&dev->bdaddr, HAL_PROP_DEVICE_NAME,
@@ -2288,11 +2289,9 @@ static void handle_get_adapter_props_cmd(const void *buf, uint16_t len)
 
 static uint8_t get_device_uuids(struct device *dev)
 {
-	DBG("Not implemented");
+	send_device_uuids_notif(dev);
 
-	/* TODO */
-
-	return HAL_STATUS_FAILED;
+	return HAL_STATUS_SUCCESS;
 }
 
 static uint8_t get_device_class(struct device *dev)
-- 
1.8.3.2


^ permalink raw reply related

* Re: [RFC v2 BlueZ] build: Add coverage support
From: Anderson Lizardo @ 2013-12-13 13:23 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: BlueZ development
In-Reply-To: <1386874657-26642-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Thu, Dec 12, 2013 at 4:57 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> +clean-local: clean-coverage
> +       @find $(top_builddir) -name "*.gcda" -exec $(RM) {} \;
> +       @find $(top_builddir) -name "*.gcno" -exec $(RM) {} \;

Another simplification suggestion:  Replace " -exec $(RM) {} \;" with
"-delete", e.g.:

@find $(top_builddir) -name "*.gcda" -delete

BTW if the deletion fails (e.g. file was created as root but cleanup
is done as non-root), the find command will fail. If it is desirable
that the cleanup never fail, you may need to add a "-" before the
command (or use "|| true", whatever is the convention in BlueZ).

Best Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil

^ permalink raw reply

* Re: [PATCH] Adding missing test scripts to Makefile.tools
From: Johan Hedberg @ 2013-12-13 12:51 UTC (permalink / raw)
  To: Sebastian; +Cc: linux-bluetooth, Sebastian
In-Reply-To: <1386880421-19461-2-git-send-email-sebastianx.chlad@intel.com>

Hi Sebastian,

On Thu, Dec 12, 2013, Sebastian wrote:
> ---
>  Makefile.tools | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile.tools b/Makefile.tools
> index 78034f5..b306c34 100644
> --- a/Makefile.tools
> +++ b/Makefile.tools
> @@ -289,6 +289,7 @@ test_scripts += test/sap_client.py test/bluezutils.py \
>  		test/test-thermometer test/test-profile test/test-health \
>  		test/test-health-sink test/service-record.dtd \
>  		test/service-did.xml test/service-spp.xml test/service-opp.xml \
> -		test/service-ftp.xml test/simple-player test/test-nap \
> +		test/opp-client test/service-ftp.xml test/ftp-client \
> +		test/simple-player test/test-nap \
>  		test/test-heartrate test/test-alert test/test-hfp \
> -		test/test-cyclingspeed
> +		test/test-cyclingspeed test/pbap-client test/map-client

Looks otherwise fine, but you'll need to fix your git author information
and resend. We're not going to have an entry in the git history simply
from someone called "Sebastian". It should also contain a last name.

Johan

^ permalink raw reply

* [PATCH v2 5/5] android/tester: Add bdname get prop success test case
From: Grzegorz Kolodziejczyk @ 2013-12-13 12:44 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1386938665-7179-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

This adds bdname set property success test case. First bdname is set and
then is read.
---
 android/android-tester.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index f347edf..36266e7 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -606,6 +606,15 @@ static const struct generic_data bluetooth_getprop_bdaddr_success_test = {
 	.expected_property.len = sizeof(bt_bdaddr_t)
 };
 
+static const struct generic_data bluetooth_getprop_bdname_success_test = {
+	.expected_hal_callbacks = {adapter_prop_bdname, adapter_prop_bdname,
+							adapter_test_end},
+	.expected_adapter_status = BT_STATUS_SUCCESS,
+	.expected_property.type = BT_PROPERTY_BDNAME,
+	.expected_property.val = "test_bdname_setget",
+	.expected_property.len = 17
+};
+
 static bt_callbacks_t bt_callbacks = {
 	.size = sizeof(bt_callbacks),
 	.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -875,6 +884,22 @@ static void test_getprop_bdaddr_success(const void *test_data)
 	check_expected_status(adapter_status);
 }
 
+static void test_getprop_bdname_success(const void *test_data)
+{
+	struct test_data *data = tester_get_data();
+	const struct generic_data *test = data->test_data;
+	const bt_property_t *prop = &test->expected_property;
+	bt_status_t adapter_status;
+
+	init_test_conditions(data);
+
+	adapter_status = data->if_bluetooth->set_adapter_property(prop);
+	check_expected_status(adapter_status);
+
+	adapter_status = data->if_bluetooth->get_adapter_property((*prop).type);
+	check_expected_status(adapter_status);
+}
+
 #define test_bredrle(name, data, test_setup, test, test_teardown) \
 	do { \
 		struct test_data *user; \
@@ -925,6 +950,11 @@ int main(int argc, char *argv[])
 					setup_enabled_adapter,
 					test_getprop_bdaddr_success, teardown);
 
+	test_bredrle("Test Get BDNAME - Success",
+					&bluetooth_getprop_bdname_success_test,
+					setup_enabled_adapter,
+					test_getprop_bdname_success, teardown);
+
 	test_bredrle("Test Socket Init", NULL, setup_socket_interface,
 						test_dummy, teardown);
 
-- 
1.8.4.2


^ permalink raw reply related

* [PATCH v2 4/5] android/tester: Add bdaddr get prop success test case
From: Grzegorz Kolodziejczyk @ 2013-12-13 12:44 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1386938665-7179-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

This adds bdaddr set property success test case.
---
 android/android-tester.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index 369af31..f347edf 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -598,6 +598,14 @@ static const struct generic_data bluetooth_setprop_disctimeout_success_test = {
 	.expected_property.len = sizeof(test_setprop_disctimeout_val)
 };
 
+static const struct generic_data bluetooth_getprop_bdaddr_success_test = {
+	.expected_hal_callbacks = {adapter_prop_bdaddr, adapter_test_end},
+	.expected_adapter_status = BT_STATUS_SUCCESS,
+	.expected_property.type = BT_PROPERTY_BDADDR,
+	.expected_property.val = NULL,
+	.expected_property.len = sizeof(bt_bdaddr_t)
+};
+
 static bt_callbacks_t bt_callbacks = {
 	.size = sizeof(bt_callbacks),
 	.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -854,6 +862,19 @@ static void test_setprop_disctimeout_succes(const void *test_data)
 	check_expected_status(adapter_status);
 }
 
+static void test_getprop_bdaddr_success(const void *test_data)
+{
+	struct test_data *data = tester_get_data();
+	const struct generic_data *test = data->test_data;
+	const bt_property_t prop = test->expected_property;
+	bt_status_t adapter_status;
+
+	init_test_conditions(data);
+
+	adapter_status = data->if_bluetooth->get_adapter_property(prop.type);
+	check_expected_status(adapter_status);
+}
+
 #define test_bredrle(name, data, test_setup, test, test_teardown) \
 	do { \
 		struct test_data *user; \
@@ -899,6 +920,11 @@ int main(int argc, char *argv[])
 				setup_enabled_adapter,
 				test_setprop_disctimeout_succes, teardown);
 
+	test_bredrle("Test Get BDADDR - Success",
+					&bluetooth_getprop_bdaddr_success_test,
+					setup_enabled_adapter,
+					test_getprop_bdaddr_success, teardown);
+
 	test_bredrle("Test Socket Init", NULL, setup_socket_interface,
 						test_dummy, teardown);
 
-- 
1.8.4.2


^ permalink raw reply related

* [PATCH v2 3/5] android/tester: Add discovery timeout set prop success test case
From: Grzegorz Kolodziejczyk @ 2013-12-13 12:44 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1386938665-7179-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

This adds discovery timeout set property success test case.
---
 android/android-tester.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index fc521a4..369af31 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -43,6 +43,7 @@
 
 static bt_scan_mode_t test_setprop_scanmode_val =
 					BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE;
+static uint32_t test_setprop_disctimeout_val = 120;
 
 /*
  * those are assigned to HAL methods and callbacks, we use ID later
@@ -589,6 +590,14 @@ static const struct generic_data bluetooth_setprop_scanmode_success_test = {
 	.expected_property.len = sizeof(bt_scan_mode_t)
 };
 
+static const struct generic_data bluetooth_setprop_disctimeout_success_test = {
+	.expected_hal_callbacks = {adapter_prop_disc_timeout, adapter_test_end},
+	.expected_adapter_status = BT_STATUS_SUCCESS,
+	.expected_property.type = BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT,
+	.expected_property.val = &test_setprop_disctimeout_val,
+	.expected_property.len = sizeof(test_setprop_disctimeout_val)
+};
+
 static bt_callbacks_t bt_callbacks = {
 	.size = sizeof(bt_callbacks),
 	.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -832,6 +841,19 @@ static void test_setprop_scanmode_succes(const void *test_data)
 	check_expected_status(adapter_status);
 }
 
+static void test_setprop_disctimeout_succes(const void *test_data)
+{
+	struct test_data *data = tester_get_data();
+	const struct generic_data *test = data->test_data;
+	const bt_property_t *prop = &test->expected_property;
+	bt_status_t adapter_status;
+
+	init_test_conditions(data);
+
+	adapter_status = data->if_bluetooth->set_adapter_property(prop);
+	check_expected_status(adapter_status);
+}
+
 #define test_bredrle(name, data, test_setup, test, test_teardown) \
 	do { \
 		struct test_data *user; \
@@ -872,6 +894,11 @@ int main(int argc, char *argv[])
 				setup_enabled_adapter,
 				test_setprop_scanmode_succes, teardown);
 
+	test_bredrle("Test Set DISCOVERY_TIMEOUT - Success",
+				&bluetooth_setprop_disctimeout_success_test,
+				setup_enabled_adapter,
+				test_setprop_disctimeout_succes, teardown);
+
 	test_bredrle("Test Socket Init", NULL, setup_socket_interface,
 						test_dummy, teardown);
 
-- 
1.8.4.2


^ permalink raw reply related

* [PATCH v2 2/5] android/tester: Add scan mode set prop success test case
From: Grzegorz Kolodziejczyk @ 2013-12-13 12:44 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1386938665-7179-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

This adds scan mode set property success test case.
---
 android/android-tester.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index 0a31b53..fc521a4 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -41,6 +41,9 @@
 			adapter_prop_type, adapter_prop_scan_mode, \
 			adapter_prop_bonded_devices, adapter_prop_disc_timeout
 
+static bt_scan_mode_t test_setprop_scanmode_val =
+					BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE;
+
 /*
  * those are assigned to HAL methods and callbacks, we use ID later
  * on mapped in switch-case due to different functions prototypes.
@@ -577,6 +580,15 @@ static const struct generic_data bluetooth_setprop_bdname_success_test = {
 	.expected_property.len = 11
 };
 
+static const struct generic_data bluetooth_setprop_scanmode_success_test = {
+	.expected_hal_callbacks = {adapter_prop_scan_mode,
+				adapter_prop_scan_mode, adapter_test_end},
+	.expected_adapter_status = BT_STATUS_SUCCESS,
+	.expected_property.type = BT_PROPERTY_ADAPTER_SCAN_MODE,
+	.expected_property.val = &test_setprop_scanmode_val,
+	.expected_property.len = sizeof(bt_scan_mode_t)
+};
+
 static bt_callbacks_t bt_callbacks = {
 	.size = sizeof(bt_callbacks),
 	.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -807,6 +819,19 @@ static void test_setprop_bdname_success(const void *test_data)
 	check_expected_status(adapter_status);
 }
 
+static void test_setprop_scanmode_succes(const void *test_data)
+{
+	struct test_data *data = tester_get_data();
+	const struct generic_data *test = data->test_data;
+	const bt_property_t *prop = &test->expected_property;
+	bt_status_t adapter_status;
+
+	init_test_conditions(data);
+
+	adapter_status = data->if_bluetooth->set_adapter_property(prop);
+	check_expected_status(adapter_status);
+}
+
 #define test_bredrle(name, data, test_setup, test, test_teardown) \
 	do { \
 		struct test_data *user; \
@@ -842,6 +867,11 @@ int main(int argc, char *argv[])
 					setup_enabled_adapter,
 					test_setprop_bdname_success, teardown);
 
+	test_bredrle("Test Set SCAN_MODE - Success",
+				&bluetooth_setprop_scanmode_success_test,
+				setup_enabled_adapter,
+				test_setprop_scanmode_succes, teardown);
+
 	test_bredrle("Test Socket Init", NULL, setup_socket_interface,
 						test_dummy, teardown);
 
-- 
1.8.4.2


^ permalink raw reply related

* [PATCH v2 1/5] android/tester: Add property check and bdname set success test case
From: Grzegorz Kolodziejczyk @ 2013-12-13 12:44 UTC (permalink / raw)
  To: linux-bluetooth

This adds handling of property check, bdname set property success.
---
 android/android-tester.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/android/android-tester.c b/android/android-tester.c
index f34b4ac..0a31b53 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -65,6 +65,7 @@ enum hal_bluetooth_callbacks_id {
 struct generic_data {
 	uint8_t expected_adapter_status;
 	uint32_t expect_settings_set;
+	bt_property_t expected_property;
 	uint8_t expected_hal_callbacks[];
 };
 
@@ -95,7 +96,9 @@ struct test_data {
 	bool mgmt_settings_set;
 	bool hal_cb_called;
 	bool status_checked;
+	bool property_checked;
 
+	bt_property_t test_property;
 	GSList *expected_callbacks;
 };
 
@@ -111,6 +114,8 @@ static void test_update_state(void)
 		return;
 	if (!(data->status_checked))
 		return;
+	if (!(data->property_checked))
+		return;
 	tester_test_passed();
 }
 
@@ -177,11 +182,20 @@ static void expected_status_init(struct test_data *data)
 		data->status_checked = true;
 }
 
+static void test_property_init(struct test_data *data)
+{
+	const struct generic_data *test_data = data->test_data;
+
+	if (!(test_data->expected_property.type))
+		data->property_checked = true;
+}
+
 static void init_test_conditions(struct test_data *data)
 {
 	hal_cb_init(data);
 	mgmt_cb_init(data);
 	expected_status_init(data);
+	test_property_init(data);
 }
 
 static void check_expected_status(uint8_t status)
@@ -197,6 +211,33 @@ static void check_expected_status(uint8_t status)
 	test_update_state();
 }
 
+static void check_test_property(void)
+{
+	struct test_data *data = tester_get_data();
+	bt_property_t expected_prop = data->test_property;
+	const struct generic_data *test_data = data->test_data;
+	bt_property_t test_prop = test_data->expected_property;
+
+	if (test_prop.type && (expected_prop.type != test_prop.type)) {
+		tester_test_failed();
+		return;
+	}
+
+	if (test_prop.len && (expected_prop.len != test_prop.len)) {
+		tester_test_failed();
+		return;
+	}
+
+	if (test_prop.val && memcmp(expected_prop.val, test_prop.val,
+							expected_prop.len)) {
+		tester_test_failed();
+		return;
+	}
+
+	data->property_checked = true;
+	test_update_state();
+}
+
 static int get_expected_hal_cb(void)
 {
 	struct test_data *data = tester_get_data();
@@ -448,6 +489,7 @@ static void adapter_properties_cb(bt_status_t status, int num_properties,
 						bt_property_t *properties)
 {
 	enum hal_bluetooth_callbacks_id hal_cb;
+	struct test_data *data = tester_get_data();
 	int i;
 
 	for (i = 0; i < num_properties; i++) {
@@ -456,6 +498,12 @@ static void adapter_properties_cb(bt_status_t status, int num_properties,
 		if (hal_cb == adapter_test_setup_mode)
 			break;
 
+		data->test_property = *properties;
+
+		if (g_slist_next(data->expected_callbacks) ==
+							adapter_test_end)
+			check_test_property();
+
 		switch (properties[i].type) {
 		case BT_PROPERTY_BDADDR:
 			if (hal_cb != adapter_prop_bdaddr)
@@ -521,6 +569,14 @@ static const struct generic_data bluetooth_disable_success_test = {
 	.expected_hal_callbacks = {adapter_state_changed_off, adapter_test_end}
 };
 
+static const struct generic_data bluetooth_setprop_bdname_success_test = {
+	.expected_hal_callbacks = {adapter_prop_bdname, adapter_test_end},
+	.expected_adapter_status = BT_STATUS_SUCCESS,
+	.expected_property.type = BT_PROPERTY_BDNAME,
+	.expected_property.val = "test_bdname",
+	.expected_property.len = 11
+};
+
 static bt_callbacks_t bt_callbacks = {
 	.size = sizeof(bt_callbacks),
 	.adapter_state_changed_cb = adapter_state_changed_cb,
@@ -737,6 +793,20 @@ clean:
 		close(sock_fd);
 }
 
+static void test_setprop_bdname_success(const void *test_data)
+{
+	struct test_data *data = tester_get_data();
+	const struct generic_data *test = data->test_data;
+	const bt_property_t *prop = &test->expected_property;
+	bt_status_t adapter_status;
+
+	init_test_conditions(data);
+
+	adapter_status = data->if_bluetooth->set_adapter_property(prop);
+
+	check_expected_status(adapter_status);
+}
+
 #define test_bredrle(name, data, test_setup, test, test_teardown) \
 	do { \
 		struct test_data *user; \
@@ -767,6 +837,11 @@ int main(int argc, char *argv[])
 	test_bredrle("Test Disable - Success", &bluetooth_disable_success_test,
 			setup_enabled_adapter, test_disable, teardown);
 
+	test_bredrle("Test Set BDNAME - Success",
+					&bluetooth_setprop_bdname_success_test,
+					setup_enabled_adapter,
+					test_setprop_bdname_success, teardown);
+
 	test_bredrle("Test Socket Init", NULL, setup_socket_interface,
 						test_dummy, teardown);
 
-- 
1.8.4.2


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox