OSDN Git Service

android-x86/external-bluetooth-bluez.git
8 years agoandroid: fix building errors on Android 6.0 lollipop-x86
Chih-Wei Huang [Thu, 10 Dec 2015 07:40:59 +0000 (15:40 +0800)]
android: fix building errors on Android 6.0

Change libhal to match the new HAL headers.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: fix building errors of the 64-bit targets
Chih-Wei Huang [Wed, 9 Dec 2015 10:08:39 +0000 (18:08 +0800)]
android: fix building errors of the 64-bit targets

Some functions prototypes are not declared implicitly for
the Android 6.0 64-bit targets that result in the errors:

  external/bluetooth/bluez/android/hal-ipc.c: In function 'notification_handler':
  external/bluetooth/bluez/android/hal-ipc.c:143:3: error: implicit declaration of function 'memset' [-Werror=implicit-function-declaration]
     memset(&msg, 0, sizeof(msg));
     ^
  external/bluetooth/bluez/android/log.c: In function 'init_logd':
  external/bluetooth/bluez/android/log.c:175:2: error: implicit declaration of function 'memset' [-Werror=implicit-function-declaration]
    memset(&addr, 0, sizeof(addr));
    ^

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: remove bluetooth-headers
Chih-Wei Huang [Wed, 2 Dec 2015 15:03:45 +0000 (23:03 +0800)]
android: remove bluetooth-headers

The Android build system discourages from copying headers.
Besides, it's incorrect to do actions in the make shell function.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoshared/utils: add the missing header <strings.h>
Chih-Wei Huang [Wed, 2 Dec 2015 07:21:26 +0000 (15:21 +0800)]
shared/utils: add the missing header <strings.h>

It defines the prototype of ffs() that fixes the building errors
of an Android 6.0 64-bit target.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 years agoandroid: include hciattach
Chih-Wei Huang [Fri, 17 Jul 2015 03:56:17 +0000 (11:56 +0800)]
android: include hciattach

It may be used by HCI UART devices.

8 years agoandroid: tools: add brcm_patchram_plus
Chih-Wei Huang [Mon, 6 Jul 2015 17:28:24 +0000 (01:28 +0800)]
android: tools: add brcm_patchram_plus

8 years agogdbus: Move typedefs for interwork with strict compilers
Grant Erickson [Tue, 8 Dec 2015 16:09:02 +0000 (18:09 +0200)]
gdbus: Move typedefs for interwork with strict compilers

Move enumeration type defintions AFTER the enumerations themselves are
declared and defined such that the header works with strict compilers.

This occurs when building a plugin, compiled with C++, and occurs on
all of:

arm-none-linux-gnueabi-g++ (Sourcery G++ Lite 2010q1-202) 4.4.1
arm-poky-linux-gnueabi-g++ (GCC) 4.8.2
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

8 years agogdbus: Fix Memory Leak
Saurav Babu [Tue, 1 Dec 2015 13:11:32 +0000 (15:11 +0200)]
gdbus: Fix Memory Leak

Members of data are allocated memory but not freed only data is freed

8 years agotest: Fix ftp-client not printing progress
Gowtham Anandha Babu [Wed, 2 Dec 2015 14:25:49 +0000 (19:55 +0530)]
test: Fix ftp-client not printing progress

This patch fixes the keyError while printing transfer progress.

8 years agogdbus: Drop message replies if the sender requested no reply
Philip Withnall [Wed, 2 Dec 2015 15:36:42 +0000 (15:36 +0000)]
gdbus: Drop message replies if the sender requested no reply

If the sender flags a D-Bus message as not expecting a reply, it is
against system bus policy to send a reply — sending one will result in
errors being sent to us by dbus-daemon.

Magically drop all replies to messages which request no reply.

ofonod is one process which sends BlueZ messages which request no
reply,
when it is setting up a hands-free agent.

This is not a complete fix. In an ideal world, the existing check for
G_DBUS_METHOD_FLAG_NOREPLY would be dropped, as the server should be
prepared to return a reply to every method, if the client requests and
expects one — otherwise the client will time out. However, that’s a
much
bigger change with a much bigger risk of breaking things, so I’ll stick
with this for now.

8 years agounit/test-uuid: Fix using strcmp
Luiz Augusto von Dentz [Fri, 4 Dec 2015 12:18:54 +0000 (14:18 +0200)]
unit/test-uuid: Fix using strcmp

It is no longer guaranteed the string will match since bt_uuid_to_string
now always uses 128 Bits format to be consistent with the format used
over D-Bus.

8 years agolib/uuid: Make bt_uuid_to_string always use the same format
Luiz Augusto von Dentz [Wed, 2 Dec 2015 08:49:12 +0000 (10:49 +0200)]
lib/uuid: Make bt_uuid_to_string always use the same format

The convention has been to use 128 Bits UUID strings so other types must
be converted first.

8 years agocore/device: Fix not emitting GattServices
Luiz Augusto von Dentz [Tue, 1 Dec 2015 11:22:08 +0000 (13:22 +0200)]
core/device: Fix not emitting GattServices

gatt_cache_used shall be set only when db was populated after the first
connection and shall not be affected by storage.

