OSDN Git Service
Marcin Kraglak [Fri, 30 May 2014 09:37:41 +0000 (11:37 +0200)]
shared/gatt: Return bool in gatt_db_get_attribute_permissions
It will return true if attribute with given handle exists in db and
set permissions value, otherwise it will return false.
Now, if get_permissions failed, we should reply with
ATT_ECODE_ATTR_NOT_FOUND.
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:34 +0000 (15:16 +0200)]
android/hal-audio: Allow to autoselect endpoint in open_stream IPC
audio_open_output_stream always tries to open 1st registered endpoint
based on assumption that there is only one endpoint registered anyway
(due to support for only one codec). With more endpoints available in
future we need to be able to retrieve endpoint id which is connected
and use it for streaming.
This patch adds special case for id=0 in open_stream IPC to return 1st
opened endpoint on BlueZ side which is enough for now since only one
headset can be connected at any time (i.e. we should not have more
than 1 endpoint opened).
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:33 +0000 (15:16 +0200)]
android/hal-audio: Send packets only when data were encoded
Codec may not return encoded packet on every encode_mediapacket call,
i.e. in case there's not enough data it may buffer data and encode on
subsequent calls when enough data were provided. We need to make sure
media packet is written only in case somethind was encoded so we don't
send empty packets.
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:32 +0000 (15:16 +0200)]
android/hal-audio: Make update_qos optional
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:31 +0000 (15:16 +0200)]
android/hal-audio: Make RTP header optional
Not every codec on A2DP will use RTP so it's now optional - codec can
be defined to use it and core will take care of filling the data.
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:30 +0000 (15:16 +0200)]
android/hal-audio: Fix media_packet definition
rtp_payload field in media_packet is specific for SBC codec thus it
should be moved to SBC codec implementation and removed from generic
structs.
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:29 +0000 (15:16 +0200)]
android/hal-audio: Fix PT in media packets
According to A2DP 1.3 spec section 4.3.3.2:
"A payload type in the RTP dynamic range shall be chosen (see [22],
section 3)." - [22] = RFC3551
As per referenced RFC3551, values in range 96-127 are reserved for
dynamic assignment so we can set PT to 96.
Johan Hedberg [Sun, 1 Jun 2014 06:23:34 +0000 (09:23 +0300)]
tools/smp-tester: Add client test case for MITM
Lukasz Rymanowski [Tue, 27 May 2014 15:17:45 +0000 (17:17 +0200)]
tools/btmgmt: Add set-io-cap command
This is needed for testing e.g. PTS
Jakub Tyszkowski [Fri, 30 May 2014 13:19:42 +0000 (15:19 +0200)]
android/gatt: Fix not setting request as done on direct db read
Previously if read was succesfull - request was not marked as completed
because no callback was called for direct db read.
Jakub Tyszkowski [Fri, 30 May 2014 13:19:41 +0000 (15:19 +0200)]
android/gatt: Support find request in permission check
Permissions check was failing on those requests.
Eva Kolanska [Fri, 30 May 2014 11:51:49 +0000 (13:51 +0200)]
android/gatt: Update GATT test results
Szymon Janc [Fri, 30 May 2014 12:15:22 +0000 (14:15 +0200)]
android/pts: Update GAP TC_BOND_BON_BV_03_C result
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:49 +0000 (15:16 +0200)]
android/a2dp: Add support to check aptX capabilities
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:48 +0000 (15:16 +0200)]
android/a2dp: Add support to check MPEG-2,4 AAC caps
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:42 +0000 (15:16 +0200)]
android/a2dp: Fix SEP selection
When matching remote SEP to local SEP we do not match vendor codecs
properly, i.e. neither vendor ID not codec ID are checked, which may
cause wrong endpoint to be selected in case there are more that one
endpoints using vendor codec on remote.
This patch fixes this by assinging vendor codec indentification to
local SEP after it's registered and uses this information when matching
SEPs.
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:28 +0000 (15:16 +0200)]
android: Fix missing include
It's needed for getenv().
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:27 +0000 (15:16 +0200)]
android/a2dp: Fix removing device on incoming connection
Connection state is not changed for incoming connection, i.e. during
discovery device is still in disconnected state and in case connection
fails for some reason, device won't be removed due to triggered state
change disconnected->disconnected which is silently ignored.
This patch fixes this problem by changing device state to connecting
immediately after signalling channel is connected. This allows device
to be removed properly in case something fails and is also consistent
with behaviour of Bluedroid.
In addition there's new flag added to device which stores information
whether we're initiator of connection. This is required because before
fix this property was decided based on HAL state which we can't now
use since it will be always connecting for both incoming and outgoing
connections.
Lukasz Rymanowski [Thu, 29 May 2014 13:49:44 +0000 (15:49 +0200)]
shared/crypto: Remove not needed memcpy
Lukasz Rymanowski [Thu, 29 May 2014 13:49:43 +0000 (15:49 +0200)]
android/pts: Update GATT PTS test results
Update tests related to write signed
Lukasz Rymanowski [Thu, 29 May 2014 13:49:42 +0000 (15:49 +0200)]
unit/crypto: Update unit test vectors after changes in singing process
Lukasz Rymanowski [Thu, 29 May 2014 13:49:41 +0000 (15:49 +0200)]
shared/crypto: Fix byte order of message
Message should be swapped before we send it to the kernel for signing
Lukasz Rymanowski [Thu, 29 May 2014 13:49:40 +0000 (15:49 +0200)]
shared/crypto: Change swap128 to swap_buf
We will need to swap bigger buffers so lets make swap128 more generic for
that purpose
Lukasz Rymanowski [Thu, 29 May 2014 13:49:39 +0000 (15:49 +0200)]
shared/crypto: Fix byte order of sign counter added to signature
Lukasz Rymanowski [Thu, 29 May 2014 13:49:38 +0000 (15:49 +0200)]
shared/crypto: Fix concatenate of sign counter into the msg
This patch fixes incorrectly concatenated sign counter to the message
Lukasz Rymanowski [Thu, 29 May 2014 13:49:37 +0000 (15:49 +0200)]
android/gatt: Fix signed write command encoding
As per spec (BT spec 4.1 Vol[3], Part F, chapter 3.4.5.4) we need to
take opcode, handle and parameters to generate signature.
In order to support it signing is moved to att.c, place where pdu is
encoded
Lukasz Rymanowski [Thu, 29 May 2014 13:49:36 +0000 (15:49 +0200)]
android/gatt: Fix handling signed write command from remote
As per spec (BT spec 4.1 Vol[3], Part F, chapter 3.4.5.4) message which
should be taken to generate signature is opcode, handle and parameters
Lukasz Rymanowski [Thu, 29 May 2014 13:49:35 +0000 (15:49 +0200)]
android/gatt: Verify signature counter from remote
We will receive signature counter as a part of signature in att packet.
We shall verify if signature counter has value as expected otherwise
drop the message.
Szymon Janc [Fri, 30 May 2014 10:02:57 +0000 (12:02 +0200)]
android/pics: Fix GATT PICS settings
Luiz Augusto von Dentz [Wed, 28 May 2014 11:23:33 +0000 (14:23 +0300)]
input: Do not send UHID_DESTROY
Accourding to uHID documentation when diconnecting the kernel will take
care of cleaning up any device created:
"If you close() the fd, the device is automatically unregistered and
destroyed internally."
Luiz Augusto von Dentz [Wed, 28 May 2014 11:18:18 +0000 (14:18 +0300)]
android/hidhost: Rework uHID code to use bt_uhid
Jakub Tyszkowski [Thu, 29 May 2014 13:05:04 +0000 (15:05 +0200)]
android/pts: Update GATT results
Jakub Tyszkowski [Thu, 29 May 2014 13:05:03 +0000 (15:05 +0200)]
android/gatt: Support exec write request test command
'u2' parameter is used to pass exec write flag.
Jakub Tyszkowski [Thu, 29 May 2014 13:05:02 +0000 (15:05 +0200)]
android/gatt: Support prepare write request test command
'u2' parameter is used for handle value, 'u3' for offset and
'u4' holds the value.
Jakub Tyszkowski [Thu, 29 May 2014 13:05:01 +0000 (15:05 +0200)]
android/gatt: Support write command test command
'u2' parameter is used to pass handle value.
Jakub Tyszkowski [Thu, 29 May 2014 13:05:00 +0000 (15:05 +0200)]
android/gatt: Support write request test command
'u2' parameter is used to pass handle value.
Jakub Tyszkowski [Thu, 29 May 2014 13:04:59 +0000 (15:04 +0200)]
android/gatt: Initial support for write test command
This is handled mostly the same way as read so we can use the same
function for sending att requests.
As test command parameters are of type uint16_t, we cannot write longer
values. We can figure out the ways to overcome this limitation if it
turns out that it's really needed (i.e. some PTS test cases cannot be
passed).
Eva Kolanska [Thu, 29 May 2014 13:34:15 +0000 (15:34 +0200)]
android/pts: Update GATT test results
Jakub Tyszkowski [Thu, 29 May 2014 10:34:08 +0000 (12:34 +0200)]
android/pts: Update GATT PTS status
Jakub Tyszkowski [Thu, 29 May 2014 10:34:07 +0000 (12:34 +0200)]
android/gatt: Support read by group in test commands
'u2' command parameter is used as start handle, 'u3' as end handle and
uuid as group type.
Jakub Tyszkowski [Thu, 29 May 2014 10:34:06 +0000 (12:34 +0200)]
android/gatt: Support read blob request in test command
'u2' command paremeter is used as handle and 'u3' as offset value.
Jakub Tyszkowski [Thu, 29 May 2014 10:34:05 +0000 (12:34 +0200)]
android/gatt: Suport read by type request in test command
'u2' parameter is used as start handle, 'u3' as end handle and uuid as
attribute type.
Jakub Tyszkowski [Thu, 29 May 2014 10:34:04 +0000 (12:34 +0200)]
android/gatt: Support read request in test command
'u2' command parameter is used to pass attribute handle.
Jakub Tyszkowski [Thu, 29 May 2014 10:34:03 +0000 (12:34 +0200)]
android/gatt: Add read test command stub
This adds read support to test command handler. Particular read types will be
handled basing on the 'u1' command parameter.
Szymon Janc [Thu, 29 May 2014 08:01:07 +0000 (10:01 +0200)]
android/pts: Update PTS GAP tests results
Szymon Janc [Thu, 29 May 2014 08:01:06 +0000 (10:01 +0200)]
android/pics: Update PICS for GAP
Enable peripheral mode and tweak some other settings.
Szymon Janc [Thu, 29 May 2014 10:48:20 +0000 (12:48 +0200)]
android/pts: Update PTS GATT tests selection
Szymon Janc [Thu, 29 May 2014 10:37:31 +0000 (12:37 +0200)]
android/pics: Update PICS for GATT
Eva Kolanska [Wed, 28 May 2014 14:24:48 +0000 (16:24 +0200)]
android/pts: Update GATT Server test results
Jakub Tyszkowski [Thu, 29 May 2014 05:59:11 +0000 (07:59 +0200)]
android/gatt: Fix doing database reads on write
Wrong function was called resulting in read responses being send along
with write response. As it is now 'process_dev_pending_requests' is
processing only read requests.
Szymon Janc [Mon, 26 May 2014 21:53:28 +0000 (23:53 +0200)]
android/gatt: Implement disconnect test command
Szymon Janc [Mon, 26 May 2014 21:53:27 +0000 (23:53 +0200)]
android/gatt: Implement connect test command
Szymon Janc [Mon, 26 May 2014 21:53:26 +0000 (23:53 +0200)]
android/gatt: Implement enable test command
This command is used to enable and disable test interface.
Szymon Janc [Mon, 26 May 2014 21:53:25 +0000 (23:53 +0200)]
android/gatt: Factor out unregistering client into helper function
This will be also used by test interface.
Szymon Janc [Mon, 26 May 2014 21:53:24 +0000 (23:53 +0200)]
android/gatt: Add initial implementation of client test command
This command is used to performe some tasks not available from
standard API and usable only for PTS testing.
Andrzej Kaczmarek [Wed, 28 May 2014 08:50:02 +0000 (10:50 +0200)]
tools/hcidump: Decode MPEG-1,2 Audio codec capabilities
Jakub Tyszkowski [Wed, 28 May 2014 07:48:49 +0000 (09:48 +0200)]
android/gatt: Initialize crypto first
This fixes the missleading error on crypto setup failure:
02-17 20:19:44.639 I/bluetoothd( 1705): bluetoothd[1706]: gatt: Failed
to allocate memory for queues
Jakub Tyszkowski [Wed, 28 May 2014 09:34:15 +0000 (11:34 +0200)]
android/pts: Update GATT PTS results
Lukasz Rymanowski [Wed, 28 May 2014 09:30:06 +0000 (11:30 +0200)]
android/pts: Update SM PTS test results
Rerun TC_JW_* test cases
Jakub Tyszkowski [Wed, 28 May 2014 09:17:59 +0000 (11:17 +0200)]
android/gatt: Fix not checking for read errors in read by type
Jakub Tyszkowski [Wed, 28 May 2014 09:19:06 +0000 (11:19 +0200)]
android/client: Allow zero length responses
Eva Kolanska [Wed, 28 May 2014 08:53:21 +0000 (10:53 +0200)]
android/pts: Update GATT test results
Jakub Tyszkowski [Tue, 27 May 2014 10:15:32 +0000 (12:15 +0200)]
shared/gatt-db: Fix cropping permissions value
Jakub Tyszkowski [Tue, 27 May 2014 10:15:31 +0000 (12:15 +0200)]
android/gatt: Use proper variable to store response length
This fixes confirmations being not send.
Jakub Tyszkowski [Tue, 27 May 2014 10:15:30 +0000 (12:15 +0200)]
gatt: Fix not freeing GError on failure
Jakub Tyszkowski [Tue, 27 May 2014 10:15:29 +0000 (12:15 +0200)]
attrib: Fix minor whitespace issue
Replace spaces with tabs.
Jakub Tyszkowski [Tue, 27 May 2014 11:52:47 +0000 (13:52 +0200)]
android/gatt: Fix not sending write request responses
Responses were pushed to pending response queue but send was never
triggered.
Eva Kolanska [Tue, 27 May 2014 14:22:39 +0000 (16:22 +0200)]
android/pts: Update GATT PTS tests results
Johan Hedberg [Tue, 27 May 2014 17:58:28 +0000 (20:58 +0300)]
tools/btmgmt: Fix address type in user confirm replies
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:47 +0000 (15:16 +0200)]
android: Add avinfo to makefile
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:46 +0000 (15:16 +0200)]
tools/avinfo: Decode aptX codec capabilities
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:45 +0000 (15:16 +0200)]
tools/avinfo: Decode MPEG-2,4 AAC codec capabilities
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:44 +0000 (15:16 +0200)]
tools/hcidump: Decode aptX codec capabilities
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:43 +0000 (15:16 +0200)]
tools/hcidump: Decode MPEG-2,4 AAC codec capabilities
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:41 +0000 (15:16 +0200)]
audio: Add definitions for aptX
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:40 +0000 (15:16 +0200)]
audio: Add macros to access MPEG-2,4 AAC codec info
This patch provides helper macros to get, set and init-in-struct both
frequency and bitrate fields in codec info structs for MPEG-2,4 AAC.
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:39 +0000 (15:16 +0200)]
audio: Add definitions for MPEG-2,4 AAC codec
frequency and bitrate bit-fields are splitted into separate bytes since
they span across byte-boundary and cannot be set easily on LE arch
anyway.
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:38 +0000 (15:16 +0200)]
audio: Fix a2dp_vendor_codec_t declaration
As per A2DP spec, both Vendor ID (4.7.2.1) and Codec ID (4.7.2.2) are
defined as 32-bit and 16-bit values respectively rather that array of
bytes. Also changing to uint types will make using these values in code
much easier.
Andrei Emeltchenko [Thu, 22 May 2014 12:06:05 +0000 (15:06 +0300)]
android/hal-sco: Fix memory leak
Release resampler on exit.
Johan Hedberg [Tue, 27 May 2014 09:15:11 +0000 (12:15 +0300)]
shared/crypto: Fix fd leaks in bt_crypto_sign_att()
Eva Kolanska [Tue, 27 May 2014 08:40:39 +0000 (10:40 +0200)]
android/pts: Update GATT PTS tests results
Marcin Kraglak [Mon, 26 May 2014 14:06:23 +0000 (16:06 +0200)]
android/gatt: Check permissions before write execution
Check attribute's permissions and return error if device is not allowed
to read.
Marcin Kraglak [Mon, 26 May 2014 14:06:22 +0000 (16:06 +0200)]
android/gatt: Fix possible memory leak in write request
If write cannot be executed, remove data from queue and free
allocated memory.
Eva Kolanska [Mon, 26 May 2014 15:03:46 +0000 (17:03 +0200)]
android/pts: Update GATT tests results
Szymon Janc [Mon, 26 May 2014 15:03:45 +0000 (17:03 +0200)]
android/README: Update required kernel options
CRYPTO support is required by gatt.
Szymon Janc [Mon, 26 May 2014 15:03:44 +0000 (17:03 +0200)]
android/hal-gatt: Fix missing check if interface is ready
Andrei Emeltchenko [Thu, 22 May 2014 13:07:02 +0000 (16:07 +0300)]
android/hal-audio: Fix invalid memory access when downmixing to mono
While iterating over input buffer frame's size was not correctly taken
into account. Input buffer is always PCM 16bit stereo (4 bytes per
frame).
Marcin Kraglak [Mon, 26 May 2014 09:10:29 +0000 (11:10 +0200)]
android/gatt: Check permissions before read execution
Check device security level and attribute permissions before read
execution.
Marcin Kraglak [Mon, 26 May 2014 09:10:28 +0000 (11:10 +0200)]
android/gatt: Add proper permissions to built-in services
Set permissions to built in services.
Marcin Kraglak [Mon, 26 May 2014 09:10:27 +0000 (11:10 +0200)]
android/gatt: Store proper attributes permissions in database
Convert Android HAL permissions to GATT server permissions and store
them in database.
Marcin Kraglak [Mon, 26 May 2014 09:10:26 +0000 (11:10 +0200)]
android/hal-gatt: Define attribute permissions values
These values are defined in Android and should be used on daemon
side.
Marcin Kraglak [Mon, 26 May 2014 09:10:25 +0000 (11:10 +0200)]
shared/gatt: Add helper for getting attribute's permissions
It will return attribute's permissions or 0 if attribute was not found.
Marcin Kraglak [Mon, 26 May 2014 09:10:24 +0000 (11:10 +0200)]
shared/gatt: Define atribute permissions as uint32_t
Szymon Janc [Thu, 22 May 2014 09:41:14 +0000 (11:41 +0200)]
android/pts: Update MPS tests results
Szymon Janc [Fri, 23 May 2014 11:30:21 +0000 (13:30 +0200)]
android/pics: Enable NAP and PBAP in MPS settings
Szymon Janc [Thu, 22 May 2014 09:39:47 +0000 (11:39 +0200)]
android/bluetooth: Register SDP record for MPS
This was affecting TC_AG_SRC_HFAV_ACT_SD_BV_01_I and
TC_SDP_CTH_SD_BV_01_I PTS qualification tests.
Szymon Janc [Thu, 22 May 2014 08:57:05 +0000 (10:57 +0200)]
lib/sdp: Add attributes and service class for MPS
Jakub Tyszkowski [Mon, 26 May 2014 07:13:16 +0000 (09:13 +0200)]
android/gatt: Use default mtu on mtu exchange response
We should be setting new mtu after sending response using old mtu. This
also moves sending the response from att_handler to mtu_att_handle.
Jakub Tyszkowski [Mon, 26 May 2014 07:13:15 +0000 (09:13 +0200)]
android/gatt: Make att_handler use g_attrib buffer
This makes use of g_attrib buffer for output and removes some unused
read_by_group_type function parameters.
Jakub Tyszkowski [Mon, 26 May 2014 07:13:14 +0000 (09:13 +0200)]
android/gatt: Use g_attrib buffer where possible for att
This replaces fixed size pdu usage with g_attrib buffer when possible.
When only received packets are decoded we use dynamic allocation with
current mtu.