Commit Graph

9934 Commits

Author SHA1 Message Date
Claudio Takahasi
962688893d thermometer: Reduce the array for temperature type
Temperature Type characteristic is a 8-bits value used to describe
the type of temperature measurement in relation to the location on the
human body.
2012-06-27 15:49:18 +03:00
Claudio Takahasi
7659391a25 thermometer: Reduce the array for Valid Range
Valid Range descriptor contains two unsigned 16-bits integers
representing the valid range of values that the Measurement Interval
characteristic can support.
2012-06-27 15:49:18 +03:00
Claudio Takahasi
cb6db2386b gatttool: Use GAttrib buffer
This patch replaces the static local buffer by the GAttrib internal
buffer to store temporarly the output ATT PDU.
2012-06-27 15:49:18 +03:00
Claudio Takahasi
fb722d8448 thermometer: Use GAttrib buffer
This patch replaces the static local buffer by the GAttrib internal
buffer to temporarily store the output ATT PDU.
2012-06-27 15:49:18 +03:00
Claudio Takahasi
033193927a dis: Reduce array size for PnP ID
PnP_ID characteristic is a 7 octets value which includes Vendor ID
source, a Vendor ID, Product ID, and Product Version.
2012-06-27 15:49:18 +03:00
Claudio Takahasi
2f8cd0cb7e ATT: Avoid invalid memory access for large PDU
This patch avoids invalid memory access when decoding ATT read response
PDUs. The ATT_MTU value is a per ATT Bearer value defined by the higher
layer specification.
2012-06-27 15:49:18 +03:00
Johan Hedberg
f0478f073a TODO: Add/cleanup BlueZ 5 items 2012-06-27 15:18:58 +03:00
Gustavo Padovan
f491b24295 TODO: add BlueZ 5 tasks 2012-06-27 15:12:16 +03:00
Lucas De Marchi
a66a557038 Fix GDBus flags after conversion to macros
Commit "aa3b9016bf444b60e1b7e1804dfc323a23a93c5a Convert GDBus methods
to use macro helpers" converted the previous tables to use the new
macros but some flags were lost.
2012-06-27 10:33:53 +03:00
Luiz Augusto von Dentz
ea793cb9f7 input: Fix not adding watches when io channel is connected
This can leave dangling pointers in case one of the channel is never
connected which cause -EALREADY to be returned by
input_device_set_channel next time the device attempts to connect.

For the same reason the code path when acting as client now add the
watch as soon as the connection completes instead when both channels
are connected.
2012-06-26 12:51:47 +03:00
Marcel Holtmann
67ef3ac837 Release 4.101 2012-06-22 14:07:04 -07:00
Stefan Seyfried
02ea3647ac build: fix MISC_LDFLAGS typo to fix "--enable-pie" 2012-06-21 18:10:16 +03:00
Johan Hedberg
f267a12c34 adapter: Change not-connected authorization error to a warning
Due to scheduling/timing on some kernels it is possible that the device
connected event through mgmt comes slightly after an L2CAP socket
receives the same event. We should try to fix this on the kernel side
but as this check in user space is not protecting against critical
errors but just potential profile bugs it can be changed to a simple
warning message.
2012-06-19 13:40:49 +03:00
Lucas De Marchi
80525c138b gdbus: add macro for methods marked as NOREPLY 2012-06-18 17:32:18 +03:00
Johan Hedberg
5c9af79845 simple-agent: Fix input with python version < 3.0
input() in python < 3.0 is the same as eval(raw_input()) which is not
what we want. With python >= 3.0 in turn raw_input doesn't exist. This
patch fixes support for both versions by a simple try-except clause.
2012-06-18 14:09:57 +03:00
Luiz Augusto von Dentz
9d2f3c94d6 AVDTP: Fix rejecting AVDTP Start if starting flag is set
This is now handled by checking if the command collided.
2012-06-18 11:40:37 +03:00
Luiz Augusto von Dentz
83630251be audio: Fix aborting A2DP setup while AVDTP Start is in progress
Change return of avdtp_start to -EINPROGRESS so the caller can check if
the operation is in progress and don't abort because of that.
2012-06-15 17:50:58 +03:00
Luiz Augusto von Dentz
a59e82103a AVDTP: Fix responding to ABORT with reject
ABORT command cannot be rejected
2012-06-15 17:50:23 +03:00
Luiz Augusto von Dentz
2b3bf7b241 AVDTP: Do not respond ABORT command with invalid id
AVDTP spec, 8.15.2 Abort Response:

  "If an AVDTP_ABORT_CMD contains an invalid SEID, no response shall be
  sent."