8 years agoHACKING: Add suppression file in valgrind cmd
Gowtham Anandha Babu [Mon, 23 Nov 2015 14:38:07 +0000 (20:08 +0530)]
HACKING: Add suppression file in valgrind cmd

Without --suppressions=./tools/valgrind.supp in valgrind cmd,
bluetoothd throws following error:

==1237== Syscall param socketcall.bind(my_addr.rc_bdaddr) points to uninitialised byte(s)
==1237==    at 0x588B227: bind (syscall-template.S:81)
==1237==    by 0x451545: logging_open (log.c:76)
==1237==    by 0x451545: __btd_log_init (log.c:314)
==1237==    by 0x40B035: main (main.c:610)
==1237==  Address 0xfff0003b6 is on thread 1's stack
==1237==  in frame #1, created by __btd_log_init (log.c:306)
==1237==  Uninitialised value was created by a stack allocation
==1237==    at 0x451490: __btd_log_init (log.c:306)
==1237==
==1237== Syscall param socketcall.bind(my_addr.rc_channel) points to uninitialised byte(s)
==1237==    at 0x588B227: bind (syscall-template.S:81)
==1237==    by 0x451545: logging_open (log.c:76)
==1237==    by 0x451545: __btd_log_init (log.c:314)
==1237==    by 0x40B035: main (main.c:610)
==1237==  Address 0xfff0003b8 is on thread 1's stack
==1237==  in frame #1, created by __btd_log_init (log.c:306)
==1237==  Uninitialised value was created by a stack allocation
==1237==    at 0x451490: __btd_log_init (log.c:306)

8 years agomonitor/a2dp: Decode LDAC capabilities
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:34 +0000 (21:20 +0100)]
monitor/a2dp: Decode LDAC capabilities

> ACL Data RX: Handle 12 flags 0x02 dlen 24
      Channel: 67 len 20 [PSM 25 mode 0] {chan 1}
      AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 2 nosp 0
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
          Media Type: Audio (0x00)
          Media Codec: Non-A2DP (0xff)
            Vendor ID: Sony Corporation (0x0000012d)
            Vendor Specific Codec ID: LDAC (0x00aa)
              Unknown: 0x073c
        Service Category: Content Protection (0x04)
          Content Protection Type: SCMS-T (0x0002)

< ACL Data TX: Handle 12 flags 0x02 dlen 26
      Channel: 2753 len 22 [PSM 25 mode 0] {chan 1}
      AVDTP: Set Configuration (0x03) Command (0x00) type 0x00 label 5 nosp 0
        ACP SEID: 5
        INT SEID: 3
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
          Media Type: Audio (0x00)
          Media Codec: Non-A2DP (0xff)
            Vendor ID: Sony Corporation (0x0000012d)
            Vendor Specific Codec ID: LDAC (0x00aa0
              Unknown: 0x0104
        Service Category: Content Protection (0x04)
          Content Protection Type: SCMS-T (0x0002)

8 years agomonitor/a2dp: Decode aptX capabilities
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:33 +0000 (21:20 +0100)]
monitor/a2dp: Decode aptX capabilities

> ACL Data RX: Handle 5 flags 0x02 dlen 23
      Channel: 65 len 19 [PSM 25 mode 0] {chan 1}
      AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 12 nosp 0
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
          Media Type: Audio (0x00)
          Media Codec: Non-A2DP (0xff)
            Vendor ID: APT Licensing Ltd. (0x0000004f)
            Vendor Specific Codec ID: aptX (0x0001)
              Frequency: 0x30
                44100
                48000
              Channel Mode: 0x02
                Stereo
        Service Category: Content Protection (0x04)
          Content Protection Type: SCMS-T (0x0002)

< ACL Data TX: Handle 5 flags 0x00 dlen 21
      Channel: 193 len 17 [PSM 25 mode 0] {chan 1}
      AVDTP: Set Configuration (0x03) Command (0x00) type 0x00 label 14 nosp 0
        ACP SEID: 3
        INT SEID: 1
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
          Media Type: Audio (0x00)
          Media Codec: Non-A2DP (0xff)
            Vendor ID: APT Licensing Ltd. (0x0000004f)
            Vendor Specific Codec ID: aptX (0x0001)
              Frequency: 48000 (0x10)
              Channel Mode: Stereo (0x02)

8 years agomonitor/a2dp: Decode AAC capabilities
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:32 +0000 (21:20 +0100)]
monitor/a2dp: Decode AAC capabilities

> ACL Data RX: Handle 12 flags 0x02 dlen 22                                                                                                                            4.565591
      Channel: 67 len 18 [PSM 25 mode 0] {chan 1}
      AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 4 nosp 0
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
          Media Type: Audio (0x00)
          Media Codec: MPEG-2,4 AAC (0x02)
            Object Type: 0xc0
              MPEG-2 AAC LC
              MPEG-4 AAC LC
            Frequency: 0x180
              44100
              48000
            Channels: 0x0c
              1
              2
            Bitrate: 320000bps
            VBR: Yes
        Service Category: Content Protection (0x04)
          Content Protection Type: SCMS-T (0x0002)

8 years agomonitor/a2dp: Decode MPEG-1,2 capabilities
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:31 +0000 (21:20 +0100)]
monitor/a2dp: Decode MPEG-1,2 capabilities

