When matching remote SEP to local SEP avdtp does not compare 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 it by adding a2dp codec match call back.
Support for extension headers is mandatory functionality. This patch
add support to it and leave responsibility for processing extension
header and sending setup success response to kernel.
This patch is necessary to pass PTS bnep test TC_CTRL_BV_19_C.
Using UINT32_MAX overflow in Android implementation as it multiple the
value by 1000 to get the interval in miliseconds which seem to truncate
the value causing it to send position changed too frequently flooding
the channel.
Some player do not change state when backward is pressed only once,
instead it will just start the track from the beginning.
To fix this subscribe to playback position changed event since it is
mandatory to be sent in the following conditions:
- TG has reached the registered playback Interval time.
- Changed PLAY STATUS.
- Changed Current Track.
- Reached end or beginning of track.
This patch fixes an Invalid Handle error that gets returned while
discovering the "External Report Reference" descriptors, where an
invalid handle range of "0x00 - 0xff" was being used. 0x0000 is an
invalid handle in ATT so this patch fixes changes the range to
"0x0001 - 0xffff".
On HoG device reconnect, attio_connected_cb() should re-enable
HoG report notification callbacks for only those HoG reports that
have a valid CCC handle and notifications enabled on the device.
Note that the call:
enable_report_notifications(r, false)
only reinstalls the callback for HoG report notifications. It doesn't
rewrite the HoG report notification enable bit on the HoG device.
1. Store HoG report CCC handle in the report data structure, so that
it can be used when needed.
2. Rename write_ccc() to enable_report_notifications().
3. In enable_report_notifications():
- first register the callback for HoG report notifications
- then enable the notifications on the HoG device
4. In report_ccc_written_cb():
- improve the emitted messages
Crash was due to invalid use of libdbus API.
Invalid read of size 1
at 0x4A092F2: strlen (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x36A9A29DF3: ??? (in /usr/lib64/libdbus-1.so.3.7.12)
by 0x36A9A17CC4: ??? (in /usr/lib64/libdbus-1.so.3.7.12)
by 0x36A9A19EAD: dbus_message_iter_append_basic (in /usr/lib64/libdbus-1.so.3.7.12)
by 0x42B9B6: network_property_get_uuid (connection.c:453)
by 0x4847EE: append_property.isra.1 (object.c:510)
by 0x4849EF: process_properties_from_interface (object.c:1688)
by 0x484D23: process_changes (object.c:1719)
by 0x36A7E492A5: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x36A7E49627: ??? (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x36A7E49A39: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3800.2)
by 0x40AF95: main (main.c:661)
Address 0x3631313130303030 is not stack'd, malloc'd or (recently) free'd
When acting as TG the code may end up using GetCapabilities to figure
out if volume changed event is supported, this cause crashes with
remote devices that don't support TG themselves because
session->controller is not initialized.
Note that to pass AVRCP qualification when volume changed is supported
the device has to support TG as well as CT record, this is because PTS
will attempt to fetch the TG record for any test that it is sending
commands so devices where this crash happen most likely don't have
volume control feature enabled.
This fixes a crash with below trace that a discover_callback
object has a NULL cb function pointer being triggered, which
may due to an error happened in avdtp_discover() and left it
unset.
0x00000000 in ?? ()
0xb6f5606e in finalize_discovery (err=22, session=0xb7514a00)
at profiles/audio/avdtp.c:1043
connection_lost (session=session@entry=0xb7514a00, err=err@entry=22)
at profiles/audio/avdtp.c:1143
0xb6f57cf6 in avdtp_connect_cb (chan=<optimized out>, err=0xb7514410,
user_data=0xb7514a00) at profiles/audio/avdtp.c:2373
0xb6f723e4 in accept_cb (io=0xb7516a10, cond=<optimized out>,
user_data=0xb7516b48) at btio/btio.c:203
0xb6e6cf10 in ?? ()
If there is a call to avrcp_connect, state of service is changed to
BTD_SERVICE_STATE_CONNECTING. If connection failed, state didn't change
to BTD_SERVICE_STATE_DISCONNECTED because controller_destroy() and
target_destroy() was not called. Set state of services in session_destroy()
instead.
Disconnect callback can be set while connecting bnep. In previous
implementation there was separated method to setting up the disconnect
callback and it was always called immediately after calling connect -
this method was redundand.
CC profiles/network/bluetoothd-bnep.o
profiles/network/bnep.c: In function ‘bnep_server_add’:
profiles/network/bnep.c:633:22: error: initialization makes integer
from pointer without a cast [-Werror]
uint16_t rsp, dst = NULL;
Command response can be three bytes long (in case if command is not
understood) 1 byte(packet type) + 1 byte(control type) + 1 byte(unknown
control type). Command response can be also four bytes long if it's
response for setup connection, filter net type and filter multi addr,
1 byte(packet type) + 1 byte(control type) + 2 byte(response message).
BNEP connection set up logic which was added before bnep_server_add,
can be private method of bnep. Moved logic was almost doubled in two
cases: NAP role in PAN, server listening. Now set up and connect
scenario check of bnep connection is only handled in bnep part for
listen connections.
get_service_id method is used only within connection code to get id (16
bit value) of received string format 128bit uuid or service named e.g.
panu, gn or nap. There is no need to make it public as bnep.c only
related code.
While bnep setup, roles must be determined and checked if the connection
scanario is possible. Get and check possible service roles routines are
always performed in serie. So there is no need to split it to separate
calls.
When handling DBUS_ERROR_NO_REPLY error in media endpoint, the
a2dp_setup gets unref'ed in the associated request callback when
it's called for the first time. A crash happens in the later
clear_endpoint call with below backtrace that, the request callback
will be triggered again with NULL session.
To fix this, remove the additional request callback so that every
callback only gets triggered for once in clear_endpoint.
avdtp_server struct doesn't make sense to exist since there exist an
equivalent in the form of a2dp_server which can be used as context for
incoming connections.