2012-06-15 17:50:14 +03:00
Luiz Augusto von Dentz
34d9bd7dd2 audio: Wait remote side to send AVDTP_START when acting as acceptor
Some devices like Sony Ericsson MW600 reject AVDTP_START if it was the
initiator of the connection, apparently it follows recommendation 12 of
simultaneous use of HFP, A2DP and AVRCP profiles white paper which says:

  "If the RD has configured and opened a stream it is also responsible to
  start the streaming via GAVDP_START."

If the client is fast enough and try to acquire the transport this cause
an error, so instead of sending AVDTP_START the code now checks if it is
the acceptor of the stream and wait the remote side to send the command.
2012-06-15 17:50:01 +03:00
Luiz Augusto von Dentz
4503dba4ba audio: Fix handling of A2DP abort indication
When an abort is received all setup callbacks should return an error.
2012-06-15 17:49:42 +03:00
Luiz Augusto von Dentz
c1b8914642 audio: Fix handling of A2DP start indication
Only process callbacks if avdtp_start was sent, otherwise it may cancel
setup callbacks that were registere via g_idle_add.
2012-06-15 17:49:33 +03:00
Luiz Augusto von Dentz
ef539d8461 audio: Fix handling of A2DP open indication
When accepting the open indication all config callbacks should be
notified that open completed.
2012-06-15 17:49:25 +03:00
Luiz Augusto von Dentz
c5bf6d662b audio: Fix handling of A2DP suspend indication
When accepting the suspend indication all callbacks should be notified
that suspend completed.

In addition to this fix not using avdtp_start return in indication
callback as well as in the confirmation.
2012-06-15 17:48:52 +03:00
Luiz Augusto von Dentz
ee89674c0b audio: Add handling of AVDTP command collision
Check collision for AVDTP Open, Close, Start, Suspend and Abort commands
and if they collided remove the pending request if SEP has accepted the
indication.
2012-06-15 17:47:53 +03:00
Bastien Nocera
e395d8dd7a Fix ALSA plugin having full soname
This is a plugin, so spell -avoid-version correctly so
it doesn't have a full soname.
2012-06-15 13:15:01 +03:00
Steve Langasek
ee56337e41 Update tests to be compatible with gi and python3
This patch makes the python tests source-compatible with python 3, while
leaving the interpreter at python 2 for now.

The tradeoff is that this source is no longer compatible with python
versions < 2.6, and requires gobject-introspection for the glib-based
tests.
2012-06-15 12:32:50 +03:00
Johan Hedberg
ebb2896b3a Remove test/apitest
This script is back from BlueZ 3.x times and unusable now
2012-06-15 12:32:44 +03:00
Bastien Nocera
a59814adec Add org.bluez.service to the tarball
Seeing as we want to install it.
2012-06-15 09:52:29 +03:00
Marcel Holtmann
094acfddba Release 4.100 2012-06-13 11:59:36 -07:00
Marcel Holtmann
933d78a98d Update library version 2012-06-13 11:58:23 -07:00
Johan Hedberg
cf75b3f8d2 mgmtops: Clear pending_cod_change when powering off 2012-06-13 19:33:58 +03:00
Szymon Janc
00372cde4d mgmtops: Move error message after command status handlers calls
Don't print error message for actions that are expected or recoverable
i.e. add_uuid returning EBUSY status.
2012-06-13 17:54:44 +03:00
Szymon Janc
4da87e3e2b mgmtops: Handle EBUSY status from MGMT_OP_ADD_UUID commands
MGMT_OP_ADD_UUID may fail with EBUSY due to ongoing CoD update. In case
of EBUSY error wait for Class Of Device changed event before adding
more UUIDs.
2012-06-13 17:54:40 +03:00
Luiz Augusto von Dentz
07b6738fb4 audio: Separate profile specific fields from media_transport 2012-06-12 16:38:45 +03:00
Johan Hedberg
18ffa5c18b gattrib: Make event callback identifiers globally unique
The attrib server code relies on these id's to be unique globally and
not just per GAttrib instance. As an easy fix make them global by adding
a static guint to g_attrib_register.
2012-06-08 23:37:33 +08:00
Szymon Janc
1da4a66054 btmgmt: Fix use after free in mgmt_check_pending
Break loop when pending command was found and callback called.
2012-06-07 23:34:45 +08:00
Johan Hedberg
283b4b7d69 gattrib: Fix protection of GAttrib while calling callbacks
The callbacks could result with the reference count dropping to 0 and
the object being freed. This patch fixes the issue by adding one extra
reference for the duration of the timeout function.
2012-06-07 09:41:50 +03:00
Johan Hedberg
c03184efcb mgmtops: Fix handling of cmd_status(0) 2012-06-07 09:41:40 +03:00
Andre Guedes
7dc92fb807 Remove workaround in gatt_connect
This workaround is not necessary anymore since setsockopt is now
checking for minimum MTU.
2012-06-07 04:27:46 +03:00
Andre Guedes
7125410781 Fix gatt_connect for BR/EDR
Use BT_IO_OPT_IMTU instead of BT_IO_OPT_OMTU in bt_io_connect.
We cannot control omtu value since it is negotiated during L2CAP
configuration phase.
2012-06-07 04:27:43 +03:00
Andre Guedes
ece3234da6 Remove omtu parameter from LE bt_io_connect calls
There is no need to set the omtu of L2CAP ATT fixed channel. We
use the default value.
2012-06-07 04:27:39 +03:00
Andre Guedes
5d1f47f1b4 attrib-server: Update GAttrib buffer after Exchange MTU
We should update the GAttrib buffer length after exchanging ATT_MTU.
2012-06-07 04:27:35 +03:00
Andre Guedes
5e4460249a attrib-server: Fix mtu_exchange
If the client requests an ATT_MTU less than the minimum ATT_MTU,
the server should send an Error Response message with Request Not
Supported code.