8 years agomonitor/a2dp: Decode SBC capabilities
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:30 +0000 (21:20 +0100)]
monitor/a2dp: Decode SBC capabilities

> ACL Data RX: Handle 256 flags 0x02 dlen 20                                                                                                                    [hci0] 9.242155
      Channel: 66 len 16 [PSM 25 mode 0] {chan 2}
      AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 1 nosp 0
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
          Media Type: Audio (0x00)
          Media Codec: SBC (0x00)
            Frequency: 0x30
              44100
              48000
            Channel Mode: 0x0f
              Mono
              Dual Channel
              Stereo
              Joint Channel
            Block Length: 0xf0
              4
              8
              12
              16
            Subbands: 0x0c
              4
              8
            Allocation Method: 0x03
              SNR
              Loudness
            Minimum Bitpool: 2
            Maximum Bitpool: 53
        Service Category: Content Protection (0x04)
          Content Protection Type: SCMS-T (0x0002)

< ACL Data TX: Handle 256 flags 0x00 dlen 18                                                                                                                    [hci0] 9.272120
      Channel: 258 len 14 [PSM 25 mode 0] {chan 2}
      AVDTP: Set Configuration (0x03) Command (0x00) type 0x00 label 5 nosp 0
        ACP SEID: 1
        INT SEID: 3
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
          Media Type: Audio (0x00)
          Media Codec: SBC (0x00)
            Frequency: 44100 (0x20)
            Channel Mode: Joint Channel (0x01)
            Block Length: 16 (0x10)
            Subbands: 8 (0x04)
            Allocation Method: Loudness (0x01)
            Minimum Bitpool: 2
            Maximum Bitpool: 53

8 years agomonitor/avdtp: Decode basic Content Protection capabilities
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:29 +0000 (21:20 +0100)]
monitor/avdtp: Decode basic Content Protection capabilities

> ACL Data RX: Handle 256 flags 0x02 dlen 20
      Channel: 66 len 16 [PSM 25 mode 0] {chan 2}
      AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 1 nosp 0
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
          Media Type: Audio (0x00)
          Media Codec: SBC (0x00)
        3f ff 02 35                                      ?..5
        Service Category: Content Protection (0x04)
          Content Protection Type: SCMS-T (0x0002)

8 years agomonitor/avdtp: Decode basic Media Codec capabilities
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:28 +0000 (21:20 +0100)]
monitor/avdtp: Decode basic Media Codec capabilities

> ACL Data RX: Handle 256 flags 0x02 dlen 20
      Channel: 66 len 16 [PSM 25 mode 0] {chan 2}
      AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 1 nosp 0
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
          Media Type: Audio (0x00)
          Media Codec: SBC (0x00)
        3f ff 02 35                                      ?..5
        Service Category: Content Protection (0x04)
        02 00                                            ..

8 years agomonitor/avdtp: Decode AVDTP_DELAYREPORT
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:27 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_DELAYREPORT

8 years agomonitor/avdtp: Decode AVDTP_GET_ALL_CAPABILITIES
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:26 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_GET_ALL_CAPABILITIES

< ACL Data TX: Handle 256 flags 0x00 dlen 7
      Channel: 832 len 3 [PSM 25 mode 0] {chan 0}
      AVDTP: Get All Capabilities (0x0c) Command (0x00) type 0x00 label 1 nosp 0
        ACP SEID: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 20
      Channel: 64 len 16 [PSM 25 mode 0] {chan 0}
      AVDTP: Get All Capabilities (0x0c) Response Accept (0x02) type 0x00 label 1 nosp 0
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
        00 00 3f ff 02 35                                ..?..5
        Service Category: Content Protection (0x04)
        02 00                                            ..

8 years agomonitor/avdtp: Decode AVDTP_SECURITY_CONTROL
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:25 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_SECURITY_CONTROL

8 years agomonitor/avdtp: Decode AVDTP_ABORT
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:24 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_ABORT

> ACL Data RX: Handle 256 flags 0x02 dlen 7
      Channel: 66 len 3 [PSM 25 mode 0] {chan 2}
      AVDTP: Abort (0x0a) Command (0x00) type 0x00 label 3 nosp 0
        ACP SEID: 3
< ACL Data TX: Handle 256 flags 0x00 dlen 6
      Channel: 258 len 2 [PSM 25 mode 0] {chan 2}
      AVDTP: Abort (0x0a) Response Accept (0x02) type 0x00 label 3 nosp 0

8 years agomonitor/avdtp: Decode AVDTP_SUSPEND
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:23 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_SUSPEND

< ACL Data TX: Handle 256 flags 0x00 dlen 7
      Channel: 258 len 3 [PSM 25 mode 0] {chan 2}
      AVDTP: Suspend (0x09) Command (0x00) type 0x00 label 8 nosp 0
        ACP SEID: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 6
      Channel: 66 len 2 [PSM 25 mode 0] {chan 2}
      AVDTP: Suspend (0x09) Response Accept (0x02) type 0x00 label 8 nosp 0

8 years agomonitor/avdtp: Decode AVDTP_CLOSE
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:22 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_CLOSE

