Commit Graph

19070 Commits

Author SHA1 Message Date
Andrzej Kaczmarek
fd00c597a7 shared: Fix queue_find to accept const ptr as match data
This patch fixes queue_find definition to have const pointer as data to
be matched against. Match function already does have const pointers as
arguments. Also parameter name is updated to be 'match_data' since this
actually is not user_data, just data to be matched against.
2014-05-21 10:16:01 +03:00
Lukasz Rymanowski
9a9f6acc06 android/gatt: Fix handling write cmd
We should not response on write cmd. This patch fixed that.
2014-05-20 23:55:07 +02:00
Jakub Tyszkowski
fcb22276d9 android/gatt: Fix possible invalid read
Fix dereferencing attrib before checking if not null.
2014-05-20 22:31:46 +02:00
Sebastian Chlad
9fbe1bc021 android/pts: Re-run all GATT PTS tests 2014-05-20 21:02:32 +02:00
Sebastian Chlad
2b9aa9fd3a android/pts: Adjust PICS for GATT
As we do not support SDP record for GATT we shall disable
respective PICS (6/3). Moreover patch disables support for
Attribute Protocol over BR/EDR.
2014-05-20 21:02:32 +02:00
Andrzej Kaczmarek
fbf5f5819a tools/mgmt-tester: Add "Get Conn Info - Not Connected" 2014-05-20 21:55:15 +03:00
Andrzej Kaczmarek
a168191dce tools/mgmt-tester: Add "Get Conn Info - Success" 2014-05-20 21:55:15 +03:00
Andrzej Kaczmarek
f5b1a7289a emulator/btdev: Add support for Read TX Power command 2014-05-20 21:55:14 +03:00
Andrzej Kaczmarek
5d1d3dc192 emulator/btdev: Add support for Read RSSI command 2014-05-20 21:55:14 +03:00
Sebastian Chlad
9948b56018 android/pts: Run MPS PTS tests 2014-05-20 20:13:28 +02:00
Lukasz Rymanowski
8a2166b1a5 android/gatt: Use connect_confirm on incoming connection
This is in order to reuse connect_cb for incoming and outgoing
connections. Also it makes code cleaner.
2014-05-20 20:13:28 +02:00
Marcin Kraglak
06351304fa android/gatt: Don't response with error for NOTIFICATION and INDICATION
We shouldn't response for these commands, as they will be serviced
in client implementation.
2014-05-20 20:13:28 +02:00
Marcel Holtmann
261b1f6542 doc: Add crypto unit tests to test coverage details 2014-05-20 07:38:25 -07:00
Lukasz Rymanowski
a257810878 unit: Add test case for AES-CMAC-128
Test vectors taken from the NIST Special Publication 800-38B
(http://csrc.nist.gov/publications/PubsSPs.html)
2014-05-20 14:54:30 +03:00
Lukasz Rymanowski
50830f476a shared/crypto: Add support to sign data with AES-CMAC
This patch adds support to generate hash using AES-CMAC algorithm
2014-05-20 14:54:29 +03:00
Lukasz Rymanowski
810eba69ec shared/crypto: Add support for AES-CMAC-128
This patch extends bt_crypto with AF_ALG socket for cmac(aes) hash.
Socket is created on bt_crybto initialization.
2014-05-20 14:54:29 +03:00
Johan Hedberg
d33546d729 smp-tester: Update invalid request test to use correct response
Recent kernels will return the correct Invalid Parameters (0x0a)
response instead of the Unspecified Reason (0x08) response.
2014-05-20 09:21:57 +03:00
Marcel Holtmann
95f338a7fa Release 5.19 2014-05-19 12:11:13 -07:00
Szymon Janc
4f9577e675 core: Improve handling of unpaired event
Unpaired event is per bearer and and bluetoothd should unpair device
only on that bearer.
2014-05-19 20:40:31 +03:00
Marcel Holtmann
547ddef35c build: Update library version 2014-05-19 09:08:30 -07:00
Luiz Augusto von Dentz
8cf946adb0 doc: Update test coverage numbers 2014-05-19 16:20:56 +03:00
Luiz Augusto von Dentz
d5a247053d unit/test-avrcp: Add /TP/VLH/BI-02-C test
To verify the behavior of the TG receiving a SetAbsoluteVolume command
with the top level bit set.
2014-05-19 16:12:54 +03:00
Luiz Augusto von Dentz
d4a3119903 unit/test-avrcp: Add /TP/VLH/BI-01-C test
To verify the behavior of the TG receiving an invalid SetAbsoluteVolume
command.
2014-05-19 16:12:54 +03:00
Luiz Augusto von Dentz
cf52741577 unit/test-avrcp: Add /TP/VLH/BV-02-C test
To verify the behavior of the TG receiving a valid SetAbsoluteVolume
command.
2014-05-19 16:12:53 +03:00
Luiz Augusto von Dentz
b6bc216fd7 unit/test-avrcp: Add /TP/VLH/BV-01-C test
To verify the SetAbsoluteVolume command issued by the CT.
2014-05-19 16:12:53 +03:00
Luiz Augusto von Dentz
49e49b00dc android/avrcp-lib: Add support for SetAbsoluteVolume PDU 2014-05-19 16:12:47 +03:00
Andrzej Kaczmarek
86a7a090e4 tools/mgmt-tester: Fix "Pair Device - SSP Confirm Reject 1"
With changes introduced in kernel by 6fd6b915 we no longer require MITM
when being pairing initiator (i.e. we indicate it to remote but do not
force it when remote does not require it) thus kernel will auto-accept
pairing when remote also does not require MITM. As a result it's not
possible for tester to reject user confirmation since there's no
request from kernel.

This patch sets acceptor authentication requirements to include MITM
so we'll have user confirmation request and tester can reject it.
2014-05-19 14:14:21 +03:00
Andrzej Kaczmarek
1a4cb1a207 emulator/bthost: Add support to set auth_req for bthost
This patch makes possible to set Authentication_Requirements to be used
in io_capa_request_reply when replying for io_capa_request_evt.
2014-05-19 14:14:14 +03:00
Szymon Janc
889c3c03ad android/bluetooth: Simplify check if device type changed
This makes code easier to follow. Also LE address type is not lost
if dual mode device connected over BR/EDR.
2014-05-19 10:17:25 +02:00
Szymon Janc
00d7691055 android/bluetooth: Track if paired device is bonded
This is a preparation for correctly handling no bond pairing.

Currently paired but not bonded devices are left on list of bonded
devices in Framework until BT is restarted on device. This is due to
Android Framework is not allowing stack to unpair device by its own
(setting bond state bonded->no_bond is ignored).
2014-05-19 10:17:25 +02:00
Szymon Janc
b9d6d37fd5 android/bluetooth: Fix unpairing dual mode device
If device is paired on LE and BR/EDR it should be unpaired on both
bearers.
2014-05-19 10:17:25 +02:00
Szymon Janc
033024822b android/bluetooth: Fix pairing of dual mode devices
It is possible that dual mode device is paired both for LE and BR/EDR
link. This patch add tracking of this.

Due to HAL API contraints second pairing will result in following bond
state changed events:
bonded -> bonding (success) -> bonded (success/failed)
2014-05-19 10:17:25 +02:00
Szymon Janc
8911e43cb0 android/bluetooth: Track device last connected bearer
This allows to correctly choose address type when pairing dual mode
devices.
2014-05-19 10:17:25 +02:00
Andrzej Kaczmarek
2c2262cf66 android/gatt: Add proper read_remote_rssi implementation 2014-05-19 10:10:33 +02:00
Andrzej Kaczmarek
c3364dee4a android/bluetooth: Add support to read connection RSSI 2014-05-19 10:10:33 +02:00
Lukasz Rymanowski
3afaef7655 tools: Add conn-info to btmgmt 2014-05-19 08:21:35 +03:00
Andrzej Kaczmarek
62e9043c16 lib: Add definitions for Get Connection Information command 2014-05-19 08:21:35 +03:00
Szymon Janc
0ae116b187 android/pts: Keep PTS GAP results style consistent
If test is not pass due to missing feature mark it as INC and use
appropriate comment.
2014-05-18 22:10:16 +02:00
Sebastian Chlad
34b1129381 android/pts: Re-run PTS GAP tests 2014-05-18 14:07:07 +02:00
Szymon Janc
dfb5e49ee0 android/gatt: Add stub for setting advertising data
Currently kernel is lacking support for fine grained configuration of
advertising data but this is ignored for now.

Vendor data is not supported and if it is to be set command will fail.
This should be implemented when kernel support is added.
2014-05-18 14:03:44 +02:00
Jakub Tyszkowski
c75e5374f7 android/hal: Fix not seting mode in health hal
This fixes the following issue:
==8505== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to
uninitialised byte(s)
==8505==    at 0x534133D: ??? (syscall-template.S:82)
==8505==    by 0x7756346: hal_ipc_cmd (hal-ipc.c:359)
==8505==    by 0x7750EB2: init (hal-health.c:206)
==8505==    by 0x40DF7F: init_p (if-hl.c:86)
==8505==    by 0x401961: main (haltest.c:417)
==8505==  Address 0x7fefffb81 is on thread 1's stack
2014-05-18 13:58:33 +02:00
Jakub Tyszkowski
3519d60fae android/client: Support sending GATT Server responses
We prepare response by filling btgatt_response_t union's first member
only. The same thing is done by JNI in Android, which ignores second
member. There is also no parameter to tell which union member is set.
More to this, second union member seams to be redundant duplicate of
first member's inner member (broken API?). JNI method is always called
with auth_req set to 0 thus this parameter is omitted in haltest.
2014-05-18 13:58:33 +02:00
Jakub Tyszkowski
c89bc105a0 android/hal: Fix sending not initialised data
As we always send whole gatt_response_t struct through IPC,
but copy only cmd->len bytes, the rest should be initilised to 0.

This fixes the following issue:
==30585== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points
to uninitialised byte(s)
==30585==    at 0x534133D: ??? (syscall-template.S:82)
==30585==    by 0x7756336: hal_ipc_cmd (hal-ipc.c:359)
==30585==    by 0x77546DF: send_response.part.0 (hal-gatt.c:1247)
==30585==    by 0x408119: gatts_send_response_p (if-gatt.c:1777)
==30585==    by 0x40219F: process_line (haltest.c:293)
==30585==    by 0x402552: terminal_action_enter (terminal.c:666)
==30585==    by 0x403184: terminal_process_char (terminal.c:781)
==30585==    by 0x401B90: stdin_handler (haltest.c:308)
==30585==    by 0x402261: poll_dispatch_loop (pollhandler.c:60)
==30585==    by 0x401870: main (haltest.c:441)
==30585==  Address 0x7fefff2a3 is on thread 1's stack
2014-05-18 13:58:33 +02:00
Jakub Tyszkowski
e770585f46 android/gatt: Handle Androids read/write responses in response queue
This is needed for reads like "read by type" to support Android
responses, callback reads and direct db reads in a single request.
2014-05-18 13:58:33 +02:00
Marcel Holtmann
b4755d7f8c lib: Update company identifiers 2014-05-16 15:56:35 -07:00
Antonio Ospite
1783548cf7 plugins/sixaxis: Factor out a calc_leds_bitmap() function
This is also in preparation of set_leds_sysfs().
2014-05-16 14:34:47 +02:00
Antonio Ospite
f6e6850c1e plugins/sixaxis: Factor out a set_leds_hidraw() function
This is in preparation for a set_leds_sysfs() function.

Make set_leds_hidraw() return void, as its return value is never used
by the caller: the setup_leds() callback has to always return FALSE.
2014-05-16 14:34:47 +02:00
Marcin Kraglak
a148b6bbf9 shared/gatt: Fix freeing uninitialized attributes
Don't free uninitialized attributes. It could cause NULL pointer
dereference.
2014-05-16 14:34:29 +02:00
Lukasz Rymanowski
40798ee2cf android/gatt: Fix for read request
If there is no attribute in database we should return immediately.
2014-05-16 14:34:29 +02:00
Szymon Janc
db36dfe7c9 android/bluetooth: Fix minor codestyle issues 2014-05-16 13:22:43 +02:00