According to GATT spec, the server shall respond to Exchange MTU
Requests messages with an Exchange MTU Response with the Server
Rx MTU parameter set to the maximum MTU that this server can
receive. Thus, we should get L2CAP imtu value in order to properly
send the Exchange MTU Response message.

Additionally, we should not change the L2CAP ATT fixed channel MTU.
bt_io_set call will always fail since we are not supposed to change
L2CAP MTU after connection is established.
2012-06-07 04:27:32 +03:00
Andre Guedes
e3598c492e attrib-server: Fix gatt_channel MTU value
In attrib_channel_attach, channel->mtu should be initialized according
to ATT_MTU value.

Over BR/EDR, ATT_MTU should be set to the L2CAP imtu negotiated during
L2CAP configuration phase. Over LE, ATT_MTU should be 23 octets.
2012-06-07 04:27:28 +03:00
Andre Guedes
ea2718060e gattrib: Fix g_attrib_set_mtu
23 octets is the default (and minimum) ATT_MTU value. If someone tries
to set ATT_MTU less than 23 octets g_attrib_set_mtu should fail (return
FALSE). Additionally, there is no constraint regarding the maximum value
of ATT_MTU, so we should not check for it.

Also, we should not change the L2CAP ATT fixed channel MTU. bt_io_set
call will always fail since we are not supposed to change L2CAP MTU
after connection is established.
2012-06-07 04:27:24 +03:00
Andre Guedes
185c7ce8a4 gattrib: Fix GAttrib buffer allocation
GAttrib buffer should be allocated according to ATT_MTU value. Over
BR/EDR, ATT_MTU should be set to the L2CAP imtu negotiated during
L2CAP configuration phase. Over LE, ATT_MTU should be 23 octets.
2012-06-07 04:27:19 +03:00
Ido Yariv
33523ab31c gattrib: Fix a premature response timer removal
A timer is set when a response is expected. The timer is removed when
data is received, regardless of whether or not the data is a response.
As a result, the timer may be cleared even though a response was not
received and there would be no way to detect a command timeout.

Fix this by clearing the timer only after verifying a response was
received.
2012-06-07 04:25:06 +03:00
Johan Hedberg
fec848dba7 att: Start application error codes from the beginning of the range
Application error codes start off with 0x80 onwards. In CSSv2 the range
0xE0-0xFF is reserved for "Common Profile Error Codes" so we should
ensure not to mix that with our own definitions.
2012-06-06 16:05:30 +08:00
Johan Hedberg
5232f76214 attrib: Fix always requiring high security
If we get an insufficient encryption error for ATT it doesn't
necessarily mean that we need to have high secirity. If we have an
unauthenticated key and are unencrypted it could also mean that we just
need to encrypt the link (medium security). Always requiring high
security would make the connection fail for unauthenticated keys.
2012-06-06 09:02:23 +03:00