< ACL Data TX: Handle 12 flags 0x02 dlen 7
      Channel: 2753 len 3 [PSM 25 mode 0] {chan 1}
      AVDTP: Close (0x08) Command (0x00) type 0x00 label 8 nosp 0
        ACP SEID: 5
> ACL Data RX: Handle 12 flags 0x02 dlen 6
      Channel: 67 len 2 [PSM 25 mode 0] {chan 1}
      AVDTP: Close (0x08) Response Accept (0x02) type 0x00 label 8 nosp 0

8 years agomonitor/avdtp: Decode AVDTP_START
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:21 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_START

< ACL Data TX: Handle 256 flags 0x00 dlen 7
      Channel: 258 len 3 [PSM 25 mode 0] {chan 2}
      AVDTP: Start (0x07) Command (0x00) type 0x00 label 7 nosp 0
        ACP SEID: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 6
      Channel: 66 len 2 [PSM 25 mode 0] {chan 2}
      AVDTP: Start (0x07) Response Accept (0x02) type 0x00 label 7 nosp 0

8 years agomonitor/avdtp: Decode AVDTP_OPEN
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:20 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_OPEN

< ACL Data TX: Handle 256 flags 0x00 dlen 7
      Channel: 258 len 3 [PSM 25 mode 0] {chan 2}
      AVDTP: Open (0x06) Command (0x00) type 0x00 label 6 nosp 0
        ACP SEID: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 6
      Channel: 66 len 2 [PSM 25 mode 0] {chan 2}
      AVDTP: Open (0x06) Response Accept (0x02) type 0x00 label 6 nosp 0

8 years agomonitor/avdtp: Decode AVDTP_RECONFIGURE
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:19 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_RECONFIGURE

8 years agomonitor/avdtp: Decode AVDTP_GET_CONFIGURATION
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:18 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_GET_CONFIGURATION

8 years agomonitor/avdtp: Decode AVDTP_SET_CONFIGURATION
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:17 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_SET_CONFIGURATION

< ACL Data TX: Handle 256 flags 0x00 dlen 18
      Channel: 258 len 14 [PSM 25 mode 0] {chan 2}
      AVDTP: Set Configuration (0x03) Command (0x00) type 0x00 label 5 nosp 0
        ACP SEID: 1
        INT SEID: 3
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
        00 00 21 15 02 35                                ..!..5
> ACL Data RX: Handle 256 flags 0x02 dlen 6
      Channel: 66 len 2 [PSM 25 mode 0] {chan 2}
      AVDTP: Set Configuration (0x03) Response Accept (0x02) type 0x00 label 5 nosp 0

8 years agomonitor/avdtp: Decode AVDTP_GET_CAPABILITIES
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:16 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_GET_CAPABILITIES

< ACL Data TX: Handle 256 flags 0x00 dlen 7
      Channel: 258 len 3 [PSM 25 mode 0] {chan 2}
      AVDTP: Get Capabilities (0x02) Command (0x00) type 0x00 label 1 nosp 0
        ACP SEID: 1
> ACL Data RX: Handle 256 flags 0x02 dlen 20
      Channel: 66 len 16 [PSM 25 mode 0] {chan 2}
      AVDTP: Get Capabilities (0x02) Response Accept (0x02) type 0x00 label 1 nosp 0
        Service Category: Media Transport (0x01)
        Service Category: Media Codec (0x07)
        00 00 3f ff 02 35                                ..?..5
        Service Category: Content Protection (0x04)
        02 00                                            ..

8 years agomonitor/avdtp: Decode AVDTP_DISCOVER
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:15 +0000 (21:20 +0100)]
monitor/avdtp: Decode AVDTP_DISCOVER

< ACL Data TX: Handle 256 flags 0x00 dlen 6
      Channel: 258 len 2 [PSM 25 mode 0] {chan 2}
      AVDTP: Discover (0x01) Command (0x00) type 0x00 label 0 nosp 0
> ACL Data RX: Handle 256 flags 0x02 dlen 14
      Channel: 66 len 10 [PSM 25 mode 0] {chan 2}
      AVDTP: Discover (0x01) Response Accept (0x02) type 0x00 label 0 nosp 0
        ACP SEID: 1
          Media Type: Audio (0x00)
          SEP Type: SRC (0x01)
          In use: No
        ACP SEID: 5
          Media Type: Audio (0x00)
          SEP Type: SRC (0x01)
          In use: No
        ACP SEID: 3
          Media Type: Audio (0x00)
          SEP Type: SRC (0x01)
          In use: No
        ACP SEID: 2
          Media Type: Audio (0x00)
          SEP Type: SRC (0x01)
          In use: No

8 years agomonitor/avdtp: Add basic decoding of AVDTP signalling
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:14 +0000 (21:20 +0100)]
monitor/avdtp: Add basic decoding of AVDTP signalling

< ACL Data TX: Handle 256 flags 0x00 dlen 6
      Channel: 258 len 2 [PSM 25 mode 0] {chan 2}
      AVDTP: Discover (0x01) Command (0x00) type 0x00 label 0 nosp 0
> ACL Data RX: Handle 256 flags 0x02 dlen 14
      Channel: 66 len 10 [PSM 25 mode 0] {chan 2}
      AVDTP: Discover (0x01) Response Accept (0x02) type 0x00 label 0 nosp 0
        04 08 14 08 0c 08 08 08                          ........

8 years agomonitor/l2cap: Add channel sequence number
Andrzej Kaczmarek [Sun, 22 Nov 2015 20:20:13 +0000 (21:20 +0100)]
monitor/l2cap: Add channel sequence number

This patch adds sequence number to channels structure which determines
order in which channels for the same PSM were created. It will be used
for protocols like AVDTP where there is single PSM used for multiple
channels and order it which they were created is important.

8 years agoagent: Change default IO capability to KeyboardDisplay
Johan Hedberg [Wed, 25 Nov 2015 12:20:03 +0000 (14:20 +0200)]
agent: Change default IO capability to KeyboardDisplay

The intention of the DisplayYesNo default capability was originally to
provide the richest possible option available. However with LE there
is a new even more capable option, namely KeyboardDisplay. When
applied to BR/EDR connections this gets implicitly downgraded to
DisplayYesNo since KeyboardDisplay is LE-specific.

8 years agomonitor: Fix possible crash on unknown LE Meta Event
Szymon Janc [Sat, 21 Nov 2015 20:09:04 +0000 (21:09 +0100)]
monitor: Fix possible crash on unknown LE Meta Event

For unknown LE Meta Event subevent_data passed to print_subevent is
NULL. This results in NULL pointer dereference when subeven code is
printed. Fix that by making print_subevent expect always valid
subevent_data and handle unknown event in caller.

8 years agomonitor: Fix use of uninitialized variable
Szymon Janc [Sat, 21 Nov 2015 20:09:03 +0000 (21:09 +0100)]
monitor: Fix use of uninitialized variable

subevent code was never set in vendor_evt() resulting in printing
random stack data as subevent opcode in print_subevent().

8 years agotools/mgmt-tester: Add power on testcase with adv and privacy
Andrzej Kaczmarek [Thu, 12 Nov 2015 20:43:07 +0000 (21:43 +0100)]
tools/mgmt-tester: Add power on testcase with adv and privacy

This test verifies if kernel can properly enable advertising during
power on with privacy also enabled. This requires to generate new RPA
which will fail if not done after SMP is registered. As a consequence
advertising is not enabled in controller which means it cannot be also
disabled (controller will reject HCI command).

8 years agocore: Fix replying with an error for connected profile
Luiz Augusto von Dentz [Thu, 19 Nov 2015 11:36:20 +0000 (13:36 +0200)]
core: Fix replying with an error for connected profile

If the profile(s) is already connected don't reply with an error, if the
profile is in fact connecting already just wait until it completes.

8 years agotools: Add support for Get Advertising Size Information command
Marcel Holtmann [Mon, 23 Nov 2015 13:09:44 +0000 (14:09 +0100)]
tools: Add support for Get Advertising Size Information command

8 years agolib: Add data structures for Get Advertising Size Information command
Marcel Holtmann [Mon, 23 Nov 2015 13:09:03 +0000 (14:09 +0100)]
lib: Add data structures for Get Advertising Size Information command

8 years agodoc: Mention the management version 1.11 information
Marcel Holtmann [Mon, 23 Nov 2015 13:08:18 +0000 (14:08 +0100)]
doc: Mention the management version 1.11 information

8 years agotools/mgmt-tester: Fix minor typo
Johan Hedberg [Mon, 23 Nov 2015 10:41:37 +0000 (12:41 +0200)]
tools/mgmt-tester: Fix minor typo

8 years agotools/mgmt-tester: Simplify command result log
Johan Hedberg [Mon, 23 Nov 2015 10:22:10 +0000 (12:22 +0200)]
tools/mgmt-tester: Simplify command result log

8 years agolib/mgmt: Update string tables
Johan Hedberg [Mon, 23 Nov 2015 08:41:04 +0000 (10:41 +0200)]
lib/mgmt: Update string tables

8 years agotools/mgmt-tester: Take advantage of mgmt string helpers
Johan Hedberg [Mon, 23 Nov 2015 08:36:02 +0000 (10:36 +0200)]
tools/mgmt-tester: Take advantage of mgmt string helpers

8 years agobuild: Link mcaptest with -lrt
John Keeping [Tue, 17 Nov 2015 15:21:11 +0000 (15:21 +0000)]
build: Link mcaptest with -lrt

profiles/health/mcap.c uses clock_gettime(3) so it needs to be linked
with -lrt on some systems.

8 years agodoc: Fix missing field for Get Advertising Size Information response
Marcel Holtmann [Fri, 20 Nov 2015 05:41:49 +0000 (06:41 +0100)]
doc: Fix missing field for Get Advertising Size Information response

8 years agomonitor: Add missing Intel Startup event
Marcel Holtmann [Thu, 19 Nov 2015 20:21:45 +0000 (21:21 +0100)]
monitor: Add missing Intel Startup event

8 years agodoc: Add description for Add Advertising Size Information command
Marcel Holtmann [Thu, 19 Nov 2015 14:26:20 +0000 (15:26 +0100)]
doc: Add description for Add Advertising Size Information command

8 years agoAUTHORS: Update Szymon, Łukasz and Andrzej emails
Szymon Janc [Tue, 17 Nov 2015 20:26:56 +0000 (21:26 +0100)]
AUTHORS: Update Szymon, Łukasz and Andrzej emails

Szymon, Łukasz and Andrzej are now working for CODECOUP.

8 years agotest/test-discovery: Remove dead code
Łukasz Rymanowski [Mon, 16 Nov 2015 20:58:13 +0000 (21:58 +0100)]
test/test-discovery: Remove dead code

PropertyChanged is left over from BlueZ 4.x now it is PropertiesChanged.
However in this test it does not make sense to register for this signal
as StopDiscovery is never called from this test.

8 years agodoc/adapter-api: Use correct signal name
Łukasz Rymanowski [Mon, 16 Nov 2015 20:58:12 +0000 (21:58 +0100)]
doc/adapter-api: Use correct signal name

8 years agoemulator/hciemu: Fix return value
Gowtham Anandha Babu [Mon, 16 Nov 2015 13:12:40 +0000 (18:42 +0530)]
emulator/hciemu: Fix return value

make throws out the following errors.

emulator/hciemu.c: In function ‘hciemu_get_master_scan_enable’:
emulator/hciemu.c:433:3: error: return makes integer from pointer without a cast [-Werror]
   return NULL;
   ^
emulator/hciemu.c: In function ‘hciemu_get_master_le_scan_enable’:
emulator/hciemu.c:441:3: error: return makes integer from pointer without a cast [-Werror]
   return NULL;
   ^
cc1: all warnings being treated as errors

Fixed by returning zero.

8 years agotools/mgmt-tester: Wait before checking BR/EDR scan state
Johan Hedberg [Mon, 16 Nov 2015 10:31:18 +0000 (12:31 +0200)]
tools/mgmt-tester: Wait before checking BR/EDR scan state

Like the LE scan state, recent kernels moved to updating the BR/EDR
scan state for Add/Remove Device independent from the mgmt command
completion. We should therefore update the corresponding mgmt-tester
cases to wait a bit before making a test result conclusion.

8 years agoemulator: Add API to get BR/EDR scan_enable value
Johan Hedberg [Mon, 16 Nov 2015 10:26:13 +0000 (12:26 +0200)]
emulator: Add API to get BR/EDR scan_enable value

8 years agoemulator: Return raw LE scan_enable value
Johan Hedberg [Mon, 16 Nov 2015 10:22:46 +0000 (12:22 +0200)]
emulator: Return raw LE scan_enable value

This is more future proof (in case other values besides 0x00/0x01 are
introduced) and consistent with a similar BR/EDR API that will be
added soon.

8 years agotools/l2cap-tester: Fix minor coding style issue (line lengths)
Johan Hedberg [Mon, 16 Nov 2015 10:22:19 +0000 (12:22 +0200)]
tools/l2cap-tester: Fix minor coding style issue (line lengths)

8 years agotools/hcidump: Print LDAC vendor codec name
Andrzej Kaczmarek [Fri, 13 Nov 2015 10:59:41 +0000 (11:59 +0100)]
tools/hcidump: Print LDAC vendor codec name

8 years agotools/avinfo: Print content protection
Andrzej Kaczmarek [Fri, 13 Nov 2015 10:59:40 +0000 (11:59 +0100)]
tools/avinfo: Print content protection

8 years agotools/avinfo: Add partial support for Sony LDAC
Andrzej Kaczmarek [Fri, 13 Nov 2015 10:59:39 +0000 (11:59 +0100)]
tools/avinfo: Add partial support for Sony LDAC

Contents of Vendor Specific Value in codec information is unknown at
the moment so only raw value is printed.

8 years agomonitor/rfcomm: Fix names formatting
Andrzej Kaczmarek [Sat, 14 Nov 2015 13:35:06 +0000 (14:35 +0100)]
monitor/rfcomm: Fix names formatting

8 years agomonitor/avctp: Fix typos
Andrzej Kaczmarek [Sat, 14 Nov 2015 12:28:57 +0000 (13:28 +0100)]
monitor/avctp: Fix typos

8 years agoinput/hog: Fix not reseting queue to NULL after destroying it
Luiz Augusto von Dentz [Fri, 13 Nov 2015 15:48:48 +0000 (17:48 +0200)]
input/hog: Fix not reseting queue to NULL after destroying it

This can cause crashes as the data pointed by devices if a new device is
probed it would most likely access invalid memory.

8 years agoandroid/README: Fix typo
Andrzej Kaczmarek [Fri, 13 Nov 2015 10:46:08 +0000 (11:46 +0100)]
android/README: Fix typo

8 years agoandroid/README: Update links to BfA on GitHub
Andrzej Kaczmarek [Fri, 13 Nov 2015 10:46:07 +0000 (11:46 +0100)]
android/README: Update links to BfA on GitHub

Since code.google.com is now read-only, sample implementation of BfA is
moved to GitHub. README is updated with new links.

8 years agoinput/hog-lib: Print report value handle and type
Luiz Augusto von Dentz [Thu, 12 Nov 2015 15:03:20 +0000 (17:03 +0200)]
input/hog-lib: Print report value handle and type

This adds better debug logs when discovering report type.

8 years agoinput/hog: Make use of hog-lib
Luiz Augusto von Dentz [Wed, 11 Nov 2015 13:49:07 +0000 (15:49 +0200)]
input/hog: Make use of hog-lib

This changes the input plugin to use hog-lib so the same code is used in
both D-Bus daemon, Android and unit tests.

8 years agohog: Move code from android to profiles
Luiz Augusto von Dentz [Wed, 11 Nov 2015 11:39:51 +0000 (13:39 +0200)]
hog: Move code from android to profiles

This is a place holder until the code is ported to use shared API so it
can be shared by android and D-Bus daemon.

8 years agodis: Move code from android to profiles
Luiz Augusto von Dentz [Wed, 11 Nov 2015 11:26:11 +0000 (13:26 +0200)]
dis: Move code from android to profiles

This is a place holder until the code is ported to use shared API so it
can be shared by android and D-Bus daemon.

8 years agoscpp: Move code from android to profiles
Luiz Augusto von Dentz [Wed, 11 Nov 2015 11:17:33 +0000 (13:17 +0200)]
scpp: Move code from android to profiles

This is a place holder until the code is ported to use shared API so it
can be shared by android and D-Bus daemon.

8 years agobas: Move code from android to profiles
Luiz Augusto von Dentz [Wed, 11 Nov 2015 11:08:52 +0000 (13:08 +0200)]
bas: Move code from android to profiles

This is a place holder until the code is ported to use shared API so it
can be shared by android and D-Bus daemon.

8 years agoandroid/hog: Port fixes to profiles HoG
Luiz Augusto von Dentz [Wed, 11 Nov 2015 10:23:19 +0000 (12:23 +0200)]
android/hog: Port fixes to profiles HoG

This align the 2 copies of Hog since the plan is to merge android
version back to profiles and just reuse from there.

The fix for incomplete discover is modified so the reports are keep
while attempting to discover.

8 years agoshared/att: Use smaller defines
Luiz Augusto von Dentz [Mon, 9 Nov 2015 16:39:07 +0000 (18:39 +0200)]
shared/att: Use smaller defines

Not every term of the command needs to be part of the define as it make
them awful long.

8 years agoshared/att: Fix going over 80 columns
Luiz Augusto von Dentz [Mon, 9 Nov 2015 16:30:39 +0000 (18:30 +0200)]
shared/att: Fix going over 80 columns

This fixes lines that are over 80 columns by renaming op_type to just
type so it doesn't turn into multi line either.

8 years agocore/device: Fix not responding to Connect
Luiz Augusto von Dentz [Mon, 9 Nov 2015 12:37:38 +0000 (14:37 +0200)]
core/device: Fix not responding to Connect

If profile is removed while its connection is pending it may not respond
to Connect method and not cleaning up properly leaving dev->connect set
which will prevent any attempt to connect to the device again.

8 years agoclient: Fix printing selcted device prompt
Johan Hedberg [Fri, 13 Nov 2015 11:15:52 +0000 (13:15 +0200)]
client: Fix printing selcted device prompt

8 years agoclient: Fix crash when exiting
Luiz Augusto von Dentz [Thu, 12 Nov 2015 14:13:33 +0000 (16:13 +0200)]
client: Fix crash when exiting

When exiting the available proxies are destroy in the same order they are
added causing the following crash when there are attributes whose service
has already been removed:

Invalid read of size 8
   at 0x414AAD: g_dbus_proxy_get_path (client.c:525)
   by 0x40B948: characteristic_is_child (gatt.c:136)
   by 0x40C420: gatt_remove_characteristic (gatt.c:157)
   by 0x4067A7: proxy_removed (main.c:446)
   by 0x414A2E: proxy_free (client.c:439)
   by 0x4E7AF6C: g_list_foreach (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x4E7AF8A: g_list_free_full (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x415D54: g_dbus_client_unref (client.c:1310)
   by 0x40511B: main (main.c:2067)
 Address 0x5eb5450 is 16 bytes inside a block of size 80 free'd
   at 0x4C29D6A: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E8479E: g_free (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x4149D6: g_dbus_proxy_unref (client.c:517)
   by 0x414A8D: proxy_free (client.c:451)
   by 0x4E7AF6C: g_list_foreach (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x4E7AF8A: g_list_free_full (in /usr/lib64/libglib-2.0.so.0.4400.1)
   by 0x415D54: g_dbus_client_unref (client.c:1310)
   by 0x40511B: main (main.c:2067)

8 years agocore/gatt-client: Fix warning when removing services
Luiz Augusto von Dentz [Wed, 11 Nov 2015 13:40:56 +0000 (15:40 +0200)]
core/gatt-client: Fix warning when removing services

This fixes the following warnings caused by not resetting id to 0:

GLib-CRITICAL **: Source ID 145 was not found when attempting to remove it
GLib-CRITICAL **: Source ID 151 was not found when attempting to remove it
GLib-CRITICAL **: Source ID 155 was not found when attempting to remove it
GLib-CRITICAL **: Source ID 162 was not found when attempting to remove it

8 years agotools/l2cap-tester: Fix NULL-dereference for tests with no data
Johan Hedberg [Thu, 12 Nov 2015 12:45:59 +0000 (14:45 +0200)]
tools/l2cap-tester: Fix NULL-dereference for tests with no data

8 years agoclient: Make GATT listing more readable
Johan Hedberg [Thu, 12 Nov 2015 11:21:08 +0000 (13:21 +0200)]
client: Make GATT listing more readable

8 years agotools/l2cap-tester: Minor whitespace fix
Johan Hedberg [Thu, 12 Nov 2015 10:36:32 +0000 (12:36 +0200)]
tools/l2cap-tester: Minor whitespace fix

8 years agodoc/test-coverage: Update l2cap-tester test count
Johan Hedberg [Thu, 12 Nov 2015 10:33:43 +0000 (12:33 +0200)]
doc/test-coverage: Update l2cap-tester test count

8 years agotools/l2cap-tester: Add test case for direct advertising
Johan Hedberg [Thu, 12 Nov 2015 10:33:16 +0000 (12:33 +0200)]
tools/l2cap-tester: Add test case for direct advertising

8 years agoandroid/log: Fix compilation error in AOSP
Andrzej Kaczmarek [Wed, 11 Nov 2015 18:09:51 +0000 (19:09 +0100)]
android/log: Fix compilation error in AOSP

btd_debug() has new parameter introduced in dcfdc556.

8 years agotools/l2cap-tester: Fix expected LE CoC conn rsp parameters
Johan Hedberg [Thu, 12 Nov 2015 09:15:54 +0000 (11:15 +0200)]
tools/l2cap-tester: Fix expected LE CoC conn rsp parameters

8 years agoemulator: Fix sending valid HCI_LE_Create_Connection parameters
Johan Hedberg [Thu, 12 Nov 2015 09:08:34 +0000 (11:08 +0200)]
emulator: Fix sending valid HCI_LE_Create_Connection parameters

8 years agomonitor: Update UUID strings to latest versions
Marcel Holtmann [Thu, 12 Nov 2015 08:14:44 +0000 (09:14 +0100)]
monitor: Update UUID strings to latest versions

8 years agotools/l2cap-tester: Don't treat unexpected L2CAP PDUs as failures
Johan Hedberg [Wed, 11 Nov 2015 18:41:00 +0000 (20:41 +0200)]
tools/l2cap-tester: Don't treat unexpected L2CAP PDUs as failures

8 years agocore: Use daemon specific GLib logging handling for backtraces
Marcel Holtmann [Wed, 11 Nov 2015 14:09:02 +0000 (15:09 +0100)]
core: Use daemon specific GLib logging handling for backtraces

8 years agocore: Add function for logging with priority information
Marcel Holtmann [Wed, 11 Nov 2015 14:08:19 +0000 (15:08 +0100)]
core: Add function for logging with priority information

8 years agotools/mgmt-tester: Fix Remove Device tests for LE
Johan Hedberg [Wed, 11 Nov 2015 08:52:15 +0000 (10:52 +0200)]
tools/mgmt-tester: Fix Remove Device tests for LE

The timing of Add/Remove device is different in recent kernels so that
if they are sent in rapid succession no HCI command will be sent at
all. Since the relevant thing is that LE scan is disabled after the
test add a timeout to verify this instead of waiting for a specific
HCI command.

8 years agodoc/test-coverage: Update l2cap-tester test count
Johan Hedberg [Wed, 11 Nov 2015 08:00:59 +0000 (10:00 +0200)]
doc/test-coverage: Update l2cap-tester test count

8 years agotools/l2cap-tester connect two sockets disconnect one test
Jakub Pawlowski [Wed, 11 Nov 2015 06:36:30 +0000 (22:36 -0800)]
tools/l2cap-tester connect two sockets disconnect one test

This test open two sockets to same client, then close first one and make
sure second one connect successfully.

8 years agotools/l2cap-tester: Two socket connect test
Jakub Pawlowski [Wed, 11 Nov 2015 06:36:29 +0000 (22:36 -0800)]
tools/l2cap-tester: Two socket connect test

This test tries to open two sockets to same address, to make sure
both would succeed.

8 years agotools/l2cap-tester: Disconnect during connect attempt test
Jakub Pawlowski [Wed, 11 Nov 2015 06:36:28 +0000 (22:36 -0800)]
tools/l2cap-tester: Disconnect during connect attempt test

This patch adds test that checks folowing:
1. Try to connect to existing BLE device that is not advertising.
2. Internally in kernel this adds this device to whitelist and enable scan.
3. Make the device advertise once. That would stop the scan, and trigger
   connect attempt to device.
4. Close socket. This should stop the connect attempt, by sending
   BT_HCI_CMD_LE_CREATE_CONN_CANCEL.

8 years agotools/l2cap-tester: add close socket test
Jakub Pawlowski [Wed, 11 Nov 2015 06:36:27 +0000 (22:36 -0800)]
tools/l2cap-tester: add close socket test

This patch adds test that checks folowing:
1. Try to connect to non-existing remote BLE device using socket.
2. Internally in kernel this adds this device to whitelist and enable scan.
3. At this moment test would try to close socket.
4. That should cause scan to be stopped.

8 years agoemulator: add support for checking le scan state
Jakub Pawlowski [Wed, 11 Nov 2015 06:36:26 +0000 (22:36 -0800)]
emulator: add support for checking le scan state