Projects
Mega:24.09
bluez
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:bluez.spec
Changed
@@ -1,7 +1,7 @@ Name: bluez Summary: Bluetooth utilities -Version: 5.71 -Release: 3 +Version: 5.77 +Release: 1 License: GPLv2+ URL: http://www.bluez.org/ Source0: http://www.kernel.org/pub/linux/bluetooth/bluez-%{version}.tar.xz @@ -17,12 +17,10 @@ %ifarch sw_64 Patch6013: bluez-5.54-sw.patch %endif -Patch7000: 0001-Fix-crash-after-pair-command.patch -Patch7001: Fix-memory-leak.patch BuildRequires: dbus-devel >= 1.6 libell-devel >= 0.28 autoconf BuildRequires: glib2-devel libical-devel readline-devel -BuildRequires: json-c-devel systemd-devel cups-devel libtool automake python3-docutils +BuildRequires: json-c-devel systemd-devel cups-devel libtool automake python3-docutils python3-pygments Requires: dbus >= 1.6 %{name}-libs = %{version}-%{release} Requires(post): systemd Requires(preun): systemd @@ -98,6 +96,9 @@ # Copy bluetooth config file install -D -p -m0644 src/main.conf %{buildroot}/etc/bluetooth/main.conf install -D -p -m0644 mesh/mesh-main.conf %{buildroot}/etc/bluetooth/mesh-main.conf +install -D -p -m0644 profiles/input/input.conf %${buildroot}/etc/bluetooth/input.conf +install -D -p -m0644 profiles/network/network.conf %${buildroot}/etc/bluetooth/network.conf + # Setup auto enable sed -i 's/#\Policy\$/\Policy\/; s/#AutoEnable=false/AutoEnable=true/' ${RPM_BUILD_ROOT}/%{_sysconfdir}/bluetooth/main.conf @@ -132,6 +133,8 @@ %doc AUTHORS ChangeLog %license COPYING %config %{_sysconfdir}/bluetooth/main.conf +%config %{_sysconfdir}/bluetooth/input.conf +%config %{_sysconfdir}/bluetooth/network.conf %config %{_sysconfdir}/bluetooth/mesh-main.conf %{_datadir}/dbus-1/system.d/bluetooth.conf %{_datadir}/dbus-1/system.d/bluetooth-mesh.conf @@ -148,6 +151,7 @@ %{_unitdir}/bluetooth-mesh.service %{_datadir}/zsh/site-functions/_bluetoothctl %{_datadir}/dbus-1/services/org.bluez.obex.service +%{_userunitdir}/dbus-org.bluez.obex.service %{_datadir}/dbus-1/system-services/org.bluez.service %{_datadir}/dbus-1/system-services/org.bluez.mesh.service %{_userunitdir}/obex.service @@ -174,8 +178,15 @@ %{_mandir}/man1/* %{_mandir}/man5/* %{_mandir}/man8/* +%{_mandir}/man7/* %changelog +* Tue Jul 16 2024 dillon chen <dillon.chen@gmail.com> - 5.77-1 +- update to 5.77 + +* Thu Jul 11 2024 dillon chen <dillon.chen@gmail.com> - 5.76-1 +- update to 5.76 + * Tue Jun 4 2024 xuchenchen <xuchenchen@kylinos.cn> - 5.71-3 - sync patches from community, shared/csip: Fix memory leak
View file
_service:tar_scm:0001-Fix-crash-after-pair-command.patch
Deleted
@@ -1,76 +0,0 @@ -From 60d60166e4bfae8555fb671e5a99952586cc6b56 Mon Sep 17 00:00:00 2001 -From: Vinit Mehta <vinit.mehta@nxp.com> -Date: 2023-12-19 11:58:01 +0530 -Subject: PATCH Fix crash after pair command - -After pair command, if the user doesn't provide any input on bluetoothctl -CLI interface after receiving the prompt(yes/no) below crash is observed: - -dbus782: arguments to dbus_message_get_no_reply() were incorrect, -assertion "message != NULL" failed in file -/usr/src/debug/dbus/1.14.10-r0/dbus/dbus-message.c line 3250. -This is normally a bug in some application using the D-Bus library. -/usr/lib/libc.so.6(+0x27534) 0xffffa1b67534 -/usr/lib/libc.so.6(__libc_start_main+0x9c) 0xffffa1b6760c -bluetoothctl(+0x188f0) 0xaaaac9c088f0 -Aborted (core dumped) ---- - client/agent.c | 15 +++++++++------ - client/mgmt.c | 12 +++++++++--- - 2 files changed, 18 insertions(+), 9 deletions(-) - -diff --git a/client/agent.c b/client/agent.c -index 35b4041..ff5e57f 100644 ---- a/client/agent.c -+++ b/client/agent.c -@@ -77,14 +77,17 @@ static void confirm_response(const char *input, void *user_data) - { - DBusConnection *conn = user_data; - -- if (!strcmp(input, "yes")) -- g_dbus_send_reply(conn, pending_message, DBUS_TYPE_INVALID); -- else if (!strcmp(input, "no")) -- g_dbus_send_error(conn, pending_message, -+ if (pending_message != NULL) { -+ if (!strcmp(input, "yes")) -+ g_dbus_send_reply(conn, pending_message, -+ DBUS_TYPE_INVALID); -+ else if (!strcmp(input, "no")) -+ g_dbus_send_error(conn, pending_message, - "org.bluez.Error.Rejected", NULL); -- else -- g_dbus_send_error(conn, pending_message, -+ else -+ g_dbus_send_error(conn, pending_message, - "org.bluez.Error.Canceled", NULL); -+ } - } - - static void agent_release(DBusConnection *conn) -diff --git a/client/mgmt.c b/client/mgmt.c -index 947d8fc..e9ebb3d 100644 ---- a/client/mgmt.c -+++ b/client/mgmt.c -@@ -849,10 +849,16 @@ static void prompt_input(const char *input, void *user_data) - &prompt.addr); - break; - case MGMT_EV_USER_CONFIRM_REQUEST: -- if (input0 == 'y' || input0 == 'Y') -- mgmt_confirm_reply(prompt.index, &prompt.addr); -- else -+ if (len) { -+ if (input0 == 'y' || input0 == 'Y') -+ mgmt_confirm_reply(prompt.index, &prompt.addr); -+ else -+ mgmt_confirm_neg_reply(prompt.index, -+ &prompt.addr); -+ } else { - mgmt_confirm_neg_reply(prompt.index, &prompt.addr); -+ bt_shell_set_prompt(PROMPT_ON); -+ } - break; - } - } --- -2.33.0 -
View file
_service:tar_scm:Fix-memory-leak.patch
Deleted
@@ -1,58 +0,0 @@ -From 09e39a7d6dca8041f3723ee9020c54b94c0c8d47 Mon Sep 17 00:00:00 2001 -From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> -Date: Fri, 24 May 2024 10:47:41 -0400 -Subject: shared/csip: Fix memory leak - -This fixes the following leak: - -102 bytes in 6 blocks are definitely lost in loss record 660 of 909 - at 0x484282F: malloc (vg_replace_malloc.c:446) - by 0x5A078B: util_malloc (util.c:46) - by 0x649162: read_sirk (csip.c:485) - by 0x5C74FA: read_cb (gatt-client.c:2713) - by 0x5C4137: handle_rsp (att.c:880) - by 0x5C4137: can_read_data (att.c:1072) - by 0x65DDA4: watch_callback (io-glib.c:157) - by 0x49656AB: ??? (in /usr/lib64/libglib-2.0.so.0.8000.2) - by 0x49C6707: ??? (in /usr/lib64/libglib-2.0.so.0.8000.2) - by 0x496B666: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.8000.2) - by 0x65FE3D: mainloop_run (mainloop-glib.c:66) - by 0x6605A3: mainloop_run_with_signal (mainloop-notify.c:188) - by 0x31DEFA: main (main.c:1468) - ---- - src/shared/csip.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/src/shared/csip.c b/src/shared/csip.c -index e13efb6..87b4590 100644 ---- a/src/shared/csip.c -+++ b/src/shared/csip.c -@@ -128,6 +128,15 @@ void bt_csip_detach(struct bt_csip *csip) - queue_foreach(csip_cbs, csip_detached, csip); - } - -+static void csis_free(struct bt_csis *csis) -+{ -+ if (!csis) -+ return; -+ -+ free(csis->sirk_val); -+ free(csis); -+} -+ - static void csip_db_free(void *data) - { - struct bt_csip_db *cdb = data; -@@ -137,7 +146,7 @@ static void csip_db_free(void *data) - - gatt_db_unref(cdb->db); - -- free(cdb->csis); -+ csis_free(cdb->csis); - free(cdb); - } - --- -2.27.0 -
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/bluez.git</param> - <param name="revision">master</param> + <param name="revision">openEuler-24.09</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/org.bluez.obex.service
Deleted
@@ -1,4 +0,0 @@ -D-BUS Service -Name=org.bluez.obex -Exec=/bin/false -SystemdService=dbus-org.bluez.obex.service
View file
_service:tar_scm:bluez-5.71.tar.xz/plugins/external-dummy.c
Deleted
@@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "src/plugin.h" -#include "src/log.h" - -static int dummy_init(void) -{ - DBG(""); - - return 0; -} - -static void dummy_exit(void) -{ - DBG(""); -} - -BLUETOOTH_PLUGIN_DEFINE(external_dummy, VERSION, - BLUETOOTH_PLUGIN_PRIORITY_LOW, dummy_init, dummy_exit)
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/input/suspend-dummy.c
Deleted
@@ -1,149 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * - * BlueZ - Bluetooth protocol stack for Linux - * - * Copyright (C) 2012 Nordic Semiconductor Inc. - * Copyright (C) 2012 Instituto Nokia de Tecnologia - INdT - * - * - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <errno.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> - -#include <glib.h> - -#include "src/log.h" -#include "suspend.h" - -#define HOG_SUSPEND_FIFO "/tmp/hogsuspend" - -static suspend_event suspend_cb = NULL; -static resume_event resume_cb = NULL; -static guint watch = 0; - -static int fifo_open(void); - -static gboolean read_fifo(GIOChannel *io, GIOCondition cond, gpointer user_data) -{ - char buffer12; - gsize offset, left, bread; - GIOStatus iostatus; - - if (cond & (G_IO_ERR | G_IO_HUP)) { - /* - * Both ends needs to be open simultaneously before proceeding - * any input or output operation. When the remote closes the - * channel, hup signal is received on this end. - */ - fifo_open(); - return FALSE; - } - - offset = 0; - left = sizeof(buffer) - 1; - memset(buffer, 0, sizeof(buffer)); - - do { - iostatus = g_io_channel_read_chars(io, &bufferoffset, left, - &bread, NULL); - - offset += bread; - left -= bread; - if (left == 0) - break; - } while (iostatus == G_IO_STATUS_NORMAL); - - if (g_ascii_strncasecmp("suspend", buffer, 7) == 0) - suspend_cb(); - else if (g_ascii_strncasecmp("resume", buffer, 6) == 0) - resume_cb(); - - return TRUE; -} - -static int fifo_open(void) -{ - GIOCondition condition = G_IO_IN | G_IO_ERR | G_IO_HUP; - GIOChannel *fifoio; - int fd; - - fd = open(HOG_SUSPEND_FIFO, O_RDONLY | O_NONBLOCK); - if (fd < 0) { - int err = -errno; - error("Can't open FIFO (%s): %s(%d)", HOG_SUSPEND_FIFO, - strerror(-err), -err); - return err; - } - - fifoio = g_io_channel_unix_new(fd); - g_io_channel_set_close_on_unref(fifoio, TRUE); - - watch = g_io_add_watch(fifoio, condition, read_fifo, NULL); - - g_io_channel_unref(fifoio); - - return 0; -} - -int suspend_init(suspend_event suspend, resume_event resume) -{ - struct stat st; - int ret; - - DBG(""); - - suspend_cb = suspend; - resume_cb = resume; - - if (stat(HOG_SUSPEND_FIFO, &st) == 0) { - if (!S_ISFIFO(st.st_mode)) { - error("Unexpected non-FIFO %s file", HOG_SUSPEND_FIFO); - return -EIO; - } - - if (unlink(HOG_SUSPEND_FIFO) < 0) { - int err = -errno; - error("Failed to remove FIFO (%s): %s (%d)", - HOG_SUSPEND_FIFO, strerror(-err), -err); - return err; - } - } - - if (mkfifo(HOG_SUSPEND_FIFO, 0600) < 0) { - int err = -errno; - - error("Can't create FIFO (%s): %s (%d)", HOG_SUSPEND_FIFO, - strerror(-err), -err); - return err; - } - - DBG("Created suspend-dummy FIFO on %s", HOG_SUSPEND_FIFO); - - ret = fifo_open(); - if (ret < 0) - unlink(HOG_SUSPEND_FIFO); - - return ret; -} - -void suspend_exit(void) -{ - if (watch > 0) { - g_source_remove(watch); - watch = 0; - } - - unlink(HOG_SUSPEND_FIFO); -}
View file
_service:tar_scm:bluez-5.71.tar.xz/ChangeLog -> _service:tar_scm:bluez-5.77.tar.xz/ChangeLog
Changed
@@ -1,3 +1,44 @@ +ver 5.77: + Fix issue with storing and handling connection parameters. + Fix issue with handling device that are marked as temporary. + Fix issue with HID and special handling for non-keyboards. + Fix issue with BR/EDR not support when discoverable is off. + Add support for initial implementation of ASHA profile. + +ver 5.76: + Fix issue with broadcast channel location and stream capabilities. + Fix issue with handling BIS management and synchronization. + Fix issue with handling Extended Advertising. + Fix issue with UserspaceHID and replay structures. + Add support for providing PPCP characteristic. + +ver 5.75: + Fix issue with build system and header inclusion. + +ver 5.74: + Fix issue with not enabling Wideband Speech when available. + Fix issue with UserspaceHID and Bluetooth Classic devices. + Fix issue with checking for services being connected. + Fix issue with GATT client connection creation. + Fix issue with OBEX and small file transfers. + Fix issue with handling pairing with Apple AirPods. + +ver 5.73: + Fix issue with BAP and setting up broadcast source. + Fix issue with BAP and register all endpoints. + Fix issue with BAP and missing metadata property. + Fix issue with BAP and not handling out of order responses. + Fix issue with BAP and attempting to set device as connectable. + Add support for CCP plugin for call control profile. + +ver 5.72: + Fix issue with BAP and handling stream IO linking. + Fix issue with BAP and setup of multiple streams per endpoint. + Fix issue with AVDTP and potential incorrect transaction label. + Fix issue with A2DP and handling crash on suspend. + Fix issue with GATT database and an invalid pointer. + Add support for AICS service. + ver 5.71: Fix issue with not registering CSIS service. Fix issue with registering pairing callbacks.
View file
_service:tar_scm:bluez-5.71.tar.xz/Makefile.am -> _service:tar_scm:bluez-5.77.tar.xz/Makefile.am
Changed
@@ -16,7 +16,7 @@ EXTRA_DIST = -pkglibexecdir = $(libexecdir)/bluetooth +pkglibexecdir = @PKGLIBEXECDIR@ pkglibexec_PROGRAMS = @@ -31,11 +31,17 @@ confdir = $(sysconfdir)/bluetooth statedir = $(localstatedir)/lib/bluetooth +bluetoothd-fix-permissions: + install -dm555 $(DESTDIR)$(confdir) + install -dm700 $(DESTDIR)$(statedir) + if DATAFILES dbusdir = $(DBUS_CONFDIR)/dbus-1/system.d dbus_DATA = src/bluetooth.conf -conf_DATA = +conf_DATA = src/main.conf +conf_DATA += profiles/input/input.conf +conf_DATA += profiles/network/network.conf state_DATA = endif @@ -47,15 +53,11 @@ dbussystembus_DATA = src/org.bluez.service endif -EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service +EXTRA_DIST += src/org.bluez.service plugindir = $(libdir)/bluetooth/plugins -if MAINTAINER_MODE -build_plugindir = $(abs_top_srcdir)/plugins/.libs -else build_plugindir = $(plugindir) -endif if MANPAGES man_MANS = @@ -82,8 +84,7 @@ lib_LTLIBRARIES += lib/libbluetooth.la lib_libbluetooth_la_SOURCES = $(lib_headers) $(lib_sources) -lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 22:11:19 -lib_libbluetooth_la_DEPENDENCIES = $(local_headers) +lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 22:14:19 endif noinst_LTLIBRARIES += lib/libbluetooth-internal.la @@ -100,12 +101,10 @@ if EXTERNAL_ELL ell_cflags = @ELL_CFLAGS@ ell_ldadd = @ELL_LIBS@ -ell_dependencies = ell_built_sources = ell/shared else ell_cflags = ell_ldadd = ell/libell-internal.la -ell_dependencies = $(ell_ldadd) ell_built_sources = ell/shared ell/internal ell/ell.h noinst_LTLIBRARIES += ell/libell-internal.la @@ -237,7 +236,10 @@ src/shared/micp.c src/shared/micp.h \ src/shared/csip.c src/shared/csip.h \ src/shared/bass.h src/shared/bass.c \ - src/shared/lc3.h src/shared/tty.h + src/shared/ccp.h src/shared/ccp.c \ + src/shared/lc3.h src/shared/tty.h \ + src/shared/bap-defs.h \ + src/shared/asha.h src/shared/asha.c if READLINE shared_sources += src/shared/shell.c src/shared/shell.h @@ -288,24 +290,14 @@ builtin_modules = builtin_sources = builtin_cppflags = -builtin_nodist = builtin_ldadd = include Makefile.plugins -if MAINTAINER_MODE -plugin_LTLIBRARIES += plugins/external-dummy.la -plugins_external_dummy_la_SOURCES = plugins/external-dummy.c -plugins_external_dummy_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ - -no-undefined -plugins_external_dummy_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden -endif - pkglibexec_PROGRAMS += src/bluetoothd src_bluetoothd_SOURCES = $(builtin_sources) \ $(attrib_sources) $(btio_sources) \ - src/bluetooth.ver \ src/main.c src/log.h src/log.c \ src/backtrace.h src/backtrace.c \ src/rfkill.c src/btd.h src/sdpd.h \ @@ -337,27 +329,27 @@ src/libshared-glib.la \ $(BACKTRACE_LIBS) $(GLIB_LIBS) $(DBUS_LIBS) -ldl -lrt \ $(builtin_ldadd) + +if EXTERNAL_PLUGINS +src_bluetoothd_SOURCES += src/bluetooth.ver src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \ -Wl,--version-script=$(srcdir)/src/bluetooth.ver - -src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \ - gdbus/libgdbus-internal.la \ - src/libshared-glib.la \ - src/bluetooth.service +endif src_bluetoothd_CPPFLAGS = $(AM_CPPFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \ -DPLUGINDIR=\""$(build_plugindir)"\" \ $(BACKTRACE_CFLAGS) $(builtin_cppflags) src_bluetoothd_SHORTNAME = bluetoothd -builtin_files = src/builtin.h $(builtin_nodist) +builtin_files = src/builtin.h nodist_src_bluetoothd_SOURCES = $(builtin_files) -CLEANFILES += $(builtin_files) src/bluetooth.service +CLEANFILES += $(builtin_files) if MANPAGES man_MANS += src/bluetoothd.8 +man_MANS += doc/l2cap.7 doc/rfcomm.7 man_MANS += doc/org.bluez.Adapter.5 doc/org.bluez.Device.5 \ doc/org.bluez.DeviceSet.5 doc/org.bluez.AgentManager.5 \ doc/org.bluez.Agent.5 doc/org.bluez.ProfileManager.5 \ @@ -390,6 +382,7 @@ doc/org.bluez.obex.AgentManager.5 doc/org.bluez.obex.Agent.5 endif manual_pages += src/bluetoothd.8 +manual_pages += doc/l2cap.7 doc/rfcomm.7 manual_pages += doc/org.bluez.Adapter.5 doc/org.bluez.Device.5 \ doc/org.bluez.DeviceSet.5 doc/org.bluez.AgentManager.5 \ doc/org.bluez.Agent.5 doc/org.bluez.ProfileManager.5 \ @@ -433,6 +426,14 @@ include android/Makefile.am include Makefile.mesh +if SYSTEMD +install-data-hook: obexd-add-service-symlink +else +install-data-hook: bluetoothd-fix-permissions obexd-add-service-symlink +endif + +uninstall-hook: obexd-remove-service-symlink + if HID2HCI rulesdir = $(UDEV_DIR)/rules.d @@ -459,6 +460,8 @@ doc/health-api.txt \ doc/sap-api.txt +EXTRA_DIST += doc/l2cap.rst + EXTRA_DIST += doc/org.bluez.Adapter.rst doc/org.bluez.Device.rst \ doc/org.bluez.DeviceSet.rst doc/org.bluez.AgentManager.rst \ doc/org.bluez.Agent.rst doc/org.bluez.ProfileManager.rst \ @@ -745,13 +748,6 @@ aclocal.m4 configure config.h.in config.sub config.guess \ ltmain.sh depcomp compile missing install-sh mkinstalldirs test-driver -SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ - $(SED) -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \ - -e 's,@libexecdir\@,$(libexecdir),g' \ - -e 's,@statedir\@,$(statedir),g' \ - -e 's,@confdir\@,$(confdir),g' \ - < $< > $@ - if RUN_RST2MAN RST2MAN_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ $(RST2MAN) --strict --no-raw \ @@ -761,15 +757,15 @@ { echo "Generated manual page $@ does not exist"; false; } endif -%.service: %.service.in Makefile - $(SED_PROCESS) - %.1: %.rst Makefile $(RST2MAN_PROCESS) %.5: %.rst Makefile $(RST2MAN_PROCESS) +%.7: %.rst Makefile + $(RST2MAN_PROCESS) + %.8: %.rst Makefile $(RST2MAN_PROCESS) @@ -811,8 +807,8 @@ maintainer-clean-local: -rm -rf ell -if COVERAGE clean-coverage: +if COVERAGE @lcov --directory $(top_builddir) --zerocounters $(RM) -r coverage $(top_builddir)/coverage.info @@ -821,15 +817,9 @@ --output-file $(top_builddir)/coverage.info $(AM_V_at)$(MKDIR_P) coverage @genhtml -o coverage/ $(top_builddir)/coverage.info +endif clean-local: clean-coverage -find $(top_builddir) -name "*.gcno" -delete -find $(top_builddir) -name "*.gcda" -delete $(RM) -r lib/bluetooth - -else -clean-local: - -find $(top_builddir) -name "*.gcno" -delete - -find $(top_builddir) -name "*.gcda" -delete - $(RM) -r lib/bluetooth -endif
View file
_service:tar_scm:bluez-5.71.tar.xz/Makefile.in -> _service:tar_scm:bluez-5.77.tar.xz/Makefile.in
Changed
@@ -149,44 +149,49 @@ @HOG_TRUE@ profiles/scanparam/scpp.c profiles/scanparam/scpp.h \ @HOG_TRUE@ profiles/input/suspend.h profiles/input/suspend-none.c -@HOG_TRUE@am__append_22 = profiles/input/suspend-dummy.c -@HEALTH_TRUE@am__append_23 = health -@HEALTH_TRUE@am__append_24 = profiles/health/mcap.h profiles/health/mcap.c \ +@HEALTH_TRUE@am__append_22 = health +@HEALTH_TRUE@am__append_23 = profiles/health/mcap.h profiles/health/mcap.c \ @HEALTH_TRUE@ profiles/health/hdp_main.c profiles/health/hdp_types.h \ @HEALTH_TRUE@ profiles/health/hdp_manager.h \ @HEALTH_TRUE@ profiles/health/hdp_manager.c \ @HEALTH_TRUE@ profiles/health/hdp.h profiles/health/hdp.c \ @HEALTH_TRUE@ profiles/health/hdp_util.h profiles/health/hdp_util.c -@MIDI_TRUE@am__append_25 = midi -@MIDI_TRUE@am__append_26 = profiles/midi/midi.c \ +@MIDI_TRUE@am__append_24 = midi +@MIDI_TRUE@am__append_25 = profiles/midi/midi.c \ @MIDI_TRUE@ profiles/midi/libmidi.h \ @MIDI_TRUE@ profiles/midi/libmidi.c -@MIDI_TRUE@am__append_27 = $(ALSA_CFLAGS) -@MIDI_TRUE@am__append_28 = $(ALSA_LIBS) -@SIXAXIS_TRUE@am__append_29 = plugins/sixaxis.la -@BAP_TRUE@am__append_30 = bap -@BAP_TRUE@am__append_31 = profiles/audio/bap.c -@BASS_TRUE@am__append_32 = bass -@BASS_TRUE@am__append_33 = profiles/audio/bass.c -@MCP_TRUE@am__append_34 = mcp -@MCP_TRUE@am__append_35 = profiles/audio/mcp.c -@VCP_TRUE@am__append_36 = vcp -@VCP_TRUE@am__append_37 = profiles/audio/vcp.c -@MICP_TRUE@am__append_38 = micp -@MICP_TRUE@am__append_39 = profiles/audio/micp.c -@CSIP_TRUE@am__append_40 = csip -@CSIP_TRUE@am__append_41 = profiles/audio/csip.c -@MAINTAINER_MODE_TRUE@am__append_42 = plugins/external-dummy.la +@MIDI_TRUE@am__append_26 = $(ALSA_CFLAGS) +@MIDI_TRUE@am__append_27 = $(ALSA_LIBS) +@SIXAXIS_TRUE@am__append_28 = sixaxis +@SIXAXIS_TRUE@am__append_29 = plugins/sixaxis.c +@SIXAXIS_TRUE@am__append_30 = $(UDEV_LIBS) +@BAP_TRUE@am__append_31 = bap +@BAP_TRUE@am__append_32 = profiles/audio/bap.c +@BASS_TRUE@am__append_33 = bass +@BASS_TRUE@am__append_34 = profiles/audio/bass.c +@MCP_TRUE@am__append_35 = mcp +@MCP_TRUE@am__append_36 = profiles/audio/mcp.c +@VCP_TRUE@am__append_37 = vcp +@VCP_TRUE@am__append_38 = profiles/audio/vcp.c +@MICP_TRUE@am__append_39 = micp +@MICP_TRUE@am__append_40 = profiles/audio/micp.c +@CCP_TRUE@am__append_41 = ccp +@CCP_TRUE@am__append_42 = profiles/audio/ccp.c +@CSIP_TRUE@am__append_43 = csip +@CSIP_TRUE@am__append_44 = profiles/audio/csip.c +@ASHA_TRUE@am__append_45 = asha +@ASHA_TRUE@am__append_46 = profiles/audio/asha.h profiles/audio/asha.c +@EXTERNAL_PLUGINS_TRUE@am__append_47 = src/bluetooth.ver # SPDX-License-Identifier: GPL-2.0 -@CLIENT_TRUE@am__append_43 = client/bluetoothctl -@MONITOR_TRUE@am__append_44 = monitor/btmon -@MANPAGES_TRUE@@MONITOR_TRUE@am__append_45 = monitor/btmon.1 -@LOGGER_TRUE@am__append_46 = tools/btmon-logger -@LOGGER_TRUE@@SYSTEMD_TRUE@am__append_47 = tools/bluetooth-logger.service -@TESTING_TRUE@am__append_48 = emulator/btvirt emulator/b1ee emulator/hfp \ +@CLIENT_TRUE@am__append_48 = client/bluetoothctl +@MONITOR_TRUE@am__append_49 = monitor/btmon +@MANPAGES_TRUE@@MONITOR_TRUE@am__append_50 = monitor/btmon.1 +@LOGGER_TRUE@am__append_51 = tools/btmon-logger +@LOGGER_TRUE@@SYSTEMD_TRUE@am__append_52 = tools/bluetooth-logger.service +@TESTING_TRUE@am__append_53 = emulator/btvirt emulator/b1ee emulator/hfp \ @TESTING_TRUE@ peripheral/btsensor tools/3dsp \ @TESTING_TRUE@ tools/mgmt-tester tools/gap-tester \ @TESTING_TRUE@ tools/l2cap-tester tools/sco-tester \ @@ -195,10 +200,10 @@ @TESTING_TRUE@ tools/userchan-tester tools/iso-tester \ @TESTING_TRUE@ tools/mesh-tester tools/ioctl-tester -@TOOLS_TRUE@am__append_49 = tools/rctest tools/l2test tools/l2ping tools/bluemoon \ +@TOOLS_TRUE@am__append_54 = tools/rctest tools/l2test tools/l2ping tools/bluemoon \ @TOOLS_TRUE@ tools/hex2hcd tools/mpris-proxy tools/btattach tools/isotest -@TOOLS_TRUE@am__append_50 = tools/bdaddr tools/avinfo tools/avtest \ +@TOOLS_TRUE@am__append_55 = tools/bdaddr tools/avinfo tools/avtest \ @TOOLS_TRUE@ tools/scotest tools/amptest tools/hwdb \ @TOOLS_TRUE@ tools/hcieventmask tools/hcisecfilter \ @TOOLS_TRUE@ tools/btinfo tools/btconfig \ @@ -212,65 +217,66 @@ @TOOLS_TRUE@ tools/test-runner tools/check-selftest \ @TOOLS_TRUE@ tools/gatt-service profiles/iap/iapd -@MANPAGES_TRUE@@TOOLS_TRUE@am__append_51 = tools/rctest.1 tools/l2ping.1 tools/btattach.1 tools/isotest.1 \ -@MANPAGES_TRUE@@TOOLS_TRUE@ tools/btmgmt.1 client/bluetoothctl-mgmt.1 \ +@MANPAGES_TRUE@@TOOLS_TRUE@am__append_56 = tools/rctest.1 tools/l2ping.1 tools/btattach.1 tools/isotest.1 \ +@MANPAGES_TRUE@@TOOLS_TRUE@ tools/btmgmt.1 client/bluetoothctl.1 \ +@MANPAGES_TRUE@@TOOLS_TRUE@ client/bluetoothctl-mgmt.1 \ @MANPAGES_TRUE@@TOOLS_TRUE@ client/bluetoothctl-monitor.1 client/bluetoothctl-admin.1 \ @MANPAGES_TRUE@@TOOLS_TRUE@ client/bluetoothctl-advertise.1 client/bluetoothctl-endpoint.1 \ @MANPAGES_TRUE@@TOOLS_TRUE@ client/bluetoothctl-gatt.1 client/bluetoothctl-player.1 \ @MANPAGES_TRUE@@TOOLS_TRUE@ client/bluetoothctl-scan.1 client/bluetoothctl-transport.1 -@DEPRECATED_TRUE@@MESH_TRUE@@TOOLS_TRUE@am__append_52 = tools/meshctl -@DEPRECATED_TRUE@@MESH_TRUE@@TOOLS_TRUE@am__append_53 = tools/mesh-gatt/local_node.json tools/mesh-gatt/prov_db.json -@MESH_TRUE@@TOOLS_TRUE@am__append_54 = tools/mesh-cfgclient \ +@DEPRECATED_TRUE@@MESH_TRUE@@TOOLS_TRUE@am__append_57 = tools/meshctl +@DEPRECATED_TRUE@@MESH_TRUE@@TOOLS_TRUE@am__append_58 = tools/mesh-gatt/local_node.json tools/mesh-gatt/prov_db.json +@MESH_TRUE@@TOOLS_TRUE@am__append_59 = tools/mesh-cfgclient \ @MESH_TRUE@@TOOLS_TRUE@ tools/mesh-cfgtest -@DEPRECATED_TRUE@@TOOLS_TRUE@am__append_55 = tools/hciattach tools/hciconfig tools/hcitool tools/hcidump \ +@DEPRECATED_TRUE@@TOOLS_TRUE@am__append_60 = tools/hciattach tools/hciconfig tools/hcitool tools/hcidump \ @DEPRECATED_TRUE@@TOOLS_TRUE@ tools/rfcomm tools/sdptool tools/ciptool -@DEPRECATED_TRUE@@MANPAGES_TRUE@@TOOLS_TRUE@am__append_56 = tools/hciattach.1 tools/hciconfig.1 \ +@DEPRECATED_TRUE@@MANPAGES_TRUE@@TOOLS_TRUE@am__append_61 = tools/hciattach.1 tools/hciconfig.1 \ @DEPRECATED_TRUE@@MANPAGES_TRUE@@TOOLS_TRUE@ tools/hcitool.1 tools/hcidump.1 \ @DEPRECATED_TRUE@@MANPAGES_TRUE@@TOOLS_TRUE@ tools/rfcomm.1 tools/sdptool.1 tools/ciptool.1 @HID2HCI_TRUE@udev_PROGRAMS = tools/hid2hci$(EXEEXT) -@HID2HCI_TRUE@@MANPAGES_TRUE@am__append_57 = tools/hid2hci.1 -@READLINE_TRUE@am__append_58 = tools/btmgmt tools/obex-client-tool tools/obex-server-tool \ +@HID2HCI_TRUE@@MANPAGES_TRUE@am__append_62 = tools/hid2hci.1 +@READLINE_TRUE@am__append_63 = tools/btmgmt tools/obex-client-tool tools/obex-server-tool \ @READLINE_TRUE@ tools/bluetooth-player tools/obexctl -@DEPRECATED_TRUE@@READLINE_TRUE@am__append_59 = attrib/gatttool +@DEPRECATED_TRUE@@READLINE_TRUE@am__append_64 = attrib/gatttool @CUPS_TRUE@cups_PROGRAMS = profiles/cups/bluetooth$(EXEEXT) -@BTPCLIENT_TRUE@am__append_60 = tools/btpclient tools/btpclientctl -@EXPERIMENTAL_TRUE@@OBEX_TRUE@am__append_61 = pcsuite -@EXPERIMENTAL_TRUE@@OBEX_TRUE@am__append_62 = obexd/plugins/pcsuite.c -@OBEX_TRUE@am__append_63 = obexd/plugins/phonebook-dummy.c obexd/plugins/phonebook-ebook.c \ +@BTPCLIENT_TRUE@am__append_65 = tools/btpclient tools/btpclientctl +@EXPERIMENTAL_TRUE@@OBEX_TRUE@am__append_66 = pcsuite +@EXPERIMENTAL_TRUE@@OBEX_TRUE@am__append_67 = obexd/plugins/pcsuite.c +@OBEX_TRUE@am__append_68 = obexd/plugins/phonebook-dummy.c obexd/plugins/phonebook-ebook.c \ @OBEX_TRUE@ obexd/plugins/phonebook-tracker.c -@OBEX_TRUE@am__append_64 = obexd/src/obexd -@ANDROID_TRUE@am__append_65 = -DANDROID_VERSION=0x050100 -@ANDROID_TRUE@am__append_66 = android/system-emulator \ +@OBEX_TRUE@am__append_69 = obexd/src/obexd +@ANDROID_TRUE@am__append_70 = -DANDROID_VERSION=0x050100 +@ANDROID_TRUE@am__append_71 = android/system-emulator \ @ANDROID_TRUE@ android/bluetoothd-snoop android/bluetoothd \ @ANDROID_TRUE@ android/avdtptest android/haltest \ @ANDROID_TRUE@ android/android-tester android/ipc-tester -@ANDROID_TRUE@am__append_67 = android/bluetooth.default.la \ +@ANDROID_TRUE@am__append_72 = android/bluetooth.default.la \ @ANDROID_TRUE@ android/audio.a2dp.default.la \ @ANDROID_TRUE@ android/audio.sco.default.la -@ANDROID_TRUE@am__append_68 = android/test-ipc +@ANDROID_TRUE@am__append_73 = android/test-ipc # SPDX-License-Identifier: GPL-2.0 -@DATAFILES_TRUE@@MESH_TRUE@am__append_69 = mesh/bluetooth-mesh.conf -@MESH_TRUE@@SYSTEMD_TRUE@am__append_70 = mesh/bluetooth-mesh.service -@MESH_TRUE@@SYSTEMD_TRUE@am__append_71 = mesh/org.bluez.mesh.service -@MESH_TRUE@am__append_72 = mesh/bluetooth-meshd -@MANPAGES_TRUE@@MESH_TRUE@am__append_73 = mesh/bluetooth-meshd.8 -@MESH_TRUE@am__append_74 = mesh/bluetooth-meshd.8 -@MESH_TRUE@am__append_75 = mesh/bluetooth-mesh.service -@HID2HCI_TRUE@am__append_76 = $(rules_DATA) -@OBEX_TRUE@am__append_77 = unit/test-gobex-header unit/test-gobex-packet unit/test-gobex \ +@DATAFILES_TRUE@@MESH_TRUE@am__append_74 = mesh/bluetooth-mesh.conf +@DATAFILES_TRUE@@MESH_TRUE@am__append_75 = mesh/mesh-main.conf +@MESH_TRUE@@SYSTEMD_TRUE@am__append_76 = mesh/bluetooth-mesh.service +@MESH_TRUE@@SYSTEMD_TRUE@am__append_77 = mesh/org.bluez.mesh.service +@MESH_TRUE@am__append_78 = mesh/bluetooth-meshd +@MANPAGES_TRUE@@MESH_TRUE@am__append_79 = mesh/bluetooth-meshd.8 +@MESH_TRUE@am__append_80 = mesh/bluetooth-meshd.8 +@HID2HCI_TRUE@am__append_81 = $(rules_DATA) +@OBEX_TRUE@am__append_82 = unit/test-gobex-header unit/test-gobex-packet unit/test-gobex \ @OBEX_TRUE@ unit/test-gobex-transfer unit/test-gobex-apparam -@MIDI_TRUE@am__append_78 = unit/test-midi -@MESH_TRUE@am__append_79 = unit/test-mesh-crypto -@MAINTAINER_MODE_TRUE@am__append_80 = $(unit_tests) +@MIDI_TRUE@am__append_83 = unit/test-midi +@MESH_TRUE@am__append_84 = unit/test-mesh-crypto +@MAINTAINER_MODE_TRUE@am__append_85 = $(unit_tests) TESTS = $(am__EXEEXT_17) -@DBUS_RUN_SESSION_TRUE@am__append_81 = dbus-run-session -- +@DBUS_RUN_SESSION_TRUE@am__append_86 = dbus-run-session -- subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ @@ -284,8 +290,10 @@ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = src/bluetoothd.rst lib/bluez.pc \ - mesh/bluetooth-meshd.rst +CONFIG_CLEAN_FILES = lib/bluez.pc mesh/bluetooth-meshd.rst \ + mesh/bluetooth-mesh.service obexd/src/obex.service \ + obexd/src/org.bluez.obex.service src/bluetoothd.rst \ + src/bluetooth.service tools/bluetooth-logger.service CONFIG_CLEAN_VPATH_FILES = @CLIENT_TRUE@am__EXEEXT_1 = client/bluetoothctl$(EXEEXT) @MONITOR_TRUE@am__EXEEXT_2 = monitor/btmon$(EXEEXT) @@ -307,9 +315,9 @@ "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(udevdir)" \ "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugindir)" \ "$(DESTDIR)$(testdir)" "$(DESTDIR)$(man1dir)" \ - "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" \ - "$(DESTDIR)$(confdir)" "$(DESTDIR)$(dbusdir)" \ - "$(DESTDIR)$(dbussessionbusdir)" \ + "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" \ + "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(confdir)" \ + "$(DESTDIR)$(dbusdir)" "$(DESTDIR)$(dbussessionbusdir)" \ "$(DESTDIR)$(dbussystembusdir)" \ "$(DESTDIR)$(zshcompletiondir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(rulesdir)" "$(DESTDIR)$(statedir)" \ @@ -444,7 +452,7 @@ am__v_lt_1 = android_audio_a2dp_default_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) \ + $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) \ $(android_audio_a2dp_default_la_LDFLAGS) $(LDFLAGS) -o $@ @ANDROID_TRUE@am_android_audio_a2dp_default_la_rpath = -rpath \ @ANDROID_TRUE@ $(plugindir) @@ -462,8 +470,8 @@ $(am_android_audio_sco_default_la_OBJECTS) android_audio_sco_default_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(android_audio_sco_default_la_LDFLAGS) \ - $(LDFLAGS) -o $@ + $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) \ + $(android_audio_sco_default_la_LDFLAGS) $(LDFLAGS) -o $@ @ANDROID_TRUE@am_android_audio_sco_default_la_rpath = -rpath \ @ANDROID_TRUE@ $(plugindir) android_bluetooth_default_la_LIBADD = @@ -505,8 +513,8 @@ $(am_android_bluetooth_default_la_OBJECTS) android_bluetooth_default_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(android_bluetooth_default_la_LDFLAGS) \ - $(LDFLAGS) -o $@ + $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) \ + $(android_bluetooth_default_la_LDFLAGS) $(LDFLAGS) -o $@ @ANDROID_TRUE@am_android_bluetooth_default_la_rpath = -rpath \ @ANDROID_TRUE@ $(plugindir) ell_libell_internal_la_LIBADD = @@ -578,27 +586,6 @@ $(AM_CFLAGS) $(CFLAGS) $(lib_libbluetooth_la_LDFLAGS) \ $(LDFLAGS) -o $@ @LIBRARY_TRUE@am_lib_libbluetooth_la_rpath = -rpath $(libdir) -plugins_external_dummy_la_LIBADD = -am__plugins_external_dummy_la_SOURCES_DIST = plugins/external-dummy.c -@MAINTAINER_MODE_TRUE@am_plugins_external_dummy_la_OBJECTS = plugins/external_dummy_la-external-dummy.lo -plugins_external_dummy_la_OBJECTS = \ - $(am_plugins_external_dummy_la_OBJECTS) -plugins_external_dummy_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(plugins_external_dummy_la_CFLAGS) $(CFLAGS) \ - $(plugins_external_dummy_la_LDFLAGS) $(LDFLAGS) -o $@ -@MAINTAINER_MODE_TRUE@am_plugins_external_dummy_la_rpath = -rpath \ -@MAINTAINER_MODE_TRUE@ $(plugindir) -@SIXAXIS_TRUE@plugins_sixaxis_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am__plugins_sixaxis_la_SOURCES_DIST = plugins/sixaxis.c -@SIXAXIS_TRUE@am_plugins_sixaxis_la_OBJECTS = \ -@SIXAXIS_TRUE@ plugins/sixaxis_la-sixaxis.lo -plugins_sixaxis_la_OBJECTS = $(am_plugins_sixaxis_la_OBJECTS) -plugins_sixaxis_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(plugins_sixaxis_la_CFLAGS) $(CFLAGS) \ - $(plugins_sixaxis_la_LDFLAGS) $(LDFLAGS) -o $@ -@SIXAXIS_TRUE@am_plugins_sixaxis_la_rpath = -rpath $(plugindir) src_libshared_ell_la_LIBADD = am__src_libshared_ell_la_SOURCES_DIST = src/shared/io.h \ src/shared/timeout.h src/shared/queue.h src/shared/queue.c \ @@ -622,10 +609,11 @@ src/shared/mcp.c src/shared/vcp.c src/shared/vcp.h \ src/shared/micp.c src/shared/micp.h src/shared/csip.c \ src/shared/csip.h src/shared/bass.h src/shared/bass.c \ - src/shared/lc3.h src/shared/tty.h src/shared/shell.c \ - src/shared/shell.h src/shared/io-ell.c \ - src/shared/timeout-ell.c src/shared/mainloop.h \ - src/shared/mainloop-ell.c + src/shared/ccp.h src/shared/ccp.c src/shared/lc3.h \ + src/shared/tty.h src/shared/bap-defs.h src/shared/asha.h \ + src/shared/asha.c src/shared/shell.c src/shared/shell.h \ + src/shared/io-ell.c src/shared/timeout-ell.c \ + src/shared/mainloop.h src/shared/mainloop-ell.c @READLINE_TRUE@am__objects_5 = src/shared/libshared_ell_la-shell.lo am__objects_6 = src/shared/libshared_ell_la-queue.lo \ src/shared/libshared_ell_la-util.lo \ @@ -653,7 +641,9 @@ src/shared/libshared_ell_la-vcp.lo \ src/shared/libshared_ell_la-micp.lo \ src/shared/libshared_ell_la-csip.lo \ - src/shared/libshared_ell_la-bass.lo $(am__objects_5) + src/shared/libshared_ell_la-bass.lo \ + src/shared/libshared_ell_la-ccp.lo \ + src/shared/libshared_ell_la-asha.lo $(am__objects_5) @LIBSHARED_ELL_TRUE@am_src_libshared_ell_la_OBJECTS = \ @LIBSHARED_ELL_TRUE@ $(am__objects_6) \ @LIBSHARED_ELL_TRUE@ src/shared/libshared_ell_la-io-ell.lo \ @@ -688,11 +678,12 @@ src/shared/mcp.c src/shared/vcp.c src/shared/vcp.h \ src/shared/micp.c src/shared/micp.h src/shared/csip.c \ src/shared/csip.h src/shared/bass.h src/shared/bass.c \ - src/shared/lc3.h src/shared/tty.h src/shared/shell.c \ - src/shared/shell.h src/shared/io-glib.c \ - src/shared/timeout-glib.c src/shared/mainloop-glib.c \ - src/shared/mainloop-notify.h src/shared/mainloop-notify.c \ - src/shared/tester.c + src/shared/ccp.h src/shared/ccp.c src/shared/lc3.h \ + src/shared/tty.h src/shared/bap-defs.h src/shared/asha.h \ + src/shared/asha.c src/shared/shell.c src/shared/shell.h \ + src/shared/io-glib.c src/shared/timeout-glib.c \ + src/shared/mainloop-glib.c src/shared/mainloop-notify.h \ + src/shared/mainloop-notify.c src/shared/tester.c @READLINE_TRUE@am__objects_7 = src/shared/libshared_glib_la-shell.lo am__objects_8 = src/shared/libshared_glib_la-queue.lo \ src/shared/libshared_glib_la-util.lo \ @@ -720,7 +711,9 @@ src/shared/libshared_glib_la-vcp.lo \ src/shared/libshared_glib_la-micp.lo \ src/shared/libshared_glib_la-csip.lo \ - src/shared/libshared_glib_la-bass.lo $(am__objects_7) + src/shared/libshared_glib_la-bass.lo \ + src/shared/libshared_glib_la-ccp.lo \ + src/shared/libshared_glib_la-asha.lo $(am__objects_7) am_src_libshared_glib_la_OBJECTS = $(am__objects_8) \ src/shared/libshared_glib_la-io-glib.lo \ src/shared/libshared_glib_la-timeout-glib.lo \ @@ -755,11 +748,12 @@ src/shared/mcp.c src/shared/vcp.c src/shared/vcp.h \ src/shared/micp.c src/shared/micp.h src/shared/csip.c \ src/shared/csip.h src/shared/bass.h src/shared/bass.c \ - src/shared/lc3.h src/shared/tty.h src/shared/shell.c \ - src/shared/shell.h src/shared/io-mainloop.c \ - src/shared/timeout-mainloop.c src/shared/mainloop.h \ - src/shared/mainloop.c src/shared/mainloop-notify.h \ - src/shared/mainloop-notify.c + src/shared/ccp.h src/shared/ccp.c src/shared/lc3.h \ + src/shared/tty.h src/shared/bap-defs.h src/shared/asha.h \ + src/shared/asha.c src/shared/shell.c src/shared/shell.h \ + src/shared/io-mainloop.c src/shared/timeout-mainloop.c \ + src/shared/mainloop.h src/shared/mainloop.c \ + src/shared/mainloop-notify.h src/shared/mainloop-notify.c @READLINE_TRUE@am__objects_9 = \ @READLINE_TRUE@ src/shared/libshared_mainloop_la-shell.lo am__objects_10 = src/shared/libshared_mainloop_la-queue.lo \ @@ -788,7 +782,9 @@ src/shared/libshared_mainloop_la-vcp.lo \ src/shared/libshared_mainloop_la-micp.lo \ src/shared/libshared_mainloop_la-csip.lo \ - src/shared/libshared_mainloop_la-bass.lo $(am__objects_9) + src/shared/libshared_mainloop_la-bass.lo \ + src/shared/libshared_mainloop_la-ccp.lo \ + src/shared/libshared_mainloop_la-asha.lo $(am__objects_9) am_src_libshared_mainloop_la_OBJECTS = $(am__objects_10) \ src/shared/libshared_mainloop_la-io-mainloop.lo \ src/shared/libshared_mainloop_la-timeout-mainloop.lo \ @@ -1095,6 +1091,8 @@ @MESH_TRUE@ mesh/main.$(OBJEXT) mesh_bluetooth_meshd_OBJECTS = $(am_mesh_bluetooth_meshd_OBJECTS) @EXTERNAL_ELL_FALSE@am__DEPENDENCIES_2 = ell/libell-internal.la +@MESH_TRUE@mesh_bluetooth_meshd_DEPENDENCIES = src/libshared-ell.la \ +@MESH_TRUE@ $(am__DEPENDENCIES_2) am__monitor_btmon_SOURCES_DIST = monitor/main.c monitor/bt.h \ monitor/display.h monitor/display.c monitor/hcidump.h \ monitor/hcidump.c monitor/ellisys.h monitor/ellisys.c \ @@ -1222,8 +1220,8 @@ @OBEX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) obexd_src_obexd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(obexd_src_obexd_CFLAGS) $(CFLAGS) $(obexd_src_obexd_LDFLAGS) \ - $(LDFLAGS) -o $@ + $(AM_CFLAGS) $(CFLAGS) $(obexd_src_obexd_LDFLAGS) $(LDFLAGS) \ + -o $@ am__peripheral_btsensor_SOURCES_DIST = peripheral/main.c \ peripheral/efivars.h peripheral/efivars.c peripheral/attach.h \ peripheral/attach.c peripheral/log.h peripheral/log.c \ @@ -1298,14 +1296,15 @@ profiles/scanparam/scan.c profiles/deviceinfo/deviceinfo.c \ profiles/midi/midi.c profiles/midi/libmidi.h \ profiles/midi/libmidi.c profiles/battery/battery.c \ - profiles/audio/bap.c profiles/audio/bass.c \ + plugins/sixaxis.c profiles/audio/bap.c profiles/audio/bass.c \ profiles/audio/mcp.c profiles/audio/vcp.c \ - profiles/audio/micp.c profiles/audio/csip.c attrib/att.h \ - attrib/att-database.h attrib/att.c attrib/gatt.h attrib/gatt.c \ - attrib/gattrib.h attrib/gattrib.c btio/btio.h btio/btio.c \ - src/bluetooth.ver src/main.c src/log.h src/log.c \ - src/backtrace.h src/backtrace.c src/rfkill.c src/btd.h \ - src/sdpd.h src/sdpd-server.c src/sdpd-request.c \ + profiles/audio/micp.c profiles/audio/ccp.c \ + profiles/audio/csip.c profiles/audio/asha.h \ + profiles/audio/asha.c attrib/att.h attrib/att-database.h \ + attrib/att.c attrib/gatt.h attrib/gatt.c attrib/gattrib.h \ + attrib/gattrib.c btio/btio.h btio/btio.c src/main.c src/log.h \ + src/log.c src/backtrace.h src/backtrace.c src/rfkill.c \ + src/btd.h src/sdpd.h src/sdpd-server.c src/sdpd-request.c \ src/sdpd-service.c src/sdpd-database.c src/gatt-database.h \ src/gatt-database.c src/sdp-xml.h src/sdp-xml.c \ src/sdp-client.h src/sdp-client.c src/textfile.h \ @@ -1318,7 +1317,7 @@ src/dbus-common.c src/dbus-common.h src/eir.h src/eir.c \ src/adv_monitor.h src/adv_monitor.c src/battery.h \ src/battery.c src/settings.h src/settings.c src/set.h \ - src/set.c + src/set.c src/bluetooth.ver @ADMIN_TRUE@am__objects_17 = plugins/bluetoothd-admin.$(OBJEXT) @NFC_TRUE@am__objects_18 = plugins/bluetoothd-neard.$(OBJEXT) @SAP_TRUE@am__objects_19 = profiles/sap/bluetoothd-main.$(OBJEXT) \ @@ -1360,13 +1359,16 @@ @HEALTH_TRUE@ profiles/health/bluetoothd-hdp_util.$(OBJEXT) @MIDI_TRUE@am__objects_26 = profiles/midi/bluetoothd-midi.$(OBJEXT) \ @MIDI_TRUE@ profiles/midi/bluetoothd-libmidi.$(OBJEXT) -@BAP_TRUE@am__objects_27 = profiles/audio/bluetoothd-bap.$(OBJEXT) -@BASS_TRUE@am__objects_28 = profiles/audio/bluetoothd-bass.$(OBJEXT) -@MCP_TRUE@am__objects_29 = profiles/audio/bluetoothd-mcp.$(OBJEXT) -@VCP_TRUE@am__objects_30 = profiles/audio/bluetoothd-vcp.$(OBJEXT) -@MICP_TRUE@am__objects_31 = profiles/audio/bluetoothd-micp.$(OBJEXT) -@CSIP_TRUE@am__objects_32 = profiles/audio/bluetoothd-csip.$(OBJEXT) -am__objects_33 = plugins/bluetoothd-hostname.$(OBJEXT) \ +@SIXAXIS_TRUE@am__objects_27 = plugins/bluetoothd-sixaxis.$(OBJEXT) +@BAP_TRUE@am__objects_28 = profiles/audio/bluetoothd-bap.$(OBJEXT) +@BASS_TRUE@am__objects_29 = profiles/audio/bluetoothd-bass.$(OBJEXT) +@MCP_TRUE@am__objects_30 = profiles/audio/bluetoothd-mcp.$(OBJEXT) +@VCP_TRUE@am__objects_31 = profiles/audio/bluetoothd-vcp.$(OBJEXT) +@MICP_TRUE@am__objects_32 = profiles/audio/bluetoothd-micp.$(OBJEXT) +@CCP_TRUE@am__objects_33 = profiles/audio/bluetoothd-ccp.$(OBJEXT) +@CSIP_TRUE@am__objects_34 = profiles/audio/bluetoothd-csip.$(OBJEXT) +@ASHA_TRUE@am__objects_35 = profiles/audio/bluetoothd-asha.$(OBJEXT) +am__objects_36 = plugins/bluetoothd-hostname.$(OBJEXT) \ plugins/bluetoothd-wiimote.$(OBJEXT) \ plugins/bluetoothd-autopair.$(OBJEXT) \ plugins/bluetoothd-policy.$(OBJEXT) $(am__objects_17) \ @@ -1379,13 +1381,14 @@ $(am__objects_26) \ profiles/battery/bluetoothd-battery.$(OBJEXT) \ $(am__objects_27) $(am__objects_28) $(am__objects_29) \ - $(am__objects_30) $(am__objects_31) $(am__objects_32) -am__objects_34 = attrib/bluetoothd-att.$(OBJEXT) \ + $(am__objects_30) $(am__objects_31) $(am__objects_32) \ + $(am__objects_33) $(am__objects_34) $(am__objects_35) +am__objects_37 = attrib/bluetoothd-att.$(OBJEXT) \ attrib/bluetoothd-gatt.$(OBJEXT) \ attrib/bluetoothd-gattrib.$(OBJEXT) -am__objects_35 = btio/bluetoothd-btio.$(OBJEXT) -am_src_bluetoothd_OBJECTS = $(am__objects_33) $(am__objects_34) \ - $(am__objects_35) src/bluetoothd-main.$(OBJEXT) \ +am__objects_38 = btio/bluetoothd-btio.$(OBJEXT) +am_src_bluetoothd_OBJECTS = $(am__objects_36) $(am__objects_37) \ + $(am__objects_38) src/bluetoothd-main.$(OBJEXT) \ src/bluetoothd-log.$(OBJEXT) \ src/bluetoothd-backtrace.$(OBJEXT) \ src/bluetoothd-rfkill.$(OBJEXT) \ @@ -1411,12 +1414,18 @@ src/bluetoothd-eir.$(OBJEXT) \ src/bluetoothd-adv_monitor.$(OBJEXT) \ src/bluetoothd-battery.$(OBJEXT) \ - src/bluetoothd-settings.$(OBJEXT) src/bluetoothd-set.$(OBJEXT) -nodist_src_bluetoothd_OBJECTS = $(am__objects_16) + src/bluetoothd-settings.$(OBJEXT) src/bluetoothd-set.$(OBJEXT) \ + $(am__objects_1) +nodist_src_bluetoothd_OBJECTS = $(am__objects_1) src_bluetoothd_OBJECTS = $(am_src_bluetoothd_OBJECTS) \ $(nodist_src_bluetoothd_OBJECTS) @MIDI_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) -am__DEPENDENCIES_4 = $(am__DEPENDENCIES_3) +@SIXAXIS_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) +am__DEPENDENCIES_5 = $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4) +src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \ + gdbus/libgdbus-internal.la src/libshared-glib.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_5) src_bluetoothd_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(src_bluetoothd_LDFLAGS) $(LDFLAGS) -o \ @@ -1535,12 +1544,17 @@ @LOGGER_TRUE@am_tools_btmon_logger_OBJECTS = \ @LOGGER_TRUE@ tools/btmon-logger.$(OBJEXT) tools_btmon_logger_OBJECTS = $(am_tools_btmon_logger_OBJECTS) +@LOGGER_TRUE@tools_btmon_logger_DEPENDENCIES = \ +@LOGGER_TRUE@ src/libshared-mainloop.la am__tools_btpclient_SOURCES_DIST = tools/btpclient.c src/shared/btp.c \ src/shared/btp.h @BTPCLIENT_TRUE@am_tools_btpclient_OBJECTS = \ @BTPCLIENT_TRUE@ tools/btpclient.$(OBJEXT) \ @BTPCLIENT_TRUE@ src/shared/btp.$(OBJEXT) tools_btpclient_OBJECTS = $(am_tools_btpclient_OBJECTS) +@BTPCLIENT_TRUE@tools_btpclient_DEPENDENCIES = \ +@BTPCLIENT_TRUE@ lib/libbluetooth-internal.la \ +@BTPCLIENT_TRUE@ src/libshared-ell.la $(am__DEPENDENCIES_2) am__tools_btpclientctl_SOURCES_DIST = tools/btpclientctl.c \ client/display.c @BTPCLIENT_TRUE@am_tools_btpclientctl_OBJECTS = \ @@ -1713,10 +1727,11 @@ @TESTING_TRUE@tools_ioctl_tester_DEPENDENCIES = \ @TESTING_TRUE@ lib/libbluetooth-internal.la \ @TESTING_TRUE@ src/libshared-glib.la $(am__DEPENDENCIES_1) -am__tools_iso_tester_SOURCES_DIST = tools/iso-tester.c monitor/bt.h \ - emulator/hciemu.h emulator/hciemu.c emulator/vhci.h \ - emulator/vhci.c emulator/btdev.h emulator/btdev.c \ - emulator/bthost.h emulator/bthost.c emulator/smp.c +am__tools_iso_tester_SOURCES_DIST = tools/iso-tester.c tools/tester.h \ + monitor/bt.h emulator/hciemu.h emulator/hciemu.c \ + emulator/vhci.h emulator/vhci.c emulator/btdev.h \ + emulator/btdev.c emulator/bthost.h emulator/bthost.c \ + emulator/smp.c @TESTING_TRUE@am_tools_iso_tester_OBJECTS = \ @TESTING_TRUE@ tools/iso-tester.$(OBJEXT) \ @TESTING_TRUE@ emulator/hciemu.$(OBJEXT) \ @@ -1730,10 +1745,10 @@ tools_isotest_OBJECTS = tools/isotest.$(OBJEXT) @TOOLS_TRUE@tools_isotest_DEPENDENCIES = lib/libbluetooth-internal.la am__tools_l2cap_tester_SOURCES_DIST = tools/l2cap-tester.c \ - monitor/bt.h emulator/hciemu.h emulator/hciemu.c \ - emulator/vhci.h emulator/vhci.c emulator/btdev.h \ - emulator/btdev.c emulator/bthost.h emulator/bthost.c \ - emulator/smp.c + tools/tester.h monitor/bt.h emulator/hciemu.h \ + emulator/hciemu.c emulator/vhci.h emulator/vhci.c \ + emulator/btdev.h emulator/btdev.c emulator/bthost.h \ + emulator/bthost.c emulator/smp.c @TESTING_TRUE@am_tools_l2cap_tester_OBJECTS = \ @TESTING_TRUE@ tools/l2cap-tester.$(OBJEXT) \ @TESTING_TRUE@ emulator/hciemu.$(OBJEXT) \ @@ -1863,12 +1878,12 @@ gobex/gobex-transfer.c gobex/gobex-debug.h \ gobex/gobex-apparam.c gobex/gobex-apparam.h btio/btio.h \ btio/btio.c tools/obex-client-tool.c -am__objects_36 = gobex/gobex.$(OBJEXT) gobex/gobex-defs.$(OBJEXT) \ +am__objects_39 = gobex/gobex.$(OBJEXT) gobex/gobex-defs.$(OBJEXT) \ gobex/gobex-packet.$(OBJEXT) gobex/gobex-header.$(OBJEXT) \ gobex/gobex-transfer.$(OBJEXT) gobex/gobex-apparam.$(OBJEXT) -am__objects_37 = btio/btio.$(OBJEXT) -@READLINE_TRUE@am_tools_obex_client_tool_OBJECTS = $(am__objects_36) \ -@READLINE_TRUE@ $(am__objects_37) \ +am__objects_40 = btio/btio.$(OBJEXT) +@READLINE_TRUE@am_tools_obex_client_tool_OBJECTS = $(am__objects_39) \ +@READLINE_TRUE@ $(am__objects_40) \ @READLINE_TRUE@ tools/obex-client-tool.$(OBJEXT) tools_obex_client_tool_OBJECTS = $(am_tools_obex_client_tool_OBJECTS) @READLINE_TRUE@tools_obex_client_tool_DEPENDENCIES = \ @@ -1880,8 +1895,8 @@ gobex/gobex-transfer.c gobex/gobex-debug.h \ gobex/gobex-apparam.c gobex/gobex-apparam.h btio/btio.h \ btio/btio.c tools/obex-server-tool.c -@READLINE_TRUE@am_tools_obex_server_tool_OBJECTS = $(am__objects_36) \ -@READLINE_TRUE@ $(am__objects_37) \ +@READLINE_TRUE@am_tools_obex_server_tool_OBJECTS = $(am__objects_39) \ +@READLINE_TRUE@ $(am__objects_40) \ @READLINE_TRUE@ tools/obex-server-tool.$(OBJEXT) tools_obex_server_tool_OBJECTS = $(am_tools_obex_server_tool_OBJECTS) @READLINE_TRUE@tools_obex_server_tool_DEPENDENCIES = \ @@ -1924,10 +1939,11 @@ @TOOLS_TRUE@am_tools_rtlfw_OBJECTS = tools/rtlfw.$(OBJEXT) tools_rtlfw_OBJECTS = $(am_tools_rtlfw_OBJECTS) tools_rtlfw_LDADD = $(LDADD) -am__tools_sco_tester_SOURCES_DIST = tools/sco-tester.c monitor/bt.h \ - emulator/hciemu.h emulator/hciemu.c emulator/vhci.h \ - emulator/vhci.c emulator/btdev.h emulator/btdev.c \ - emulator/bthost.h emulator/bthost.c emulator/smp.c +am__tools_sco_tester_SOURCES_DIST = tools/sco-tester.c tools/tester.h \ + monitor/bt.h emulator/hciemu.h emulator/hciemu.c \ + emulator/vhci.h emulator/vhci.c emulator/btdev.h \ + emulator/btdev.c emulator/bthost.h emulator/bthost.c \ + emulator/smp.c @TESTING_TRUE@am_tools_sco_tester_OBJECTS = \ @TESTING_TRUE@ tools/sco-tester.$(OBJEXT) \ @TESTING_TRUE@ emulator/hciemu.$(OBJEXT) \ @@ -2003,7 +2019,7 @@ unit_test_bap_OBJECTS = $(am_unit_test_bap_OBJECTS) unit_test_bap_DEPENDENCIES = src/libshared-glib.la \ lib/libbluetooth-internal.la $(am__DEPENDENCIES_1) -am_unit_test_bass_OBJECTS = unit/test-bass.$(OBJEXT) $(am__objects_37) +am_unit_test_bass_OBJECTS = unit/test-bass.$(OBJEXT) $(am__objects_40) unit_test_bass_OBJECTS = $(am_unit_test_bass_OBJECTS) unit_test_bass_DEPENDENCIES = src/libshared-glib.la \ lib/libbluetooth-internal.la $(am__DEPENDENCIES_1) @@ -2030,7 +2046,7 @@ unit_test_gatt_DEPENDENCIES = src/libshared-glib.la \ lib/libbluetooth-internal.la $(am__DEPENDENCIES_1) am_unit_test_gattrib_OBJECTS = unit/test-gattrib.$(OBJEXT) \ - attrib/gattrib.$(OBJEXT) $(am__objects_37) src/log.$(OBJEXT) + attrib/gattrib.$(OBJEXT) $(am__objects_40) src/log.$(OBJEXT) unit_test_gattrib_OBJECTS = $(am_unit_test_gattrib_OBJECTS) unit_test_gattrib_DEPENDENCIES = src/libshared-glib.la \ lib/libbluetooth-internal.la $(am__DEPENDENCIES_1) \ @@ -2046,7 +2062,7 @@ gobex/gobex-transfer.c gobex/gobex-debug.h \ gobex/gobex-apparam.c gobex/gobex-apparam.h unit/util.c \ unit/util.h unit/test-gobex.c -@OBEX_TRUE@am_unit_test_gobex_OBJECTS = $(am__objects_36) \ +@OBEX_TRUE@am_unit_test_gobex_OBJECTS = $(am__objects_39) \ @OBEX_TRUE@ unit/util.$(OBJEXT) unit/test-gobex.$(OBJEXT) unit_test_gobex_OBJECTS = $(am_unit_test_gobex_OBJECTS) @OBEX_TRUE@unit_test_gobex_DEPENDENCIES = src/libshared-glib.la \ @@ -2057,7 +2073,7 @@ gobex/gobex-transfer.c gobex/gobex-debug.h \ gobex/gobex-apparam.c gobex/gobex-apparam.h unit/util.c \ unit/util.h unit/test-gobex-apparam.c -@OBEX_TRUE@am_unit_test_gobex_apparam_OBJECTS = $(am__objects_36) \ +@OBEX_TRUE@am_unit_test_gobex_apparam_OBJECTS = $(am__objects_39) \ @OBEX_TRUE@ unit/util.$(OBJEXT) \ @OBEX_TRUE@ unit/test-gobex-apparam.$(OBJEXT) unit_test_gobex_apparam_OBJECTS = \ @@ -2070,7 +2086,7 @@ gobex/gobex-transfer.c gobex/gobex-debug.h \ gobex/gobex-apparam.c gobex/gobex-apparam.h unit/util.c \ unit/util.h unit/test-gobex-header.c -@OBEX_TRUE@am_unit_test_gobex_header_OBJECTS = $(am__objects_36) \ +@OBEX_TRUE@am_unit_test_gobex_header_OBJECTS = $(am__objects_39) \ @OBEX_TRUE@ unit/util.$(OBJEXT) \ @OBEX_TRUE@ unit/test-gobex-header.$(OBJEXT) unit_test_gobex_header_OBJECTS = $(am_unit_test_gobex_header_OBJECTS) @@ -2082,7 +2098,7 @@ gobex/gobex-transfer.c gobex/gobex-debug.h \ gobex/gobex-apparam.c gobex/gobex-apparam.h unit/util.c \ unit/util.h unit/test-gobex-packet.c -@OBEX_TRUE@am_unit_test_gobex_packet_OBJECTS = $(am__objects_36) \ +@OBEX_TRUE@am_unit_test_gobex_packet_OBJECTS = $(am__objects_39) \ @OBEX_TRUE@ unit/util.$(OBJEXT) \ @OBEX_TRUE@ unit/test-gobex-packet.$(OBJEXT) unit_test_gobex_packet_OBJECTS = $(am_unit_test_gobex_packet_OBJECTS) @@ -2095,7 +2111,7 @@ gobex/gobex-debug.h gobex/gobex-apparam.c \ gobex/gobex-apparam.h unit/util.c unit/util.h \ unit/test-gobex-transfer.c -@OBEX_TRUE@am_unit_test_gobex_transfer_OBJECTS = $(am__objects_36) \ +@OBEX_TRUE@am_unit_test_gobex_transfer_OBJECTS = $(am__objects_39) \ @OBEX_TRUE@ unit/util.$(OBJEXT) \ @OBEX_TRUE@ unit/test-gobex-transfer.$(OBJEXT) unit_test_gobex_transfer_OBJECTS = \ @@ -2106,7 +2122,7 @@ unit_test_hfp_OBJECTS = $(am_unit_test_hfp_OBJECTS) unit_test_hfp_DEPENDENCIES = src/libshared-glib.la \ $(am__DEPENDENCIES_1) -am_unit_test_hog_OBJECTS = unit/test-hog.$(OBJEXT) $(am__objects_37) \ +am_unit_test_hog_OBJECTS = unit/test-hog.$(OBJEXT) $(am__objects_40) \ profiles/input/hog-lib.$(OBJEXT) \ profiles/scanparam/scpp.$(OBJEXT) \ profiles/battery/bas.$(OBJEXT) \ @@ -2173,7 +2189,7 @@ unit_test_uuid_OBJECTS = $(am_unit_test_uuid_OBJECTS) unit_test_uuid_DEPENDENCIES = src/libshared-glib.la \ lib/libbluetooth-internal.la $(am__DEPENDENCIES_1) -am_unit_test_vcp_OBJECTS = unit/test-vcp.$(OBJEXT) $(am__objects_37) +am_unit_test_vcp_OBJECTS = unit/test-vcp.$(OBJEXT) $(am__objects_40) unit_test_vcp_OBJECTS = $(am_unit_test_vcp_OBJECTS) unit_test_vcp_DEPENDENCIES = src/libshared-glib.la \ lib/libbluetooth-internal.la $(am__DEPENDENCIES_1) @@ -2399,15 +2415,16 @@ plugins/$(DEPDIR)/bluetoothd-hostname.Po \ plugins/$(DEPDIR)/bluetoothd-neard.Po \ plugins/$(DEPDIR)/bluetoothd-policy.Po \ + plugins/$(DEPDIR)/bluetoothd-sixaxis.Po \ plugins/$(DEPDIR)/bluetoothd-wiimote.Po \ - plugins/$(DEPDIR)/external_dummy_la-external-dummy.Plo \ - plugins/$(DEPDIR)/sixaxis_la-sixaxis.Plo \ profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po \ + profiles/audio/$(DEPDIR)/bluetoothd-asha.Po \ profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po \ profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po \ profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po \ profiles/audio/$(DEPDIR)/bluetoothd-bap.Po \ profiles/audio/$(DEPDIR)/bluetoothd-bass.Po \ + profiles/audio/$(DEPDIR)/bluetoothd-ccp.Po \ profiles/audio/$(DEPDIR)/bluetoothd-control.Po \ profiles/audio/$(DEPDIR)/bluetoothd-csip.Po \ profiles/audio/$(DEPDIR)/bluetoothd-mcp.Po \ @@ -2498,11 +2515,13 @@ src/shared/$(DEPDIR)/android_avdtptest-util.Po \ src/shared/$(DEPDIR)/btp.Po \ src/shared/$(DEPDIR)/libshared_ell_la-ad.Plo \ + src/shared/$(DEPDIR)/libshared_ell_la-asha.Plo \ src/shared/$(DEPDIR)/libshared_ell_la-att.Plo \ src/shared/$(DEPDIR)/libshared_ell_la-bap-debug.Plo \ src/shared/$(DEPDIR)/libshared_ell_la-bap.Plo \ src/shared/$(DEPDIR)/libshared_ell_la-bass.Plo \ src/shared/$(DEPDIR)/libshared_ell_la-btsnoop.Plo \ + src/shared/$(DEPDIR)/libshared_ell_la-ccp.Plo \ src/shared/$(DEPDIR)/libshared_ell_la-crypto.Plo \ src/shared/$(DEPDIR)/libshared_ell_la-csip.Plo \ src/shared/$(DEPDIR)/libshared_ell_la-ecc.Plo \ @@ -2529,11 +2548,13 @@ src/shared/$(DEPDIR)/libshared_ell_la-util.Plo \ src/shared/$(DEPDIR)/libshared_ell_la-vcp.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-ad.Plo \ + src/shared/$(DEPDIR)/libshared_glib_la-asha.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-att.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-bap-debug.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-bap.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-bass.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-btsnoop.Plo \ + src/shared/$(DEPDIR)/libshared_glib_la-ccp.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-crypto.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-csip.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-ecc.Plo \ @@ -2562,11 +2583,13 @@ src/shared/$(DEPDIR)/libshared_glib_la-util.Plo \ src/shared/$(DEPDIR)/libshared_glib_la-vcp.Plo \ src/shared/$(DEPDIR)/libshared_mainloop_la-ad.Plo \ + src/shared/$(DEPDIR)/libshared_mainloop_la-asha.Plo \ src/shared/$(DEPDIR)/libshared_mainloop_la-att.Plo \ src/shared/$(DEPDIR)/libshared_mainloop_la-bap-debug.Plo \ src/shared/$(DEPDIR)/libshared_mainloop_la-bap.Plo \ src/shared/$(DEPDIR)/libshared_mainloop_la-bass.Plo \ src/shared/$(DEPDIR)/libshared_mainloop_la-btsnoop.Plo \ + src/shared/$(DEPDIR)/libshared_mainloop_la-ccp.Plo \ src/shared/$(DEPDIR)/libshared_mainloop_la-crypto.Plo \ src/shared/$(DEPDIR)/libshared_mainloop_la-csip.Plo \ src/shared/$(DEPDIR)/libshared_mainloop_la-ecc.Plo \ @@ -2709,9 +2732,7 @@ $(ell_libell_internal_la_SOURCES) \ $(gdbus_libgdbus_internal_la_SOURCES) \ $(lib_libbluetooth_internal_la_SOURCES) \ - $(lib_libbluetooth_la_SOURCES) \ - $(plugins_external_dummy_la_SOURCES) \ - $(plugins_sixaxis_la_SOURCES) $(src_libshared_ell_la_SOURCES) \ + $(lib_libbluetooth_la_SOURCES) $(src_libshared_ell_la_SOURCES) \ $(src_libshared_glib_la_SOURCES) \ $(src_libshared_mainloop_la_SOURCES) \ $(android_android_tester_SOURCES) $(android_avdtptest_SOURCES) \ @@ -2784,8 +2805,6 @@ $(gdbus_libgdbus_internal_la_SOURCES) \ $(lib_libbluetooth_internal_la_SOURCES) \ $(am__lib_libbluetooth_la_SOURCES_DIST) \ - $(am__plugins_external_dummy_la_SOURCES_DIST) \ - $(am__plugins_sixaxis_la_SOURCES_DIST) \ $(am__src_libshared_ell_la_SOURCES_DIST) \ $(am__src_libshared_glib_la_SOURCES_DIST) \ $(am__src_libshared_mainloop_la_SOURCES_DIST) \ @@ -2890,6 +2909,7 @@ esac man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 +man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) @@ -3102,9 +3122,14 @@ $(srcdir)/Makefile.obexd $(srcdir)/Makefile.plugins \ $(srcdir)/Makefile.tools $(srcdir)/android/Makefile.am \ $(srcdir)/config.h.in $(top_srcdir)/lib/bluez.pc.in \ + $(top_srcdir)/mesh/bluetooth-mesh.service.in \ $(top_srcdir)/mesh/bluetooth-meshd.rst.in \ - $(top_srcdir)/src/bluetoothd.rst.in AUTHORS COPYING \ - COPYING.LIB ChangeLog INSTALL NEWS README TODO compile \ + $(top_srcdir)/obexd/src/obex.service.in \ + $(top_srcdir)/obexd/src/org.bluez.obex.service.in \ + $(top_srcdir)/src/bluetooth.service.in \ + $(top_srcdir)/src/bluetoothd.rst.in \ + $(top_srcdir)/tools/bluetooth-logger.service.in AUTHORS \ + COPYING COPYING.LIB ChangeLog INSTALL NEWS README TODO compile \ config.guess config.sub depcomp install-sh ltmain.sh missing \ test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -3127,7 +3152,7 @@ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print pkgincludedir = $(includedir)/bluetooth -pkglibexecdir = $(libexecdir)/bluetooth +pkglibexecdir = @PKGLIBEXECDIR@ ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -3148,6 +3173,7 @@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ +CUPS_SERVERBIN = @CUPS_SERVERBIN@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_CONFDIR = @DBUS_CONFDIR@ @@ -3183,8 +3209,6 @@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JSONC_CFLAGS = @JSONC_CFLAGS@ JSONC_LIBS = @JSONC_LIBS@ -JSON_CFLAGS = @JSON_CFLAGS@ -JSON_LIBS = @JSON_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBEBOOK_CFLAGS = @LIBEBOOK_CFLAGS@ @@ -3219,6 +3243,7 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGLIBEXECDIR = @PKGLIBEXECDIR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ @@ -3300,7 +3325,7 @@ # SPDX-License-Identifier: GPL-2.0 AM_MAKEFLAGS = --no-print-directory -AM_CPPFLAGS = $(am__append_65) $(DBUS_CFLAGS) $(GLIB_CFLAGS) \ +AM_CPPFLAGS = $(am__append_70) $(DBUS_CFLAGS) $(GLIB_CFLAGS) \ -I$(builddir)/lib lib_LTLIBRARIES = $(am__append_2) noinst_LIBRARIES = @@ -3308,16 +3333,11 @@ gdbus/libgdbus-internal.la $(am__append_3) \ src/libshared-glib.la src/libshared-mainloop.la \ $(am__append_4) -CLEANFILES = $(ell_built_sources) $(builtin_files) \ - src/bluetooth.service tools/bluetooth-logger.service \ - obexd/src/builtin.h $(builtin_files) obexd/src/obex.service \ - $(am__append_75) $(am__append_76) -EXTRA_DIST = src/bluetooth.service.in src/org.bluez.service \ - $(am__append_22) src/genbuiltin src/bluetooth.conf \ +CLEANFILES = $(ell_built_sources) $(builtin_files) obexd/src/builtin.h \ + $(am__append_81) +EXTRA_DIST = src/org.bluez.service src/genbuiltin src/bluetooth.conf \ src/main.conf profiles/network/network.conf \ - profiles/input/input.conf tools/bluetooth-logger.service.in \ - $(am__append_53) obexd/src/obex.service.in \ - obexd/src/org.bluez.obex.service $(am__append_63) \ + profiles/input/input.conf $(am__append_58) $(am__append_68) \ obexd/src/genbuiltin android/Android.mk android/README \ android/compat/readline/history.h \ android/compat/readline/readline.h android/compat/wordexp.h \ @@ -3362,12 +3382,12 @@ android/pts-hogp.txt android/pts-scpp.txt android/pts-dis.txt \ android/pts-avdtp.txt android/pts-gavdp.txt \ android/pts-sdp.txt android/pts-bnep.txt \ - mesh/bluetooth-mesh.conf mesh/bluetooth-mesh.service.in \ - mesh/org.bluez.mesh.service mesh/mesh-main.conf \ - tools/hid2hci.rules $(test_scripts) doc/assigned-numbers.txt \ - doc/supported-features.txt doc/test-coverage.txt \ - doc/test-runner.rst doc/settings-storage.txt doc/mgmt-api.txt \ - doc/health-api.txt doc/sap-api.txt doc/org.bluez.Adapter.rst \ + mesh/bluetooth-mesh.conf mesh/org.bluez.mesh.service \ + mesh/mesh-main.conf tools/hid2hci.rules $(test_scripts) \ + doc/assigned-numbers.txt doc/supported-features.txt \ + doc/test-coverage.txt doc/test-runner.rst \ + doc/settings-storage.txt doc/mgmt-api.txt doc/health-api.txt \ + doc/sap-api.txt doc/l2cap.rst doc/org.bluez.Adapter.rst \ doc/org.bluez.Device.rst doc/org.bluez.DeviceSet.rst \ doc/org.bluez.AgentManager.rst doc/org.bluez.Agent.rst \ doc/org.bluez.ProfileManager.rst doc/org.bluez.Profile.rst \ @@ -3409,20 +3429,20 @@ confdir = $(sysconfdir)/bluetooth statedir = $(localstatedir)/lib/bluetooth @DATAFILES_TRUE@dbusdir = $(DBUS_CONFDIR)/dbus-1/system.d -@DATAFILES_TRUE@dbus_DATA = src/bluetooth.conf $(am__append_69) -@DATAFILES_TRUE@conf_DATA = +@DATAFILES_TRUE@dbus_DATA = src/bluetooth.conf $(am__append_74) +@DATAFILES_TRUE@conf_DATA = src/main.conf profiles/input/input.conf \ +@DATAFILES_TRUE@ profiles/network/network.conf $(am__append_75) @DATAFILES_TRUE@state_DATA = @SYSTEMD_TRUE@systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR) @SYSTEMD_TRUE@systemdsystemunit_DATA = src/bluetooth.service \ -@SYSTEMD_TRUE@ $(am__append_47) $(am__append_70) +@SYSTEMD_TRUE@ $(am__append_52) $(am__append_76) @SYSTEMD_TRUE@dbussystembusdir = $(DBUS_SYSTEMBUSDIR) @SYSTEMD_TRUE@dbussystembus_DATA = src/org.bluez.service \ -@SYSTEMD_TRUE@ $(am__append_71) +@SYSTEMD_TRUE@ $(am__append_77) plugindir = $(libdir)/bluetooth/plugins -@MAINTAINER_MODE_FALSE@build_plugindir = $(plugindir) -@MAINTAINER_MODE_TRUE@build_plugindir = $(abs_top_srcdir)/plugins/.libs -@MANPAGES_TRUE@man_MANS = src/bluetoothd.8 doc/org.bluez.Adapter.5 \ -@MANPAGES_TRUE@ doc/org.bluez.Device.5 \ +build_plugindir = $(plugindir) +@MANPAGES_TRUE@man_MANS = src/bluetoothd.8 doc/l2cap.7 doc/rfcomm.7 \ +@MANPAGES_TRUE@ doc/org.bluez.Adapter.5 doc/org.bluez.Device.5 \ @MANPAGES_TRUE@ doc/org.bluez.DeviceSet.5 \ @MANPAGES_TRUE@ doc/org.bluez.AgentManager.5 \ @MANPAGES_TRUE@ doc/org.bluez.Agent.5 \ @@ -3461,15 +3481,16 @@ @MANPAGES_TRUE@ doc/org.bluez.obex.MessageAccess.5 \ @MANPAGES_TRUE@ doc/org.bluez.obex.Message.5 \ @MANPAGES_TRUE@ doc/org.bluez.obex.AgentManager.5 \ -@MANPAGES_TRUE@ doc/org.bluez.obex.Agent.5 $(am__append_45) \ -@MANPAGES_TRUE@ $(am__append_51) $(am__append_56) \ -@MANPAGES_TRUE@ $(am__append_57) $(am__append_73) -manual_pages = src/bluetoothd.8 doc/org.bluez.Adapter.5 \ - doc/org.bluez.Device.5 doc/org.bluez.DeviceSet.5 \ - doc/org.bluez.AgentManager.5 doc/org.bluez.Agent.5 \ - doc/org.bluez.ProfileManager.5 doc/org.bluez.Profile.5 \ - doc/org.bluez.NetworkServer.5 doc/org.bluez.Network.5 \ - doc/org.bluez.Input.5 doc/org.bluez.BatteryProviderManager.5 \ +@MANPAGES_TRUE@ doc/org.bluez.obex.Agent.5 $(am__append_50) \ +@MANPAGES_TRUE@ $(am__append_56) $(am__append_61) \ +@MANPAGES_TRUE@ $(am__append_62) $(am__append_79) +manual_pages = src/bluetoothd.8 doc/l2cap.7 doc/rfcomm.7 \ + doc/org.bluez.Adapter.5 doc/org.bluez.Device.5 \ + doc/org.bluez.DeviceSet.5 doc/org.bluez.AgentManager.5 \ + doc/org.bluez.Agent.5 doc/org.bluez.ProfileManager.5 \ + doc/org.bluez.Profile.5 doc/org.bluez.NetworkServer.5 \ + doc/org.bluez.Network.5 doc/org.bluez.Input.5 \ + doc/org.bluez.BatteryProviderManager.5 \ doc/org.bluez.BatteryProvider.5 doc/org.bluez.Battery.5 \ doc/org.bluez.AdminPolicySet.5 \ doc/org.bluez.AdminPolicyStatus.5 doc/org.bluez.Media.5 \ @@ -3494,14 +3515,14 @@ tools/hciconfig.1 tools/hcitool.1 tools/hcidump.1 \ tools/rfcomm.1 tools/sdptool.1 tools/ciptool.1 tools/rctest.1 \ tools/l2ping.1 tools/btattach.1 tools/bdaddr.1 tools/isotest.1 \ - tools/btmgmt.1 client/bluetoothctl-mgmt.1 \ - client/bluetoothctl-monitor.1 client/bluetoothctl-admin.1 \ - client/bluetoothctl-advertise.1 client/bluetoothctl-endpoint.1 \ - client/bluetoothctl-gatt.1 client/bluetoothctl-player.1 \ - client/bluetoothctl-scan.1 client/bluetoothctl-transport.1 \ - tools/hid2hci.1 $(am__append_74) -plugin_LTLIBRARIES = $(am__append_29) $(am__append_42) \ - $(am__append_67) + tools/btmgmt.1 client/bluetoothctl.1 \ + client/bluetoothctl-mgmt.1 client/bluetoothctl-monitor.1 \ + client/bluetoothctl-admin.1 client/bluetoothctl-advertise.1 \ + client/bluetoothctl-endpoint.1 client/bluetoothctl-gatt.1 \ + client/bluetoothctl-player.1 client/bluetoothctl-scan.1 \ + client/bluetoothctl-transport.1 tools/hid2hci.1 \ + $(am__append_80) +plugin_LTLIBRARIES = $(am__append_72) lib_sources = lib/bluetooth.c lib/hci.c lib/sdp.c lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h \ lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \ @@ -3513,8 +3534,7 @@ BUILT_SOURCES = $(local_headers) $(ell_built_sources) src/builtin.h \ obexd/src/builtin.h @LIBRARY_TRUE@lib_libbluetooth_la_SOURCES = $(lib_headers) $(lib_sources) -@LIBRARY_TRUE@lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 22:11:19 -@LIBRARY_TRUE@lib_libbluetooth_la_DEPENDENCIES = $(local_headers) +@LIBRARY_TRUE@lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 22:14:19 lib_libbluetooth_internal_la_SOURCES = $(lib_headers) $(lib_sources) \ $(extra_headers) $(extra_sources) @@ -3526,8 +3546,6 @@ @EXTERNAL_ELL_TRUE@ell_cflags = @ELL_CFLAGS@ @EXTERNAL_ELL_FALSE@ell_ldadd = ell/libell-internal.la @EXTERNAL_ELL_TRUE@ell_ldadd = @ELL_LIBS@ -@EXTERNAL_ELL_FALSE@ell_dependencies = $(ell_ldadd) -@EXTERNAL_ELL_TRUE@ell_dependencies = @EXTERNAL_ELL_FALSE@ell_built_sources = ell/shared ell/internal ell/ell.h @EXTERNAL_ELL_TRUE@ell_built_sources = ell/shared @EXTERNAL_ELL_FALSE@ell_headers = ell/util.h \ @@ -3638,7 +3656,9 @@ src/shared/mcp.c src/shared/vcp.c src/shared/vcp.h \ src/shared/micp.c src/shared/micp.h src/shared/csip.c \ src/shared/csip.h src/shared/bass.h src/shared/bass.c \ - src/shared/lc3.h src/shared/tty.h $(am__append_5) + src/shared/ccp.h src/shared/ccp.c src/shared/lc3.h \ + src/shared/tty.h src/shared/bap-defs.h src/shared/asha.h \ + src/shared/asha.c $(am__append_5) src_libshared_glib_la_SOURCES = $(shared_sources) \ src/shared/io-glib.c \ src/shared/timeout-glib.c \ @@ -3683,81 +3703,54 @@ builtin_modules = hostname wiimote autopair policy $(am__append_6) \ $(am__append_8) $(am__append_10) $(am__append_12) \ $(am__append_14) $(am__append_16) $(am__append_18) \ - $(am__append_20) $(am__append_23) gap scanparam deviceinfo \ - $(am__append_25) battery $(am__append_30) $(am__append_32) \ - $(am__append_34) $(am__append_36) $(am__append_38) \ - $(am__append_40) + $(am__append_20) $(am__append_22) gap scanparam deviceinfo \ + $(am__append_24) battery $(am__append_28) $(am__append_31) \ + $(am__append_33) $(am__append_35) $(am__append_37) \ + $(am__append_39) $(am__append_41) $(am__append_43) \ + $(am__append_45) builtin_sources = plugins/hostname.c plugins/wiimote.c \ plugins/autopair.c plugins/policy.c $(am__append_7) \ $(am__append_9) $(am__append_11) $(am__append_13) \ $(am__append_15) $(am__append_17) $(am__append_19) \ - $(am__append_21) $(am__append_24) profiles/gap/gas.c \ + $(am__append_21) $(am__append_23) profiles/gap/gas.c \ profiles/scanparam/scan.c profiles/deviceinfo/deviceinfo.c \ - $(am__append_26) profiles/battery/battery.c $(am__append_31) \ - $(am__append_33) $(am__append_35) $(am__append_37) \ - $(am__append_39) $(am__append_41) -builtin_cppflags = $(am__append_27) -builtin_nodist = -builtin_ldadd = $(am__append_28) -@SIXAXIS_TRUE@plugins_sixaxis_la_SOURCES = plugins/sixaxis.c -@SIXAXIS_TRUE@plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -@SIXAXIS_TRUE@plugins_sixaxis_la_LIBADD = $(UDEV_LIBS) -@SIXAXIS_TRUE@plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden -@MAINTAINER_MODE_TRUE@plugins_external_dummy_la_SOURCES = plugins/external-dummy.c -@MAINTAINER_MODE_TRUE@plugins_external_dummy_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ -@MAINTAINER_MODE_TRUE@ -no-undefined - -@MAINTAINER_MODE_TRUE@plugins_external_dummy_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden -src_bluetoothd_SOURCES = $(builtin_sources) \ - $(attrib_sources) $(btio_sources) \ - src/bluetooth.ver \ - src/main.c src/log.h src/log.c \ - src/backtrace.h src/backtrace.c \ - src/rfkill.c src/btd.h src/sdpd.h \ - src/sdpd-server.c src/sdpd-request.c \ - src/sdpd-service.c src/sdpd-database.c \ - src/gatt-database.h src/gatt-database.c \ - src/sdp-xml.h src/sdp-xml.c \ - src/sdp-client.h src/sdp-client.c \ - src/textfile.h src/textfile.c \ - src/uuid-helper.h src/uuid-helper.c \ - src/plugin.h src/plugin.c \ - src/storage.h src/storage.c \ - src/advertising.h src/advertising.c \ - src/agent.h src/agent.c \ - src/error.h src/error.c \ - src/adapter.h src/adapter.c \ - src/profile.h src/profile.c \ - src/service.h src/service.c \ - src/gatt-client.h src/gatt-client.c \ - src/device.h src/device.c \ - src/dbus-common.c src/dbus-common.h \ - src/eir.h src/eir.c \ - src/adv_monitor.h src/adv_monitor.c \ - src/battery.h src/battery.c \ - src/settings.h src/settings.c \ - src/set.h src/set.c - + $(am__append_25) profiles/battery/battery.c $(am__append_29) \ + $(am__append_32) $(am__append_34) $(am__append_36) \ + $(am__append_38) $(am__append_40) $(am__append_42) \ + $(am__append_44) $(am__append_46) +builtin_cppflags = $(am__append_26) +builtin_ldadd = $(am__append_27) $(am__append_30) +src_bluetoothd_SOURCES = $(builtin_sources) $(attrib_sources) \ + $(btio_sources) src/main.c src/log.h src/log.c src/backtrace.h \ + src/backtrace.c src/rfkill.c src/btd.h src/sdpd.h \ + src/sdpd-server.c src/sdpd-request.c src/sdpd-service.c \ + src/sdpd-database.c src/gatt-database.h src/gatt-database.c \ + src/sdp-xml.h src/sdp-xml.c src/sdp-client.h src/sdp-client.c \ + src/textfile.h src/textfile.c src/uuid-helper.h \ + src/uuid-helper.c src/plugin.h src/plugin.c src/storage.h \ + src/storage.c src/advertising.h src/advertising.c src/agent.h \ + src/agent.c src/error.h src/error.c src/adapter.h \ + src/adapter.c src/profile.h src/profile.c src/service.h \ + src/service.c src/gatt-client.h src/gatt-client.c src/device.h \ + src/device.c src/dbus-common.c src/dbus-common.h src/eir.h \ + src/eir.c src/adv_monitor.h src/adv_monitor.c src/battery.h \ + src/battery.c src/settings.h src/settings.c src/set.h \ + src/set.c $(am__append_47) src_bluetoothd_LDADD = lib/libbluetooth-internal.la \ gdbus/libgdbus-internal.la \ src/libshared-glib.la \ $(BACKTRACE_LIBS) $(GLIB_LIBS) $(DBUS_LIBS) -ldl -lrt \ $(builtin_ldadd) -src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \ - -Wl,--version-script=$(srcdir)/src/bluetooth.ver - -src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \ - gdbus/libgdbus-internal.la \ - src/libshared-glib.la \ - src/bluetooth.service +@EXTERNAL_PLUGINS_TRUE@src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \ +@EXTERNAL_PLUGINS_TRUE@ -Wl,--version-script=$(srcdir)/src/bluetooth.ver src_bluetoothd_CPPFLAGS = $(AM_CPPFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \ -DPLUGINDIR=\""$(build_plugindir)"\" \ $(BACKTRACE_CFLAGS) $(builtin_cppflags) src_bluetoothd_SHORTNAME = bluetoothd -builtin_files = src/builtin.h $(builtin_nodist) +builtin_files = src/builtin.h nodist_src_bluetoothd_SOURCES = $(builtin_files) test_scripts = test/sap_client.py test/bluezutils.py test/dbusdef.py \ test/monitor-bluetooth test/list-devices test/test-discovery \ @@ -3771,15 +3764,15 @@ test/map-client test/example-advertisement \ test/example-gatt-server test/example-gatt-client \ test/test-gatt-profile test/test-mesh test/agent.py -unit_tests = $(am__append_68) unit/test-tester unit/test-eir \ +unit_tests = $(am__append_73) unit/test-tester unit/test-eir \ unit/test-uuid unit/test-textfile unit/test-crc \ unit/test-crypto unit/test-ecc unit/test-ringbuf \ unit/test-queue unit/test-mgmt unit/test-uhid unit/test-sdp \ unit/test-avdtp unit/test-avctp unit/test-avrcp unit/test-hfp \ - unit/test-gdbus-client $(am__append_77) unit/test-lib \ + unit/test-gdbus-client $(am__append_82) unit/test-lib \ unit/test-gatt unit/test-hog unit/test-gattrib unit/test-bap \ - unit/test-micp unit/test-bass unit/test-vcp $(am__append_78) \ - $(am__append_79) + unit/test-micp unit/test-bass unit/test-vcp $(am__append_83) \ + $(am__append_84) @CLIENT_TRUE@client_bluetoothctl_SOURCES = client/main.c \ @CLIENT_TRUE@ client/print.h client/print.c \ @CLIENT_TRUE@ client/display.h client/display.c \ @@ -3835,9 +3828,6 @@ @LOGGER_TRUE@tools_btmon_logger_SOURCES = tools/btmon-logger.c @LOGGER_TRUE@tools_btmon_logger_LDADD = src/libshared-mainloop.la -@LOGGER_TRUE@tools_btmon_logger_DEPENDENCIES = src/libshared-mainloop.la \ -@LOGGER_TRUE@ tools/bluetooth-logger.service - @TESTING_TRUE@emulator_btvirt_SOURCES = emulator/main.c monitor/bt.h \ @TESTING_TRUE@ emulator/serial.h emulator/serial.c \ @TESTING_TRUE@ emulator/server.h emulator/server.c \ @@ -3886,7 +3876,7 @@ @TESTING_TRUE@tools_mesh_tester_LDADD = lib/libbluetooth-internal.la \ @TESTING_TRUE@ src/libshared-glib.la $(GLIB_LIBS) -@TESTING_TRUE@tools_l2cap_tester_SOURCES = tools/l2cap-tester.c monitor/bt.h \ +@TESTING_TRUE@tools_l2cap_tester_SOURCES = tools/l2cap-tester.c tools/tester.h monitor/bt.h \ @TESTING_TRUE@ emulator/hciemu.h emulator/hciemu.c \ @TESTING_TRUE@ emulator/vhci.h emulator/vhci.c \ @TESTING_TRUE@ emulator/btdev.h emulator/btdev.c \ @@ -3938,7 +3928,7 @@ @TESTING_TRUE@ src/libshared-glib.la \ @TESTING_TRUE@ $(GLIB_LIBS) $(DBUS_LIBS) -@TESTING_TRUE@tools_sco_tester_SOURCES = tools/sco-tester.c monitor/bt.h \ +@TESTING_TRUE@tools_sco_tester_SOURCES = tools/sco-tester.c tools/tester.h monitor/bt.h \ @TESTING_TRUE@ emulator/hciemu.h emulator/hciemu.c \ @TESTING_TRUE@ emulator/vhci.h emulator/vhci.c \ @TESTING_TRUE@ emulator/btdev.h emulator/btdev.c \ @@ -3960,7 +3950,7 @@ @TESTING_TRUE@tools_userchan_tester_LDADD = lib/libbluetooth-internal.la \ @TESTING_TRUE@ src/libshared-glib.la $(GLIB_LIBS) -@TESTING_TRUE@tools_iso_tester_SOURCES = tools/iso-tester.c monitor/bt.h \ +@TESTING_TRUE@tools_iso_tester_SOURCES = tools/iso-tester.c tools/tester.h monitor/bt.h \ @TESTING_TRUE@ emulator/hciemu.h emulator/hciemu.c \ @TESTING_TRUE@ emulator/vhci.h emulator/vhci.c \ @TESTING_TRUE@ emulator/btdev.h emulator/btdev.c \ @@ -4179,7 +4169,8 @@ @DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ @DEPRECATED_TRUE@@READLINE_TRUE@ src/libshared-glib.la $(GLIB_LIBS) -lreadline -@CUPS_TRUE@cupsdir = $(libdir)/cups/backend +@CUPS_SERVERBIN_FALSE@@CUPS_TRUE@cupsdir = $(libdir)/cups/backend +@CUPS_SERVERBIN_TRUE@@CUPS_TRUE@cupsdir = $(CUPS_SERVERBIN)/backend @CUPS_TRUE@profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \ @CUPS_TRUE@ profiles/cups/cups.h \ @CUPS_TRUE@ profiles/cups/sdp.c \ @@ -4194,23 +4185,22 @@ @BTPCLIENT_TRUE@tools_btpclient_LDADD = lib/libbluetooth-internal.la \ @BTPCLIENT_TRUE@ src/libshared-ell.la $(ell_ldadd) -@BTPCLIENT_TRUE@tools_btpclient_DEPENDENCIES = lib/libbluetooth-internal.la $(ell_dependencies) @BTPCLIENT_TRUE@tools_btpclientctl_SOURCES = tools/btpclientctl.c client/display.c @BTPCLIENT_TRUE@tools_btpclientctl_LDADD = src/libshared-mainloop.la src/libshared-glib.la \ @BTPCLIENT_TRUE@ lib/libbluetooth-internal.la -lreadline # SPDX-License-Identifier: GPL-2.0 -@SYSTEMD_TRUE@systemduserunitdir = $(SYSTEMD_USERUNITDIR) -@SYSTEMD_TRUE@systemduserunit_DATA = obexd/src/obex.service -@SYSTEMD_TRUE@dbussessionbusdir = $(DBUS_SESSIONBUSDIR) -@SYSTEMD_TRUE@dbussessionbus_DATA = obexd/src/org.bluez.obex.service +@OBEX_TRUE@@SYSTEMD_TRUE@systemduserunitdir = $(SYSTEMD_USERUNITDIR) +@OBEX_TRUE@@SYSTEMD_TRUE@systemduserunit_DATA = obexd/src/obex.service +@OBEX_TRUE@@SYSTEMD_TRUE@dbussessionbusdir = $(DBUS_SESSIONBUSDIR) +@OBEX_TRUE@@SYSTEMD_TRUE@dbussessionbus_DATA = obexd/src/org.bluez.obex.service @OBEX_TRUE@obex_plugindir = $(libdir)/obex/plugins @OBEX_TRUE@obexd_builtin_modules = filesystem bluetooth \ -@OBEX_TRUE@ $(am__append_61) opp ftp irmc pbap mas mns +@OBEX_TRUE@ $(am__append_66) opp ftp irmc pbap mas mns @OBEX_TRUE@obexd_builtin_sources = obexd/plugins/filesystem.c \ @OBEX_TRUE@ obexd/plugins/filesystem.h \ -@OBEX_TRUE@ obexd/plugins/bluetooth.c $(am__append_62) \ +@OBEX_TRUE@ obexd/plugins/bluetooth.c $(am__append_67) \ @OBEX_TRUE@ obexd/plugins/opp.c obexd/plugins/ftp.c \ @OBEX_TRUE@ obexd/plugins/ftp.h obexd/plugins/irmc.c \ @OBEX_TRUE@ obexd/plugins/pbap.c obexd/plugins/vcard.h \ @@ -4252,14 +4242,13 @@ @OBEX_TRUE@ $(ICAL_LIBS) $(DBUS_LIBS) $(LIBEBOOK_LIBS) \ @OBEX_TRUE@ $(LIBEDATASERVER_LIBS) $(GLIB_LIBS) -ldl -@OBEX_TRUE@obexd_src_obexd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic +@EXTERNAL_PLUGINS_TRUE@@OBEX_TRUE@obexd_src_obexd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic @OBEX_TRUE@obexd_src_obexd_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \ @OBEX_TRUE@ $(ICAL_CFLAGS) -DOBEX_PLUGIN_BUILTIN \ @OBEX_TRUE@ -DPLUGINDIR=\""$(obex_plugindir)"\" \ @OBEX_TRUE@ -D_FILE_OFFSET_BITS=64 \ -@OBEX_TRUE@ -I$(builddir)/lib -I$(builddir)/obexd/src +@OBEX_TRUE@ -I$(builddir)/obexd/src -@OBEX_TRUE@obexd_src_obexd_CFLAGS = $(AM_CFLAGS) -fPIC obexd_src_obexd_SHORTNAME = obexd obexd_builtin_files = obexd/src/builtin.h $(obexd_builtin_nodist) nodist_obexd_src_obexd_SOURCES = $(obexd_builtin_files) @@ -4348,6 +4337,7 @@ @ANDROID_TRUE@ android/hal-ipc.h android/hal-ipc.c \ @ANDROID_TRUE@ android/hal-utils.h android/hal-utils.c +@ANDROID_TRUE@android_bluetooth_default_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @ANDROID_TRUE@android_bluetooth_default_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android @ANDROID_TRUE@android_bluetooth_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ @ANDROID_TRUE@ -no-undefined @@ -4442,6 +4432,7 @@ @ANDROID_TRUE@ android/hardware/hardware.h \ @ANDROID_TRUE@ android/system/audio.h +@ANDROID_TRUE@android_audio_a2dp_default_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @ANDROID_TRUE@android_audio_a2dp_default_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android \ @ANDROID_TRUE@ $(SBC_CFLAGS) @@ -4459,6 +4450,7 @@ @ANDROID_TRUE@ android/audio_utils/resampler.h \ @ANDROID_TRUE@ android/system/audio.h +@ANDROID_TRUE@android_audio_sco_default_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden @ANDROID_TRUE@android_audio_sco_default_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android @ANDROID_TRUE@android_audio_sco_default_la_LIBADD = $(SPEEXDSP_LIBS) -lrt @ANDROID_TRUE@android_audio_sco_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ @@ -4501,9 +4493,6 @@ @MESH_TRUE@mesh_bluetooth_meshd_SOURCES = $(mesh_sources) mesh/main.c @MESH_TRUE@mesh_bluetooth_meshd_LDADD = src/libshared-ell.la $(ell_ldadd) -ljson-c -@MESH_TRUE@mesh_bluetooth_meshd_DEPENDENCIES = $(ell_dependencies) src/libshared-ell.la \ -@MESH_TRUE@ mesh/bluetooth-mesh.service - @HID2HCI_TRUE@rulesdir = $(UDEV_DIR)/rules.d @HID2HCI_TRUE@rules_DATA = tools/97-hid2hci.rules @TEST_TRUE@testdir = $(pkglibdir)/test @@ -4647,7 +4636,7 @@ @MESH_TRUE@unit_test_mesh_crypto_LDADD = $(ell_ldadd) AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69 \ - $(am__append_81) + $(am__append_86) @VALGRIND_TRUE@LOG_COMPILER = valgrind --error-exitcode=1 --num-callers=30 @VALGRIND_TRUE@LOG_FLAGS = --trace-children=yes --leak-check=full --show-reachable=no \ @VALGRIND_TRUE@ --suppressions=$(srcdir)/tools/valgrind.supp --quiet @@ -4669,13 +4658,6 @@ aclocal.m4 configure config.h.in config.sub config.guess \ ltmain.sh depcomp compile missing install-sh mkinstalldirs test-driver -SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ - $(SED) -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \ - -e 's,@libexecdir\@,$(libexecdir),g' \ - -e 's,@statedir\@,$(statedir),g' \ - -e 's,@confdir\@,$(confdir),g' \ - < $< > $@ - @RUN_RST2MAN_FALSE@RST2MAN_PROCESS = $(AM_V_GEN)test -f $@ || \ @RUN_RST2MAN_FALSE@ { echo "Generated manual page $@ does not exist"; false; } @@ -4737,12 +4719,22 @@ distclean-hdr: -rm -f config.h stamp-h1 -src/bluetoothd.rst: $(top_builddir)/config.status $(top_srcdir)/src/bluetoothd.rst.in - cd $(top_builddir) && $(SHELL) ./config.status $@ lib/bluez.pc: $(top_builddir)/config.status $(top_srcdir)/lib/bluez.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mesh/bluetooth-meshd.rst: $(top_builddir)/config.status $(top_srcdir)/mesh/bluetooth-meshd.rst.in cd $(top_builddir) && $(SHELL) ./config.status $@ +mesh/bluetooth-mesh.service: $(top_builddir)/config.status $(top_srcdir)/mesh/bluetooth-mesh.service.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +obexd/src/obex.service: $(top_builddir)/config.status $(top_srcdir)/obexd/src/obex.service.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +obexd/src/org.bluez.obex.service: $(top_builddir)/config.status $(top_srcdir)/obexd/src/org.bluez.obex.service.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +src/bluetoothd.rst: $(top_builddir)/config.status $(top_srcdir)/src/bluetoothd.rst.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +src/bluetooth.service: $(top_builddir)/config.status $(top_srcdir)/src/bluetooth.service.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +tools/bluetooth-logger.service: $(top_builddir)/config.status $(top_srcdir)/tools/bluetooth-logger.service.in + cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -5177,22 +5169,6 @@ lib/libbluetooth.la: $(lib_libbluetooth_la_OBJECTS) $(lib_libbluetooth_la_DEPENDENCIES) $(EXTRA_lib_libbluetooth_la_DEPENDENCIES) lib/$(am__dirstamp) $(AM_V_CCLD)$(lib_libbluetooth_la_LINK) $(am_lib_libbluetooth_la_rpath) $(lib_libbluetooth_la_OBJECTS) $(lib_libbluetooth_la_LIBADD) $(LIBS) -plugins/$(am__dirstamp): - @$(MKDIR_P) plugins - @: > plugins/$(am__dirstamp) -plugins/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) plugins/$(DEPDIR) - @: > plugins/$(DEPDIR)/$(am__dirstamp) -plugins/external_dummy_la-external-dummy.lo: plugins/$(am__dirstamp) \ - plugins/$(DEPDIR)/$(am__dirstamp) - -plugins/external-dummy.la: $(plugins_external_dummy_la_OBJECTS) $(plugins_external_dummy_la_DEPENDENCIES) $(EXTRA_plugins_external_dummy_la_DEPENDENCIES) plugins/$(am__dirstamp) - $(AM_V_CCLD)$(plugins_external_dummy_la_LINK) $(am_plugins_external_dummy_la_rpath) $(plugins_external_dummy_la_OBJECTS) $(plugins_external_dummy_la_LIBADD) $(LIBS) -plugins/sixaxis_la-sixaxis.lo: plugins/$(am__dirstamp) \ - plugins/$(DEPDIR)/$(am__dirstamp) - -plugins/sixaxis.la: $(plugins_sixaxis_la_OBJECTS) $(plugins_sixaxis_la_DEPENDENCIES) $(EXTRA_plugins_sixaxis_la_DEPENDENCIES) plugins/$(am__dirstamp) - $(AM_V_CCLD)$(plugins_sixaxis_la_LINK) $(am_plugins_sixaxis_la_rpath) $(plugins_sixaxis_la_OBJECTS) $(plugins_sixaxis_la_LIBADD) $(LIBS) src/shared/$(am__dirstamp): @$(MKDIR_P) src/shared @: > src/shared/$(am__dirstamp) @@ -5256,6 +5232,10 @@ src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libshared_ell_la-bass.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libshared_ell_la-ccp.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libshared_ell_la-asha.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libshared_ell_la-shell.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libshared_ell_la-io-ell.lo: src/shared/$(am__dirstamp) \ @@ -5330,6 +5310,10 @@ src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libshared_glib_la-bass.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libshared_glib_la-ccp.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libshared_glib_la-asha.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libshared_glib_la-shell.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libshared_glib_la-io-glib.lo: src/shared/$(am__dirstamp) \ @@ -5411,6 +5395,10 @@ src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libshared_mainloop_la-bass.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libshared_mainloop_la-ccp.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) +src/shared/libshared_mainloop_la-asha.lo: src/shared/$(am__dirstamp) \ + src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libshared_mainloop_la-shell.lo: src/shared/$(am__dirstamp) \ src/shared/$(DEPDIR)/$(am__dirstamp) src/shared/libshared_mainloop_la-io-mainloop.lo: \ @@ -6103,6 +6091,12 @@ profiles/iap/iapd$(EXEEXT): $(profiles_iap_iapd_OBJECTS) $(profiles_iap_iapd_DEPENDENCIES) $(EXTRA_profiles_iap_iapd_DEPENDENCIES) profiles/iap/$(am__dirstamp) @rm -f profiles/iap/iapd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(profiles_iap_iapd_OBJECTS) $(profiles_iap_iapd_LDADD) $(LIBS) +plugins/$(am__dirstamp): + @$(MKDIR_P) plugins + @: > plugins/$(am__dirstamp) +plugins/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) plugins/$(DEPDIR) + @: > plugins/$(DEPDIR)/$(am__dirstamp) plugins/bluetoothd-hostname.$(OBJEXT): plugins/$(am__dirstamp) \ plugins/$(DEPDIR)/$(am__dirstamp) plugins/bluetoothd-wiimote.$(OBJEXT): plugins/$(am__dirstamp) \ @@ -6251,6 +6245,8 @@ profiles/battery/bluetoothd-battery.$(OBJEXT): \ profiles/battery/$(am__dirstamp) \ profiles/battery/$(DEPDIR)/$(am__dirstamp) +plugins/bluetoothd-sixaxis.$(OBJEXT): plugins/$(am__dirstamp) \ + plugins/$(DEPDIR)/$(am__dirstamp) profiles/audio/bluetoothd-bap.$(OBJEXT): \ profiles/audio/$(am__dirstamp) \ profiles/audio/$(DEPDIR)/$(am__dirstamp) @@ -6266,9 +6262,15 @@ profiles/audio/bluetoothd-micp.$(OBJEXT): \ profiles/audio/$(am__dirstamp) \ profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-ccp.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) profiles/audio/bluetoothd-csip.$(OBJEXT): \ profiles/audio/$(am__dirstamp) \ profiles/audio/$(DEPDIR)/$(am__dirstamp) +profiles/audio/bluetoothd-asha.$(OBJEXT): \ + profiles/audio/$(am__dirstamp) \ + profiles/audio/$(DEPDIR)/$(am__dirstamp) attrib/bluetoothd-att.$(OBJEXT): attrib/$(am__dirstamp) \ attrib/$(DEPDIR)/$(am__dirstamp) attrib/bluetoothd-gatt.$(OBJEXT): attrib/$(am__dirstamp) \ @@ -7164,7 +7166,6 @@ -rm -f obexd/src/*.$(OBJEXT) -rm -f peripheral/*.$(OBJEXT) -rm -f plugins/*.$(OBJEXT) - -rm -f plugins/*.lo -rm -f profiles/audio/*.$(OBJEXT) -rm -f profiles/battery/*.$(OBJEXT) -rm -f profiles/cups/*.$(OBJEXT) @@ -7470,15 +7471,16 @@ @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-hostname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-neard.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-policy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-sixaxis.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/bluetoothd-wiimote.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/external_dummy_la-external-dummy.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@plugins/$(DEPDIR)/sixaxis_la-sixaxis.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-asha.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-bap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-bass.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-ccp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-control.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-csip.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@profiles/audio/$(DEPDIR)/bluetoothd-mcp.Po@am__quote@ # am--include-marker @@ -7576,11 +7578,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/android_avdtptest-util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/btp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-ad.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-asha.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-att.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-bap-debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-bap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-bass.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-btsnoop.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-ccp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-crypto.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-csip.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-ecc.Plo@am__quote@ # am--include-marker @@ -7607,11 +7611,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-util.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_ell_la-vcp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-ad.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-asha.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-att.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-bap-debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-bap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-bass.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-btsnoop.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-ccp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-crypto.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-csip.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-ecc.Plo@am__quote@ # am--include-marker @@ -7640,11 +7646,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-util.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_glib_la-vcp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-ad.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-asha.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-att.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-bap-debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-bap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-bass.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-btsnoop.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-ccp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-crypto.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-csip.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/shared/$(DEPDIR)/libshared_mainloop_la-ecc.Plo@am__quote@ # am--include-marker @@ -7853,158 +7861,144 @@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< android/audio_a2dp_default_la-hal-audio.lo: android/hal-audio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/audio_a2dp_default_la-hal-audio.lo -MD -MP -MF android/$(DEPDIR)/audio_a2dp_default_la-hal-audio.Tpo -c -o android/audio_a2dp_default_la-hal-audio.lo `test -f 'android/hal-audio.c' || echo '$(srcdir)/'`android/hal-audio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -MT android/audio_a2dp_default_la-hal-audio.lo -MD -MP -MF android/$(DEPDIR)/audio_a2dp_default_la-hal-audio.Tpo -c -o android/audio_a2dp_default_la-hal-audio.lo `test -f 'android/hal-audio.c' || echo '$(srcdir)/'`android/hal-audio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/audio_a2dp_default_la-hal-audio.Tpo android/$(DEPDIR)/audio_a2dp_default_la-hal-audio.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-audio.c' object='android/audio_a2dp_default_la-hal-audio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/audio_a2dp_default_la-hal-audio.lo `test -f 'android/hal-audio.c' || echo '$(srcdir)/'`android/hal-audio.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -c -o android/audio_a2dp_default_la-hal-audio.lo `test -f 'android/hal-audio.c' || echo '$(srcdir)/'`android/hal-audio.c android/audio_a2dp_default_la-hal-audio-sbc.lo: android/hal-audio-sbc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/audio_a2dp_default_la-hal-audio-sbc.lo -MD -MP -MF android/$(DEPDIR)/audio_a2dp_default_la-hal-audio-sbc.Tpo -c -o android/audio_a2dp_default_la-hal-audio-sbc.lo `test -f 'android/hal-audio-sbc.c' || echo '$(srcdir)/'`android/hal-audio-sbc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -MT android/audio_a2dp_default_la-hal-audio-sbc.lo -MD -MP -MF android/$(DEPDIR)/audio_a2dp_default_la-hal-audio-sbc.Tpo -c -o android/audio_a2dp_default_la-hal-audio-sbc.lo `test -f 'android/hal-audio-sbc.c' || echo '$(srcdir)/'`android/hal-audio-sbc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/audio_a2dp_default_la-hal-audio-sbc.Tpo android/$(DEPDIR)/audio_a2dp_default_la-hal-audio-sbc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-audio-sbc.c' object='android/audio_a2dp_default_la-hal-audio-sbc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/audio_a2dp_default_la-hal-audio-sbc.lo `test -f 'android/hal-audio-sbc.c' || echo '$(srcdir)/'`android/hal-audio-sbc.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -c -o android/audio_a2dp_default_la-hal-audio-sbc.lo `test -f 'android/hal-audio-sbc.c' || echo '$(srcdir)/'`android/hal-audio-sbc.c android/audio_a2dp_default_la-hal-audio-aptx.lo: android/hal-audio-aptx.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/audio_a2dp_default_la-hal-audio-aptx.lo -MD -MP -MF android/$(DEPDIR)/audio_a2dp_default_la-hal-audio-aptx.Tpo -c -o android/audio_a2dp_default_la-hal-audio-aptx.lo `test -f 'android/hal-audio-aptx.c' || echo '$(srcdir)/'`android/hal-audio-aptx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -MT android/audio_a2dp_default_la-hal-audio-aptx.lo -MD -MP -MF android/$(DEPDIR)/audio_a2dp_default_la-hal-audio-aptx.Tpo -c -o android/audio_a2dp_default_la-hal-audio-aptx.lo `test -f 'android/hal-audio-aptx.c' || echo '$(srcdir)/'`android/hal-audio-aptx.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/audio_a2dp_default_la-hal-audio-aptx.Tpo android/$(DEPDIR)/audio_a2dp_default_la-hal-audio-aptx.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-audio-aptx.c' object='android/audio_a2dp_default_la-hal-audio-aptx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/audio_a2dp_default_la-hal-audio-aptx.lo `test -f 'android/hal-audio-aptx.c' || echo '$(srcdir)/'`android/hal-audio-aptx.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_a2dp_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_a2dp_default_la_CFLAGS) $(CFLAGS) -c -o android/audio_a2dp_default_la-hal-audio-aptx.lo `test -f 'android/hal-audio-aptx.c' || echo '$(srcdir)/'`android/hal-audio-aptx.c android/audio_sco_default_la-hal-sco.lo: android/hal-sco.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_sco_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/audio_sco_default_la-hal-sco.lo -MD -MP -MF android/$(DEPDIR)/audio_sco_default_la-hal-sco.Tpo -c -o android/audio_sco_default_la-hal-sco.lo `test -f 'android/hal-sco.c' || echo '$(srcdir)/'`android/hal-sco.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_sco_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) -MT android/audio_sco_default_la-hal-sco.lo -MD -MP -MF android/$(DEPDIR)/audio_sco_default_la-hal-sco.Tpo -c -o android/audio_sco_default_la-hal-sco.lo `test -f 'android/hal-sco.c' || echo '$(srcdir)/'`android/hal-sco.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/audio_sco_default_la-hal-sco.Tpo android/$(DEPDIR)/audio_sco_default_la-hal-sco.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-sco.c' object='android/audio_sco_default_la-hal-sco.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_sco_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/audio_sco_default_la-hal-sco.lo `test -f 'android/hal-sco.c' || echo '$(srcdir)/'`android/hal-sco.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_sco_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) -c -o android/audio_sco_default_la-hal-sco.lo `test -f 'android/hal-sco.c' || echo '$(srcdir)/'`android/hal-sco.c android/audio_utils/audio_sco_default_la-resampler.lo: android/audio_utils/resampler.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_sco_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/audio_utils/audio_sco_default_la-resampler.lo -MD -MP -MF android/audio_utils/$(DEPDIR)/audio_sco_default_la-resampler.Tpo -c -o android/audio_utils/audio_sco_default_la-resampler.lo `test -f 'android/audio_utils/resampler.c' || echo '$(srcdir)/'`android/audio_utils/resampler.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_sco_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) -MT android/audio_utils/audio_sco_default_la-resampler.lo -MD -MP -MF android/audio_utils/$(DEPDIR)/audio_sco_default_la-resampler.Tpo -c -o android/audio_utils/audio_sco_default_la-resampler.lo `test -f 'android/audio_utils/resampler.c' || echo '$(srcdir)/'`android/audio_utils/resampler.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/audio_utils/$(DEPDIR)/audio_sco_default_la-resampler.Tpo android/audio_utils/$(DEPDIR)/audio_sco_default_la-resampler.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/audio_utils/resampler.c' object='android/audio_utils/audio_sco_default_la-resampler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_sco_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/audio_utils/audio_sco_default_la-resampler.lo `test -f 'android/audio_utils/resampler.c' || echo '$(srcdir)/'`android/audio_utils/resampler.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_audio_sco_default_la_CPPFLAGS) $(CPPFLAGS) $(android_audio_sco_default_la_CFLAGS) $(CFLAGS) -c -o android/audio_utils/audio_sco_default_la-resampler.lo `test -f 'android/audio_utils/resampler.c' || echo '$(srcdir)/'`android/audio_utils/resampler.c android/bluetooth_default_la-hal-bluetooth.lo: android/hal-bluetooth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-bluetooth.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-bluetooth.Tpo -c -o android/bluetooth_default_la-hal-bluetooth.lo `test -f 'android/hal-bluetooth.c' || echo '$(srcdir)/'`android/hal-bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-bluetooth.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-bluetooth.Tpo -c -o android/bluetooth_default_la-hal-bluetooth.lo `test -f 'android/hal-bluetooth.c' || echo '$(srcdir)/'`android/hal-bluetooth.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-bluetooth.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-bluetooth.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-bluetooth.c' object='android/bluetooth_default_la-hal-bluetooth.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-bluetooth.lo `test -f 'android/hal-bluetooth.c' || echo '$(srcdir)/'`android/hal-bluetooth.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-bluetooth.lo `test -f 'android/hal-bluetooth.c' || echo '$(srcdir)/'`android/hal-bluetooth.c android/bluetooth_default_la-hal-socket.lo: android/hal-socket.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-socket.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-socket.Tpo -c -o android/bluetooth_default_la-hal-socket.lo `test -f 'android/hal-socket.c' || echo '$(srcdir)/'`android/hal-socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-socket.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-socket.Tpo -c -o android/bluetooth_default_la-hal-socket.lo `test -f 'android/hal-socket.c' || echo '$(srcdir)/'`android/hal-socket.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-socket.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-socket.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-socket.c' object='android/bluetooth_default_la-hal-socket.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-socket.lo `test -f 'android/hal-socket.c' || echo '$(srcdir)/'`android/hal-socket.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-socket.lo `test -f 'android/hal-socket.c' || echo '$(srcdir)/'`android/hal-socket.c android/bluetooth_default_la-hal-hidhost.lo: android/hal-hidhost.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-hidhost.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-hidhost.Tpo -c -o android/bluetooth_default_la-hal-hidhost.lo `test -f 'android/hal-hidhost.c' || echo '$(srcdir)/'`android/hal-hidhost.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-hidhost.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-hidhost.Tpo -c -o android/bluetooth_default_la-hal-hidhost.lo `test -f 'android/hal-hidhost.c' || echo '$(srcdir)/'`android/hal-hidhost.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-hidhost.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-hidhost.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-hidhost.c' object='android/bluetooth_default_la-hal-hidhost.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-hidhost.lo `test -f 'android/hal-hidhost.c' || echo '$(srcdir)/'`android/hal-hidhost.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-hidhost.lo `test -f 'android/hal-hidhost.c' || echo '$(srcdir)/'`android/hal-hidhost.c android/bluetooth_default_la-hal-health.lo: android/hal-health.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-health.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-health.Tpo -c -o android/bluetooth_default_la-hal-health.lo `test -f 'android/hal-health.c' || echo '$(srcdir)/'`android/hal-health.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-health.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-health.Tpo -c -o android/bluetooth_default_la-hal-health.lo `test -f 'android/hal-health.c' || echo '$(srcdir)/'`android/hal-health.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-health.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-health.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-health.c' object='android/bluetooth_default_la-hal-health.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-health.lo `test -f 'android/hal-health.c' || echo '$(srcdir)/'`android/hal-health.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-health.lo `test -f 'android/hal-health.c' || echo '$(srcdir)/'`android/hal-health.c android/bluetooth_default_la-hal-pan.lo: android/hal-pan.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-pan.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-pan.Tpo -c -o android/bluetooth_default_la-hal-pan.lo `test -f 'android/hal-pan.c' || echo '$(srcdir)/'`android/hal-pan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-pan.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-pan.Tpo -c -o android/bluetooth_default_la-hal-pan.lo `test -f 'android/hal-pan.c' || echo '$(srcdir)/'`android/hal-pan.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-pan.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-pan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-pan.c' object='android/bluetooth_default_la-hal-pan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-pan.lo `test -f 'android/hal-pan.c' || echo '$(srcdir)/'`android/hal-pan.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-pan.lo `test -f 'android/hal-pan.c' || echo '$(srcdir)/'`android/hal-pan.c android/bluetooth_default_la-hal-a2dp.lo: android/hal-a2dp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-a2dp.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-a2dp.Tpo -c -o android/bluetooth_default_la-hal-a2dp.lo `test -f 'android/hal-a2dp.c' || echo '$(srcdir)/'`android/hal-a2dp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-a2dp.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-a2dp.Tpo -c -o android/bluetooth_default_la-hal-a2dp.lo `test -f 'android/hal-a2dp.c' || echo '$(srcdir)/'`android/hal-a2dp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-a2dp.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-a2dp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-a2dp.c' object='android/bluetooth_default_la-hal-a2dp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-a2dp.lo `test -f 'android/hal-a2dp.c' || echo '$(srcdir)/'`android/hal-a2dp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-a2dp.lo `test -f 'android/hal-a2dp.c' || echo '$(srcdir)/'`android/hal-a2dp.c android/bluetooth_default_la-hal-a2dp-sink.lo: android/hal-a2dp-sink.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-a2dp-sink.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-a2dp-sink.Tpo -c -o android/bluetooth_default_la-hal-a2dp-sink.lo `test -f 'android/hal-a2dp-sink.c' || echo '$(srcdir)/'`android/hal-a2dp-sink.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-a2dp-sink.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-a2dp-sink.Tpo -c -o android/bluetooth_default_la-hal-a2dp-sink.lo `test -f 'android/hal-a2dp-sink.c' || echo '$(srcdir)/'`android/hal-a2dp-sink.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-a2dp-sink.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-a2dp-sink.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-a2dp-sink.c' object='android/bluetooth_default_la-hal-a2dp-sink.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-a2dp-sink.lo `test -f 'android/hal-a2dp-sink.c' || echo '$(srcdir)/'`android/hal-a2dp-sink.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-a2dp-sink.lo `test -f 'android/hal-a2dp-sink.c' || echo '$(srcdir)/'`android/hal-a2dp-sink.c android/bluetooth_default_la-hal-avrcp.lo: android/hal-avrcp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-avrcp.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-avrcp.Tpo -c -o android/bluetooth_default_la-hal-avrcp.lo `test -f 'android/hal-avrcp.c' || echo '$(srcdir)/'`android/hal-avrcp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-avrcp.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-avrcp.Tpo -c -o android/bluetooth_default_la-hal-avrcp.lo `test -f 'android/hal-avrcp.c' || echo '$(srcdir)/'`android/hal-avrcp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-avrcp.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-avrcp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-avrcp.c' object='android/bluetooth_default_la-hal-avrcp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-avrcp.lo `test -f 'android/hal-avrcp.c' || echo '$(srcdir)/'`android/hal-avrcp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-avrcp.lo `test -f 'android/hal-avrcp.c' || echo '$(srcdir)/'`android/hal-avrcp.c android/bluetooth_default_la-hal-avrcp-ctrl.lo: android/hal-avrcp-ctrl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-avrcp-ctrl.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-avrcp-ctrl.Tpo -c -o android/bluetooth_default_la-hal-avrcp-ctrl.lo `test -f 'android/hal-avrcp-ctrl.c' || echo '$(srcdir)/'`android/hal-avrcp-ctrl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-avrcp-ctrl.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-avrcp-ctrl.Tpo -c -o android/bluetooth_default_la-hal-avrcp-ctrl.lo `test -f 'android/hal-avrcp-ctrl.c' || echo '$(srcdir)/'`android/hal-avrcp-ctrl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-avrcp-ctrl.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-avrcp-ctrl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-avrcp-ctrl.c' object='android/bluetooth_default_la-hal-avrcp-ctrl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-avrcp-ctrl.lo `test -f 'android/hal-avrcp-ctrl.c' || echo '$(srcdir)/'`android/hal-avrcp-ctrl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-avrcp-ctrl.lo `test -f 'android/hal-avrcp-ctrl.c' || echo '$(srcdir)/'`android/hal-avrcp-ctrl.c android/bluetooth_default_la-hal-handsfree.lo: android/hal-handsfree.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-handsfree.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-handsfree.Tpo -c -o android/bluetooth_default_la-hal-handsfree.lo `test -f 'android/hal-handsfree.c' || echo '$(srcdir)/'`android/hal-handsfree.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-handsfree.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-handsfree.Tpo -c -o android/bluetooth_default_la-hal-handsfree.lo `test -f 'android/hal-handsfree.c' || echo '$(srcdir)/'`android/hal-handsfree.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-handsfree.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-handsfree.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-handsfree.c' object='android/bluetooth_default_la-hal-handsfree.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-handsfree.lo `test -f 'android/hal-handsfree.c' || echo '$(srcdir)/'`android/hal-handsfree.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-handsfree.lo `test -f 'android/hal-handsfree.c' || echo '$(srcdir)/'`android/hal-handsfree.c android/bluetooth_default_la-hal-handsfree-client.lo: android/hal-handsfree-client.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-handsfree-client.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-handsfree-client.Tpo -c -o android/bluetooth_default_la-hal-handsfree-client.lo `test -f 'android/hal-handsfree-client.c' || echo '$(srcdir)/'`android/hal-handsfree-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-handsfree-client.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-handsfree-client.Tpo -c -o android/bluetooth_default_la-hal-handsfree-client.lo `test -f 'android/hal-handsfree-client.c' || echo '$(srcdir)/'`android/hal-handsfree-client.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-handsfree-client.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-handsfree-client.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-handsfree-client.c' object='android/bluetooth_default_la-hal-handsfree-client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-handsfree-client.lo `test -f 'android/hal-handsfree-client.c' || echo '$(srcdir)/'`android/hal-handsfree-client.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-handsfree-client.lo `test -f 'android/hal-handsfree-client.c' || echo '$(srcdir)/'`android/hal-handsfree-client.c android/bluetooth_default_la-hal-gatt.lo: android/hal-gatt.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-gatt.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-gatt.Tpo -c -o android/bluetooth_default_la-hal-gatt.lo `test -f 'android/hal-gatt.c' || echo '$(srcdir)/'`android/hal-gatt.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-gatt.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-gatt.Tpo -c -o android/bluetooth_default_la-hal-gatt.lo `test -f 'android/hal-gatt.c' || echo '$(srcdir)/'`android/hal-gatt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-gatt.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-gatt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-gatt.c' object='android/bluetooth_default_la-hal-gatt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-gatt.lo `test -f 'android/hal-gatt.c' || echo '$(srcdir)/'`android/hal-gatt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-gatt.lo `test -f 'android/hal-gatt.c' || echo '$(srcdir)/'`android/hal-gatt.c android/bluetooth_default_la-hal-map-client.lo: android/hal-map-client.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-map-client.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-map-client.Tpo -c -o android/bluetooth_default_la-hal-map-client.lo `test -f 'android/hal-map-client.c' || echo '$(srcdir)/'`android/hal-map-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-map-client.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-map-client.Tpo -c -o android/bluetooth_default_la-hal-map-client.lo `test -f 'android/hal-map-client.c' || echo '$(srcdir)/'`android/hal-map-client.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-map-client.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-map-client.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-map-client.c' object='android/bluetooth_default_la-hal-map-client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-map-client.lo `test -f 'android/hal-map-client.c' || echo '$(srcdir)/'`android/hal-map-client.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-map-client.lo `test -f 'android/hal-map-client.c' || echo '$(srcdir)/'`android/hal-map-client.c android/bluetooth_default_la-hal-ipc.lo: android/hal-ipc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-ipc.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-ipc.Tpo -c -o android/bluetooth_default_la-hal-ipc.lo `test -f 'android/hal-ipc.c' || echo '$(srcdir)/'`android/hal-ipc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-ipc.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-ipc.Tpo -c -o android/bluetooth_default_la-hal-ipc.lo `test -f 'android/hal-ipc.c' || echo '$(srcdir)/'`android/hal-ipc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-ipc.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-ipc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-ipc.c' object='android/bluetooth_default_la-hal-ipc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-ipc.lo `test -f 'android/hal-ipc.c' || echo '$(srcdir)/'`android/hal-ipc.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-ipc.lo `test -f 'android/hal-ipc.c' || echo '$(srcdir)/'`android/hal-ipc.c android/bluetooth_default_la-hal-utils.lo: android/hal-utils.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-utils.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-utils.Tpo -c -o android/bluetooth_default_la-hal-utils.lo `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -MT android/bluetooth_default_la-hal-utils.lo -MD -MP -MF android/$(DEPDIR)/bluetooth_default_la-hal-utils.Tpo -c -o android/bluetooth_default_la-hal-utils.lo `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) android/$(DEPDIR)/bluetooth_default_la-hal-utils.Tpo android/$(DEPDIR)/bluetooth_default_la-hal-utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='android/hal-utils.c' object='android/bluetooth_default_la-hal-utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-utils.lo `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c - -plugins/external_dummy_la-external-dummy.lo: plugins/external-dummy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_external_dummy_la_CFLAGS) $(CFLAGS) -MT plugins/external_dummy_la-external-dummy.lo -MD -MP -MF plugins/$(DEPDIR)/external_dummy_la-external-dummy.Tpo -c -o plugins/external_dummy_la-external-dummy.lo `test -f 'plugins/external-dummy.c' || echo '$(srcdir)/'`plugins/external-dummy.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/external_dummy_la-external-dummy.Tpo plugins/$(DEPDIR)/external_dummy_la-external-dummy.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/external-dummy.c' object='plugins/external_dummy_la-external-dummy.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_external_dummy_la_CFLAGS) $(CFLAGS) -c -o plugins/external_dummy_la-external-dummy.lo `test -f 'plugins/external-dummy.c' || echo '$(srcdir)/'`plugins/external-dummy.c - -plugins/sixaxis_la-sixaxis.lo: plugins/sixaxis.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_sixaxis_la_CFLAGS) $(CFLAGS) -MT plugins/sixaxis_la-sixaxis.lo -MD -MP -MF plugins/$(DEPDIR)/sixaxis_la-sixaxis.Tpo -c -o plugins/sixaxis_la-sixaxis.lo `test -f 'plugins/sixaxis.c' || echo '$(srcdir)/'`plugins/sixaxis.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/sixaxis_la-sixaxis.Tpo plugins/$(DEPDIR)/sixaxis_la-sixaxis.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/sixaxis.c' object='plugins/sixaxis_la-sixaxis.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(plugins_sixaxis_la_CFLAGS) $(CFLAGS) -c -o plugins/sixaxis_la-sixaxis.lo `test -f 'plugins/sixaxis.c' || echo '$(srcdir)/'`plugins/sixaxis.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_bluetooth_default_la_CPPFLAGS) $(CPPFLAGS) $(android_bluetooth_default_la_CFLAGS) $(CFLAGS) -c -o android/bluetooth_default_la-hal-utils.lo `test -f 'android/hal-utils.c' || echo '$(srcdir)/'`android/hal-utils.c src/shared/libshared_ell_la-queue.lo: src/shared/queue.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_ell_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_ell_la-queue.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_ell_la-queue.Tpo -c -o src/shared/libshared_ell_la-queue.lo `test -f 'src/shared/queue.c' || echo '$(srcdir)/'`src/shared/queue.c @@ -8195,6 +8189,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_ell_la_CFLAGS) $(CFLAGS) -c -o src/shared/libshared_ell_la-bass.lo `test -f 'src/shared/bass.c' || echo '$(srcdir)/'`src/shared/bass.c +src/shared/libshared_ell_la-ccp.lo: src/shared/ccp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_ell_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_ell_la-ccp.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_ell_la-ccp.Tpo -c -o src/shared/libshared_ell_la-ccp.lo `test -f 'src/shared/ccp.c' || echo '$(srcdir)/'`src/shared/ccp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libshared_ell_la-ccp.Tpo src/shared/$(DEPDIR)/libshared_ell_la-ccp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/ccp.c' object='src/shared/libshared_ell_la-ccp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_ell_la_CFLAGS) $(CFLAGS) -c -o src/shared/libshared_ell_la-ccp.lo `test -f 'src/shared/ccp.c' || echo '$(srcdir)/'`src/shared/ccp.c + +src/shared/libshared_ell_la-asha.lo: src/shared/asha.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_ell_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_ell_la-asha.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_ell_la-asha.Tpo -c -o src/shared/libshared_ell_la-asha.lo `test -f 'src/shared/asha.c' || echo '$(srcdir)/'`src/shared/asha.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libshared_ell_la-asha.Tpo src/shared/$(DEPDIR)/libshared_ell_la-asha.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/asha.c' object='src/shared/libshared_ell_la-asha.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_ell_la_CFLAGS) $(CFLAGS) -c -o src/shared/libshared_ell_la-asha.lo `test -f 'src/shared/asha.c' || echo '$(srcdir)/'`src/shared/asha.c + src/shared/libshared_ell_la-shell.lo: src/shared/shell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_ell_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_ell_la-shell.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_ell_la-shell.Tpo -c -o src/shared/libshared_ell_la-shell.lo `test -f 'src/shared/shell.c' || echo '$(srcdir)/'`src/shared/shell.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libshared_ell_la-shell.Tpo src/shared/$(DEPDIR)/libshared_ell_la-shell.Plo @@ -8412,6 +8420,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_glib_la_CFLAGS) $(CFLAGS) -c -o src/shared/libshared_glib_la-bass.lo `test -f 'src/shared/bass.c' || echo '$(srcdir)/'`src/shared/bass.c +src/shared/libshared_glib_la-ccp.lo: src/shared/ccp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_glib_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_glib_la-ccp.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_glib_la-ccp.Tpo -c -o src/shared/libshared_glib_la-ccp.lo `test -f 'src/shared/ccp.c' || echo '$(srcdir)/'`src/shared/ccp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libshared_glib_la-ccp.Tpo src/shared/$(DEPDIR)/libshared_glib_la-ccp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/ccp.c' object='src/shared/libshared_glib_la-ccp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_glib_la_CFLAGS) $(CFLAGS) -c -o src/shared/libshared_glib_la-ccp.lo `test -f 'src/shared/ccp.c' || echo '$(srcdir)/'`src/shared/ccp.c + +src/shared/libshared_glib_la-asha.lo: src/shared/asha.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_glib_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_glib_la-asha.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_glib_la-asha.Tpo -c -o src/shared/libshared_glib_la-asha.lo `test -f 'src/shared/asha.c' || echo '$(srcdir)/'`src/shared/asha.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libshared_glib_la-asha.Tpo src/shared/$(DEPDIR)/libshared_glib_la-asha.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/asha.c' object='src/shared/libshared_glib_la-asha.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_glib_la_CFLAGS) $(CFLAGS) -c -o src/shared/libshared_glib_la-asha.lo `test -f 'src/shared/asha.c' || echo '$(srcdir)/'`src/shared/asha.c + src/shared/libshared_glib_la-shell.lo: src/shared/shell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_glib_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_glib_la-shell.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_glib_la-shell.Tpo -c -o src/shared/libshared_glib_la-shell.lo `test -f 'src/shared/shell.c' || echo '$(srcdir)/'`src/shared/shell.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libshared_glib_la-shell.Tpo src/shared/$(DEPDIR)/libshared_glib_la-shell.Plo @@ -8643,6 +8665,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_mainloop_la_CFLAGS) $(CFLAGS) -c -o src/shared/libshared_mainloop_la-bass.lo `test -f 'src/shared/bass.c' || echo '$(srcdir)/'`src/shared/bass.c +src/shared/libshared_mainloop_la-ccp.lo: src/shared/ccp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_mainloop_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_mainloop_la-ccp.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_mainloop_la-ccp.Tpo -c -o src/shared/libshared_mainloop_la-ccp.lo `test -f 'src/shared/ccp.c' || echo '$(srcdir)/'`src/shared/ccp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libshared_mainloop_la-ccp.Tpo src/shared/$(DEPDIR)/libshared_mainloop_la-ccp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/ccp.c' object='src/shared/libshared_mainloop_la-ccp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_mainloop_la_CFLAGS) $(CFLAGS) -c -o src/shared/libshared_mainloop_la-ccp.lo `test -f 'src/shared/ccp.c' || echo '$(srcdir)/'`src/shared/ccp.c + +src/shared/libshared_mainloop_la-asha.lo: src/shared/asha.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_mainloop_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_mainloop_la-asha.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_mainloop_la-asha.Tpo -c -o src/shared/libshared_mainloop_la-asha.lo `test -f 'src/shared/asha.c' || echo '$(srcdir)/'`src/shared/asha.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libshared_mainloop_la-asha.Tpo src/shared/$(DEPDIR)/libshared_mainloop_la-asha.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/shared/asha.c' object='src/shared/libshared_mainloop_la-asha.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_mainloop_la_CFLAGS) $(CFLAGS) -c -o src/shared/libshared_mainloop_la-asha.lo `test -f 'src/shared/asha.c' || echo '$(srcdir)/'`src/shared/asha.c + src/shared/libshared_mainloop_la-shell.lo: src/shared/shell.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_libshared_mainloop_la_CFLAGS) $(CFLAGS) -MT src/shared/libshared_mainloop_la-shell.lo -MD -MP -MF src/shared/$(DEPDIR)/libshared_mainloop_la-shell.Tpo -c -o src/shared/libshared_mainloop_la-shell.lo `test -f 'src/shared/shell.c' || echo '$(srcdir)/'`src/shared/shell.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/shared/$(DEPDIR)/libshared_mainloop_la-shell.Tpo src/shared/$(DEPDIR)/libshared_mainloop_la-shell.Plo @@ -9407,564 +9443,564 @@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(android_ipc_tester_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o android/ipc_tester-ipc-tester.obj `if test -f 'android/ipc-tester.c'; then $(CYGPATH_W) 'android/ipc-tester.c'; else $(CYGPATH_W) '$(srcdir)/android/ipc-tester.c'; fi` btio/obexd-btio.o: btio/btio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT btio/obexd-btio.o -MD -MP -MF btio/$(DEPDIR)/obexd-btio.Tpo -c -o btio/obexd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT btio/obexd-btio.o -MD -MP -MF btio/$(DEPDIR)/obexd-btio.Tpo -c -o btio/obexd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/obexd-btio.Tpo btio/$(DEPDIR)/obexd-btio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/obexd-btio.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o btio/obexd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o btio/obexd-btio.o `test -f 'btio/btio.c' || echo '$(srcdir)/'`btio/btio.c btio/obexd-btio.obj: btio/btio.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT btio/obexd-btio.obj -MD -MP -MF btio/$(DEPDIR)/obexd-btio.Tpo -c -o btio/obexd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT btio/obexd-btio.obj -MD -MP -MF btio/$(DEPDIR)/obexd-btio.Tpo -c -o btio/obexd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) btio/$(DEPDIR)/obexd-btio.Tpo btio/$(DEPDIR)/obexd-btio.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='btio/btio.c' object='btio/obexd-btio.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o btio/obexd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o btio/obexd-btio.obj `if test -f 'btio/btio.c'; then $(CYGPATH_W) 'btio/btio.c'; else $(CYGPATH_W) '$(srcdir)/btio/btio.c'; fi` gobex/obexd-gobex.o: gobex/gobex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex.Tpo -c -o gobex/obexd-gobex.o `test -f 'gobex/gobex.c' || echo '$(srcdir)/'`gobex/gobex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex.Tpo -c -o gobex/obexd-gobex.o `test -f 'gobex/gobex.c' || echo '$(srcdir)/'`gobex/gobex.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex.Tpo gobex/$(DEPDIR)/obexd-gobex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex.c' object='gobex/obexd-gobex.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex.o `test -f 'gobex/gobex.c' || echo '$(srcdir)/'`gobex/gobex.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex.o `test -f 'gobex/gobex.c' || echo '$(srcdir)/'`gobex/gobex.c gobex/obexd-gobex.obj: gobex/gobex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex.Tpo -c -o gobex/obexd-gobex.obj `if test -f 'gobex/gobex.c'; then $(CYGPATH_W) 'gobex/gobex.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex.Tpo -c -o gobex/obexd-gobex.obj `if test -f 'gobex/gobex.c'; then $(CYGPATH_W) 'gobex/gobex.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex.Tpo gobex/$(DEPDIR)/obexd-gobex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex.c' object='gobex/obexd-gobex.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex.obj `if test -f 'gobex/gobex.c'; then $(CYGPATH_W) 'gobex/gobex.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex.obj `if test -f 'gobex/gobex.c'; then $(CYGPATH_W) 'gobex/gobex.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex.c'; fi` gobex/obexd-gobex-defs.o: gobex/gobex-defs.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-defs.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-defs.Tpo -c -o gobex/obexd-gobex-defs.o `test -f 'gobex/gobex-defs.c' || echo '$(srcdir)/'`gobex/gobex-defs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-defs.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-defs.Tpo -c -o gobex/obexd-gobex-defs.o `test -f 'gobex/gobex-defs.c' || echo '$(srcdir)/'`gobex/gobex-defs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-defs.Tpo gobex/$(DEPDIR)/obexd-gobex-defs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-defs.c' object='gobex/obexd-gobex-defs.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-defs.o `test -f 'gobex/gobex-defs.c' || echo '$(srcdir)/'`gobex/gobex-defs.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-defs.o `test -f 'gobex/gobex-defs.c' || echo '$(srcdir)/'`gobex/gobex-defs.c gobex/obexd-gobex-defs.obj: gobex/gobex-defs.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-defs.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-defs.Tpo -c -o gobex/obexd-gobex-defs.obj `if test -f 'gobex/gobex-defs.c'; then $(CYGPATH_W) 'gobex/gobex-defs.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-defs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-defs.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-defs.Tpo -c -o gobex/obexd-gobex-defs.obj `if test -f 'gobex/gobex-defs.c'; then $(CYGPATH_W) 'gobex/gobex-defs.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-defs.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-defs.Tpo gobex/$(DEPDIR)/obexd-gobex-defs.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-defs.c' object='gobex/obexd-gobex-defs.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-defs.obj `if test -f 'gobex/gobex-defs.c'; then $(CYGPATH_W) 'gobex/gobex-defs.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-defs.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-defs.obj `if test -f 'gobex/gobex-defs.c'; then $(CYGPATH_W) 'gobex/gobex-defs.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-defs.c'; fi` gobex/obexd-gobex-packet.o: gobex/gobex-packet.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-packet.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-packet.Tpo -c -o gobex/obexd-gobex-packet.o `test -f 'gobex/gobex-packet.c' || echo '$(srcdir)/'`gobex/gobex-packet.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-packet.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-packet.Tpo -c -o gobex/obexd-gobex-packet.o `test -f 'gobex/gobex-packet.c' || echo '$(srcdir)/'`gobex/gobex-packet.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-packet.Tpo gobex/$(DEPDIR)/obexd-gobex-packet.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-packet.c' object='gobex/obexd-gobex-packet.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-packet.o `test -f 'gobex/gobex-packet.c' || echo '$(srcdir)/'`gobex/gobex-packet.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-packet.o `test -f 'gobex/gobex-packet.c' || echo '$(srcdir)/'`gobex/gobex-packet.c gobex/obexd-gobex-packet.obj: gobex/gobex-packet.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-packet.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-packet.Tpo -c -o gobex/obexd-gobex-packet.obj `if test -f 'gobex/gobex-packet.c'; then $(CYGPATH_W) 'gobex/gobex-packet.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-packet.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-packet.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-packet.Tpo -c -o gobex/obexd-gobex-packet.obj `if test -f 'gobex/gobex-packet.c'; then $(CYGPATH_W) 'gobex/gobex-packet.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-packet.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-packet.Tpo gobex/$(DEPDIR)/obexd-gobex-packet.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-packet.c' object='gobex/obexd-gobex-packet.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-packet.obj `if test -f 'gobex/gobex-packet.c'; then $(CYGPATH_W) 'gobex/gobex-packet.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-packet.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-packet.obj `if test -f 'gobex/gobex-packet.c'; then $(CYGPATH_W) 'gobex/gobex-packet.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-packet.c'; fi` gobex/obexd-gobex-header.o: gobex/gobex-header.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-header.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-header.Tpo -c -o gobex/obexd-gobex-header.o `test -f 'gobex/gobex-header.c' || echo '$(srcdir)/'`gobex/gobex-header.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-header.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-header.Tpo -c -o gobex/obexd-gobex-header.o `test -f 'gobex/gobex-header.c' || echo '$(srcdir)/'`gobex/gobex-header.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-header.Tpo gobex/$(DEPDIR)/obexd-gobex-header.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-header.c' object='gobex/obexd-gobex-header.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-header.o `test -f 'gobex/gobex-header.c' || echo '$(srcdir)/'`gobex/gobex-header.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-header.o `test -f 'gobex/gobex-header.c' || echo '$(srcdir)/'`gobex/gobex-header.c gobex/obexd-gobex-header.obj: gobex/gobex-header.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-header.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-header.Tpo -c -o gobex/obexd-gobex-header.obj `if test -f 'gobex/gobex-header.c'; then $(CYGPATH_W) 'gobex/gobex-header.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-header.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-header.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-header.Tpo -c -o gobex/obexd-gobex-header.obj `if test -f 'gobex/gobex-header.c'; then $(CYGPATH_W) 'gobex/gobex-header.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-header.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-header.Tpo gobex/$(DEPDIR)/obexd-gobex-header.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-header.c' object='gobex/obexd-gobex-header.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-header.obj `if test -f 'gobex/gobex-header.c'; then $(CYGPATH_W) 'gobex/gobex-header.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-header.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-header.obj `if test -f 'gobex/gobex-header.c'; then $(CYGPATH_W) 'gobex/gobex-header.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-header.c'; fi` gobex/obexd-gobex-transfer.o: gobex/gobex-transfer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-transfer.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo -c -o gobex/obexd-gobex-transfer.o `test -f 'gobex/gobex-transfer.c' || echo '$(srcdir)/'`gobex/gobex-transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-transfer.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo -c -o gobex/obexd-gobex-transfer.o `test -f 'gobex/gobex-transfer.c' || echo '$(srcdir)/'`gobex/gobex-transfer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo gobex/$(DEPDIR)/obexd-gobex-transfer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-transfer.c' object='gobex/obexd-gobex-transfer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-transfer.o `test -f 'gobex/gobex-transfer.c' || echo '$(srcdir)/'`gobex/gobex-transfer.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-transfer.o `test -f 'gobex/gobex-transfer.c' || echo '$(srcdir)/'`gobex/gobex-transfer.c gobex/obexd-gobex-transfer.obj: gobex/gobex-transfer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-transfer.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo -c -o gobex/obexd-gobex-transfer.obj `if test -f 'gobex/gobex-transfer.c'; then $(CYGPATH_W) 'gobex/gobex-transfer.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-transfer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-transfer.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo -c -o gobex/obexd-gobex-transfer.obj `if test -f 'gobex/gobex-transfer.c'; then $(CYGPATH_W) 'gobex/gobex-transfer.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-transfer.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-transfer.Tpo gobex/$(DEPDIR)/obexd-gobex-transfer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-transfer.c' object='gobex/obexd-gobex-transfer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-transfer.obj `if test -f 'gobex/gobex-transfer.c'; then $(CYGPATH_W) 'gobex/gobex-transfer.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-transfer.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-transfer.obj `if test -f 'gobex/gobex-transfer.c'; then $(CYGPATH_W) 'gobex/gobex-transfer.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-transfer.c'; fi` gobex/obexd-gobex-apparam.o: gobex/gobex-apparam.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-apparam.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo -c -o gobex/obexd-gobex-apparam.o `test -f 'gobex/gobex-apparam.c' || echo '$(srcdir)/'`gobex/gobex-apparam.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-apparam.o -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo -c -o gobex/obexd-gobex-apparam.o `test -f 'gobex/gobex-apparam.c' || echo '$(srcdir)/'`gobex/gobex-apparam.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo gobex/$(DEPDIR)/obexd-gobex-apparam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-apparam.c' object='gobex/obexd-gobex-apparam.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-apparam.o `test -f 'gobex/gobex-apparam.c' || echo '$(srcdir)/'`gobex/gobex-apparam.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-apparam.o `test -f 'gobex/gobex-apparam.c' || echo '$(srcdir)/'`gobex/gobex-apparam.c gobex/obexd-gobex-apparam.obj: gobex/gobex-apparam.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-apparam.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo -c -o gobex/obexd-gobex-apparam.obj `if test -f 'gobex/gobex-apparam.c'; then $(CYGPATH_W) 'gobex/gobex-apparam.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-apparam.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gobex/obexd-gobex-apparam.obj -MD -MP -MF gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo -c -o gobex/obexd-gobex-apparam.obj `if test -f 'gobex/gobex-apparam.c'; then $(CYGPATH_W) 'gobex/gobex-apparam.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-apparam.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) gobex/$(DEPDIR)/obexd-gobex-apparam.Tpo gobex/$(DEPDIR)/obexd-gobex-apparam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gobex/gobex-apparam.c' object='gobex/obexd-gobex-apparam.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-apparam.obj `if test -f 'gobex/gobex-apparam.c'; then $(CYGPATH_W) 'gobex/gobex-apparam.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-apparam.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gobex/obexd-gobex-apparam.obj `if test -f 'gobex/gobex-apparam.c'; then $(CYGPATH_W) 'gobex/gobex-apparam.c'; else $(CYGPATH_W) '$(srcdir)/gobex/gobex-apparam.c'; fi` obexd/plugins/obexd-filesystem.o: obexd/plugins/filesystem.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-filesystem.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo -c -o obexd/plugins/obexd-filesystem.o `test -f 'obexd/plugins/filesystem.c' || echo '$(srcdir)/'`obexd/plugins/filesystem.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-filesystem.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo -c -o obexd/plugins/obexd-filesystem.o `test -f 'obexd/plugins/filesystem.c' || echo '$(srcdir)/'`obexd/plugins/filesystem.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo obexd/plugins/$(DEPDIR)/obexd-filesystem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/filesystem.c' object='obexd/plugins/obexd-filesystem.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-filesystem.o `test -f 'obexd/plugins/filesystem.c' || echo '$(srcdir)/'`obexd/plugins/filesystem.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-filesystem.o `test -f 'obexd/plugins/filesystem.c' || echo '$(srcdir)/'`obexd/plugins/filesystem.c obexd/plugins/obexd-filesystem.obj: obexd/plugins/filesystem.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-filesystem.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo -c -o obexd/plugins/obexd-filesystem.obj `if test -f 'obexd/plugins/filesystem.c'; then $(CYGPATH_W) 'obexd/plugins/filesystem.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/filesystem.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-filesystem.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo -c -o obexd/plugins/obexd-filesystem.obj `if test -f 'obexd/plugins/filesystem.c'; then $(CYGPATH_W) 'obexd/plugins/filesystem.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/filesystem.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-filesystem.Tpo obexd/plugins/$(DEPDIR)/obexd-filesystem.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/filesystem.c' object='obexd/plugins/obexd-filesystem.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-filesystem.obj `if test -f 'obexd/plugins/filesystem.c'; then $(CYGPATH_W) 'obexd/plugins/filesystem.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/filesystem.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-filesystem.obj `if test -f 'obexd/plugins/filesystem.c'; then $(CYGPATH_W) 'obexd/plugins/filesystem.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/filesystem.c'; fi` obexd/plugins/obexd-bluetooth.o: obexd/plugins/bluetooth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-bluetooth.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/plugins/obexd-bluetooth.o `test -f 'obexd/plugins/bluetooth.c' || echo '$(srcdir)/'`obexd/plugins/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-bluetooth.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/plugins/obexd-bluetooth.o `test -f 'obexd/plugins/bluetooth.c' || echo '$(srcdir)/'`obexd/plugins/bluetooth.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo obexd/plugins/$(DEPDIR)/obexd-bluetooth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/bluetooth.c' object='obexd/plugins/obexd-bluetooth.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-bluetooth.o `test -f 'obexd/plugins/bluetooth.c' || echo '$(srcdir)/'`obexd/plugins/bluetooth.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-bluetooth.o `test -f 'obexd/plugins/bluetooth.c' || echo '$(srcdir)/'`obexd/plugins/bluetooth.c obexd/plugins/obexd-bluetooth.obj: obexd/plugins/bluetooth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-bluetooth.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/plugins/obexd-bluetooth.obj `if test -f 'obexd/plugins/bluetooth.c'; then $(CYGPATH_W) 'obexd/plugins/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/bluetooth.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-bluetooth.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/plugins/obexd-bluetooth.obj `if test -f 'obexd/plugins/bluetooth.c'; then $(CYGPATH_W) 'obexd/plugins/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/bluetooth.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-bluetooth.Tpo obexd/plugins/$(DEPDIR)/obexd-bluetooth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/bluetooth.c' object='obexd/plugins/obexd-bluetooth.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-bluetooth.obj `if test -f 'obexd/plugins/bluetooth.c'; then $(CYGPATH_W) 'obexd/plugins/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/bluetooth.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-bluetooth.obj `if test -f 'obexd/plugins/bluetooth.c'; then $(CYGPATH_W) 'obexd/plugins/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/bluetooth.c'; fi` obexd/plugins/obexd-pcsuite.o: obexd/plugins/pcsuite.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pcsuite.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo -c -o obexd/plugins/obexd-pcsuite.o `test -f 'obexd/plugins/pcsuite.c' || echo '$(srcdir)/'`obexd/plugins/pcsuite.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pcsuite.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo -c -o obexd/plugins/obexd-pcsuite.o `test -f 'obexd/plugins/pcsuite.c' || echo '$(srcdir)/'`obexd/plugins/pcsuite.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo obexd/plugins/$(DEPDIR)/obexd-pcsuite.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pcsuite.c' object='obexd/plugins/obexd-pcsuite.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pcsuite.o `test -f 'obexd/plugins/pcsuite.c' || echo '$(srcdir)/'`obexd/plugins/pcsuite.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pcsuite.o `test -f 'obexd/plugins/pcsuite.c' || echo '$(srcdir)/'`obexd/plugins/pcsuite.c obexd/plugins/obexd-pcsuite.obj: obexd/plugins/pcsuite.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pcsuite.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo -c -o obexd/plugins/obexd-pcsuite.obj `if test -f 'obexd/plugins/pcsuite.c'; then $(CYGPATH_W) 'obexd/plugins/pcsuite.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pcsuite.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pcsuite.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo -c -o obexd/plugins/obexd-pcsuite.obj `if test -f 'obexd/plugins/pcsuite.c'; then $(CYGPATH_W) 'obexd/plugins/pcsuite.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pcsuite.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pcsuite.Tpo obexd/plugins/$(DEPDIR)/obexd-pcsuite.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pcsuite.c' object='obexd/plugins/obexd-pcsuite.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pcsuite.obj `if test -f 'obexd/plugins/pcsuite.c'; then $(CYGPATH_W) 'obexd/plugins/pcsuite.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pcsuite.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pcsuite.obj `if test -f 'obexd/plugins/pcsuite.c'; then $(CYGPATH_W) 'obexd/plugins/pcsuite.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pcsuite.c'; fi` obexd/plugins/obexd-opp.o: obexd/plugins/opp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-opp.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/plugins/obexd-opp.o `test -f 'obexd/plugins/opp.c' || echo '$(srcdir)/'`obexd/plugins/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-opp.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/plugins/obexd-opp.o `test -f 'obexd/plugins/opp.c' || echo '$(srcdir)/'`obexd/plugins/opp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-opp.Tpo obexd/plugins/$(DEPDIR)/obexd-opp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/opp.c' object='obexd/plugins/obexd-opp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-opp.o `test -f 'obexd/plugins/opp.c' || echo '$(srcdir)/'`obexd/plugins/opp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-opp.o `test -f 'obexd/plugins/opp.c' || echo '$(srcdir)/'`obexd/plugins/opp.c obexd/plugins/obexd-opp.obj: obexd/plugins/opp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-opp.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/plugins/obexd-opp.obj `if test -f 'obexd/plugins/opp.c'; then $(CYGPATH_W) 'obexd/plugins/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/opp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-opp.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/plugins/obexd-opp.obj `if test -f 'obexd/plugins/opp.c'; then $(CYGPATH_W) 'obexd/plugins/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/opp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-opp.Tpo obexd/plugins/$(DEPDIR)/obexd-opp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/opp.c' object='obexd/plugins/obexd-opp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-opp.obj `if test -f 'obexd/plugins/opp.c'; then $(CYGPATH_W) 'obexd/plugins/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/opp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-opp.obj `if test -f 'obexd/plugins/opp.c'; then $(CYGPATH_W) 'obexd/plugins/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/opp.c'; fi` obexd/plugins/obexd-ftp.o: obexd/plugins/ftp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-ftp.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/plugins/obexd-ftp.o `test -f 'obexd/plugins/ftp.c' || echo '$(srcdir)/'`obexd/plugins/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-ftp.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/plugins/obexd-ftp.o `test -f 'obexd/plugins/ftp.c' || echo '$(srcdir)/'`obexd/plugins/ftp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo obexd/plugins/$(DEPDIR)/obexd-ftp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/ftp.c' object='obexd/plugins/obexd-ftp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-ftp.o `test -f 'obexd/plugins/ftp.c' || echo '$(srcdir)/'`obexd/plugins/ftp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-ftp.o `test -f 'obexd/plugins/ftp.c' || echo '$(srcdir)/'`obexd/plugins/ftp.c obexd/plugins/obexd-ftp.obj: obexd/plugins/ftp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-ftp.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/plugins/obexd-ftp.obj `if test -f 'obexd/plugins/ftp.c'; then $(CYGPATH_W) 'obexd/plugins/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/ftp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-ftp.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/plugins/obexd-ftp.obj `if test -f 'obexd/plugins/ftp.c'; then $(CYGPATH_W) 'obexd/plugins/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/ftp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-ftp.Tpo obexd/plugins/$(DEPDIR)/obexd-ftp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/ftp.c' object='obexd/plugins/obexd-ftp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-ftp.obj `if test -f 'obexd/plugins/ftp.c'; then $(CYGPATH_W) 'obexd/plugins/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/ftp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-ftp.obj `if test -f 'obexd/plugins/ftp.c'; then $(CYGPATH_W) 'obexd/plugins/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/ftp.c'; fi` obexd/plugins/obexd-irmc.o: obexd/plugins/irmc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-irmc.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo -c -o obexd/plugins/obexd-irmc.o `test -f 'obexd/plugins/irmc.c' || echo '$(srcdir)/'`obexd/plugins/irmc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-irmc.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo -c -o obexd/plugins/obexd-irmc.o `test -f 'obexd/plugins/irmc.c' || echo '$(srcdir)/'`obexd/plugins/irmc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo obexd/plugins/$(DEPDIR)/obexd-irmc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/irmc.c' object='obexd/plugins/obexd-irmc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-irmc.o `test -f 'obexd/plugins/irmc.c' || echo '$(srcdir)/'`obexd/plugins/irmc.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-irmc.o `test -f 'obexd/plugins/irmc.c' || echo '$(srcdir)/'`obexd/plugins/irmc.c obexd/plugins/obexd-irmc.obj: obexd/plugins/irmc.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-irmc.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo -c -o obexd/plugins/obexd-irmc.obj `if test -f 'obexd/plugins/irmc.c'; then $(CYGPATH_W) 'obexd/plugins/irmc.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/irmc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-irmc.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo -c -o obexd/plugins/obexd-irmc.obj `if test -f 'obexd/plugins/irmc.c'; then $(CYGPATH_W) 'obexd/plugins/irmc.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/irmc.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-irmc.Tpo obexd/plugins/$(DEPDIR)/obexd-irmc.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/irmc.c' object='obexd/plugins/obexd-irmc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-irmc.obj `if test -f 'obexd/plugins/irmc.c'; then $(CYGPATH_W) 'obexd/plugins/irmc.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/irmc.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-irmc.obj `if test -f 'obexd/plugins/irmc.c'; then $(CYGPATH_W) 'obexd/plugins/irmc.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/irmc.c'; fi` obexd/plugins/obexd-pbap.o: obexd/plugins/pbap.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pbap.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/plugins/obexd-pbap.o `test -f 'obexd/plugins/pbap.c' || echo '$(srcdir)/'`obexd/plugins/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pbap.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/plugins/obexd-pbap.o `test -f 'obexd/plugins/pbap.c' || echo '$(srcdir)/'`obexd/plugins/pbap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo obexd/plugins/$(DEPDIR)/obexd-pbap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pbap.c' object='obexd/plugins/obexd-pbap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pbap.o `test -f 'obexd/plugins/pbap.c' || echo '$(srcdir)/'`obexd/plugins/pbap.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pbap.o `test -f 'obexd/plugins/pbap.c' || echo '$(srcdir)/'`obexd/plugins/pbap.c obexd/plugins/obexd-pbap.obj: obexd/plugins/pbap.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pbap.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/plugins/obexd-pbap.obj `if test -f 'obexd/plugins/pbap.c'; then $(CYGPATH_W) 'obexd/plugins/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pbap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-pbap.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/plugins/obexd-pbap.obj `if test -f 'obexd/plugins/pbap.c'; then $(CYGPATH_W) 'obexd/plugins/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pbap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-pbap.Tpo obexd/plugins/$(DEPDIR)/obexd-pbap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/pbap.c' object='obexd/plugins/obexd-pbap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pbap.obj `if test -f 'obexd/plugins/pbap.c'; then $(CYGPATH_W) 'obexd/plugins/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pbap.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-pbap.obj `if test -f 'obexd/plugins/pbap.c'; then $(CYGPATH_W) 'obexd/plugins/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/pbap.c'; fi` obexd/plugins/obexd-vcard.o: obexd/plugins/vcard.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-vcard.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo -c -o obexd/plugins/obexd-vcard.o `test -f 'obexd/plugins/vcard.c' || echo '$(srcdir)/'`obexd/plugins/vcard.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-vcard.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo -c -o obexd/plugins/obexd-vcard.o `test -f 'obexd/plugins/vcard.c' || echo '$(srcdir)/'`obexd/plugins/vcard.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo obexd/plugins/$(DEPDIR)/obexd-vcard.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/vcard.c' object='obexd/plugins/obexd-vcard.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-vcard.o `test -f 'obexd/plugins/vcard.c' || echo '$(srcdir)/'`obexd/plugins/vcard.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-vcard.o `test -f 'obexd/plugins/vcard.c' || echo '$(srcdir)/'`obexd/plugins/vcard.c obexd/plugins/obexd-vcard.obj: obexd/plugins/vcard.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-vcard.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo -c -o obexd/plugins/obexd-vcard.obj `if test -f 'obexd/plugins/vcard.c'; then $(CYGPATH_W) 'obexd/plugins/vcard.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/vcard.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-vcard.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo -c -o obexd/plugins/obexd-vcard.obj `if test -f 'obexd/plugins/vcard.c'; then $(CYGPATH_W) 'obexd/plugins/vcard.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/vcard.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-vcard.Tpo obexd/plugins/$(DEPDIR)/obexd-vcard.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/vcard.c' object='obexd/plugins/obexd-vcard.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-vcard.obj `if test -f 'obexd/plugins/vcard.c'; then $(CYGPATH_W) 'obexd/plugins/vcard.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/vcard.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-vcard.obj `if test -f 'obexd/plugins/vcard.c'; then $(CYGPATH_W) 'obexd/plugins/vcard.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/vcard.c'; fi` obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.o: obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-phonebook-@PLUGIN_PHONEBOOK@.Tpo -c -o obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.o `test -f 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c' || echo '$(srcdir)/'`obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-phonebook-@PLUGIN_PHONEBOOK@.Tpo -c -o obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.o `test -f 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c' || echo '$(srcdir)/'`obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-phonebook-@PLUGIN_PHONEBOOK@.Tpo obexd/plugins/$(DEPDIR)/obexd-phonebook-@PLUGIN_PHONEBOOK@.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c' object='obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.o `test -f 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c' || echo '$(srcdir)/'`obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.o `test -f 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c' || echo '$(srcdir)/'`obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.obj: obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-phonebook-@PLUGIN_PHONEBOOK@.Tpo -c -o obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.obj `if test -f 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; then $(CYGPATH_W) 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-phonebook-@PLUGIN_PHONEBOOK@.Tpo -c -o obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.obj `if test -f 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; then $(CYGPATH_W) 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-phonebook-@PLUGIN_PHONEBOOK@.Tpo obexd/plugins/$(DEPDIR)/obexd-phonebook-@PLUGIN_PHONEBOOK@.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c' object='obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.obj `if test -f 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; then $(CYGPATH_W) 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-phonebook-@PLUGIN_PHONEBOOK@.obj `if test -f 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; then $(CYGPATH_W) 'obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/phonebook-@PLUGIN_PHONEBOOK@.c'; fi` obexd/plugins/obexd-mas.o: obexd/plugins/mas.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-mas.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-mas.Tpo -c -o obexd/plugins/obexd-mas.o `test -f 'obexd/plugins/mas.c' || echo '$(srcdir)/'`obexd/plugins/mas.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-mas.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-mas.Tpo -c -o obexd/plugins/obexd-mas.o `test -f 'obexd/plugins/mas.c' || echo '$(srcdir)/'`obexd/plugins/mas.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-mas.Tpo obexd/plugins/$(DEPDIR)/obexd-mas.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/mas.c' object='obexd/plugins/obexd-mas.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-mas.o `test -f 'obexd/plugins/mas.c' || echo '$(srcdir)/'`obexd/plugins/mas.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-mas.o `test -f 'obexd/plugins/mas.c' || echo '$(srcdir)/'`obexd/plugins/mas.c obexd/plugins/obexd-mas.obj: obexd/plugins/mas.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-mas.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-mas.Tpo -c -o obexd/plugins/obexd-mas.obj `if test -f 'obexd/plugins/mas.c'; then $(CYGPATH_W) 'obexd/plugins/mas.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/mas.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-mas.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-mas.Tpo -c -o obexd/plugins/obexd-mas.obj `if test -f 'obexd/plugins/mas.c'; then $(CYGPATH_W) 'obexd/plugins/mas.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/mas.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-mas.Tpo obexd/plugins/$(DEPDIR)/obexd-mas.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/mas.c' object='obexd/plugins/obexd-mas.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-mas.obj `if test -f 'obexd/plugins/mas.c'; then $(CYGPATH_W) 'obexd/plugins/mas.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/mas.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-mas.obj `if test -f 'obexd/plugins/mas.c'; then $(CYGPATH_W) 'obexd/plugins/mas.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/mas.c'; fi` obexd/plugins/obexd-messages-dummy.o: obexd/plugins/messages-dummy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-messages-dummy.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo -c -o obexd/plugins/obexd-messages-dummy.o `test -f 'obexd/plugins/messages-dummy.c' || echo '$(srcdir)/'`obexd/plugins/messages-dummy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-messages-dummy.o -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo -c -o obexd/plugins/obexd-messages-dummy.o `test -f 'obexd/plugins/messages-dummy.c' || echo '$(srcdir)/'`obexd/plugins/messages-dummy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/messages-dummy.c' object='obexd/plugins/obexd-messages-dummy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-messages-dummy.o `test -f 'obexd/plugins/messages-dummy.c' || echo '$(srcdir)/'`obexd/plugins/messages-dummy.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-messages-dummy.o `test -f 'obexd/plugins/messages-dummy.c' || echo '$(srcdir)/'`obexd/plugins/messages-dummy.c obexd/plugins/obexd-messages-dummy.obj: obexd/plugins/messages-dummy.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-messages-dummy.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo -c -o obexd/plugins/obexd-messages-dummy.obj `if test -f 'obexd/plugins/messages-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/messages-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/messages-dummy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/plugins/obexd-messages-dummy.obj -MD -MP -MF obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo -c -o obexd/plugins/obexd-messages-dummy.obj `if test -f 'obexd/plugins/messages-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/messages-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/messages-dummy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Tpo obexd/plugins/$(DEPDIR)/obexd-messages-dummy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/plugins/messages-dummy.c' object='obexd/plugins/obexd-messages-dummy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-messages-dummy.obj `if test -f 'obexd/plugins/messages-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/messages-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/messages-dummy.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/plugins/obexd-messages-dummy.obj `if test -f 'obexd/plugins/messages-dummy.c'; then $(CYGPATH_W) 'obexd/plugins/messages-dummy.c'; else $(CYGPATH_W) '$(srcdir)/obexd/plugins/messages-dummy.c'; fi` obexd/client/obexd-mns.o: obexd/client/mns.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-mns.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-mns.Tpo -c -o obexd/client/obexd-mns.o `test -f 'obexd/client/mns.c' || echo '$(srcdir)/'`obexd/client/mns.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-mns.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-mns.Tpo -c -o obexd/client/obexd-mns.o `test -f 'obexd/client/mns.c' || echo '$(srcdir)/'`obexd/client/mns.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-mns.Tpo obexd/client/$(DEPDIR)/obexd-mns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/mns.c' object='obexd/client/obexd-mns.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-mns.o `test -f 'obexd/client/mns.c' || echo '$(srcdir)/'`obexd/client/mns.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-mns.o `test -f 'obexd/client/mns.c' || echo '$(srcdir)/'`obexd/client/mns.c obexd/client/obexd-mns.obj: obexd/client/mns.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-mns.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-mns.Tpo -c -o obexd/client/obexd-mns.obj `if test -f 'obexd/client/mns.c'; then $(CYGPATH_W) 'obexd/client/mns.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/mns.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-mns.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-mns.Tpo -c -o obexd/client/obexd-mns.obj `if test -f 'obexd/client/mns.c'; then $(CYGPATH_W) 'obexd/client/mns.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/mns.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-mns.Tpo obexd/client/$(DEPDIR)/obexd-mns.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/mns.c' object='obexd/client/obexd-mns.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-mns.obj `if test -f 'obexd/client/mns.c'; then $(CYGPATH_W) 'obexd/client/mns.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/mns.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-mns.obj `if test -f 'obexd/client/mns.c'; then $(CYGPATH_W) 'obexd/client/mns.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/mns.c'; fi` obexd/src/obexd-main.o: obexd/src/main.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-main.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-main.Tpo -c -o obexd/src/obexd-main.o `test -f 'obexd/src/main.c' || echo '$(srcdir)/'`obexd/src/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-main.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-main.Tpo -c -o obexd/src/obexd-main.o `test -f 'obexd/src/main.c' || echo '$(srcdir)/'`obexd/src/main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-main.Tpo obexd/src/$(DEPDIR)/obexd-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/main.c' object='obexd/src/obexd-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-main.o `test -f 'obexd/src/main.c' || echo '$(srcdir)/'`obexd/src/main.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-main.o `test -f 'obexd/src/main.c' || echo '$(srcdir)/'`obexd/src/main.c obexd/src/obexd-main.obj: obexd/src/main.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-main.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-main.Tpo -c -o obexd/src/obexd-main.obj `if test -f 'obexd/src/main.c'; then $(CYGPATH_W) 'obexd/src/main.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-main.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-main.Tpo -c -o obexd/src/obexd-main.obj `if test -f 'obexd/src/main.c'; then $(CYGPATH_W) 'obexd/src/main.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-main.Tpo obexd/src/$(DEPDIR)/obexd-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/main.c' object='obexd/src/obexd-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-main.obj `if test -f 'obexd/src/main.c'; then $(CYGPATH_W) 'obexd/src/main.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/main.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-main.obj `if test -f 'obexd/src/main.c'; then $(CYGPATH_W) 'obexd/src/main.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/main.c'; fi` obexd/src/obexd-plugin.o: obexd/src/plugin.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-plugin.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-plugin.Tpo -c -o obexd/src/obexd-plugin.o `test -f 'obexd/src/plugin.c' || echo '$(srcdir)/'`obexd/src/plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-plugin.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-plugin.Tpo -c -o obexd/src/obexd-plugin.o `test -f 'obexd/src/plugin.c' || echo '$(srcdir)/'`obexd/src/plugin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-plugin.Tpo obexd/src/$(DEPDIR)/obexd-plugin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/plugin.c' object='obexd/src/obexd-plugin.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-plugin.o `test -f 'obexd/src/plugin.c' || echo '$(srcdir)/'`obexd/src/plugin.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-plugin.o `test -f 'obexd/src/plugin.c' || echo '$(srcdir)/'`obexd/src/plugin.c obexd/src/obexd-plugin.obj: obexd/src/plugin.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-plugin.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-plugin.Tpo -c -o obexd/src/obexd-plugin.obj `if test -f 'obexd/src/plugin.c'; then $(CYGPATH_W) 'obexd/src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/plugin.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-plugin.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-plugin.Tpo -c -o obexd/src/obexd-plugin.obj `if test -f 'obexd/src/plugin.c'; then $(CYGPATH_W) 'obexd/src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/plugin.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-plugin.Tpo obexd/src/$(DEPDIR)/obexd-plugin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/plugin.c' object='obexd/src/obexd-plugin.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-plugin.obj `if test -f 'obexd/src/plugin.c'; then $(CYGPATH_W) 'obexd/src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/plugin.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-plugin.obj `if test -f 'obexd/src/plugin.c'; then $(CYGPATH_W) 'obexd/src/plugin.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/plugin.c'; fi` obexd/src/obexd-log.o: obexd/src/log.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-log.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-log.Tpo -c -o obexd/src/obexd-log.o `test -f 'obexd/src/log.c' || echo '$(srcdir)/'`obexd/src/log.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-log.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-log.Tpo -c -o obexd/src/obexd-log.o `test -f 'obexd/src/log.c' || echo '$(srcdir)/'`obexd/src/log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-log.Tpo obexd/src/$(DEPDIR)/obexd-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/log.c' object='obexd/src/obexd-log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-log.o `test -f 'obexd/src/log.c' || echo '$(srcdir)/'`obexd/src/log.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-log.o `test -f 'obexd/src/log.c' || echo '$(srcdir)/'`obexd/src/log.c obexd/src/obexd-log.obj: obexd/src/log.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-log.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-log.Tpo -c -o obexd/src/obexd-log.obj `if test -f 'obexd/src/log.c'; then $(CYGPATH_W) 'obexd/src/log.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/log.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-log.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-log.Tpo -c -o obexd/src/obexd-log.obj `if test -f 'obexd/src/log.c'; then $(CYGPATH_W) 'obexd/src/log.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-log.Tpo obexd/src/$(DEPDIR)/obexd-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/log.c' object='obexd/src/obexd-log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-log.obj `if test -f 'obexd/src/log.c'; then $(CYGPATH_W) 'obexd/src/log.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/log.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-log.obj `if test -f 'obexd/src/log.c'; then $(CYGPATH_W) 'obexd/src/log.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/log.c'; fi` obexd/src/obexd-manager.o: obexd/src/manager.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-manager.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/src/obexd-manager.o `test -f 'obexd/src/manager.c' || echo '$(srcdir)/'`obexd/src/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-manager.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/src/obexd-manager.o `test -f 'obexd/src/manager.c' || echo '$(srcdir)/'`obexd/src/manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-manager.Tpo obexd/src/$(DEPDIR)/obexd-manager.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/manager.c' object='obexd/src/obexd-manager.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-manager.o `test -f 'obexd/src/manager.c' || echo '$(srcdir)/'`obexd/src/manager.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-manager.o `test -f 'obexd/src/manager.c' || echo '$(srcdir)/'`obexd/src/manager.c obexd/src/obexd-manager.obj: obexd/src/manager.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-manager.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/src/obexd-manager.obj `if test -f 'obexd/src/manager.c'; then $(CYGPATH_W) 'obexd/src/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-manager.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/src/obexd-manager.obj `if test -f 'obexd/src/manager.c'; then $(CYGPATH_W) 'obexd/src/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/manager.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-manager.Tpo obexd/src/$(DEPDIR)/obexd-manager.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/manager.c' object='obexd/src/obexd-manager.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-manager.obj `if test -f 'obexd/src/manager.c'; then $(CYGPATH_W) 'obexd/src/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/manager.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-manager.obj `if test -f 'obexd/src/manager.c'; then $(CYGPATH_W) 'obexd/src/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/manager.c'; fi` obexd/src/obexd-obex.o: obexd/src/obex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-obex.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-obex.Tpo -c -o obexd/src/obexd-obex.o `test -f 'obexd/src/obex.c' || echo '$(srcdir)/'`obexd/src/obex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-obex.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-obex.Tpo -c -o obexd/src/obexd-obex.o `test -f 'obexd/src/obex.c' || echo '$(srcdir)/'`obexd/src/obex.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-obex.Tpo obexd/src/$(DEPDIR)/obexd-obex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/obex.c' object='obexd/src/obexd-obex.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-obex.o `test -f 'obexd/src/obex.c' || echo '$(srcdir)/'`obexd/src/obex.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-obex.o `test -f 'obexd/src/obex.c' || echo '$(srcdir)/'`obexd/src/obex.c obexd/src/obexd-obex.obj: obexd/src/obex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-obex.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-obex.Tpo -c -o obexd/src/obexd-obex.obj `if test -f 'obexd/src/obex.c'; then $(CYGPATH_W) 'obexd/src/obex.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/obex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-obex.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-obex.Tpo -c -o obexd/src/obexd-obex.obj `if test -f 'obexd/src/obex.c'; then $(CYGPATH_W) 'obexd/src/obex.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/obex.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-obex.Tpo obexd/src/$(DEPDIR)/obexd-obex.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/obex.c' object='obexd/src/obexd-obex.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-obex.obj `if test -f 'obexd/src/obex.c'; then $(CYGPATH_W) 'obexd/src/obex.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/obex.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-obex.obj `if test -f 'obexd/src/obex.c'; then $(CYGPATH_W) 'obexd/src/obex.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/obex.c'; fi` obexd/src/obexd-mimetype.o: obexd/src/mimetype.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-mimetype.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-mimetype.Tpo -c -o obexd/src/obexd-mimetype.o `test -f 'obexd/src/mimetype.c' || echo '$(srcdir)/'`obexd/src/mimetype.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-mimetype.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-mimetype.Tpo -c -o obexd/src/obexd-mimetype.o `test -f 'obexd/src/mimetype.c' || echo '$(srcdir)/'`obexd/src/mimetype.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-mimetype.Tpo obexd/src/$(DEPDIR)/obexd-mimetype.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/mimetype.c' object='obexd/src/obexd-mimetype.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-mimetype.o `test -f 'obexd/src/mimetype.c' || echo '$(srcdir)/'`obexd/src/mimetype.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-mimetype.o `test -f 'obexd/src/mimetype.c' || echo '$(srcdir)/'`obexd/src/mimetype.c obexd/src/obexd-mimetype.obj: obexd/src/mimetype.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-mimetype.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-mimetype.Tpo -c -o obexd/src/obexd-mimetype.obj `if test -f 'obexd/src/mimetype.c'; then $(CYGPATH_W) 'obexd/src/mimetype.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/mimetype.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-mimetype.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-mimetype.Tpo -c -o obexd/src/obexd-mimetype.obj `if test -f 'obexd/src/mimetype.c'; then $(CYGPATH_W) 'obexd/src/mimetype.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/mimetype.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-mimetype.Tpo obexd/src/$(DEPDIR)/obexd-mimetype.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/mimetype.c' object='obexd/src/obexd-mimetype.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-mimetype.obj `if test -f 'obexd/src/mimetype.c'; then $(CYGPATH_W) 'obexd/src/mimetype.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/mimetype.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-mimetype.obj `if test -f 'obexd/src/mimetype.c'; then $(CYGPATH_W) 'obexd/src/mimetype.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/mimetype.c'; fi` obexd/src/obexd-service.o: obexd/src/service.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-service.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-service.Tpo -c -o obexd/src/obexd-service.o `test -f 'obexd/src/service.c' || echo '$(srcdir)/'`obexd/src/service.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-service.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-service.Tpo -c -o obexd/src/obexd-service.o `test -f 'obexd/src/service.c' || echo '$(srcdir)/'`obexd/src/service.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-service.Tpo obexd/src/$(DEPDIR)/obexd-service.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/service.c' object='obexd/src/obexd-service.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-service.o `test -f 'obexd/src/service.c' || echo '$(srcdir)/'`obexd/src/service.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-service.o `test -f 'obexd/src/service.c' || echo '$(srcdir)/'`obexd/src/service.c obexd/src/obexd-service.obj: obexd/src/service.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-service.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-service.Tpo -c -o obexd/src/obexd-service.obj `if test -f 'obexd/src/service.c'; then $(CYGPATH_W) 'obexd/src/service.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/service.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-service.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-service.Tpo -c -o obexd/src/obexd-service.obj `if test -f 'obexd/src/service.c'; then $(CYGPATH_W) 'obexd/src/service.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/service.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-service.Tpo obexd/src/$(DEPDIR)/obexd-service.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/service.c' object='obexd/src/obexd-service.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-service.obj `if test -f 'obexd/src/service.c'; then $(CYGPATH_W) 'obexd/src/service.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/service.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-service.obj `if test -f 'obexd/src/service.c'; then $(CYGPATH_W) 'obexd/src/service.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/service.c'; fi` obexd/src/obexd-transport.o: obexd/src/transport.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-transport.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/src/obexd-transport.o `test -f 'obexd/src/transport.c' || echo '$(srcdir)/'`obexd/src/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-transport.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/src/obexd-transport.o `test -f 'obexd/src/transport.c' || echo '$(srcdir)/'`obexd/src/transport.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-transport.Tpo obexd/src/$(DEPDIR)/obexd-transport.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/transport.c' object='obexd/src/obexd-transport.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-transport.o `test -f 'obexd/src/transport.c' || echo '$(srcdir)/'`obexd/src/transport.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-transport.o `test -f 'obexd/src/transport.c' || echo '$(srcdir)/'`obexd/src/transport.c obexd/src/obexd-transport.obj: obexd/src/transport.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-transport.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/src/obexd-transport.obj `if test -f 'obexd/src/transport.c'; then $(CYGPATH_W) 'obexd/src/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/transport.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-transport.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/src/obexd-transport.obj `if test -f 'obexd/src/transport.c'; then $(CYGPATH_W) 'obexd/src/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/transport.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-transport.Tpo obexd/src/$(DEPDIR)/obexd-transport.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/transport.c' object='obexd/src/obexd-transport.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-transport.obj `if test -f 'obexd/src/transport.c'; then $(CYGPATH_W) 'obexd/src/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/transport.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-transport.obj `if test -f 'obexd/src/transport.c'; then $(CYGPATH_W) 'obexd/src/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/transport.c'; fi` obexd/src/obexd-server.o: obexd/src/server.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-server.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-server.Tpo -c -o obexd/src/obexd-server.o `test -f 'obexd/src/server.c' || echo '$(srcdir)/'`obexd/src/server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-server.o -MD -MP -MF obexd/src/$(DEPDIR)/obexd-server.Tpo -c -o obexd/src/obexd-server.o `test -f 'obexd/src/server.c' || echo '$(srcdir)/'`obexd/src/server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-server.Tpo obexd/src/$(DEPDIR)/obexd-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/server.c' object='obexd/src/obexd-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-server.o `test -f 'obexd/src/server.c' || echo '$(srcdir)/'`obexd/src/server.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-server.o `test -f 'obexd/src/server.c' || echo '$(srcdir)/'`obexd/src/server.c obexd/src/obexd-server.obj: obexd/src/server.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-server.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-server.Tpo -c -o obexd/src/obexd-server.obj `if test -f 'obexd/src/server.c'; then $(CYGPATH_W) 'obexd/src/server.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/src/obexd-server.obj -MD -MP -MF obexd/src/$(DEPDIR)/obexd-server.Tpo -c -o obexd/src/obexd-server.obj `if test -f 'obexd/src/server.c'; then $(CYGPATH_W) 'obexd/src/server.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/server.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/src/$(DEPDIR)/obexd-server.Tpo obexd/src/$(DEPDIR)/obexd-server.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/src/server.c' object='obexd/src/obexd-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-server.obj `if test -f 'obexd/src/server.c'; then $(CYGPATH_W) 'obexd/src/server.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/server.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/src/obexd-server.obj `if test -f 'obexd/src/server.c'; then $(CYGPATH_W) 'obexd/src/server.c'; else $(CYGPATH_W) '$(srcdir)/obexd/src/server.c'; fi` obexd/client/obexd-manager.o: obexd/client/manager.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-manager.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/client/obexd-manager.o `test -f 'obexd/client/manager.c' || echo '$(srcdir)/'`obexd/client/manager.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-manager.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/client/obexd-manager.o `test -f 'obexd/client/manager.c' || echo '$(srcdir)/'`obexd/client/manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-manager.Tpo obexd/client/$(DEPDIR)/obexd-manager.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/manager.c' object='obexd/client/obexd-manager.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-manager.o `test -f 'obexd/client/manager.c' || echo '$(srcdir)/'`obexd/client/manager.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-manager.o `test -f 'obexd/client/manager.c' || echo '$(srcdir)/'`obexd/client/manager.c obexd/client/obexd-manager.obj: obexd/client/manager.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-manager.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/client/obexd-manager.obj `if test -f 'obexd/client/manager.c'; then $(CYGPATH_W) 'obexd/client/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/manager.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-manager.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-manager.Tpo -c -o obexd/client/obexd-manager.obj `if test -f 'obexd/client/manager.c'; then $(CYGPATH_W) 'obexd/client/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/manager.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-manager.Tpo obexd/client/$(DEPDIR)/obexd-manager.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/manager.c' object='obexd/client/obexd-manager.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-manager.obj `if test -f 'obexd/client/manager.c'; then $(CYGPATH_W) 'obexd/client/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/manager.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-manager.obj `if test -f 'obexd/client/manager.c'; then $(CYGPATH_W) 'obexd/client/manager.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/manager.c'; fi` obexd/client/obexd-session.o: obexd/client/session.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-session.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-session.Tpo -c -o obexd/client/obexd-session.o `test -f 'obexd/client/session.c' || echo '$(srcdir)/'`obexd/client/session.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-session.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-session.Tpo -c -o obexd/client/obexd-session.o `test -f 'obexd/client/session.c' || echo '$(srcdir)/'`obexd/client/session.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-session.Tpo obexd/client/$(DEPDIR)/obexd-session.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/session.c' object='obexd/client/obexd-session.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-session.o `test -f 'obexd/client/session.c' || echo '$(srcdir)/'`obexd/client/session.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-session.o `test -f 'obexd/client/session.c' || echo '$(srcdir)/'`obexd/client/session.c obexd/client/obexd-session.obj: obexd/client/session.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-session.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-session.Tpo -c -o obexd/client/obexd-session.obj `if test -f 'obexd/client/session.c'; then $(CYGPATH_W) 'obexd/client/session.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/session.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-session.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-session.Tpo -c -o obexd/client/obexd-session.obj `if test -f 'obexd/client/session.c'; then $(CYGPATH_W) 'obexd/client/session.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/session.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-session.Tpo obexd/client/$(DEPDIR)/obexd-session.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/session.c' object='obexd/client/obexd-session.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-session.obj `if test -f 'obexd/client/session.c'; then $(CYGPATH_W) 'obexd/client/session.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/session.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-session.obj `if test -f 'obexd/client/session.c'; then $(CYGPATH_W) 'obexd/client/session.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/session.c'; fi` obexd/client/obexd-bluetooth.o: obexd/client/bluetooth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-bluetooth.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/client/obexd-bluetooth.o `test -f 'obexd/client/bluetooth.c' || echo '$(srcdir)/'`obexd/client/bluetooth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-bluetooth.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/client/obexd-bluetooth.o `test -f 'obexd/client/bluetooth.c' || echo '$(srcdir)/'`obexd/client/bluetooth.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo obexd/client/$(DEPDIR)/obexd-bluetooth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/bluetooth.c' object='obexd/client/obexd-bluetooth.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-bluetooth.o `test -f 'obexd/client/bluetooth.c' || echo '$(srcdir)/'`obexd/client/bluetooth.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-bluetooth.o `test -f 'obexd/client/bluetooth.c' || echo '$(srcdir)/'`obexd/client/bluetooth.c obexd/client/obexd-bluetooth.obj: obexd/client/bluetooth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-bluetooth.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/client/obexd-bluetooth.obj `if test -f 'obexd/client/bluetooth.c'; then $(CYGPATH_W) 'obexd/client/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/bluetooth.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-bluetooth.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo -c -o obexd/client/obexd-bluetooth.obj `if test -f 'obexd/client/bluetooth.c'; then $(CYGPATH_W) 'obexd/client/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/bluetooth.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-bluetooth.Tpo obexd/client/$(DEPDIR)/obexd-bluetooth.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/bluetooth.c' object='obexd/client/obexd-bluetooth.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-bluetooth.obj `if test -f 'obexd/client/bluetooth.c'; then $(CYGPATH_W) 'obexd/client/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/bluetooth.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-bluetooth.obj `if test -f 'obexd/client/bluetooth.c'; then $(CYGPATH_W) 'obexd/client/bluetooth.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/bluetooth.c'; fi` obexd/client/obexd-sync.o: obexd/client/sync.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-sync.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-sync.Tpo -c -o obexd/client/obexd-sync.o `test -f 'obexd/client/sync.c' || echo '$(srcdir)/'`obexd/client/sync.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-sync.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-sync.Tpo -c -o obexd/client/obexd-sync.o `test -f 'obexd/client/sync.c' || echo '$(srcdir)/'`obexd/client/sync.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-sync.Tpo obexd/client/$(DEPDIR)/obexd-sync.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/sync.c' object='obexd/client/obexd-sync.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-sync.o `test -f 'obexd/client/sync.c' || echo '$(srcdir)/'`obexd/client/sync.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-sync.o `test -f 'obexd/client/sync.c' || echo '$(srcdir)/'`obexd/client/sync.c obexd/client/obexd-sync.obj: obexd/client/sync.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-sync.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-sync.Tpo -c -o obexd/client/obexd-sync.obj `if test -f 'obexd/client/sync.c'; then $(CYGPATH_W) 'obexd/client/sync.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/sync.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-sync.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-sync.Tpo -c -o obexd/client/obexd-sync.obj `if test -f 'obexd/client/sync.c'; then $(CYGPATH_W) 'obexd/client/sync.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/sync.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-sync.Tpo obexd/client/$(DEPDIR)/obexd-sync.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/sync.c' object='obexd/client/obexd-sync.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-sync.obj `if test -f 'obexd/client/sync.c'; then $(CYGPATH_W) 'obexd/client/sync.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/sync.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-sync.obj `if test -f 'obexd/client/sync.c'; then $(CYGPATH_W) 'obexd/client/sync.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/sync.c'; fi` obexd/client/obexd-pbap.o: obexd/client/pbap.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-pbap.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/client/obexd-pbap.o `test -f 'obexd/client/pbap.c' || echo '$(srcdir)/'`obexd/client/pbap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-pbap.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/client/obexd-pbap.o `test -f 'obexd/client/pbap.c' || echo '$(srcdir)/'`obexd/client/pbap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-pbap.Tpo obexd/client/$(DEPDIR)/obexd-pbap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/pbap.c' object='obexd/client/obexd-pbap.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-pbap.o `test -f 'obexd/client/pbap.c' || echo '$(srcdir)/'`obexd/client/pbap.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-pbap.o `test -f 'obexd/client/pbap.c' || echo '$(srcdir)/'`obexd/client/pbap.c obexd/client/obexd-pbap.obj: obexd/client/pbap.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-pbap.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/client/obexd-pbap.obj `if test -f 'obexd/client/pbap.c'; then $(CYGPATH_W) 'obexd/client/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/pbap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-pbap.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-pbap.Tpo -c -o obexd/client/obexd-pbap.obj `if test -f 'obexd/client/pbap.c'; then $(CYGPATH_W) 'obexd/client/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/pbap.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-pbap.Tpo obexd/client/$(DEPDIR)/obexd-pbap.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/pbap.c' object='obexd/client/obexd-pbap.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-pbap.obj `if test -f 'obexd/client/pbap.c'; then $(CYGPATH_W) 'obexd/client/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/pbap.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-pbap.obj `if test -f 'obexd/client/pbap.c'; then $(CYGPATH_W) 'obexd/client/pbap.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/pbap.c'; fi` obexd/client/obexd-ftp.o: obexd/client/ftp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-ftp.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/client/obexd-ftp.o `test -f 'obexd/client/ftp.c' || echo '$(srcdir)/'`obexd/client/ftp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-ftp.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/client/obexd-ftp.o `test -f 'obexd/client/ftp.c' || echo '$(srcdir)/'`obexd/client/ftp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-ftp.Tpo obexd/client/$(DEPDIR)/obexd-ftp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/ftp.c' object='obexd/client/obexd-ftp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-ftp.o `test -f 'obexd/client/ftp.c' || echo '$(srcdir)/'`obexd/client/ftp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-ftp.o `test -f 'obexd/client/ftp.c' || echo '$(srcdir)/'`obexd/client/ftp.c obexd/client/obexd-ftp.obj: obexd/client/ftp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-ftp.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/client/obexd-ftp.obj `if test -f 'obexd/client/ftp.c'; then $(CYGPATH_W) 'obexd/client/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/ftp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-ftp.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-ftp.Tpo -c -o obexd/client/obexd-ftp.obj `if test -f 'obexd/client/ftp.c'; then $(CYGPATH_W) 'obexd/client/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/ftp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-ftp.Tpo obexd/client/$(DEPDIR)/obexd-ftp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/ftp.c' object='obexd/client/obexd-ftp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-ftp.obj `if test -f 'obexd/client/ftp.c'; then $(CYGPATH_W) 'obexd/client/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/ftp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-ftp.obj `if test -f 'obexd/client/ftp.c'; then $(CYGPATH_W) 'obexd/client/ftp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/ftp.c'; fi` obexd/client/obexd-opp.o: obexd/client/opp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-opp.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/client/obexd-opp.o `test -f 'obexd/client/opp.c' || echo '$(srcdir)/'`obexd/client/opp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-opp.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/client/obexd-opp.o `test -f 'obexd/client/opp.c' || echo '$(srcdir)/'`obexd/client/opp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-opp.Tpo obexd/client/$(DEPDIR)/obexd-opp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/opp.c' object='obexd/client/obexd-opp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-opp.o `test -f 'obexd/client/opp.c' || echo '$(srcdir)/'`obexd/client/opp.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-opp.o `test -f 'obexd/client/opp.c' || echo '$(srcdir)/'`obexd/client/opp.c obexd/client/obexd-opp.obj: obexd/client/opp.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-opp.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/client/obexd-opp.obj `if test -f 'obexd/client/opp.c'; then $(CYGPATH_W) 'obexd/client/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/opp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-opp.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-opp.Tpo -c -o obexd/client/obexd-opp.obj `if test -f 'obexd/client/opp.c'; then $(CYGPATH_W) 'obexd/client/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/opp.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-opp.Tpo obexd/client/$(DEPDIR)/obexd-opp.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/opp.c' object='obexd/client/obexd-opp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-opp.obj `if test -f 'obexd/client/opp.c'; then $(CYGPATH_W) 'obexd/client/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/opp.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-opp.obj `if test -f 'obexd/client/opp.c'; then $(CYGPATH_W) 'obexd/client/opp.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/opp.c'; fi` obexd/client/obexd-map.o: obexd/client/map.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map.Tpo -c -o obexd/client/obexd-map.o `test -f 'obexd/client/map.c' || echo '$(srcdir)/'`obexd/client/map.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map.Tpo -c -o obexd/client/obexd-map.o `test -f 'obexd/client/map.c' || echo '$(srcdir)/'`obexd/client/map.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map.Tpo obexd/client/$(DEPDIR)/obexd-map.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map.c' object='obexd/client/obexd-map.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map.o `test -f 'obexd/client/map.c' || echo '$(srcdir)/'`obexd/client/map.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map.o `test -f 'obexd/client/map.c' || echo '$(srcdir)/'`obexd/client/map.c obexd/client/obexd-map.obj: obexd/client/map.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map.Tpo -c -o obexd/client/obexd-map.obj `if test -f 'obexd/client/map.c'; then $(CYGPATH_W) 'obexd/client/map.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map.Tpo -c -o obexd/client/obexd-map.obj `if test -f 'obexd/client/map.c'; then $(CYGPATH_W) 'obexd/client/map.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map.Tpo obexd/client/$(DEPDIR)/obexd-map.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map.c' object='obexd/client/obexd-map.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map.obj `if test -f 'obexd/client/map.c'; then $(CYGPATH_W) 'obexd/client/map.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map.obj `if test -f 'obexd/client/map.c'; then $(CYGPATH_W) 'obexd/client/map.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map.c'; fi` obexd/client/obexd-map-event.o: obexd/client/map-event.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map-event.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map-event.Tpo -c -o obexd/client/obexd-map-event.o `test -f 'obexd/client/map-event.c' || echo '$(srcdir)/'`obexd/client/map-event.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map-event.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map-event.Tpo -c -o obexd/client/obexd-map-event.o `test -f 'obexd/client/map-event.c' || echo '$(srcdir)/'`obexd/client/map-event.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map-event.Tpo obexd/client/$(DEPDIR)/obexd-map-event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map-event.c' object='obexd/client/obexd-map-event.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map-event.o `test -f 'obexd/client/map-event.c' || echo '$(srcdir)/'`obexd/client/map-event.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map-event.o `test -f 'obexd/client/map-event.c' || echo '$(srcdir)/'`obexd/client/map-event.c obexd/client/obexd-map-event.obj: obexd/client/map-event.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map-event.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map-event.Tpo -c -o obexd/client/obexd-map-event.obj `if test -f 'obexd/client/map-event.c'; then $(CYGPATH_W) 'obexd/client/map-event.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map-event.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-map-event.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-map-event.Tpo -c -o obexd/client/obexd-map-event.obj `if test -f 'obexd/client/map-event.c'; then $(CYGPATH_W) 'obexd/client/map-event.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map-event.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-map-event.Tpo obexd/client/$(DEPDIR)/obexd-map-event.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/map-event.c' object='obexd/client/obexd-map-event.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map-event.obj `if test -f 'obexd/client/map-event.c'; then $(CYGPATH_W) 'obexd/client/map-event.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map-event.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-map-event.obj `if test -f 'obexd/client/map-event.c'; then $(CYGPATH_W) 'obexd/client/map-event.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/map-event.c'; fi` obexd/client/obexd-transfer.o: obexd/client/transfer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transfer.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transfer.Tpo -c -o obexd/client/obexd-transfer.o `test -f 'obexd/client/transfer.c' || echo '$(srcdir)/'`obexd/client/transfer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transfer.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transfer.Tpo -c -o obexd/client/obexd-transfer.o `test -f 'obexd/client/transfer.c' || echo '$(srcdir)/'`obexd/client/transfer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transfer.Tpo obexd/client/$(DEPDIR)/obexd-transfer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transfer.c' object='obexd/client/obexd-transfer.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transfer.o `test -f 'obexd/client/transfer.c' || echo '$(srcdir)/'`obexd/client/transfer.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transfer.o `test -f 'obexd/client/transfer.c' || echo '$(srcdir)/'`obexd/client/transfer.c obexd/client/obexd-transfer.obj: obexd/client/transfer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transfer.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transfer.Tpo -c -o obexd/client/obexd-transfer.obj `if test -f 'obexd/client/transfer.c'; then $(CYGPATH_W) 'obexd/client/transfer.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transfer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transfer.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transfer.Tpo -c -o obexd/client/obexd-transfer.obj `if test -f 'obexd/client/transfer.c'; then $(CYGPATH_W) 'obexd/client/transfer.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transfer.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transfer.Tpo obexd/client/$(DEPDIR)/obexd-transfer.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transfer.c' object='obexd/client/obexd-transfer.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transfer.obj `if test -f 'obexd/client/transfer.c'; then $(CYGPATH_W) 'obexd/client/transfer.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transfer.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transfer.obj `if test -f 'obexd/client/transfer.c'; then $(CYGPATH_W) 'obexd/client/transfer.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transfer.c'; fi` obexd/client/obexd-transport.o: obexd/client/transport.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transport.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/client/obexd-transport.o `test -f 'obexd/client/transport.c' || echo '$(srcdir)/'`obexd/client/transport.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transport.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/client/obexd-transport.o `test -f 'obexd/client/transport.c' || echo '$(srcdir)/'`obexd/client/transport.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transport.Tpo obexd/client/$(DEPDIR)/obexd-transport.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transport.c' object='obexd/client/obexd-transport.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transport.o `test -f 'obexd/client/transport.c' || echo '$(srcdir)/'`obexd/client/transport.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transport.o `test -f 'obexd/client/transport.c' || echo '$(srcdir)/'`obexd/client/transport.c obexd/client/obexd-transport.obj: obexd/client/transport.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transport.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/client/obexd-transport.obj `if test -f 'obexd/client/transport.c'; then $(CYGPATH_W) 'obexd/client/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transport.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-transport.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-transport.Tpo -c -o obexd/client/obexd-transport.obj `if test -f 'obexd/client/transport.c'; then $(CYGPATH_W) 'obexd/client/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transport.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-transport.Tpo obexd/client/$(DEPDIR)/obexd-transport.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/transport.c' object='obexd/client/obexd-transport.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transport.obj `if test -f 'obexd/client/transport.c'; then $(CYGPATH_W) 'obexd/client/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transport.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-transport.obj `if test -f 'obexd/client/transport.c'; then $(CYGPATH_W) 'obexd/client/transport.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/transport.c'; fi` obexd/client/obexd-driver.o: obexd/client/driver.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-driver.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-driver.Tpo -c -o obexd/client/obexd-driver.o `test -f 'obexd/client/driver.c' || echo '$(srcdir)/'`obexd/client/driver.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-driver.o -MD -MP -MF obexd/client/$(DEPDIR)/obexd-driver.Tpo -c -o obexd/client/obexd-driver.o `test -f 'obexd/client/driver.c' || echo '$(srcdir)/'`obexd/client/driver.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-driver.Tpo obexd/client/$(DEPDIR)/obexd-driver.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/driver.c' object='obexd/client/obexd-driver.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-driver.o `test -f 'obexd/client/driver.c' || echo '$(srcdir)/'`obexd/client/driver.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-driver.o `test -f 'obexd/client/driver.c' || echo '$(srcdir)/'`obexd/client/driver.c obexd/client/obexd-driver.obj: obexd/client/driver.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-driver.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-driver.Tpo -c -o obexd/client/obexd-driver.obj `if test -f 'obexd/client/driver.c'; then $(CYGPATH_W) 'obexd/client/driver.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/driver.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT obexd/client/obexd-driver.obj -MD -MP -MF obexd/client/$(DEPDIR)/obexd-driver.Tpo -c -o obexd/client/obexd-driver.obj `if test -f 'obexd/client/driver.c'; then $(CYGPATH_W) 'obexd/client/driver.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/driver.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) obexd/client/$(DEPDIR)/obexd-driver.Tpo obexd/client/$(DEPDIR)/obexd-driver.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='obexd/client/driver.c' object='obexd/client/obexd-driver.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(obexd_src_obexd_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-driver.obj `if test -f 'obexd/client/driver.c'; then $(CYGPATH_W) 'obexd/client/driver.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/driver.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(obexd_src_obexd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o obexd/client/obexd-driver.obj `if test -f 'obexd/client/driver.c'; then $(CYGPATH_W) 'obexd/client/driver.c'; else $(CYGPATH_W) '$(srcdir)/obexd/client/driver.c'; fi` plugins/bluetoothd-hostname.o: plugins/hostname.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-hostname.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-hostname.Tpo -c -o plugins/bluetoothd-hostname.o `test -f 'plugins/hostname.c' || echo '$(srcdir)/'`plugins/hostname.c @@ -10582,6 +10618,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o profiles/battery/bluetoothd-battery.obj `if test -f 'profiles/battery/battery.c'; then $(CYGPATH_W) 'profiles/battery/battery.c'; else $(CYGPATH_W) '$(srcdir)/profiles/battery/battery.c'; fi` +plugins/bluetoothd-sixaxis.o: plugins/sixaxis.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-sixaxis.o -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-sixaxis.Tpo -c -o plugins/bluetoothd-sixaxis.o `test -f 'plugins/sixaxis.c' || echo '$(srcdir)/'`plugins/sixaxis.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-sixaxis.Tpo plugins/$(DEPDIR)/bluetoothd-sixaxis.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/sixaxis.c' object='plugins/bluetoothd-sixaxis.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-sixaxis.o `test -f 'plugins/sixaxis.c' || echo '$(srcdir)/'`plugins/sixaxis.c + +plugins/bluetoothd-sixaxis.obj: plugins/sixaxis.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT plugins/bluetoothd-sixaxis.obj -MD -MP -MF plugins/$(DEPDIR)/bluetoothd-sixaxis.Tpo -c -o plugins/bluetoothd-sixaxis.obj `if test -f 'plugins/sixaxis.c'; then $(CYGPATH_W) 'plugins/sixaxis.c'; else $(CYGPATH_W) '$(srcdir)/plugins/sixaxis.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) plugins/$(DEPDIR)/bluetoothd-sixaxis.Tpo plugins/$(DEPDIR)/bluetoothd-sixaxis.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plugins/sixaxis.c' object='plugins/bluetoothd-sixaxis.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o plugins/bluetoothd-sixaxis.obj `if test -f 'plugins/sixaxis.c'; then $(CYGPATH_W) 'plugins/sixaxis.c'; else $(CYGPATH_W) '$(srcdir)/plugins/sixaxis.c'; fi` + profiles/audio/bluetoothd-bap.o: profiles/audio/bap.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-bap.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-bap.Tpo -c -o profiles/audio/bluetoothd-bap.o `test -f 'profiles/audio/bap.c' || echo '$(srcdir)/'`profiles/audio/bap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-bap.Tpo profiles/audio/$(DEPDIR)/bluetoothd-bap.Po @@ -10652,6 +10702,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-micp.obj `if test -f 'profiles/audio/micp.c'; then $(CYGPATH_W) 'profiles/audio/micp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/micp.c'; fi` +profiles/audio/bluetoothd-ccp.o: profiles/audio/ccp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-ccp.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-ccp.Tpo -c -o profiles/audio/bluetoothd-ccp.o `test -f 'profiles/audio/ccp.c' || echo '$(srcdir)/'`profiles/audio/ccp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-ccp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-ccp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/ccp.c' object='profiles/audio/bluetoothd-ccp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-ccp.o `test -f 'profiles/audio/ccp.c' || echo '$(srcdir)/'`profiles/audio/ccp.c + +profiles/audio/bluetoothd-ccp.obj: profiles/audio/ccp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-ccp.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-ccp.Tpo -c -o profiles/audio/bluetoothd-ccp.obj `if test -f 'profiles/audio/ccp.c'; then $(CYGPATH_W) 'profiles/audio/ccp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/ccp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-ccp.Tpo profiles/audio/$(DEPDIR)/bluetoothd-ccp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/ccp.c' object='profiles/audio/bluetoothd-ccp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-ccp.obj `if test -f 'profiles/audio/ccp.c'; then $(CYGPATH_W) 'profiles/audio/ccp.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/ccp.c'; fi` + profiles/audio/bluetoothd-csip.o: profiles/audio/csip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-csip.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-csip.Tpo -c -o profiles/audio/bluetoothd-csip.o `test -f 'profiles/audio/csip.c' || echo '$(srcdir)/'`profiles/audio/csip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-csip.Tpo profiles/audio/$(DEPDIR)/bluetoothd-csip.Po @@ -10666,6 +10730,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-csip.obj `if test -f 'profiles/audio/csip.c'; then $(CYGPATH_W) 'profiles/audio/csip.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/csip.c'; fi` +profiles/audio/bluetoothd-asha.o: profiles/audio/asha.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-asha.o -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-asha.Tpo -c -o profiles/audio/bluetoothd-asha.o `test -f 'profiles/audio/asha.c' || echo '$(srcdir)/'`profiles/audio/asha.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-asha.Tpo profiles/audio/$(DEPDIR)/bluetoothd-asha.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/asha.c' object='profiles/audio/bluetoothd-asha.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-asha.o `test -f 'profiles/audio/asha.c' || echo '$(srcdir)/'`profiles/audio/asha.c + +profiles/audio/bluetoothd-asha.obj: profiles/audio/asha.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT profiles/audio/bluetoothd-asha.obj -MD -MP -MF profiles/audio/$(DEPDIR)/bluetoothd-asha.Tpo -c -o profiles/audio/bluetoothd-asha.obj `if test -f 'profiles/audio/asha.c'; then $(CYGPATH_W) 'profiles/audio/asha.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/asha.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) profiles/audio/$(DEPDIR)/bluetoothd-asha.Tpo profiles/audio/$(DEPDIR)/bluetoothd-asha.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='profiles/audio/asha.c' object='profiles/audio/bluetoothd-asha.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o profiles/audio/bluetoothd-asha.obj `if test -f 'profiles/audio/asha.c'; then $(CYGPATH_W) 'profiles/audio/asha.c'; else $(CYGPATH_W) '$(srcdir)/profiles/audio/asha.c'; fi` + attrib/bluetoothd-att.o: attrib/att.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_bluetoothd_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT attrib/bluetoothd-att.o -MD -MP -MF attrib/$(DEPDIR)/bluetoothd-att.Tpo -c -o attrib/bluetoothd-att.o `test -f 'attrib/att.c' || echo '$(srcdir)/'`attrib/att.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) attrib/$(DEPDIR)/bluetoothd-att.Tpo attrib/$(DEPDIR)/bluetoothd-att.Po @@ -11187,7 +11265,6 @@ -rm -rf monitor/.libs monitor/_libs -rm -rf obexd/src/.libs obexd/src/_libs -rm -rf peripheral/.libs peripheral/_libs - -rm -rf plugins/.libs plugins/_libs -rm -rf profiles/cups/.libs profiles/cups/_libs -rm -rf profiles/iap/.libs profiles/iap/_libs -rm -rf src/.libs src/_libs @@ -11283,6 +11360,49 @@ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^^50-9a-z*$$,5,;x' \ -e 's,\.0-9a-z*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) +install-man7: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man7dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.7a-z*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^^70-9a-z*$$,7,;x' \ + -e 's,\.0-9a-z*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ + done; } + +uninstall-man7: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man7dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.7a-z*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^^70-9a-z*$$,7,;x' \ + -e 's,\.0-9a-z*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ @@ -12191,7 +12311,7 @@ install-pluginLTLIBRARIES: install-libLTLIBRARIES installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cupsdir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(udevdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(testdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(confdir)" "$(DESTDIR)$(dbusdir)" "$(DESTDIR)$(dbussessionbusdir)" "$(DESTDIR)$(dbussystembusdir)" "$(DESTDIR)$(zshcompletiondir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(rulesdir)" "$(DESTDIR)$(statedir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(systemduserunitdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cupsdir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(udevdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(testdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(confdir)" "$(DESTDIR)$(dbusdir)" "$(DESTDIR)$(dbussessionbusdir)" "$(DESTDIR)$(dbussystembusdir)" "$(DESTDIR)$(zshcompletiondir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(rulesdir)" "$(DESTDIR)$(statedir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(systemduserunitdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -12600,15 +12720,16 @@ -rm -f plugins/$(DEPDIR)/bluetoothd-hostname.Po -rm -f plugins/$(DEPDIR)/bluetoothd-neard.Po -rm -f plugins/$(DEPDIR)/bluetoothd-policy.Po + -rm -f plugins/$(DEPDIR)/bluetoothd-sixaxis.Po -rm -f plugins/$(DEPDIR)/bluetoothd-wiimote.Po - -rm -f plugins/$(DEPDIR)/external_dummy_la-external-dummy.Plo - -rm -f plugins/$(DEPDIR)/sixaxis_la-sixaxis.Plo -rm -f profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po + -rm -f profiles/audio/$(DEPDIR)/bluetoothd-asha.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-bap.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-bass.Po + -rm -f profiles/audio/$(DEPDIR)/bluetoothd-ccp.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-control.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-csip.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-mcp.Po @@ -12706,11 +12827,13 @@ -rm -f src/shared/$(DEPDIR)/android_avdtptest-util.Po -rm -f src/shared/$(DEPDIR)/btp.Po -rm -f src/shared/$(DEPDIR)/libshared_ell_la-ad.Plo + -rm -f src/shared/$(DEPDIR)/libshared_ell_la-asha.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-att.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-bap-debug.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-bap.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-bass.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-btsnoop.Plo + -rm -f src/shared/$(DEPDIR)/libshared_ell_la-ccp.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-crypto.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-csip.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-ecc.Plo @@ -12737,11 +12860,13 @@ -rm -f src/shared/$(DEPDIR)/libshared_ell_la-util.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-vcp.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-ad.Plo + -rm -f src/shared/$(DEPDIR)/libshared_glib_la-asha.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-att.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-bap-debug.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-bap.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-bass.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-btsnoop.Plo + -rm -f src/shared/$(DEPDIR)/libshared_glib_la-ccp.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-crypto.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-csip.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-ecc.Plo @@ -12770,11 +12895,13 @@ -rm -f src/shared/$(DEPDIR)/libshared_glib_la-util.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-vcp.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-ad.Plo + -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-asha.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-att.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-bap-debug.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-bap.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-bass.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-btsnoop.Plo + -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-ccp.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-crypto.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-csip.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-ecc.Plo @@ -12974,7 +13101,8 @@ install-pluginLTLIBRARIES install-rulesDATA install-stateDATA \ install-systemdsystemunitDATA install-systemduserunitDATA \ install-testSCRIPTS install-udevPROGRAMS - + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: @@ -12990,7 +13118,7 @@ install-info-am: -install-man: install-man1 install-man5 install-man8 +install-man: install-man1 install-man5 install-man7 install-man8 install-pdf: install-pdf-am @@ -13286,15 +13414,16 @@ -rm -f plugins/$(DEPDIR)/bluetoothd-hostname.Po -rm -f plugins/$(DEPDIR)/bluetoothd-neard.Po -rm -f plugins/$(DEPDIR)/bluetoothd-policy.Po + -rm -f plugins/$(DEPDIR)/bluetoothd-sixaxis.Po -rm -f plugins/$(DEPDIR)/bluetoothd-wiimote.Po - -rm -f plugins/$(DEPDIR)/external_dummy_la-external-dummy.Plo - -rm -f plugins/$(DEPDIR)/sixaxis_la-sixaxis.Plo -rm -f profiles/audio/$(DEPDIR)/bluetoothd-a2dp.Po + -rm -f profiles/audio/$(DEPDIR)/bluetoothd-asha.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-avctp.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-avdtp.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-avrcp.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-bap.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-bass.Po + -rm -f profiles/audio/$(DEPDIR)/bluetoothd-ccp.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-control.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-csip.Po -rm -f profiles/audio/$(DEPDIR)/bluetoothd-mcp.Po @@ -13392,11 +13521,13 @@ -rm -f src/shared/$(DEPDIR)/android_avdtptest-util.Po -rm -f src/shared/$(DEPDIR)/btp.Po -rm -f src/shared/$(DEPDIR)/libshared_ell_la-ad.Plo + -rm -f src/shared/$(DEPDIR)/libshared_ell_la-asha.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-att.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-bap-debug.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-bap.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-bass.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-btsnoop.Plo + -rm -f src/shared/$(DEPDIR)/libshared_ell_la-ccp.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-crypto.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-csip.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-ecc.Plo @@ -13423,11 +13554,13 @@ -rm -f src/shared/$(DEPDIR)/libshared_ell_la-util.Plo -rm -f src/shared/$(DEPDIR)/libshared_ell_la-vcp.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-ad.Plo + -rm -f src/shared/$(DEPDIR)/libshared_glib_la-asha.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-att.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-bap-debug.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-bap.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-bass.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-btsnoop.Plo + -rm -f src/shared/$(DEPDIR)/libshared_glib_la-ccp.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-crypto.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-csip.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-ecc.Plo @@ -13456,11 +13589,13 @@ -rm -f src/shared/$(DEPDIR)/libshared_glib_la-util.Plo -rm -f src/shared/$(DEPDIR)/libshared_glib_la-vcp.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-ad.Plo + -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-asha.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-att.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-bap-debug.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-bap.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-bass.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-btsnoop.Plo + -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-ccp.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-crypto.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-csip.Plo -rm -f src/shared/$(DEPDIR)/libshared_mainloop_la-ecc.Plo @@ -13664,11 +13799,13 @@ uninstall-stateDATA uninstall-systemdsystemunitDATA \ uninstall-systemduserunitDATA uninstall-testSCRIPTS \ uninstall-udevPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook +uninstall-man: uninstall-man1 uninstall-man5 uninstall-man7 \ + uninstall-man8 -uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 - -.MAKE: all check check-am install install-am install-exec \ - install-strip +.MAKE: all check check-am install install-am install-data-am \ + install-exec install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ check-TESTS check-am clean clean-binPROGRAMS clean-cscope \ @@ -13684,26 +13821,28 @@ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-confDATA \ install-cupsPROGRAMS install-data install-data-am \ - install-dbusDATA install-dbussessionbusDATA \ + install-data-hook install-dbusDATA install-dbussessionbusDATA \ install-dbussystembusDATA install-dist_zshcompletionDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man install-man1 install-man5 \ - install-man8 install-pdf install-pdf-am install-pkgconfigDATA \ - install-pkgincludeHEADERS install-pkglibexecPROGRAMS \ - install-pluginLTLIBRARIES install-ps install-ps-am \ - install-rulesDATA install-stateDATA install-strip \ - install-systemdsystemunitDATA install-systemduserunitDATA \ - install-testSCRIPTS install-udevPROGRAMS installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic maintainer-clean-local mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am recheck tags tags-am uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-confDATA \ + install-man7 install-man8 install-pdf install-pdf-am \ + install-pkgconfigDATA install-pkgincludeHEADERS \ + install-pkglibexecPROGRAMS install-pluginLTLIBRARIES \ + install-ps install-ps-am install-rulesDATA install-stateDATA \ + install-strip install-systemdsystemunitDATA \ + install-systemduserunitDATA install-testSCRIPTS \ + install-udevPROGRAMS installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-local mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + recheck tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-confDATA \ uninstall-cupsPROGRAMS uninstall-dbusDATA \ uninstall-dbussessionbusDATA uninstall-dbussystembusDATA \ - uninstall-dist_zshcompletionDATA uninstall-libLTLIBRARIES \ - uninstall-man uninstall-man1 uninstall-man5 uninstall-man8 \ + uninstall-dist_zshcompletionDATA uninstall-hook \ + uninstall-libLTLIBRARIES uninstall-man uninstall-man1 \ + uninstall-man5 uninstall-man7 uninstall-man8 \ uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS \ uninstall-pkglibexecPROGRAMS uninstall-pluginLTLIBRARIES \ uninstall-rulesDATA uninstall-stateDATA \ @@ -13712,8 +13851,23 @@ .PRECIOUS: Makefile + +bluetoothd-fix-permissions: + install -dm555 $(DESTDIR)$(confdir) + install -dm700 $(DESTDIR)$(statedir) @BTPCLIENT_TRUE@tools/btpclient.$(OBJEXT): src/libshared-ell.la ell/internal +@OBEX_TRUE@@SYSTEMD_TRUE@obexd-add-service-symlink: +@OBEX_TRUE@@SYSTEMD_TRUE@ $(LN_S) -f obex.service $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service + +@OBEX_TRUE@@SYSTEMD_TRUE@obexd-remove-service-symlink: +@OBEX_TRUE@@SYSTEMD_TRUE@ rm -f $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service +@OBEX_TRUE@@SYSTEMD_FALSE@obexd-add-service-symlink: +@OBEX_TRUE@@SYSTEMD_FALSE@obexd-remove-service-symlink: + +@OBEX_FALSE@obexd-add-service-symlink: +@OBEX_FALSE@obexd-remove-service-symlink: + obexd/src/plugin.$(OBJEXT): obexd/src/builtin.h obexd/src/builtin.h: obexd/src/genbuiltin $(obexd_builtin_sources) @@ -13723,8 +13877,10 @@ @MESH_TRUE@mesh/mesh.$(OBJEXT): ell/internal @MESH_TRUE@mesh/main.$(OBJEXT): src/builtin.h lib/bluetooth/bluetooth.h -%.service: %.service.in Makefile - $(SED_PROCESS) +@SYSTEMD_TRUE@install-data-hook: obexd-add-service-symlink +@SYSTEMD_FALSE@install-data-hook: bluetoothd-fix-permissions obexd-add-service-symlink + +uninstall-hook: obexd-remove-service-symlink %.1: %.rst Makefile $(RST2MAN_PROCESS) @@ -13732,6 +13888,9 @@ %.5: %.rst Makefile $(RST2MAN_PROCESS) +%.7: %.rst Makefile + $(RST2MAN_PROCESS) + %.8: %.rst Makefile $(RST2MAN_PROCESS) @@ -13773,7 +13932,7 @@ maintainer-clean-local: -rm -rf ell -@COVERAGE_TRUE@clean-coverage: +clean-coverage: @COVERAGE_TRUE@ @lcov --directory $(top_builddir) --zerocounters @COVERAGE_TRUE@ $(RM) -r coverage $(top_builddir)/coverage.info @@ -13783,15 +13942,10 @@ @COVERAGE_TRUE@ $(AM_V_at)$(MKDIR_P) coverage @COVERAGE_TRUE@ @genhtml -o coverage/ $(top_builddir)/coverage.info -@COVERAGE_TRUE@clean-local: clean-coverage -@COVERAGE_TRUE@ -find $(top_builddir) -name "*.gcno" -delete -@COVERAGE_TRUE@ -find $(top_builddir) -name "*.gcda" -delete -@COVERAGE_TRUE@ $(RM) -r lib/bluetooth - -@COVERAGE_FALSE@clean-local: -@COVERAGE_FALSE@ -find $(top_builddir) -name "*.gcno" -delete -@COVERAGE_FALSE@ -find $(top_builddir) -name "*.gcda" -delete -@COVERAGE_FALSE@ $(RM) -r lib/bluetooth +clean-local: clean-coverage + -find $(top_builddir) -name "*.gcno" -delete + -find $(top_builddir) -name "*.gcda" -delete + $(RM) -r lib/bluetooth # Tell versions 3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
View file
_service:tar_scm:bluez-5.71.tar.xz/Makefile.mesh -> _service:tar_scm:bluez-5.77.tar.xz/Makefile.mesh
Changed
@@ -3,6 +3,7 @@ if DATAFILES dbus_DATA += mesh/bluetooth-mesh.conf +conf_DATA += mesh/mesh-main.conf endif if SYSTEMD @@ -45,17 +46,12 @@ mesh_bluetooth_meshd_SOURCES = $(mesh_sources) mesh/main.c mesh_bluetooth_meshd_LDADD = src/libshared-ell.la $(ell_ldadd) -ljson-c -mesh_bluetooth_meshd_DEPENDENCIES = $(ell_dependencies) src/libshared-ell.la \ - mesh/bluetooth-mesh.service if MANPAGES man_MANS += mesh/bluetooth-meshd.8 endif manual_pages += mesh/bluetooth-meshd.8 -CLEANFILES += mesh/bluetooth-mesh.service - endif -EXTRA_DIST += mesh/bluetooth-mesh.conf mesh/bluetooth-mesh.service.in \ - mesh/org.bluez.mesh.service mesh/mesh-main.conf +EXTRA_DIST += mesh/bluetooth-mesh.conf mesh/org.bluez.mesh.service mesh/mesh-main.conf
View file
_service:tar_scm:bluez-5.71.tar.xz/Makefile.obexd -> _service:tar_scm:bluez-5.77.tar.xz/Makefile.obexd
Changed
@@ -1,15 +1,22 @@ # SPDX-License-Identifier: GPL-2.0 +if OBEX + if SYSTEMD systemduserunitdir = $(SYSTEMD_USERUNITDIR) systemduserunit_DATA = obexd/src/obex.service dbussessionbusdir = $(DBUS_SESSIONBUSDIR) dbussessionbus_DATA = obexd/src/org.bluez.obex.service -endif -EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service +obexd-add-service-symlink: + $(LN_S) -f obex.service $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service -if OBEX +obexd-remove-service-symlink: + rm -f $(DESTDIR)$(SYSTEMD_USERUNITDIR)/dbus-org.bluez.obex.service +else +obexd-add-service-symlink: +obexd-remove-service-symlink: +endif obex_plugindir = $(libdir)/obex/plugins @@ -86,16 +93,19 @@ $(ICAL_LIBS) $(DBUS_LIBS) $(LIBEBOOK_LIBS) \ $(LIBEDATASERVER_LIBS) $(GLIB_LIBS) -ldl +if EXTERNAL_PLUGINS obexd_src_obexd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic +endif obexd_src_obexd_CPPFLAGS = $(AM_CPPFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) \ $(ICAL_CFLAGS) -DOBEX_PLUGIN_BUILTIN \ -DPLUGINDIR=\""$(obex_plugindir)"\" \ -D_FILE_OFFSET_BITS=64 \ - -I$(builddir)/lib -I$(builddir)/obexd/src - -obexd_src_obexd_CFLAGS = $(AM_CFLAGS) -fPIC + -I$(builddir)/obexd/src +else +obexd-add-service-symlink: +obexd-remove-service-symlink: endif obexd_src_obexd_SHORTNAME = obexd @@ -112,6 +122,6 @@ $(AM_V_at)$(MKDIR_P) $(dir $@) $(AM_V_GEN)$(srcdir)/obexd/src/genbuiltin $(obexd_builtin_modules) > $@ -CLEANFILES += obexd/src/builtin.h $(builtin_files) obexd/src/obex.service +CLEANFILES += obexd/src/builtin.h EXTRA_DIST += obexd/src/genbuiltin
View file
_service:tar_scm:bluez-5.71.tar.xz/Makefile.plugins -> _service:tar_scm:bluez-5.77.tar.xz/Makefile.plugins
Changed
@@ -74,8 +74,6 @@ profiles/battery/bas.c profiles/battery/bas.h \ profiles/scanparam/scpp.c profiles/scanparam/scpp.h \ profiles/input/suspend.h profiles/input/suspend-none.c - -EXTRA_DIST += profiles/input/suspend-dummy.c endif if HEALTH @@ -110,11 +108,9 @@ builtin_sources += profiles/battery/battery.c if SIXAXIS -plugin_LTLIBRARIES += plugins/sixaxis.la -plugins_sixaxis_la_SOURCES = plugins/sixaxis.c -plugins_sixaxis_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version -plugins_sixaxis_la_LIBADD = $(UDEV_LIBS) -plugins_sixaxis_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden +builtin_modules += sixaxis +builtin_sources += plugins/sixaxis.c +builtin_ldadd += $(UDEV_LIBS) endif if BAP @@ -142,7 +138,17 @@ builtin_sources += profiles/audio/micp.c endif +if CCP +builtin_modules += ccp +builtin_sources += profiles/audio/ccp.c +endif + if CSIP builtin_modules += csip builtin_sources += profiles/audio/csip.c endif + +if ASHA +builtin_modules += asha +builtin_sources += profiles/audio/asha.h profiles/audio/asha.c +endif
View file
_service:tar_scm:bluez-5.71.tar.xz/Makefile.tools -> _service:tar_scm:bluez-5.77.tar.xz/Makefile.tools
Changed
@@ -71,17 +71,12 @@ tools_btmon_logger_SOURCES = tools/btmon-logger.c tools_btmon_logger_LDADD = src/libshared-mainloop.la -tools_btmon_logger_DEPENDENCIES = src/libshared-mainloop.la \ - tools/bluetooth-logger.service if SYSTEMD systemdsystemunit_DATA += tools/bluetooth-logger.service endif endif -CLEANFILES += tools/bluetooth-logger.service -EXTRA_DIST += tools/bluetooth-logger.service.in - if TESTING noinst_PROGRAMS += emulator/btvirt emulator/b1ee emulator/hfp \ peripheral/btsensor tools/3dsp \ @@ -140,7 +135,7 @@ tools_mesh_tester_LDADD = lib/libbluetooth-internal.la \ src/libshared-glib.la $(GLIB_LIBS) -tools_l2cap_tester_SOURCES = tools/l2cap-tester.c monitor/bt.h \ +tools_l2cap_tester_SOURCES = tools/l2cap-tester.c tools/tester.h monitor/bt.h \ emulator/hciemu.h emulator/hciemu.c \ emulator/vhci.h emulator/vhci.c \ emulator/btdev.h emulator/btdev.c \ @@ -187,7 +182,7 @@ src/libshared-glib.la \ $(GLIB_LIBS) $(DBUS_LIBS) -tools_sco_tester_SOURCES = tools/sco-tester.c monitor/bt.h \ +tools_sco_tester_SOURCES = tools/sco-tester.c tools/tester.h monitor/bt.h \ emulator/hciemu.h emulator/hciemu.c \ emulator/vhci.h emulator/vhci.c \ emulator/btdev.h emulator/btdev.c \ @@ -208,7 +203,7 @@ tools_userchan_tester_LDADD = lib/libbluetooth-internal.la \ src/libshared-glib.la $(GLIB_LIBS) -tools_iso_tester_SOURCES = tools/iso-tester.c monitor/bt.h \ +tools_iso_tester_SOURCES = tools/iso-tester.c tools/tester.h monitor/bt.h \ emulator/hciemu.h emulator/hciemu.c \ emulator/vhci.h emulator/vhci.c \ emulator/btdev.h emulator/btdev.c \ @@ -348,7 +343,8 @@ if MANPAGES man_MANS += tools/rctest.1 tools/l2ping.1 tools/btattach.1 tools/isotest.1 \ - tools/btmgmt.1 client/bluetoothctl-mgmt.1 \ + tools/btmgmt.1 client/bluetoothctl.1 \ + client/bluetoothctl-mgmt.1 \ client/bluetoothctl-monitor.1 client/bluetoothctl-admin.1 \ client/bluetoothctl-advertise.1 client/bluetoothctl-endpoint.1 \ client/bluetoothctl-gatt.1 client/bluetoothctl-player.1 \ @@ -475,6 +471,7 @@ tools/rfcomm.1 tools/sdptool.1 tools/ciptool.1 \ tools/rctest.1 tools/l2ping.1 tools/btattach.1 \ tools/bdaddr.1 tools/isotest.1 tools/btmgmt.1 \ + client/bluetoothctl.1 \ client/bluetoothctl-mgmt.1 \ client/bluetoothctl-monitor.1 \ client/bluetoothctl-admin.1 \ @@ -541,7 +538,12 @@ endif if CUPS + +if CUPS_SERVERBIN +cupsdir = $(CUPS_SERVERBIN)/backend +else cupsdir = $(libdir)/cups/backend +endif cups_PROGRAMS = profiles/cups/bluetooth @@ -576,7 +578,6 @@ tools_btpclient_SOURCES = tools/btpclient.c src/shared/btp.c src/shared/btp.h tools_btpclient_LDADD = lib/libbluetooth-internal.la \ src/libshared-ell.la $(ell_ldadd) -tools_btpclient_DEPENDENCIES = lib/libbluetooth-internal.la $(ell_dependencies) tools/btpclient.$(OBJEXT): src/libshared-ell.la ell/internal tools_btpclientctl_SOURCES = tools/btpclientctl.c client/display.c
View file
_service:tar_scm:bluez-5.71.tar.xz/README -> _service:tar_scm:bluez-5.77.tar.xz/README
Changed
@@ -249,6 +249,19 @@ systems. The behavior of the deprecated tools may be unstable or simply don't work anymore. + --enable-external-plugins + + Enable support for external plugins + + By default external plugins for bluetoothd and obexd are not + supported and thus disabled. + + External plugins require access to internal, undocumented and + unversioned API in said daemons. As such they can break at any + time. If you have such plugins, enable this option and work + actively with the community to make said plugin part of the + upstream bluez project. + --enable-nfc This option enable NFC pairing support.
View file
_service:tar_scm:bluez-5.71.tar.xz/acinclude.m4 -> _service:tar_scm:bluez-5.77.tar.xz/acinclude.m4
Changed
@@ -134,6 +134,8 @@ misc_cflags="$misc_cflags --coverage" misc_ldflags="$misc_ldflags --coverage" fi + misc_cflags="$misc_cflags -ffunction-sections -fdata-sections" + misc_ldflags="$misc_ldflags -Wl,--gc-sections" AC_SUBST(MISC_CFLAGS, $misc_cflags) AC_SUBST(MISC_LDFLAGS, $misc_ldflags) )
View file
_service:tar_scm:bluez-5.71.tar.xz/android/Makefile.am -> _service:tar_scm:bluez-5.77.tar.xz/android/Makefile.am
Changed
@@ -96,6 +96,7 @@ android/hal-log.h \ android/hal-ipc.h android/hal-ipc.c \ android/hal-utils.h android/hal-utils.c +android_bluetooth_default_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden android_bluetooth_default_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android android_bluetooth_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \ -no-undefined @@ -195,6 +196,7 @@ android/hardware/audio_effect.h \ android/hardware/hardware.h \ android/system/audio.h +android_audio_a2dp_default_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden android_audio_a2dp_default_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android \ $(SBC_CFLAGS) android_audio_a2dp_default_la_LIBADD = $(SBC_LIBS) -lrt @@ -212,6 +214,7 @@ android/audio_utils/resampler.c \ android/audio_utils/resampler.h \ android/system/audio.h +android_audio_sco_default_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden android_audio_sco_default_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/android android_audio_sco_default_la_LIBADD = $(SPEEXDSP_LIBS) -lrt android_audio_sco_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
View file
_service:tar_scm:bluez-5.71.tar.xz/android/hal-audio-sbc.c -> _service:tar_scm:bluez-5.77.tar.xz/android/hal-audio-sbc.c
Changed
@@ -257,7 +257,7 @@ return false; } - sbc_data = calloc(sizeof(struct sbc_data), 1); + sbc_data = calloc(1, sizeof(struct sbc_data)); if (!sbc_data) return false;
View file
_service:tar_scm:bluez-5.71.tar.xz/android/hal-audio.c -> _service:tar_scm:bluez-5.77.tar.xz/android/hal-audio.c
Changed
@@ -1618,6 +1618,7 @@ .open = audio_open, }; +__attribute__ ((visibility("default"))) struct audio_module HAL_MODULE_INFO_SYM = { .common = { .tag = HARDWARE_MODULE_TAG,
View file
_service:tar_scm:bluez-5.71.tar.xz/android/hal-bluetooth.c -> _service:tar_scm:bluez-5.77.tar.xz/android/hal-bluetooth.c
Changed
@@ -1117,6 +1117,7 @@ .open = open_bluetooth, }; +__attribute__ ((visibility("default"))) struct hw_module_t HAL_MODULE_INFO_SYM = { .tag = HARDWARE_MODULE_TAG, .version_major = 1,
View file
_service:tar_scm:bluez-5.71.tar.xz/android/hal-sco.c -> _service:tar_scm:bluez-5.77.tar.xz/android/hal-sco.c
Changed
@@ -1507,6 +1507,7 @@ .open = sco_open, }; +__attribute__ ((visibility("default"))) struct audio_module HAL_MODULE_INFO_SYM = { .common = { .tag = HARDWARE_MODULE_TAG,
View file
_service:tar_scm:bluez-5.71.tar.xz/android/handsfree.c -> _service:tar_scm:bluez-5.77.tar.xz/android/handsfree.c
Changed
@@ -1243,15 +1243,22 @@ } buf = g_malloc(len); - - ptr = buf + sprintf(buf, "+CIND:"); + if (sprintf(buf, "+CIND:") != strlen("+CIND:")) { + g_free(buf); + break; + } + ptr = buf + strlen("+CIND:"); for (i = 0; i < IND_COUNT; i++) { - ptr += sprintf(ptr, "(\"%s\",(%d%c%d)),", + int printed; + printed = sprintf(ptr, "(\"%s\",(%d%c%d)),", dev->indsi.name, dev->indsi.min, dev->indsi.max == 1 ? ',' : '-', dev->indsi.max); + if (printed < 0) + goto fail; + ptr += printed; } ptr--; @@ -1273,6 +1280,7 @@ break; } +fail: hfp_gw_send_result(dev->gw, HFP_RESULT_ERROR); if (dev->state != HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED)
View file
_service:tar_scm:bluez-5.71.tar.xz/android/hidhost.c -> _service:tar_scm:bluez-5.77.tar.xz/android/hidhost.c
Changed
@@ -796,7 +796,7 @@ if (dev->hog) { bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTED); - bt_hog_detach(dev->hog); + bt_hog_detach(dev->hog, true); return; } goto fail; @@ -808,7 +808,8 @@ if (!dev->hog) { /* TODO: Get device details and primary */ dev->hog = bt_hog_new_default("bluez-input-device", dev->vendor, - dev->product, dev->version, NULL); + dev->product, dev->version, + BT_UHID_NONE, NULL); if (!dev->hog) { error("HoG: unable to create session"); goto fail;
View file
_service:tar_scm:bluez-5.71.tar.xz/attrib/gatt.c -> _service:tar_scm:bluez-5.77.tar.xz/attrib/gatt.c
Changed
@@ -1076,10 +1076,12 @@ att_data_list_free(list); /* - * If last handle is lower from previous start handle then it is smth - * wrong. Let's stop search, otherwise we might enter infinite loop. + * If last handle is lower from previous start handle or if iterating + * to the next handle from the last possible offset would overflow, then + * something is wrong. Let's stop search, otherwise we might enter + * infinite loop. */ - if (last < dd->start) { + if (last < dd->start || last == G_MAXUINT16) { err = ATT_ECODE_UNLIKELY; goto done; }
View file
_service:tar_scm:bluez-5.71.tar.xz/attrib/gattrib.c -> _service:tar_scm:bluez-5.77.tar.xz/attrib/gattrib.c
Changed
@@ -237,9 +237,9 @@ free(buf); } -static void attrib_callback_notify(struct bt_att_chan *chan, uint8_t opcode, - const void *pdu, uint16_t length, - void *user_data) +static void attrib_callback_notify(struct bt_att_chan *chan, uint16_t mtu, + uint8_t opcode, const void *pdu, + uint16_t length, void *user_data) { uint8_t *buf; struct attrib_callbacks *cb = user_data; @@ -355,7 +355,7 @@ if (length) memcpy(buf + 2, value, length); - attrib_callback_notify(NULL, ATT_OP_HANDLE_NOTIFY, buf, length + 2, + attrib_callback_notify(NULL, 0, ATT_OP_HANDLE_NOTIFY, buf, length + 2, user_data); }
View file
_service:tar_scm:bluez-5.71.tar.xz/attrib/gatttool.c -> _service:tar_scm:bluez-5.77.tar.xz/attrib/gatttool.c
Changed
@@ -454,7 +454,7 @@ return TRUE; } -static GOptionEntry primary_char_options = { +static const GOptionEntry primary_char_options = { { "start", 's' , 0, G_OPTION_ARG_INT, &opt_start, "Starting handle (optional)", "0x0001" }, { "end", 'e' , 0, G_OPTION_ARG_INT, &opt_end, @@ -464,7 +464,7 @@ { NULL }, }; -static GOptionEntry char_rw_options = { +static const GOptionEntry char_rw_options = { { "handle", 'a' , 0, G_OPTION_ARG_INT, &opt_handle, "Read/Write characteristic by handle (required)", "0x0001" }, { "value", 'n' , 0, G_OPTION_ARG_STRING, &opt_value, @@ -473,7 +473,7 @@ {NULL}, }; -static GOptionEntry gatt_options = { +static const GOptionEntry gatt_options = { { "primary", 0, 0, G_OPTION_ARG_NONE, &opt_primary, "Primary Service Discovery", NULL }, { "characteristics", 0, 0, G_OPTION_ARG_NONE, &opt_characteristics, @@ -494,7 +494,7 @@ { NULL }, }; -static GOptionEntry options = { +static const GOptionEntry options = { { "adapter", 'i', 0, G_OPTION_ARG_STRING, &opt_src, "Specify local adapter interface", "hciX" }, { "device", 'b', 0, G_OPTION_ARG_STRING, &opt_dst,
View file
_service:tar_scm:bluez-5.71.tar.xz/attrib/interactive.c -> _service:tar_scm:bluez-5.77.tar.xz/attrib/interactive.c
Changed
@@ -760,7 +760,7 @@ gatt_exchange_mtu(attrib, opt_mtu, exchange_mtu_cb, NULL); } -static struct { +static const struct { const char *cmd; void (*func)(int argcp, char **argvp); const char *params;
View file
_service:tar_scm:bluez-5.71.tar.xz/btio/btio.c -> _service:tar_scm:bluez-5.77.tar.xz/btio/btio.c
Changed
@@ -5,7 +5,7 @@ * * Copyright (C) 2009-2010 Marcel Holtmann <marcel@holtmann.org> * Copyright (C) 2009-2010 Nokia Corporation - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -1800,7 +1800,6 @@ { int sock; char c; - struct pollfd pfd; va_list args; struct sockaddr_iso *addr = NULL; uint8_t bc_num_bis = 0; @@ -1857,22 +1856,11 @@ return FALSE; } - memset(&pfd, 0, sizeof(pfd)); - pfd.fd = sock; - pfd.events = POLLOUT; - - if (poll(&pfd, 1, 0) < 0) { - ERROR_FAILED(err, "poll", errno); + if (read(sock, &c, 1) < 0) { + ERROR_FAILED(err, "read", errno); return FALSE; } - if (!(pfd.revents & POLLOUT)) { - if (read(sock, &c, 1) < 0) { - ERROR_FAILED(err, "read", errno); - return FALSE; - } - } - server_add(io, connect, NULL, user_data, destroy); return TRUE;
View file
_service:tar_scm:bluez-5.71.tar.xz/client/adv_monitor.c -> _service:tar_scm:bluez-5.77.tar.xz/client/adv_monitor.c
Changed
@@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2020 Google LLC + * Copyright 2024 NXP * * */ @@ -372,12 +373,11 @@ if (!dbus_set_error_from_message(&error, message)) { bt_shell_printf("AdvertisementMonitor path registered\n"); - return bt_shell_noninteractive_quit(EXIT_SUCCESS); + return; } bt_shell_printf("Failed to register path: %s\n", error.name); dbus_error_free(&error); - return bt_shell_noninteractive_quit(EXIT_FAILURE); } static void unregister_setup(DBusMessageIter *iter, void *user_data) @@ -408,13 +408,13 @@ { if (manager.app_registered) { bt_shell_printf("Advertisement Monitor already registered\n"); - return bt_shell_noninteractive_quit(EXIT_FAILURE); + return; } else if (manager.supported_types == NULL || !g_dbus_proxy_method_call(manager.proxy, "RegisterMonitor", register_setup, register_reply, NULL, NULL)) { bt_shell_printf("Failed to register Advertisement Monitor\n"); - return bt_shell_noninteractive_quit(EXIT_FAILURE); + return; } manager.app_registered = TRUE; }
View file
_service:tar_scm:bluez-5.71.tar.xz/client/advertising.c -> _service:tar_scm:bluez-5.77.tar.xz/client/advertising.c
Changed
@@ -43,6 +43,7 @@ }; struct data { + bool valid; uint8_t type; struct ad_data data; }; @@ -157,7 +158,7 @@ ad.manufacturer.data.len); } - if (ad.data.data.len) { + if (ad.data.valid) { bt_shell_printf("Data Type: 0x%02x\n", ad.data.type); bt_shell_hexdump(ad.data.data.data, ad.data.data.len); } @@ -395,7 +396,7 @@ static gboolean data_exists(const GDBusPropertyTable *property, void *data) { - return ad.data.type != 0; + return ad.data.valid; } static gboolean get_data(const GDBusPropertyTable *property, @@ -415,12 +416,6 @@ return TRUE; } -static gboolean discoverable_exists(const GDBusPropertyTable *property, - void *data) -{ - return ad.discoverable; -} - static gboolean get_discoverable(const GDBusPropertyTable *property, DBusMessageIter *iter, void *user_data) { @@ -497,7 +492,7 @@ { "ManufacturerData", "a{qv}", get_manufacturer_data, NULL, manufacturer_data_exists }, { "Data", "a{yv}", get_data, NULL, data_exists }, - { "Discoverable", "b", get_discoverable, NULL, discoverable_exists }, + { "Discoverable", "b", get_discoverable, NULL, NULL }, { "DiscoverableTimeout", "q", get_discoverable_timeout, NULL, discoverable_timeout_exists }, { "Includes", "as", get_includes, NULL, includes_exists }, @@ -757,7 +752,7 @@ static void ad_clear_data(void) { - memset(&ad.manufacturer, 0, sizeof(ad.manufacturer)); + memset(&ad.data, 0, sizeof(ad.data)); return bt_shell_noninteractive_quit(EXIT_SUCCESS); } @@ -787,6 +782,7 @@ return bt_shell_noninteractive_quit(EXIT_FAILURE); ad_clear_data(); + ad.data.valid = true; ad.data.type = val; ad.data.data = data;
View file
_service:tar_scm:bluez-5.71.tar.xz/client/agent.c -> _service:tar_scm:bluez-5.77.tar.xz/client/agent.c
Changed
@@ -77,14 +77,17 @@ { DBusConnection *conn = user_data; - if (!strcmp(input, "yes")) - g_dbus_send_reply(conn, pending_message, DBUS_TYPE_INVALID); - else if (!strcmp(input, "no")) - g_dbus_send_error(conn, pending_message, + if (pending_message != NULL) { + if (!strcmp(input, "yes")) + g_dbus_send_reply(conn, pending_message, + DBUS_TYPE_INVALID); + else if (!strcmp(input, "no")) + g_dbus_send_error(conn, pending_message, "org.bluez.Error.Rejected", NULL); - else - g_dbus_send_error(conn, pending_message, + else + g_dbus_send_error(conn, pending_message, "org.bluez.Error.Canceled", NULL); + } } static void agent_release(DBusConnection *conn)
View file
_service:tar_scm:bluez-5.77.tar.xz/client/bluetoothctl.1
Added
@@ -0,0 +1,398 @@ +.\" Man page generated from reStructuredText. +. +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\nan-margin +level \\nrst2man-indent-level +level margin: \\nrst2man-indent\\nrst2man-indent-level +- +\\nrst2man-indent0 +\\nrst2man-indent1 +\\nrst2man-indent2 +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\nrst2man-indent-level \\nan-margin +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\nan-margin +.\" old: \\nrst2man-indent\\nrst2man-indent-level +.nr rst2man-indent-level -1 +.\" new: \\nrst2man-indent\\nrst2man-indent-level +.in \\nrst2man-indent\\nrst2man-indent-levelu +.. +.TH "BLUETOOTHCTL" 1 "November 2022" "BlueZ" "Linux System Administration" +.SH NAME +bluetoothctl \- Bluetooth Control Command Line Tool +.SH SYNOPSIS +.sp +\fBbluetoothctl\fP \fB\-a\fP \fIcapability\fP \fB\-e\fP \fB\-m\fP \fB\-t\fP \fIseconds\fP +\fB\-v\fP \fB\-h\fP +.SH DESCRIPTION +.sp +\fBbluetoothctl(1)\fP interactive bluetooth control tool. The tool works with +Bluetooth Classic (BR/EDR) and Bluetooth Low Energy (LE) controllers. +.sp +The tool is menu driven but can be automated from the command line. +Examples are given in the automation section. +.SH OPTIONS +.INDENT 0.0 +.TP +.BI \-a \ capability\fR,\fB \ \-\-agent \ capability +Register agent handler: <capability> +.TP +.B \-e\fP,\fB \-\-endpoints +Register Media endpoints +.TP +.B \-m\fP,\fB \-\-monitor +Enable monitor output +.TP +.BI \-t \ seconds\fR,\fB \ \-\-timeout \ seconds +Timeout in seconds for non\-interactive mode +.TP +.B \-v\fP,\fB \-\-version +Display version +.TP +.B \-h\fP,\fB \-\-help +Display help +.UNINDENT +.SH COMMANDS +.SS list +.sp +List available controllers. +.INDENT 0.0 +.TP +.B Usage +\fB# list\fP +.UNINDENT +.SS show +.sp +Controller information. +.INDENT 0.0 +.TP +.B Usage +\fB# show ctrl\fP +.UNINDENT +.SS select +.sp +Select default controller. +.INDENT 0.0 +.TP +.B Usage +\fB# select <ctrl>\fP +.UNINDENT +.SS devices +.sp +List available devices, with an optional property as the filter. +.INDENT 0.0 +.TP +.B Usage +\fB# devices Paired/Bonded/Trusted/Connected\fP +.UNINDENT +.SS system\-alias +.sp +Set controller alias. +.INDENT 0.0 +.TP +.B Usage +\fB# system\-alias <name>\fP +.UNINDENT +.SS reset\-alias +.sp +Reset controller alias. +.INDENT 0.0 +.TP +.B Usage +\fB# reset\-alias\fP +.UNINDENT +.SS power +.sp +Set controller power. +.sp +When the controller is powered off, the USB port the controller is attached to +is put into a suspend state. +.INDENT 0.0 +.TP +.B Usage +\fB# power <on/off>\fP +.UNINDENT +.SS advertise +.sp +Enable/disable advertising with given type. +.sp +If you exit the program advertising will be disabled. +.sp +When advertising the controller should advertise with random address but may +use its public address if it does not support the feature (address of the +device). +.sp +A device can advertise if it initiated the connection to another advertising +device. +.INDENT 0.0 +.TP +.B Usage +\fB# advertise <on/off/type>\fP +.UNINDENT +.SS set\-alias +.sp +Set device alias. +.INDENT 0.0 +.TP +.B Usage +\fB# set\-alias <alias>\fP +.UNINDENT +.SS scan +.sp +Scan for devices. +.sp +For LE, scanning is an important requirement before connecting or pairing. +.sp +The purpose of scanning is to find devices that are advertising with their +discoverable flag set (either limited or general). Once you have found the +address then you can connect or pair. +.sp +Note the following when scanning: +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 +.IP \(bu 2 +When scanning the controller will use a random address that is not +resolvable so the public address is not leaked. A new random address is +created every time scan on is used. +.IP \(bu 2 +When turning on scanning the device will start receiving advertising reports +of what devices are advertising. +.IP \(bu 2 +The filtering of duplicate advertising reports may be enabled depending on +the filtering settings. +.IP \(bu 2 +Device objects found during a scan session will only be persisted if they +are connected/paired otherwise they are removed after some time. +.UNINDENT +.UNINDENT +.UNINDENT +.INDENT 0.0 +.TP +.B Usage +\fB# scan <on/off/bredr/le>\fP +.UNINDENT +.SS pair +.sp +Pair with device. +.sp +This will pair with a device and then trust and connect to it. If the device is +already paired this will first remove the pairing. +.sp +The command can either be used while the controller is in the connected or not +connected state. +.sp +If the controller is already connected then the pair command can be used without +an arguments. If the controller is not connected, the pair command can be given +the address of a device with an active scan report and it will initiate the +connection before pairing. +.sp +Before pairing the agent must be selected to choose the authentication +mechanism. +.INDENT 0.0 +.TP +.B Usage +\fB# pair <dev>\fP +.UNINDENT +.SS pairable +.sp +Set controller pairable mode. +.sp +This enables/disables pairing. If pairing is disabled then the controller will +not accept any pairing requests. +.INDENT 0.0 +.TP +.B Usage +\fB# pairable <on/off>\fP +.UNINDENT +.SS discoverable +.sp +Set discoverable mode. +.sp +This enables/disables discoverable mode. If discoverable is disabled then the +controller will not respond to any scan requests. +.sp +In LE if discoverable if off the controller will just passively scan and not +make scan requests to advertising devices. If on it will make the advertising +requests. +.sp +It will use a random address if supported by the controller. The length of time +\(dqdiscoverable on\(dq is valid is determined by discoverable\-timeout command. +.INDENT 0.0 +.TP +.B Usage +\fB# discoverable <on/off>\fP +.UNINDENT +.SS discoverable\-timeout +.sp +Set discoverable timeout. +.sp +The time in seconds that \(dqdiscoverable on\(dq is valid. +.INDENT 0.0 +.TP +.B Usage +\fB# discoverable\-timeout value\fP +.UNINDENT +.SS agent +.sp +Enable/disable agent with given capability. +.sp +This chooses the local authentication mechanism of the controller. It is needed +for pairing and allows you to choose the IO capabilities of the controller. +.sp +The valid agent capabilities are: DisplayOnly, DisplayYesNo, KeyboardDisplay, +KeyboardOnly, NoInputNoOutput. +.INDENT 0.0 +.TP +.B Usage +\fB# agent <on/off/capability>\fP +.UNINDENT +.SS default\-agent +.sp +Set current agent as the default one. +.sp +After selecting the agent this will make it the default agent. +.INDENT 0.0 +.TP +.B Usage +\fB# default\-agent\fP +.UNINDENT +.SS trust +.sp +Trust device. +.INDENT 0.0 +.TP +.B Usage +\fB# trust <dev>\fP +.UNINDENT +.SS untrust +.sp +Untrust device. +.INDENT 0.0 +.TP +.B Usage +\fB# untrust <dev>\fP +.UNINDENT +.SS block +.sp +Block device. +.INDENT 0.0 +.TP +.B Usage +\fB# block <dev>\fP +.UNINDENT +.SS unblock +.sp +Unblock device +.INDENT 0.0 +.TP +.B Usage +\fB# unblock <dev>\fP +.UNINDENT +.SS remove +.sp +Remove device. +.INDENT 0.0 +.TP +.B Usage +\fB# remove <dev>\fP +.UNINDENT +.SS connect +.sp +Connect device. +.sp +This will initiate a connection to a device. +.sp +To connect with an LE device the controller must have an active scan report of +the device it wants to connect to. +.sp +If no advertising report is received before the timeout a +le\-connection\-abort\-by\-local error will be issued. In that case either try +again to connect assuming the device is advertising. +.INDENT 0.0 +.TP +.B Usage +\fB# connect <dev>\fP +.UNINDENT +.SS disconnect +.sp +Disconnect device. +.sp +For LE when disconnecting from an active connection the device address is not +needed. +.INDENT 0.0 +.TP +.B Usage +\fB# disconnect <dev>\fP +.UNINDENT +.SS info +.sp +Device information. +.INDENT 0.0 +.TP +.B Usage +\fB# info <dev>\fP +.UNINDENT +.SH ADVERTISE SUBMENU +.sp +See \fBbluetoothctl\-advertise(1)\fP\&. +.SH MONITOR SUBMENU +.sp +See \fBbluetoothctl\-monitor(1)\fP +.SH SCAN SUBMENU +.sp +See \fBbluetoothctl\-scan(1)\fP +.SH GATT SUBMENU +.sp +See \fBbluetoothctl\-gatt(1)\fP +.SH ADMIN SUBMENU +.sp +See \fBbluetoothctl\-admin(1)\fP +.SH PLAYER SUBMENU +.sp +See \fBbluetoothctl\-player(1)\fP +.SH ENDPOINT SUBMENU +.sp +See \fBbluetoothctl\-endpoint(1)\fP +.SH TRANSPORT SUBMENU +.sp +See \fBbluetoothctl\-transport(1)\fP +.SH MANAGEMENT SUBMENU +.sp +See \fBbluetoothctl\-mgmt(1)\fP +.SH AUTOMATION +.sp +Two common ways to automate the tool are to use Here Docs or the program expect. +Using Here Docs to show information about the Bluetooth controller. +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +bluetoothctl <<EOF +list +show +EOF +.EE +.UNINDENT +.UNINDENT +.SH RESOURCES +.sp +\fI\%http://www.bluez.org\fP +.SH REPORTING BUGS +.sp +\fI\%linux\-bluetooth@vger.kernel.org\fP +.SH COPYRIGHT +Free use of this software is granted under the terms of the GNU +Lesser General Public Licenses (LGPL). +.\" Generated by docutils manpage writer. +.
View file
_service:tar_scm:bluez-5.77.tar.xz/client/bluetoothctl.rst
Added
@@ -0,0 +1,358 @@ +============ +bluetoothctl +============ + +----------------------------------- +Bluetooth Control Command Line Tool +----------------------------------- + +:Version: BlueZ +:Copyright: Free use of this software is granted under the terms of the GNU + Lesser General Public Licenses (LGPL). +:Date: November 2022 +:Manual section: 1 +:Manual group: Linux System Administration + +SYNOPSIS +======== + +**bluetoothctl** **-a** *capability* **-e** **-m** **-t** *seconds* +**-v** **-h** + +DESCRIPTION +=========== + +**bluetoothctl(1)** interactive bluetooth control tool. The tool works with +Bluetooth Classic (BR/EDR) and Bluetooth Low Energy (LE) controllers. + +The tool is menu driven but can be automated from the command line. +Examples are given in the automation section. + +OPTIONS +======= + +-a capability, --agent capability Register agent handler: <capability> +-e, --endpoints Register Media endpoints +-m, --monitor Enable monitor output +-t seconds, --timeout seconds Timeout in seconds for non-interactive mode +-v, --version Display version +-h, --help Display help + + +Commands +======== + +list +---- + +List available controllers. + +:Usage: **# list** + +show +---- + +Controller information. + +:Usage: **# show ctrl** + +select +------ + +Select default controller. + +:Usage: **# select <ctrl>** + +devices +------- + +List available devices, with an optional property as the filter. + +:Usage: **# devices Paired/Bonded/Trusted/Connected** + +system-alias +------------ + +Set controller alias. + +:Usage: **# system-alias <name>** + +reset-alias +----------- + +Reset controller alias. + +:Usage: **# reset-alias** + +power +----- + +Set controller power. + +When the controller is powered off, the USB port the controller is attached to +is put into a suspend state. + +:Usage: **# power <on/off>** + +advertise +--------- + +Enable/disable advertising with given type. + +If you exit the program advertising will be disabled. + +When advertising the controller should advertise with random address but may +use its public address if it does not support the feature (address of the +device). + +A device can advertise if it initiated the connection to another advertising +device. + +:Usage: **# advertise <on/off/type>** + +set-alias +--------- + +Set device alias. + +:Usage: **# set-alias <alias>** + +scan +---- + +Scan for devices. + +For LE, scanning is an important requirement before connecting or pairing. + +The purpose of scanning is to find devices that are advertising with their +discoverable flag set (either limited or general). Once you have found the +address then you can connect or pair. + +Note the following when scanning: + + - When scanning the controller will use a random address that is not + resolvable so the public address is not leaked. A new random address is + created every time scan on is used. + - When turning on scanning the device will start receiving advertising reports + of what devices are advertising. + - The filtering of duplicate advertising reports may be enabled depending on + the filtering settings. + - Device objects found during a scan session will only be persisted if they + are connected/paired otherwise they are removed after some time. + +:Usage: **# scan <on/off/bredr/le>** + +pair +---- + +Pair with device. + +This will pair with a device and then trust and connect to it. If the device is +already paired this will first remove the pairing. + +The command can either be used while the controller is in the connected or not +connected state. + +If the controller is already connected then the pair command can be used without +an arguments. If the controller is not connected, the pair command can be given +the address of a device with an active scan report and it will initiate the +connection before pairing. + +Before pairing the agent must be selected to choose the authentication +mechanism. + +:Usage: **# pair <dev>** + +pairable +-------- + +Set controller pairable mode. + +This enables/disables pairing. If pairing is disabled then the controller will +not accept any pairing requests. + +:Usage: **# pairable <on/off>** + +discoverable +------------ + +Set discoverable mode. + +This enables/disables discoverable mode. If discoverable is disabled then the +controller will not respond to any scan requests. + +In LE if discoverable if off the controller will just passively scan and not +make scan requests to advertising devices. If on it will make the advertising +requests. + +It will use a random address if supported by the controller. The length of time +"discoverable on" is valid is determined by discoverable-timeout command. + +:Usage: **# discoverable <on/off>** + +discoverable-timeout +-------------------- + +Set discoverable timeout. + +The time in seconds that "discoverable on" is valid. + +:Usage: **# discoverable-timeout value** + +agent +----- + +Enable/disable agent with given capability. + +This chooses the local authentication mechanism of the controller. It is needed +for pairing and allows you to choose the IO capabilities of the controller. + +The valid agent capabilities are: DisplayOnly, DisplayYesNo, KeyboardDisplay, +KeyboardOnly, NoInputNoOutput. + +:Usage: **# agent <on/off/capability>** + +default-agent +------------- + +Set current agent as the default one. + +After selecting the agent this will make it the default agent. + +:Usage: **# default-agent** + +trust +----- + +Trust device. + +:Usage: **# trust <dev>** + +untrust +------- + +Untrust device. + +:Usage: **# untrust <dev>** + +block +----- + +Block device. + +:Usage: **# block <dev>** + +unblock +------- +Unblock device + +:Usage: **# unblock <dev>** + +remove +------ + +Remove device. + +:Usage: **# remove <dev>** + +connect +------- + +Connect device. + +This will initiate a connection to a device. + +To connect with an LE device the controller must have an active scan report of +the device it wants to connect to. + +If no advertising report is received before the timeout a +le-connection-abort-by-local error will be issued. In that case either try +again to connect assuming the device is advertising. + +:Usage: **# connect <dev>** + +disconnect +---------- + +Disconnect device. + +For LE when disconnecting from an active connection the device address is not +needed. + +:Usage: **# disconnect <dev>** + +info +---- + +Device information. + +:Usage: **# info <dev>** + + +Advertise Submenu +================= + +See **bluetoothctl-advertise(1)**. + +Monitor Submenu +=============== + +See **bluetoothctl-monitor(1)** + +Scan Submenu +============ + +See **bluetoothctl-scan(1)** + +Gatt Submenu +============ + +See **bluetoothctl-gatt(1)** + +Admin Submenu +============= + +See **bluetoothctl-admin(1)** + +Player Submenu +============== + +See **bluetoothctl-player(1)** + +Endpoint Submenu +================ + +See **bluetoothctl-endpoint(1)** + +Transport Submenu +================= + +See **bluetoothctl-transport(1)** + +Management Submenu +================== + +See **bluetoothctl-mgmt(1)** + +AUTOMATION +========== +Two common ways to automate the tool are to use Here Docs or the program expect. +Using Here Docs to show information about the Bluetooth controller. + +.. code:: + + bluetoothctl <<EOF + list + show + EOF + + +RESOURCES +========= + +http://www.bluez.org + +REPORTING BUGS +============== + +linux-bluetooth@vger.kernel.org
View file
_service:tar_scm:bluez-5.71.tar.xz/client/gatt.c -> _service:tar_scm:bluez-5.77.tar.xz/client/gatt.c
Changed
@@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2014 Intel Corporation. All rights reserved. + * Copyright 2024 NXP * * */ @@ -965,11 +966,15 @@ struct msghdr msg; int ret; + ret = io_get_fd(io); + if (ret < 0) + return ret; + memset(&msg, 0, sizeof(msg)); msg.msg_iov = iov; msg.msg_iovlen = iovlen; - ret = sendmsg(io_get_fd(io), &msg, MSG_NOSIGNAL); + ret = sendmsg(ret, &msg, MSG_NOSIGNAL); if (ret < 0) { ret = -errno; bt_shell_printf("sendmsg: %s", strerror(-ret)); @@ -1051,6 +1056,11 @@ if (io != notify_io.io && !chrc) return true; + if (fd < 0) { + bt_shell_printf("recvmsg: %s", strerror(-fd)); + return false; + } + iov.iov_base = buf; iov.iov_len = sizeof(buf); @@ -1401,7 +1411,7 @@ dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING_AS_STRING, &entry); - for (uuid = uuids; uuid; uuid = g_list_next(uuid->next)) + for (uuid = uuids; uuid; uuid = g_list_next(uuid)) dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &uuid->data); @@ -1427,7 +1437,7 @@ return bt_shell_noninteractive_quit(EXIT_FAILURE); } - for (i = 0; i < argc; i++) + for (i = 1; i < argc; i++) uuids = g_list_append(uuids, g_strdup(argvi)); if (uuids) { @@ -1685,6 +1695,8 @@ g_dbus_unregister_interface(service->conn, service->path, SERVICE_INTERFACE); } + + return bt_shell_noninteractive_quit(EXIT_SUCCESS); } static uint16_t parse_handle(const char *arg) @@ -1737,8 +1749,6 @@ bt_shell_prompt_input(service->path, "Primary (yes/no):", service_set_primary, service); - - return bt_shell_noninteractive_quit(EXIT_SUCCESS); } static struct service *service_find(const char *pattern) @@ -2761,6 +2771,8 @@ } chrc->max_val_len = chrc->value_len; + + return bt_shell_noninteractive_quit(EXIT_SUCCESS); } static gboolean attr_authorization_flag_exists(char **flags) @@ -2817,8 +2829,6 @@ print_chrc(chrc, COLORED_NEW); bt_shell_prompt_input(chrc->path, "Enter value:", chrc_set_value, chrc); - - return bt_shell_noninteractive_quit(EXIT_SUCCESS); } static struct chrc *chrc_find(const char *pattern) @@ -3187,9 +3197,13 @@ dbus_message_iter_get_fixed_array(&array, &value, &len); } - write_value(&chrc->value_len, &chrc->value, value, len, - 0, chrc->max_val_len); - bt_shell_hexdump(value, len); + if (write_value(&chrc->value_len, &chrc->value, value, len, + 0, chrc->max_val_len)) { + bt_shell_printf("Unable to update property value for " + "%s\n", name); + } else { + bt_shell_hexdump(value, len); + } } g_dbus_emit_property_changed(conn, chrc->path, CHRC_INTERFACE, name);
View file
_service:tar_scm:bluez-5.71.tar.xz/client/main.c -> _service:tar_scm:bluez-5.77.tar.xz/client/main.c
Changed
@@ -830,6 +830,11 @@ { const char **opt; + if (argc < 2) { + bt_shell_printf("Missing argument to %s\n", argv0); + return FALSE; + } + if (!strcmp(argv1, "help")) { for (opt = arg_table; opt && *opt; opt++) bt_shell_printf("%s\n", *opt); @@ -2108,7 +2113,7 @@ desc = g_strdup_printf(COLOR_BLUE "%s" COLOR_OFF "# ", attr); bt_shell_set_prompt(desc); - free(desc); + g_free(desc); } static void cmd_select_attribute(int argc, char *argv) @@ -3060,7 +3065,7 @@ "Unregister application service" }, { "register-includes", "<UUID> handle", cmd_register_includes, "Register as Included service in." }, - { "unregister-includes", "<Service-UUID><Inc-UUID>", + { "unregister-includes", "<Service-UUID> <Inc-UUID>", cmd_unregister_includes, "Unregister Included service." }, { "register-characteristic",
View file
_service:tar_scm:bluez-5.71.tar.xz/client/mgmt.c -> _service:tar_scm:bluez-5.77.tar.xz/client/mgmt.c
Changed
@@ -359,6 +359,8 @@ "wide-band-speech", "cis-central", "cis-peripheral", + "iso-broadcaster", + "sync-receiver" }; static const char *settings2str(uint32_t settings) @@ -849,10 +851,16 @@ &prompt.addr); break; case MGMT_EV_USER_CONFIRM_REQUEST: - if (input0 == 'y' || input0 == 'Y') - mgmt_confirm_reply(prompt.index, &prompt.addr); - else + if (len) { + if (input0 == 'y' || input0 == 'Y') + mgmt_confirm_reply(prompt.index, &prompt.addr); + else + mgmt_confirm_neg_reply(prompt.index, + &prompt.addr); + } else { mgmt_confirm_neg_reply(prompt.index, &prompt.addr); + bt_shell_set_prompt(PROMPT_ON); + } break; } } @@ -1478,7 +1486,7 @@ for (i = 0; i < count; i++) { uint16_t index = le16_to_cpu(rp->entryi.index); - char *busstr = hci_bustostr(rp->entryi.bus); + const char *busstr = hci_bustostr(rp->entryi.bus); switch (rp->entryi.type) { case 0x00: @@ -2197,7 +2205,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option get_flags_options = { +static const struct option get_flags_options = { { "help", 0, 0, 'h' }, { "type", 1, 0, 't' }, { 0, 0, 0, 0 } @@ -2266,7 +2274,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option set_flags_options = { +static const struct option set_flags_options = { { "help", 0, 0, 'h' }, { "type", 1, 0, 't' }, { "flags", 1, 0, 'f' }, @@ -2672,7 +2680,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option disconnect_options = { +static const struct option disconnect_options = { { "help", 0, 0, 'h' }, { "type", 1, 0, 't' }, { 0, 0, 0, 0 } @@ -2777,7 +2785,7 @@ discovery = true; } -static struct option find_service_options = { +static const struct option find_service_options = { { "help", no_argument, 0, 'h' }, { "le-only", no_argument, 0, 'l' }, { "bredr-only", no_argument, 0, 'b' }, @@ -2874,7 +2882,7 @@ discovery = true; } -static struct option find_options = { +static const struct option find_options = { { "help", 0, 0, 'h' }, { "le-only", 1, 0, 'l' }, { "bredr-only", 1, 0, 'b' }, @@ -2946,7 +2954,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option stop_find_options = { +static const struct option stop_find_options = { { "help", 0, 0, 'h' }, { "le-only", 1, 0, 'l' }, { "bredr-only", 1, 0, 'b' }, @@ -3068,7 +3076,7 @@ passkey_notify, mgmt, NULL); } -static struct option pair_options = { +static const struct option pair_options = { { "help", 0, 0, 'h' }, { "capability", 1, 0, 'c' }, { "type", 1, 0, 't' }, @@ -3163,7 +3171,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option cancel_pair_options = { +static const struct option cancel_pair_options = { { "help", 0, 0, 'h' }, { "type", 1, 0, 't' }, { 0, 0, 0, 0 } @@ -3245,7 +3253,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option unpair_options = { +static const struct option unpair_options = { { "help", 0, 0, 'h' }, { "type", 1, 0, 't' }, { 0, 0, 0, 0 } @@ -3372,7 +3380,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option irks_options = { +static const struct option irks_options = { { "help", 0, 0, 'h' }, { "local", 1, 0, 'l' }, { "file", 1, 0, 'f' }, @@ -3486,7 +3494,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option block_options = { +static const struct option block_options = { { "help", 0, 0, 'h' }, { "type", 1, 0, 't' }, { 0, 0, 0, 0 } @@ -3730,7 +3738,7 @@ print("Remote OOB data added for %s (%u)", addr, rp->type); } -static struct option remote_oob_opt = { +static const struct option remote_oob_opt = { { "help", 0, 0, '?' }, { "type", 1, 0, 't' }, { 0, 0, 0, 0 } @@ -3973,7 +3981,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option conn_info_options = { +static const struct option conn_info_options = { { "help", 0, 0, 'h' }, { "type", 1, 0, 't' }, { 0, 0, 0, 0 } @@ -4144,7 +4152,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option add_device_options = { +static const struct option add_device_options = { { "help", 0, 0, 'h' }, { "action", 1, 0, 'a' }, { "type", 1, 0, 't' }, @@ -4217,7 +4225,7 @@ bt_shell_noninteractive_quit(EXIT_SUCCESS); } -static struct option del_device_options = { +static const struct option del_device_options = { { "help", 0, 0, 'h' }, { "type", 1, 0, 't' }, { 0, 0, 0, 0 } @@ -4471,7 +4479,7 @@ "\t -n, --local-name \"local-name\" flag"); } -static struct option advsize_options = { +static const struct option advsize_options = { { "help", 0, 0, 'h' }, { "connectable", 0, 0, 'c' }, { "general-discov", 0, 0, 'g' }, @@ -4591,7 +4599,7 @@ "\tadd-adv -u 180d -u 180f -d 080954657374204C45 1"); } -static struct option add_adv_options = { +static const struct option add_adv_options = { { "help", 0, 0, 'h' }, { "uuid", 1, 0, 'u' }, { "adv-data", 1, 0, 'd' }, @@ -4929,7 +4937,7 @@ "\tadd-ext-adv-params -r 0x801 -x 0x802 -P 2M -g 1"); } -static struct option add_ext_adv_params_options = { +static const struct option add_ext_adv_params_options = { { "help", 0, 0, 'h' }, { "duration", 1, 0, 'd' }, { "timeout", 1, 0, 't' }, @@ -5107,7 +5115,7 @@ "\tadd-ext-adv-data -u 180d -u 180f -d 080954657374204C45 1"); } -static struct option add_ext_adv_data_options = { +static const struct option add_ext_adv_data_options = { { "help", 0, 0, 'h' }, { "uuid", 1, 0, 'u' }, { "adv-data", 1, 0, 'd' }, @@ -5551,7 +5559,7 @@ return true; } -static struct option add_monitor_rssi_options = { +static const struct option add_monitor_rssi_options = { { "help", 0, 0, 'h' }, { "high-threshold", 1, 0, 'R' }, { "low-threshold", 1, 0, 'r' },
View file
_service:tar_scm:bluez-5.71.tar.xz/client/player.c -> _service:tar_scm:bluez-5.77.tar.xz/client/player.c
Changed
@@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2020 Intel Corporation. All rights reserved. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -34,6 +34,7 @@ #include "lib/bluetooth.h" #include "lib/uuid.h" +#include "lib/iso.h" #include "profiles/audio/a2dp-codecs.h" #include "src/shared/lc3.h" @@ -63,8 +64,9 @@ #define NSEC_USEC(_t) (_t / 1000L) #define SEC_USEC(_t) (_t * 1000000L) #define TS_USEC(_ts) (SEC_USEC((_ts)->tv_sec) + NSEC_USEC((_ts)->tv_nsec)) +#define ROUND_CLOSEST(_x, _y) (((_x) + (_y / 2)) / (_y)) -#define EP_SRC_LOCATIONS 0x00000001 +#define EP_SRC_LOCATIONS 0x00000003 #define EP_SNK_LOCATIONS 0x00000003 #define EP_SRC_CTXT 0x000f @@ -72,6 +74,31 @@ #define EP_SNK_CTXT 0x0fff #define EP_SUPPORTED_SNK_CTXT EP_SNK_CTXT +#if __BYTE_ORDER == __LITTLE_ENDIAN + +struct avdtp_media_codec_capability { + uint8_t rfa0:4; + uint8_t media_type:4; + uint8_t media_codec_type; + uint8_t data0; +} __attribute__ ((packed)); + +#elif __BYTE_ORDER == __BIG_ENDIAN + +struct avdtp_media_codec_capability { + uint8_t media_type:4; + uint8_t rfa0:4; + uint8_t media_codec_type; + uint8_t data0; +} __attribute__ ((packed)); + +#else +#error "Unknown byte order" +#endif + +#define BCAST_CODE {0x01, 0x02, 0x68, 0x05, 0x53, 0xf1, 0x41, 0x5a, \ + 0xa2, 0x65, 0xbb, 0xaf, 0xc6, 0xea, 0x03, 0xb8} + struct endpoint { char *path; char *uuid; @@ -105,6 +132,7 @@ static GList *local_endpoints = NULL; static GList *transports = NULL; static struct queue *ios = NULL; +static uint8_t bcast_code = BCAST_CODE; struct transport { GDBusProxy *proxy; @@ -116,22 +144,7 @@ struct io *io; uint32_t seq; struct io *timer_io; -}; - -static const uint8_t base_lc3_16_2_1 = { - 0x28, 0x00, 0x00, /* Presentation Delay */ - 0x01, /* Number of Subgroups */ - 0x01, /* Number of BIS */ - 0x06, 0x00, 0x00, 0x00, 0x00, /* Code ID = LC3 (0x06) */ - 0x10, /* Codec Specific Configuration */ - 0x02, 0x01, 0x03, /* 16 KHZ */ - 0x02, 0x02, 0x01, /* 10 ms */ - 0x05, 0x03, 0x01, 0x00, 0x00, 0x00, /* Front Left */ - 0x03, 0x04, 0x28, 0x00, /* Frame Length 40 bytes */ - 0x04, /* Metadata */ - 0x03, 0x02, 0x02, 0x00, /* Audio Context: Convertional */ - 0x01, /* BIS */ - 0x00, /* Codec Specific Configuration */ + int num; }; static void endpoint_unregister(void *data) @@ -984,11 +997,6 @@ {} }, }; -static char *endpoint_generator(const char *text, int state) -{ - return generic_generator(text, state, endpoints); -} - static char *local_endpoint_generator(const char *text, int state) { int len = strlen(text); @@ -1010,6 +1018,17 @@ return NULL; } +static char *endpoint_generator(const char *text, int state) +{ + char *ret; + + ret = generic_generator(text, state, endpoints); + if (ret) + return ret; + + return local_endpoint_generator(text, state); +} + static void print_endpoint(void *data, void *user_data) { GDBusProxy *proxy = data; @@ -1112,38 +1131,28 @@ return NULL; } -struct codec_capabilities { - uint8_t len; - uint8_t type; - uint8_t dataUINT8_MAX; -}; - -#define data(args...) ((const unsigned char) { args }) - -#define CODEC_DATA(args...) \ - { \ - .iov_base = (void *)data(args), \ - .iov_len = sizeof(data(args)), \ - } - -#define CODEC_CAPABILITIES(_uuid, _codec_id, _data) \ +#define CODEC_CAPABILITIES(_name, _uuid, _codec_id, _data, _meta) \ { \ + .name = _name, \ .uuid = _uuid, \ .codec_id = _codec_id, \ .data = _data, \ + .meta = _meta, \ } #define LC3_DATA(_freq, _duration, _chan_count, _len_min, _len_max) \ - CODEC_DATA(0x03, LC3_FREQ, _freq, _freq >> 8, \ - 0x02, LC3_DURATION, _duration, \ - 0x02, LC3_CHAN_COUNT, _chan_count, \ - 0x05, LC3_FRAME_LEN, _len_min, _len_min >> 8, _len_max, \ - _len_max >> 8) + UTIL_IOV_INIT(0x03, LC3_FREQ, _freq, _freq >> 8, \ + 0x02, LC3_DURATION, _duration, \ + 0x02, LC3_CHAN_COUNT, _chan_count, \ + 0x05, LC3_FRAME_LEN, _len_min, _len_min >> 8, \ + _len_max, _len_max >> 8) static const struct capabilities { + const char *name; const char *uuid; uint8_t codec_id; struct iovec data; + struct iovec meta; } caps = { /* A2DP SBC Source: * @@ -1153,8 +1162,10 @@ * Blocks: 4 8 12 16 * Bitpool Range: 2-64 */ - CODEC_CAPABILITIES(A2DP_SOURCE_UUID, A2DP_CODEC_SBC, - CODEC_DATA(0xff, 0xff, 2, 64)), + CODEC_CAPABILITIES("a2dp_src/sbc", A2DP_SOURCE_UUID, A2DP_CODEC_SBC, + UTIL_IOV_INIT(0xff, 0xff, 2, 64), + UTIL_IOV_INIT()), + /* A2DP SBC Sink: * * Channel Modes: Mono DualChannel Stereo JointStereo @@ -1163,65 +1174,63 @@ * Blocks: 4 8 12 16 * Bitpool Range: 2-64 */ - CODEC_CAPABILITIES(A2DP_SINK_UUID, A2DP_CODEC_SBC, - CODEC_DATA(0xff, 0xff, 2, 64)), + CODEC_CAPABILITIES("a2dp_snk/sbc", A2DP_SINK_UUID, A2DP_CODEC_SBC, + UTIL_IOV_INIT(0xff, 0xff, 2, 64), + UTIL_IOV_INIT()), + /* PAC LC3 Sink: * * Frequencies: 8Khz 11Khz 16Khz 22Khz 24Khz 32Khz 44.1Khz 48Khz * Duration: 7.5 ms 10 ms * Channel count: 3 - * Frame length: 30-240 + * Frame length: 26-240 */ - CODEC_CAPABILITIES(PAC_SINK_UUID, LC3_ID, - LC3_DATA(LC3_FREQ_ANY, LC3_DURATION_ANY, - 3u, 30, 240)), + CODEC_CAPABILITIES("pac_snk/lc3", PAC_SINK_UUID, LC3_ID, + LC3_DATA(LC3_FREQ_ANY, LC3_DURATION_ANY, 3u, 26, + 240), + UTIL_IOV_INIT()), + /* PAC LC3 Source: * * Frequencies: 8Khz 11Khz 16Khz 22Khz 24Khz 32Khz 44.1Khz 48Khz * Duration: 7.5 ms 10 ms * Channel count: 3 - * Frame length: 30-240 + * Frame length: 26-240 */ - CODEC_CAPABILITIES(PAC_SOURCE_UUID, LC3_ID, - LC3_DATA(LC3_FREQ_ANY, LC3_DURATION_ANY, - 3u, 30, 240)), + CODEC_CAPABILITIES("pac_src/lc3", PAC_SOURCE_UUID, LC3_ID, + LC3_DATA(LC3_FREQ_ANY, LC3_DURATION_ANY, 3u, 26, + 240), + UTIL_IOV_INIT()), + /* Broadcast LC3 Source: * * Frequencies: 8Khz 11Khz 16Khz 22Khz 24Khz 32Khz 44.1Khz 48Khz * Duration: 7.5 ms 10 ms * Channel count: 3 - * Frame length: 30-240 + * Frame length: 26-240 */ - CODEC_CAPABILITIES(BCAA_SERVICE_UUID, LC3_ID, - LC3_DATA(LC3_FREQ_ANY, LC3_DURATION_ANY, - 3u, 30, 240)), + CODEC_CAPABILITIES("bcaa/lc3", BCAA_SERVICE_UUID, LC3_ID, + LC3_DATA(LC3_FREQ_ANY, LC3_DURATION_ANY, 3u, 26, + 240), + UTIL_IOV_INIT()), /* Broadcast LC3 Sink: * * Frequencies: 8Khz 11Khz 16Khz 22Khz 24Khz 32Khz 44.1Khz 48Khz * Duration: 7.5 ms 10 ms * Channel count: 3 - * Frame length: 30-240 + * Frame length: 26-240 */ - CODEC_CAPABILITIES(BAA_SERVICE_UUID, LC3_ID, - LC3_DATA(LC3_FREQ_ANY, LC3_DURATION_ANY, - 3u, 30, 240)), -}; - -struct codec_qos { - uint32_t interval; - uint8_t framing; - uint8_t phy; - uint16_t sdu; - uint8_t rtn; - uint16_t latency; - uint32_t delay; + CODEC_CAPABILITIES("baa/lc3", BAA_SERVICE_UUID, LC3_ID, + LC3_DATA(LC3_FREQ_ANY, LC3_DURATION_ANY, 3u, 26, + 240), + UTIL_IOV_INIT()), }; struct codec_preset { char *name; const struct iovec data; - const struct codec_qos qos; + struct bt_bap_qos qos; uint8_t target_latency; }; @@ -1240,117 +1249,38 @@ * mono, and 512kb/s for two-channel modes. */ SBC_PRESET("MQ_MONO_44_1", - CODEC_DATA(0x28, 0x15, 2, SBC_BITPOOL_MQ_MONO_44100)), + UTIL_IOV_INIT(0x28, 0x15, 2, SBC_BITPOOL_MQ_MONO_44100)), SBC_PRESET("MQ_MONO_48", - CODEC_DATA(0x18, 0x15, 2, SBC_BITPOOL_MQ_MONO_48000)), + UTIL_IOV_INIT(0x18, 0x15, 2, SBC_BITPOOL_MQ_MONO_48000)), SBC_PRESET("MQ_STEREO_44_1", - CODEC_DATA(0x21, 0x15, 2, SBC_BITPOOL_MQ_JOINT_STEREO_44100)), + UTIL_IOV_INIT(0x21, 0x15, 2, + SBC_BITPOOL_MQ_JOINT_STEREO_44100)), SBC_PRESET("MQ_STEREO_48", - CODEC_DATA(0x11, 0x15, 2, SBC_BITPOOL_MQ_JOINT_STEREO_48000)), + UTIL_IOV_INIT(0x11, 0x15, 2, + SBC_BITPOOL_MQ_JOINT_STEREO_48000)), SBC_PRESET("HQ_MONO_44_1", - CODEC_DATA(0x28, 0x15, 2, SBC_BITPOOL_HQ_MONO_44100)), + UTIL_IOV_INIT(0x28, 0x15, 2, SBC_BITPOOL_HQ_MONO_44100)), SBC_PRESET("HQ_MONO_48", - CODEC_DATA(0x18, 0x15, 2, SBC_BITPOOL_HQ_MONO_48000)), + UTIL_IOV_INIT(0x18, 0x15, 2, SBC_BITPOOL_HQ_MONO_48000)), SBC_PRESET("HQ_STEREO_44_1", - CODEC_DATA(0x21, 0x15, 2, SBC_BITPOOL_HQ_JOINT_STEREO_44100)), + UTIL_IOV_INIT(0x21, 0x15, 2, + SBC_BITPOOL_HQ_JOINT_STEREO_44100)), SBC_PRESET("HQ_STEREO_48", - CODEC_DATA(0x11, 0x15, 2, SBC_BITPOOL_HQ_JOINT_STEREO_48000)), + UTIL_IOV_INIT(0x11, 0x15, 2, + SBC_BITPOOL_HQ_JOINT_STEREO_48000)), /* Higher bitrates not recommended by A2DP spec, it dual channel to * avoid going above 53 bitpool: * * https://habr.com/en/post/456476/ * https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1092 */ - SBC_PRESET("XQ_DUAL_44_1", CODEC_DATA(0x24, 0x15, 2, 43)), - SBC_PRESET("XQ_DUAL_48", CODEC_DATA(0x14, 0x15, 2, 39)), + SBC_PRESET("XQ_DUAL_44_1", UTIL_IOV_INIT(0x24, 0x15, 2, 43)), + SBC_PRESET("XQ_DUAL_48", UTIL_IOV_INIT(0x14, 0x15, 2, 39)), /* Ultra high bitpool that fits in 512 kbps mandatory bitrate */ - SBC_PRESET("UQ_STEREO_44_1", CODEC_DATA(0x21, 0x15, 2, 64)), - SBC_PRESET("UQ_STEREO_48", CODEC_DATA(0x11, 0x15, 2, 58)), + SBC_PRESET("UQ_STEREO_44_1", UTIL_IOV_INIT(0x21, 0x15, 2, 64)), + SBC_PRESET("UQ_STEREO_48", UTIL_IOV_INIT(0x11, 0x15, 2, 58)), }; -#define QOS_CONFIG(_interval, _framing, _phy, _sdu, _rtn, _latency, _delay) \ - { \ - .interval = _interval, \ - .framing = _framing, \ - .phy = _phy, \ - .sdu = _sdu, \ - .rtn = _rtn, \ - .latency = _latency, \ - .delay = _delay, \ - } - -#define QOS_UNFRAMED(_interval, _phy, _sdu, _rtn, _latency, _delay) \ - QOS_CONFIG(_interval, 0x00, _phy, _sdu, _rtn, _latency, _delay) - -#define QOS_FRAMED(_interval, _phy, _sdu, _rtn, _latency, _delay) \ - QOS_CONFIG(_interval, 0x01, _phy, _sdu, _rtn, _latency, _delay) - -#define QOS_UNFRAMED_1M(_interval, _sdu, _rtn, _latency, _delay) \ - QOS_UNFRAMED(_interval, 0x01, _sdu, _rtn, _latency, _delay) \ - -#define QOS_FRAMED_1M(_interval, _sdu, _rtn, _latency, _delay) \ - QOS_FRAMED(_interval, 0x01, _sdu, _rtn, _latency, _delay) \ - -#define QOS_UNFRAMED_2M(_interval, _sdu, _rtn, _latency, _delay) \ - QOS_UNFRAMED(_interval, 0x02, _sdu, _rtn, _latency, _delay) \ - -#define QOS_FRAMED_2M(_interval, _sdu, _rtn, _latency, _delay) \ - QOS_FRAMED(_interval, 0x02, _sdu, _rtn, _latency, _delay) \ - -#define LC3_7_5_UNFRAMED(_sdu, _rtn, _latency, _delay) \ - QOS_UNFRAMED(7500u, 0x02, _sdu, _rtn, _latency, _delay) - -#define LC3_7_5_FRAMED(_sdu, _rtn, _latency, _delay) \ - QOS_FRAMED(7500u, 0x02, _sdu, _rtn, _latency, _delay) - -#define LC3_10_UNFRAMED(_sdu, _rtn, _latency, _delay) \ - QOS_UNFRAMED_2M(10000u, _sdu, _rtn, _latency, _delay) - -#define LC3_10_FRAMED(_sdu, _rtn, _latency, _delay) \ - QOS_FRAMED_2M(10000u, _sdu, _rtn, _latency, _delay) - -#define LC3_PRESET_DATA(_freq, _duration, _len) \ - CODEC_DATA(0x02, LC3_CONFIG_FREQ, _freq, \ - 0x02, LC3_CONFIG_DURATION, _duration, \ - 0x03, LC3_CONFIG_FRAME_LEN, _len, _len >> 8) - -#define LC3_PRESET_DATA_ALL(_freq, _duration, _alloc, _len) \ - CODEC_DATA(0x02, LC3_CONFIG_FREQ, _freq, \ - 0x02, LC3_CONFIG_DURATION, _duration, \ - 0x05, LC3_CONFIG_CHAN_ALLOC, _alloc, _alloc >> 8, \ - _alloc >> 16, _alloc >> 24, \ - 0x03, LC3_CONFIG_FRAME_LEN, _len, _len >> 8) - -#define LC3_PRESET_8KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_8KHZ, _duration, _len) - -#define LC3_PRESET_11KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_11KHZ, _duration, _len) - -#define LC3_PRESET_16KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_16KHZ, _duration, _len) - -#define LC3_PRESET_22KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_22KHZ, _duration, _len) - -#define LC3_PRESET_24KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_24KHZ, _duration, _len) - -#define LC3_PRESET_32KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_32KHZ, _duration, _len) - -#define LC3_PRESET_32KHZ_ALL(_duration, _len, _alloc) \ - LC3_PRESET_DATA_ALL(LC3_CONFIG_FREQ_48KHZ, _duration, _alloc, _len) - -#define LC3_PRESET_44KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_44KHZ, _duration, _len) - -#define LC3_PRESET_48KHZ(_duration, _len) \ - LC3_PRESET_DATA(LC3_CONFIG_FREQ_48KHZ, _duration, _len) - -#define LC3_PRESET_48KHZ_ALL(_duration, _len, _alloc) \ - LC3_PRESET_DATA_ALL(LC3_CONFIG_FREQ_48KHZ, _duration, _alloc, _len) - #define LC3_PRESET_LL(_name, _data, _qos) \ { \ .name = _name, \ @@ -1375,166 +1305,115 @@ .target_latency = 0x03, \ } -static struct codec_preset lc3_presets = { +#define LC3_PRESET_B(_name, _data, _qos) \ + { \ + .name = _name, \ + .data = _data, \ + .qos = _qos, \ + .target_latency = 0x00, \ + } + +static struct codec_preset lc3_ucast_presets = { /* Table 4.43: QoS configuration support setting requirements */ - LC3_PRESET("8_1_1", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_7_5, 26u), - LC3_7_5_UNFRAMED(26u, 2u, 8u, 40000u)), - LC3_PRESET("8_2_1", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_10, 30u), - LC3_10_UNFRAMED(30u, 2u, 10u, 40000u)), - LC3_PRESET("16_1_1", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), - LC3_7_5_UNFRAMED(30u, 2u, 8u, 40000u)), - LC3_PRESET("16_2_1", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), - LC3_10_UNFRAMED(40u, 2u, 10u, 40000u)), - LC3_PRESET("24_1_1", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_7_5, 45u), - LC3_7_5_UNFRAMED(45u, 2u, 8u, 40000u)), - LC3_PRESET("24_2_1", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_10, 60u), - LC3_10_UNFRAMED(60u, 2u, 10u, 40000u)), - LC3_PRESET("32_1_1", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), - LC3_7_5_UNFRAMED(60u, 2u, 8u, 40000u)), - LC3_PRESET("32_2_1", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), - LC3_10_UNFRAMED(80u, 2u, 10u, 40000u)), - LC3_PRESET("44_1_1", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_7_5, 98u), - QOS_FRAMED_2M(8163u, 98u, 5u, 24u, 40000u)), - LC3_PRESET("44_2_1", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_10, 130u), - QOS_FRAMED_2M(10884u, 130u, 5u, 31u, 40000u)), - LC3_PRESET("48_1_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), - LC3_7_5_UNFRAMED(75u, 5u, 15u, 40000u)), - LC3_PRESET("48_2_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), - LC3_10_UNFRAMED(100u, 5u, 20u, 40000u)), - LC3_PRESET("48_3_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), - LC3_7_5_UNFRAMED(90u, 5u, 15u, 40000u)), - LC3_PRESET("48_4_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), - LC3_10_UNFRAMED(120u, 5u, 20u, 40000u)), - LC3_PRESET("48_5_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 117u), - LC3_7_5_UNFRAMED(117u, 5u, 15u, 40000u)), - LC3_PRESET("48_6_1", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 155u), - LC3_10_UNFRAMED(155u, 5u, 20u, 40000u)), + LC3_PRESET("8_1_1", LC3_CONFIG_8_1, LC3_QOS_8_1_1), + LC3_PRESET("8_2_1", LC3_CONFIG_8_2, LC3_QOS_8_2_1), + LC3_PRESET("16_1_1", LC3_CONFIG_16_1, LC3_QOS_16_1_1), + LC3_PRESET("16_2_1", LC3_CONFIG_16_2, LC3_QOS_16_2_1), + LC3_PRESET("24_1_1", LC3_CONFIG_24_1, LC3_QOS_24_1_1), + LC3_PRESET("24_2_1", LC3_CONFIG_24_2, LC3_QOS_24_2_1), + LC3_PRESET("32_1_1", LC3_CONFIG_32_1, LC3_QOS_32_1_1), + LC3_PRESET("32_2_1", LC3_CONFIG_32_2, LC3_QOS_32_1_1), + LC3_PRESET("44_1_1", LC3_CONFIG_44_1, LC3_QOS_44_1_1), + LC3_PRESET("44_2_1", LC3_CONFIG_44_2, LC3_QOS_44_2_1), + LC3_PRESET("48_1_1", LC3_CONFIG_48_1, LC3_QOS_48_1_1), + LC3_PRESET("48_2_1", LC3_CONFIG_48_2, LC3_QOS_48_2_1), + LC3_PRESET("48_3_1", LC3_CONFIG_48_3, LC3_QOS_48_3_1), + LC3_PRESET("48_4_1", LC3_CONFIG_48_4, LC3_QOS_48_4_1), + LC3_PRESET("48_5_1", LC3_CONFIG_48_5, LC3_QOS_48_5_1), + LC3_PRESET("48_6_1", LC3_CONFIG_48_6, LC3_QOS_48_6_1), /* QoS Configuration settings for high reliability audio data */ - LC3_PRESET_HR("8_1_2", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_7_5, 26u), - LC3_7_5_UNFRAMED(26u, 13u, 75u, 40000u)), - LC3_PRESET_HR("8_2_2", - LC3_PRESET_8KHZ(LC3_CONFIG_DURATION_10, 30u), - LC3_10_UNFRAMED(30u, 13u, 95u, 40000u)), - LC3_PRESET_HR("16_1_2", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), - LC3_7_5_UNFRAMED(30u, 13u, 75u, 40000u)), - LC3_PRESET_HR("16_2_2", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), - LC3_10_UNFRAMED(40u, 13u, 95u, 40000u)), - LC3_PRESET_HR("24_1_2", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_7_5, 45u), - LC3_7_5_UNFRAMED(45u, 13u, 75u, 40000u)), - LC3_PRESET_HR("24_2_2", - LC3_PRESET_24KHZ(LC3_CONFIG_DURATION_10, 60u), - LC3_10_UNFRAMED(60u, 13u, 95u, 40000u)), - LC3_PRESET_HR("32_1_2", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), - LC3_7_5_UNFRAMED(60u, 13u, 75u, 40000u)), - LC3_PRESET_HR("32_2_2", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), - LC3_10_UNFRAMED(80u, 13u, 95u, 40000u)), - LC3_PRESET_HR("44_1_2", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_7_5, 98u), - QOS_FRAMED_2M(8163u, 98u, 13u, 80u, 40000u)), - LC3_PRESET_HR("44_2_2", - LC3_PRESET_44KHZ(LC3_CONFIG_DURATION_10, 130u), - QOS_FRAMED_2M(10884u, 130u, 13u, 85u, 40000u)), - LC3_PRESET_HR("48_1_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), - LC3_7_5_UNFRAMED(75u, 13u, 75u, 40000u)), - LC3_PRESET_HR("48_2_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), - LC3_10_UNFRAMED(100u, 13u, 95u, 40000u)), - LC3_PRESET_HR("48_3_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), - LC3_7_5_UNFRAMED(90u, 13u, 75u, 40000u)), - LC3_PRESET_HR("48_4_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), - LC3_10_UNFRAMED(120u, 13u, 100u, 40000u)), - LC3_PRESET_HR("48_5_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 117u), - LC3_7_5_UNFRAMED(117u, 13u, 75u, 40000u)), - LC3_PRESET_HR("48_6_2", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 155u), - LC3_10_UNFRAMED(155u, 13u, 100u, 40000u)), + LC3_PRESET_HR("8_1_2", LC3_CONFIG_8_1, LC3_QOS_8_1_2), + LC3_PRESET_HR("8_2_2", LC3_CONFIG_8_2, LC3_QOS_8_2_2), + LC3_PRESET_HR("16_1_2", LC3_CONFIG_16_1, LC3_QOS_16_1_2), + LC3_PRESET_HR("16_2_2", LC3_CONFIG_16_2, LC3_QOS_16_2_2), + LC3_PRESET_HR("24_1_2", LC3_CONFIG_24_1, LC3_QOS_24_1_2), + LC3_PRESET_HR("24_2_2", LC3_CONFIG_24_2, LC3_QOS_24_2_2), + LC3_PRESET_HR("32_1_2", LC3_CONFIG_32_1, LC3_QOS_32_1_2), + LC3_PRESET_HR("32_2_2", LC3_CONFIG_32_2, LC3_QOS_32_2_2), + LC3_PRESET_HR("44_1_2", LC3_CONFIG_44_1, LC3_QOS_44_1_2), + LC3_PRESET_HR("44_2_2", LC3_CONFIG_44_2, LC3_QOS_44_2_2), + LC3_PRESET_HR("48_1_2", LC3_CONFIG_48_1, LC3_QOS_48_1_2), + LC3_PRESET_HR("48_2_2", LC3_CONFIG_48_2, LC3_QOS_48_2_2), + LC3_PRESET_HR("48_3_2", LC3_CONFIG_48_3, LC3_QOS_48_3_2), + LC3_PRESET_HR("48_4_2", LC3_CONFIG_48_4, LC3_QOS_48_4_2), + LC3_PRESET_HR("48_5_2", LC3_CONFIG_48_5, LC3_QOS_48_5_2), + LC3_PRESET_HR("48_6_2", LC3_CONFIG_48_6, LC3_QOS_48_6_2), /* QoS configuration support setting requirements for the UGG and UGT */ - LC3_PRESET_LL("16_1_gs", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_7_5, 30u), - LC3_7_5_UNFRAMED(30u, 1u, 15u, 60000u)), - LC3_PRESET_LL("16_2_gs", - LC3_PRESET_16KHZ(LC3_CONFIG_DURATION_10, 40u), - LC3_10_UNFRAMED(40u, 1u, 20u, 60000u)), - LC3_PRESET_LL("32_1_gs", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), - LC3_7_5_UNFRAMED(60u, 1u, 15u, 60000u)), - LC3_PRESET_LL("32_2_gs", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), - LC3_10_UNFRAMED(80u, 1u, 20u, 60000u)), - LC3_PRESET_LL("48_1_gs", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), - LC3_7_5_UNFRAMED(75u, 1u, 15u, 60000u)), - LC3_PRESET_LL("48_2_gs", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), - LC3_10_UNFRAMED(100u, 1u, 20u, 60000u)), - LC3_PRESET_LL("32_1_gr", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_7_5, 60u), - LC3_7_5_UNFRAMED(60u, 1u, 15u, 10000u)), - LC3_PRESET_LL("32_2_gr", - LC3_PRESET_32KHZ(LC3_CONFIG_DURATION_10, 80u), - LC3_10_UNFRAMED(80u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_1_gr", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 75u), - LC3_7_5_UNFRAMED(75u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_2_gr", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 100u), - LC3_10_UNFRAMED(100u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_3_gr", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_7_5, 90u), - LC3_7_5_UNFRAMED(90u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_4_gr", - LC3_PRESET_48KHZ(LC3_CONFIG_DURATION_10, 120u), - LC3_10_UNFRAMED(120u, 1u, 20u, 10000u)), - LC3_PRESET_LL("32_1_gr_l+r", - LC3_PRESET_32KHZ_ALL(LC3_CONFIG_DURATION_7_5, 60u, - 0x00000003), - LC3_7_5_UNFRAMED(2 * 60u, 1u, 15u, 10000u)), - LC3_PRESET_LL("32_2_gr_l+r", - LC3_PRESET_32KHZ_ALL(LC3_CONFIG_DURATION_10, 80u, - 0x00000003), - LC3_10_UNFRAMED(2 * 80u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_1_gr_l+r", - LC3_PRESET_48KHZ_ALL(LC3_CONFIG_DURATION_7_5, 75u, - 0x00000003), - LC3_7_5_UNFRAMED(2 * 75u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_2_gr_l+r", - LC3_PRESET_48KHZ_ALL(LC3_CONFIG_DURATION_10, 100u, - 0x00000003), - LC3_10_UNFRAMED(2 * 100u, 1u, 20u, 10000u)), - LC3_PRESET_LL("48_3_gr_l+r", - LC3_PRESET_48KHZ_ALL(LC3_CONFIG_DURATION_7_5, 90u, - 0x00000003), - LC3_7_5_UNFRAMED(2 * 90u, 1u, 15u, 10000u)), - LC3_PRESET_LL("48_4_gr_l+r", - LC3_PRESET_48KHZ_ALL(LC3_CONFIG_DURATION_10, 120u, - 0x00000003), - LC3_10_UNFRAMED(2 * 120u, 1u, 20u, 10000u)), + LC3_PRESET_LL("16_1_gs", LC3_CONFIG_16_1, LC3_QOS_16_1_GS), + LC3_PRESET_LL("16_2_gs", LC3_CONFIG_16_2, LC3_QOS_16_2_GS), + LC3_PRESET_LL("32_1_gs", LC3_CONFIG_32_1, LC3_QOS_32_1_GS), + LC3_PRESET_LL("32_2_gs", LC3_CONFIG_32_2, LC3_QOS_32_2_GS), + LC3_PRESET_LL("48_1_gs", LC3_CONFIG_48_1, LC3_QOS_48_1_GS), + LC3_PRESET_LL("48_2_gs", LC3_CONFIG_48_2, LC3_QOS_48_2_GS), + LC3_PRESET_LL("32_1_gr", LC3_CONFIG_32_1, LC3_QOS_32_1_GR), + LC3_PRESET_LL("32_2_gr", LC3_CONFIG_32_2, LC3_QOS_32_2_GR), + LC3_PRESET_LL("48_1_gr", LC3_CONFIG_48_1, LC3_QOS_48_1_GR), + LC3_PRESET_LL("48_2_gr", LC3_CONFIG_48_2, LC3_QOS_48_2_GR), + LC3_PRESET_LL("48_3_gr", LC3_CONFIG_48_3, LC3_QOS_48_3_GR), + LC3_PRESET_LL("48_4_gr", LC3_CONFIG_48_4, LC3_QOS_48_4_GR), + LC3_PRESET_LL("32_1_gr_l+r", LC3_CONFIG_32_1_AC(2), + LC3_QOS_32_1_GR_AC(2)), + LC3_PRESET_LL("32_2_gr_l+r", LC3_CONFIG_32_2_AC(2), + LC3_QOS_32_2_GR_AC(2)), + LC3_PRESET_LL("48_1_gr_l+r", LC3_CONFIG_48_1_AC(2), + LC3_QOS_48_1_GR_AC(2)), + LC3_PRESET_LL("48_2_gr_l+r", LC3_CONFIG_48_2_AC(2), + LC3_QOS_48_2_GR_AC(2)), + LC3_PRESET_LL("48_3_gr_l+r", LC3_CONFIG_48_3_AC(2), + LC3_QOS_48_3_GR_AC(2)), + LC3_PRESET_LL("48_4_gr_l+r", LC3_CONFIG_48_4_AC(2), + LC3_QOS_48_4_GR_AC(2)), +}; + +static struct codec_preset lc3_bcast_presets = { + /* Table 6.4: Broadcast Audio Stream configuration support requirements + * for the Broadcast Source and Broadcast Sink + */ + LC3_PRESET_B("8_1_1", LC3_CONFIG_8_1, LC3_QOS_8_1_1_B), + LC3_PRESET_B("8_2_1", LC3_CONFIG_8_2, LC3_QOS_8_2_1_B), + LC3_PRESET_B("16_1_1", LC3_CONFIG_16_1, LC3_QOS_16_1_1_B), + LC3_PRESET_B("16_2_1", LC3_CONFIG_16_2, LC3_QOS_16_2_1_B), + LC3_PRESET_B("24_1_1", LC3_CONFIG_24_1, LC3_QOS_24_1_1_B), + LC3_PRESET_B("24_2_1", LC3_CONFIG_24_2, LC3_QOS_24_2_1_B), + LC3_PRESET_B("32_1_1", LC3_CONFIG_32_1, LC3_QOS_32_1_1_B), + LC3_PRESET_B("32_2_1", LC3_CONFIG_32_2, LC3_QOS_32_2_1_B), + LC3_PRESET_B("44_1_1", LC3_CONFIG_44_1, LC3_QOS_44_1_1_B), + LC3_PRESET_B("44_2_1", LC3_CONFIG_44_2, LC3_QOS_44_2_1_B), + LC3_PRESET_B("48_1_1", LC3_CONFIG_48_1, LC3_QOS_48_1_1_B), + LC3_PRESET_B("48_2_1", LC3_CONFIG_48_2, LC3_QOS_48_2_1_B), + LC3_PRESET_B("48_3_1", LC3_CONFIG_48_3, LC3_QOS_48_3_1_B), + LC3_PRESET_B("48_4_1", LC3_CONFIG_48_4, LC3_QOS_48_4_1_B), + LC3_PRESET_B("48_5_1", LC3_CONFIG_48_5, LC3_QOS_48_5_1_B), + LC3_PRESET_B("48_6_1", LC3_CONFIG_48_6, LC3_QOS_48_6_1_B), + /* Broadcast Audio Stream configuration settings for high-reliability + * audio data. + */ + LC3_PRESET_B("8_1_2", LC3_CONFIG_8_1, LC3_QOS_8_1_1_B), + LC3_PRESET_B("8_2_2", LC3_CONFIG_8_2, LC3_QOS_8_2_2_B), + LC3_PRESET_B("16_1_2", LC3_CONFIG_16_1, LC3_QOS_16_1_2_B), + LC3_PRESET_B("16_2_2", LC3_CONFIG_16_2, LC3_QOS_16_2_2_B), + LC3_PRESET_B("24_1_2", LC3_CONFIG_24_1, LC3_QOS_24_1_2_B), + LC3_PRESET_B("24_2_2", LC3_CONFIG_24_2, LC3_QOS_24_2_2_B), + LC3_PRESET_B("32_1_2", LC3_CONFIG_32_1, LC3_QOS_32_1_2_B), + LC3_PRESET_B("32_2_2", LC3_CONFIG_32_2, LC3_QOS_32_2_2_B), + LC3_PRESET_B("44_1_2", LC3_CONFIG_44_1, LC3_QOS_44_1_2_B), + LC3_PRESET_B("44_2_2", LC3_CONFIG_44_2, LC3_QOS_44_2_2_B), + LC3_PRESET_B("48_1_2", LC3_CONFIG_48_1, LC3_QOS_48_1_2_B), + LC3_PRESET_B("48_2_2", LC3_CONFIG_48_2, LC3_QOS_48_2_2_B), + LC3_PRESET_B("48_3_2", LC3_CONFIG_48_3, LC3_QOS_48_3_2_B), + LC3_PRESET_B("48_4_2", LC3_CONFIG_48_4, LC3_QOS_48_4_2_B), + LC3_PRESET_B("48_5_2", LC3_CONFIG_48_5, LC3_QOS_48_5_2_B), + LC3_PRESET_B("48_6_2", LC3_CONFIG_48_6, LC3_QOS_48_6_2_B), }; static void print_ltv(const char *str, void *user_data) @@ -1587,10 +1466,10 @@ } presets = { PRESET(A2DP_SOURCE_UUID, A2DP_CODEC_SBC, sbc_presets, 6), PRESET(A2DP_SINK_UUID, A2DP_CODEC_SBC, sbc_presets, 6), - PRESET(PAC_SINK_UUID, LC3_ID, lc3_presets, 3), - PRESET(PAC_SOURCE_UUID, LC3_ID, lc3_presets, 3), - PRESET(BCAA_SERVICE_UUID, LC3_ID, lc3_presets, 3), - PRESET(BAA_SERVICE_UUID, LC3_ID, lc3_presets, 3), + PRESET(PAC_SINK_UUID, LC3_ID, lc3_ucast_presets, 3), + PRESET(PAC_SOURCE_UUID, LC3_ID, lc3_ucast_presets, 3), + PRESET(BCAA_SERVICE_UUID, LC3_ID, lc3_bcast_presets, 3), + PRESET(BAA_SERVICE_UUID, LC3_ID, lc3_bcast_presets, 3), }; static void parse_vendor_codec(const char *codec, uint16_t *vid, uint16_t *cid) @@ -1857,37 +1736,14 @@ struct endpoint_config { GDBusProxy *proxy; struct endpoint *ep; - struct iovec *caps; - struct iovec *meta; + struct iovec *caps; /* Codec Specific Configuration LTVs */ + struct iovec *meta; /* Metadata LTVs*/ uint8_t target_latency; - const struct codec_qos *qos; + struct bt_bap_qos qos; /* BAP QOS configuration parameters */ }; -#define BCODE {0x01, 0x02, 0x68, 0x05, 0x53, 0xf1, 0x41, 0x5a, \ - 0xa2, 0x65, 0xbb, 0xaf, 0xc6, 0xea, 0x03, 0xb8} - -static struct bt_iso_qos bcast_qos = { - .bcast = { - .big = BT_ISO_QOS_BIG_UNSET, - .bis = BT_ISO_QOS_BIS_UNSET, - .sync_factor = 24, - .packing = 0x00, - .framing = 0x00, - .encryption = 0x00, - .bcode = BCODE, - .options = 0x00, - .skip = 0x0000, - .sync_timeout = 0x4000, - .sync_cte_type = 0x00, - .mse = 0x00, - .timeout = 0x4000, - } -}; - -static void append_io_qos(DBusMessageIter *iter, struct endpoint_config *cfg) +static void append_io_qos(DBusMessageIter *iter, struct bt_bap_io_qos *qos) { - struct codec_qos *qos = (void *)cfg->qos; - bt_shell_printf("Interval %u\n", qos->interval); g_dbus_dict_append_entry(iter, "Interval", DBUS_TYPE_UINT32, @@ -1897,24 +1753,24 @@ g_dbus_dict_append_entry(iter, "PHY", DBUS_TYPE_BYTE, &qos->phy); - bt_shell_printf("SDU %u\n", cfg->qos->sdu); + bt_shell_printf("SDU %u\n", qos->sdu); g_dbus_dict_append_entry(iter, "SDU", DBUS_TYPE_UINT16, &qos->sdu); bt_shell_printf("Retransmissions %u\n", qos->rtn); - g_dbus_dict_append_entry(iter, "Retransmissions", - DBUS_TYPE_BYTE, &qos->rtn); + g_dbus_dict_append_entry(iter, "Retransmissions", DBUS_TYPE_BYTE, + &qos->rtn); bt_shell_printf("Latency %u\n", qos->latency); - g_dbus_dict_append_entry(iter, "Latency", - DBUS_TYPE_UINT16, &qos->latency); + g_dbus_dict_append_entry(iter, "Latency", DBUS_TYPE_UINT16, + &qos->latency); } static void append_ucast_qos(DBusMessageIter *iter, struct endpoint_config *cfg) { - struct codec_qos *qos = (void *)cfg->qos; + struct bt_bap_ucast_qos *qos = &cfg->qos.ucast; if (cfg->ep->iso_group != BT_ISO_QOS_GROUP_UNSET) { bt_shell_printf("CIG 0x%2.2x\n", cfg->ep->iso_group); @@ -1931,7 +1787,7 @@ bt_shell_printf("Framing 0x%02x\n", qos->framing); g_dbus_dict_append_entry(iter, "Framing", DBUS_TYPE_BYTE, - &qos->framing); + &qos->framing); bt_shell_printf("PresentationDelay %u\n", qos->delay); @@ -1939,69 +1795,73 @@ DBUS_TYPE_UINT32, &qos->delay); if (cfg->target_latency) { - bt_shell_printf("TargetLatency 0x%02x\n", cfg->target_latency); - g_dbus_dict_append_entry(iter, "TargetLatency", - DBUS_TYPE_BYTE, &cfg->target_latency); + bt_shell_printf("TargetLatency 0x%02x\n", qos->target_latency); + g_dbus_dict_append_entry(iter, "TargetLatency", DBUS_TYPE_BYTE, + &qos->target_latency); } - append_io_qos(iter, cfg); + append_io_qos(iter, &qos->io_qos); } static void append_bcast_qos(DBusMessageIter *iter, struct endpoint_config *cfg) { - if (bcast_qos.bcast.big != BT_ISO_QOS_BIG_UNSET) { - bt_shell_printf("BIG 0x%2.2x\n", bcast_qos.bcast.big); + struct bt_bap_bcast_qos *qos = &cfg->qos.bcast; + + if (cfg->ep->iso_group != BT_ISO_QOS_BIG_UNSET) { + bt_shell_printf("BIG 0x%2.2x\n", cfg->ep->iso_group); g_dbus_dict_append_entry(iter, "BIG", DBUS_TYPE_BYTE, - &bcast_qos.bcast.big); + &cfg->ep->iso_group); } - if (bcast_qos.bcast.bis != BT_ISO_QOS_BIS_UNSET) { - bt_shell_printf("BIS 0x%2.2x\n", bcast_qos.bcast.bis); + if (cfg->ep->iso_stream != BT_ISO_QOS_BIS_UNSET) { + bt_shell_printf("BIS 0x%2.2x\n", cfg->ep->iso_stream); g_dbus_dict_append_entry(iter, "BIS", DBUS_TYPE_BYTE, - &bcast_qos.bcast.bis); + &cfg->ep->iso_stream); } - bt_shell_printf("Framing 0x%02x\n", bcast_qos.bcast.framing); - - g_dbus_dict_append_entry(iter, "Framing", DBUS_TYPE_BYTE, - &bcast_qos.bcast.framing); - - bt_shell_printf("SyncFactor %u\n", bcast_qos.bcast.sync_factor); - - g_dbus_dict_append_entry(iter, "SyncFactor", DBUS_TYPE_BYTE, - &bcast_qos.bcast.sync_factor); - - bt_shell_printf("Options %u\n", bcast_qos.bcast.options); - - g_dbus_dict_append_entry(iter, "Options", DBUS_TYPE_BYTE, - &bcast_qos.bcast.options); - - bt_shell_printf("Skip %u\n", bcast_qos.bcast.skip); - - g_dbus_dict_append_entry(iter, "Skip", DBUS_TYPE_UINT16, - &bcast_qos.bcast.skip); - - bt_shell_printf("SyncTimeout %u\n", bcast_qos.bcast.sync_timeout); - - g_dbus_dict_append_entry(iter, "SyncTimeout", DBUS_TYPE_UINT16, - &bcast_qos.bcast.sync_timeout); + if (qos->sync_factor) { + bt_shell_printf("SyncFactor %u\n", qos->sync_factor); + g_dbus_dict_append_entry(iter, "SyncFactor", DBUS_TYPE_BYTE, + &qos->sync_factor); + } - bt_shell_printf("SyncCteType %u\n", bcast_qos.bcast.sync_cte_type); + if (qos->options) { + bt_shell_printf("Options %u\n", qos->options); + g_dbus_dict_append_entry(iter, "Options", DBUS_TYPE_BYTE, + &qos->options); + } - g_dbus_dict_append_entry(iter, "SyncType", DBUS_TYPE_BYTE, - &bcast_qos.bcast.sync_cte_type); + if (qos->skip) { + bt_shell_printf("Skip %u\n", qos->skip); + g_dbus_dict_append_entry(iter, "Skip", DBUS_TYPE_UINT16, + &qos->skip); + } - bt_shell_printf("MSE %u\n", bcast_qos.bcast.mse); + if (qos->sync_timeout) { + bt_shell_printf("SyncTimeout %u\n", qos->sync_timeout); + g_dbus_dict_append_entry(iter, "SyncTimeout", DBUS_TYPE_UINT16, + &qos->sync_timeout); + } - g_dbus_dict_append_entry(iter, "MSE", DBUS_TYPE_BYTE, - &bcast_qos.bcast.mse); + if (qos->sync_cte_type) { + bt_shell_printf("SyncCteType %u\n", qos->sync_cte_type); + g_dbus_dict_append_entry(iter, "SyncCteType", DBUS_TYPE_BYTE, + &qos->sync_cte_type); + } - bt_shell_printf("Timeout %u\n", bcast_qos.bcast.timeout); + if (qos->mse) { + bt_shell_printf("MSE %u\n", qos->mse); + g_dbus_dict_append_entry(iter, "MSE", DBUS_TYPE_BYTE, + &qos->mse); + } - g_dbus_dict_append_entry(iter, "Timeout", DBUS_TYPE_UINT16, - &bcast_qos.bcast.timeout); + if (qos->timeout) { + bt_shell_printf("Timeout %u\n", qos->timeout); + g_dbus_dict_append_entry(iter, "Timeout", DBUS_TYPE_UINT16, + &qos->timeout); + } - if (cfg->ep->bcode) { + if (cfg->ep->bcode->iov_len != 0) { const char *key = "BCode"; bt_shell_printf("BCode:\n"); @@ -2014,18 +1874,25 @@ cfg->ep->bcode->iov_len); } - append_io_qos(iter, cfg); + bt_shell_printf("Framing 0x%02x\n", qos->framing); + + g_dbus_dict_append_entry(iter, "Framing", DBUS_TYPE_BYTE, + &qos->framing); + + bt_shell_printf("PresentationDelay %u\n", qos->delay); + + g_dbus_dict_append_entry(iter, "PresentationDelay", + DBUS_TYPE_UINT32, &qos->delay); + + /* Add BAP codec QOS configuration */ + append_io_qos(iter, &qos->io_qos); } static void append_qos(DBusMessageIter *iter, struct endpoint_config *cfg) { DBusMessageIter entry, var, dict; - struct codec_qos *qos = (void *)cfg->qos; const char *key = "QoS"; - if (!qos) - return; - dbus_message_iter_open_container(iter, DBUS_TYPE_DICT_ENTRY, NULL, &entry); @@ -2087,21 +1954,35 @@ dbus_message_iter_close_container(iter, &dict); } -static struct iovec *iov_append(struct iovec **iov, const void *data, - size_t len) +static int parse_chan_alloc(DBusMessageIter *iter, uint32_t *location, + uint8_t *channels) { - if (!*iov) - *iov = new0(struct iovec, 1); - - if (!((*iov)->iov_base)) - (*iov)->iov_base = new0(uint8_t, UINT8_MAX); + while (dbus_message_iter_get_arg_type(iter) == DBUS_TYPE_DICT_ENTRY) { + const char *key; + DBusMessageIter value, entry; + int var; + + dbus_message_iter_recurse(iter, &entry); + dbus_message_iter_get_basic(&entry, &key); + + dbus_message_iter_next(&entry); + dbus_message_iter_recurse(&entry, &value); + + var = dbus_message_iter_get_arg_type(&value); + + if (!strcasecmp(key, "ChannelAllocation")) { + if (var != DBUS_TYPE_UINT32) + return -EINVAL; + dbus_message_iter_get_basic(&value, location); + if (*channels) + *channels = __builtin_popcount(*location); + return 0; + } - if (data && len) { - memcpy((*iov)->iov_base + (*iov)->iov_len, data, len); - (*iov)->iov_len += len; + dbus_message_iter_next(iter); } - return *iov; + return -EINVAL; } static DBusMessage *endpoint_select_properties_reply(struct endpoint *ep, @@ -2109,8 +1990,11 @@ struct codec_preset *preset) { DBusMessage *reply; - DBusMessageIter iter; + DBusMessageIter iter, props; struct endpoint_config *cfg; + struct bt_bap_io_qos *qos; + uint32_t location = 0; + uint8_t channels = 1; if (!preset) return NULL; @@ -2123,16 +2007,39 @@ cfg->ep = ep; /* Copy capabilities */ - iov_append(&cfg->caps, preset->data.iov_base, preset->data.iov_len); + cfg->caps = util_iov_dup(&preset->data, 1); cfg->target_latency = preset->target_latency; + dbus_message_iter_init(msg, &iter); + dbus_message_iter_recurse(&iter, &props); + + if (!parse_chan_alloc(&props, &location, &channels)) { + uint8_t chan_alloc_ltv = { + 0x05, LC3_CONFIG_CHAN_ALLOC, location & 0xff, + location >> 8, location >> 16, location >> 24 + }; + + util_iov_append(cfg->caps, &chan_alloc_ltv, + sizeof(chan_alloc_ltv)); + } + /* Copy metadata */ - if (ep->meta) - iov_append(&cfg->meta, ep->meta->iov_base, ep->meta->iov_len); + cfg->meta = util_iov_dup(ep->meta, 1); - if (preset->qos.phy) + if (ep->broadcast) + qos = &preset->qos.bcast.io_qos; + else + qos = &preset->qos.ucast.io_qos; + + if (qos->phy) { /* Set QoS parameters */ - cfg->qos = &preset->qos; + cfg->qos = preset->qos; + /* Adjust the SDU size based on the number of + * locations/channels that is being requested. + */ + if (channels > 1) + qos->sdu *= channels; + } dbus_message_iter_init_append(reply, &iter); @@ -2247,40 +2154,605 @@ return NULL; } -static void print_capabilities(GDBusProxy *proxy) +static void print_aptx_common(a2dp_aptx_t *aptx) { - DBusMessageIter iter, subiter; - uint8_t codec; - uint8_t *data; - int len; + bt_shell_printf("\n\t\tFrequencies: "); + if (aptx->frequency & APTX_SAMPLING_FREQ_16000) + bt_shell_printf("16kHz "); + if (aptx->frequency & APTX_SAMPLING_FREQ_32000) + bt_shell_printf("32kHz "); + if (aptx->frequency & APTX_SAMPLING_FREQ_44100) + bt_shell_printf("44.1kHz "); + if (aptx->frequency & APTX_SAMPLING_FREQ_48000) + bt_shell_printf("48kHz "); + + bt_shell_printf("\n\t\tChannel modes: "); + if (aptx->channel_mode & APTX_CHANNEL_MODE_MONO) + bt_shell_printf("Mono "); + if (aptx->channel_mode & APTX_CHANNEL_MODE_STEREO) + bt_shell_printf("Stereo "); +} - if (!g_dbus_proxy_get_property(proxy, "Codec", &iter)) +static void print_aptx(a2dp_aptx_t *aptx, uint8_t size) +{ + bt_shell_printf("\t\tVendor Specific Value (aptX)"); + + if (size < sizeof(*aptx)) { + bt_shell_printf(" (broken)\n"); return; + } - dbus_message_iter_get_basic(&iter, &codec); + print_aptx_common(aptx); + + bt_shell_printf("\n"); +} + +static void print_faststream(a2dp_faststream_t *faststream, uint8_t size) +{ + bt_shell_printf("\t\tVendor Specific Value (FastStream)"); + + if (size < sizeof(*faststream)) { + bt_shell_printf(" (broken)\n"); + return; + } + + bt_shell_printf("\n\t\tDirections: "); + if (faststream->direction & FASTSTREAM_DIRECTION_SINK) + bt_shell_printf("sink "); + if (faststream->direction & FASTSTREAM_DIRECTION_SOURCE) + bt_shell_printf("source "); + + if (faststream->direction & FASTSTREAM_DIRECTION_SINK) { + bt_shell_printf("\n\t\tSink Frequencies: "); + if (faststream->sink_frequency & + FASTSTREAM_SINK_SAMPLING_FREQ_44100) + bt_shell_printf("44.1kHz "); + if (faststream->sink_frequency & + FASTSTREAM_SINK_SAMPLING_FREQ_48000) + bt_shell_printf("48kHz "); + } + + if (faststream->direction & FASTSTREAM_DIRECTION_SOURCE) { + bt_shell_printf("\n\t\tSource Frequencies: "); + if (faststream->source_frequency & + FASTSTREAM_SOURCE_SAMPLING_FREQ_16000) + bt_shell_printf("16kHz "); + } + + bt_shell_printf("\n"); +} + +static void print_aptx_ll(a2dp_aptx_ll_t *aptx_ll, uint8_t size) +{ + a2dp_aptx_ll_new_caps_t *aptx_ll_new; + + bt_shell_printf("\t\tVendor Specific Value (aptX Low Latency)"); + + if (size < sizeof(*aptx_ll)) { + bt_shell_printf(" (broken)\n"); + return; + } + + print_aptx_common(&aptx_ll->aptx); + + bt_shell_printf("\n\tBidirectional link: %s", + aptx_ll->bidirect_link ? "Yes" : "No"); + + aptx_ll_new = &aptx_ll->new_caps0; + if (aptx_ll->has_new_caps && + size >= sizeof(*aptx_ll) + sizeof(*aptx_ll_new)) { + bt_shell_printf("\n\tTarget codec buffer level: %u", + (unsigned int)aptx_ll_new->target_level2 | + ((unsigned int)(aptx_ll_new->target_level1) << 8)); + bt_shell_printf("\n\tInitial codec buffer level: %u", + (unsigned int)aptx_ll_new->initial_level2 | + ((unsigned int)(aptx_ll_new->initial_level1) << 8)); + bt_shell_printf("\n\tSRA max rate: %g", + aptx_ll_new->sra_max_rate / 10000.0); + bt_shell_printf("\n\tSRA averaging time: %us", + (unsigned int)aptx_ll_new->sra_avg_time); + bt_shell_printf("\n\tGood working codec buffer level: %u", + (unsigned int)aptx_ll_new->good_working_level2 | + ((unsigned int)(aptx_ll_new->good_working_level1) << 8) + ); + } + + bt_shell_printf("\n"); +} + +static void print_aptx_hd(a2dp_aptx_hd_t *aptx_hd, uint8_t size) +{ + bt_shell_printf("\t\tVendor Specific Value (aptX HD)"); + + if (size < sizeof(*aptx_hd)) { + bt_shell_printf(" (broken)\n"); + return; + } + + print_aptx_common(&aptx_hd->aptx); + + bt_shell_printf("\n"); +} + +static void print_ldac(a2dp_ldac_t *ldac, uint8_t size) +{ + bt_shell_printf("\t\tVendor Specific Value (LDAC)"); + + if (size < sizeof(*ldac)) { + bt_shell_printf(" (broken)\n"); + return; + } + + bt_shell_printf("\n\t\tFrequencies: "); + if (ldac->frequency & LDAC_SAMPLING_FREQ_44100) + bt_shell_printf("44.1kHz "); + if (ldac->frequency & LDAC_SAMPLING_FREQ_48000) + bt_shell_printf("48kHz "); + if (ldac->frequency & LDAC_SAMPLING_FREQ_88200) + bt_shell_printf("88.2kHz "); + if (ldac->frequency & LDAC_SAMPLING_FREQ_96000) + bt_shell_printf("96kHz "); + if (ldac->frequency & LDAC_SAMPLING_FREQ_176400) + bt_shell_printf("176.4kHz "); + if (ldac->frequency & LDAC_SAMPLING_FREQ_192000) + bt_shell_printf("192kHz "); + + bt_shell_printf("\n\t\tChannel modes: "); + if (ldac->channel_mode & LDAC_CHANNEL_MODE_MONO) + bt_shell_printf("Mono "); + if (ldac->channel_mode & LDAC_CHANNEL_MODE_DUAL) + bt_shell_printf("Dual "); + if (ldac->channel_mode & LDAC_CHANNEL_MODE_STEREO) + bt_shell_printf("Stereo "); + + bt_shell_printf("\n"); +} + +static void print_opus_g(a2dp_opus_g_t *opus, uint8_t size) +{ + bt_shell_printf("\t\tVendor Specific Value (Opus Google)"); + + if (size < sizeof(*opus)) { + bt_shell_printf(" (broken)\n"); + return; + } + + bt_shell_printf("\n\t\tFrequencies: "); + if (opus->data & OPUS_G_FREQUENCY_48000) + bt_shell_printf("48kHz "); + + bt_shell_printf("\n\t\tChannel modes: "); + if (opus->data & OPUS_G_CHANNELS_MONO) + bt_shell_printf("Mono "); + if (opus->data & OPUS_G_CHANNELS_STEREO) + bt_shell_printf("Stereo "); + if (opus->data & OPUS_G_CHANNELS_DUAL) + bt_shell_printf("Dual Mono "); + + bt_shell_printf("\n\t\tFrame durations: "); + if (opus->data & OPUS_G_DURATION_100) + bt_shell_printf("10 ms "); + if (opus->data & OPUS_G_DURATION_200) + bt_shell_printf("20 ms "); + + bt_shell_printf("\n"); +} + +static void print_vendor(a2dp_vendor_codec_t *vendor, uint8_t size) +{ + uint32_t vendor_id; + uint16_t codec_id; + int i; + + if (size < sizeof(*vendor)) { + bt_shell_printf("\tMedia Codec: Vendor Specific A2DP Codec " + "(broken)"); + return; + } + + vendor_id = A2DP_GET_VENDOR_ID(*vendor); + codec_id = A2DP_GET_CODEC_ID(*vendor); + + bt_shell_printf("\tMedia Codec: Vendor Specific A2DP Codec"); + + bt_shell_printf("\n\tVendor ID 0x%08x", vendor_id); + + bt_shell_printf("\n\tVendor Specific Codec ID 0x%04x", codec_id); + + bt_shell_printf("\n\tVendor Specific Data:"); + for (i = 6; i < size; ++i) + bt_shell_printf(" 0x%.02x", ((unsigned char *)vendor)i); + bt_shell_printf("\n"); + + if (vendor_id == APTX_VENDOR_ID && codec_id == APTX_CODEC_ID) + print_aptx((void *) vendor, size); + else if (vendor_id == FASTSTREAM_VENDOR_ID && + codec_id == FASTSTREAM_CODEC_ID) + print_faststream((void *) vendor, size); + else if (vendor_id == APTX_LL_VENDOR_ID && codec_id == APTX_LL_CODEC_ID) + print_aptx_ll((void *) vendor, size); + else if (vendor_id == APTX_HD_VENDOR_ID && codec_id == APTX_HD_CODEC_ID) + print_aptx_hd((void *) vendor, size); + else if (vendor_id == LDAC_VENDOR_ID && codec_id == LDAC_CODEC_ID) + print_ldac((void *) vendor, size); + else if (vendor_id == OPUS_G_VENDOR_ID && codec_id == OPUS_G_CODEC_ID) + print_opus_g((void *) vendor, size); +} + +static void print_mpeg24(a2dp_aac_t *aac, uint8_t size) +{ + unsigned int freq, bitrate; + + if (size < sizeof(*aac)) { + bt_shell_printf("\tMedia Codec: MPEG24 (broken)\n"); + return; + } + + freq = AAC_GET_FREQUENCY(*aac); + bitrate = AAC_GET_BITRATE(*aac); + + bt_shell_printf("\tMedia Codec: MPEG24\n\tObject Types: "); + + if (aac->object_type & AAC_OBJECT_TYPE_MPEG2_AAC_LC) + bt_shell_printf("MPEG-2 AAC LC "); + if (aac->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_LC) + bt_shell_printf("MPEG-4 AAC LC "); + if (aac->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_LTP) + bt_shell_printf("MPEG-4 AAC LTP "); + if (aac->object_type & AAC_OBJECT_TYPE_MPEG4_AAC_SCA) + bt_shell_printf("MPEG-4 AAC scalable "); + + bt_shell_printf("\n\tFrequencies: "); + if (freq & AAC_SAMPLING_FREQ_8000) + bt_shell_printf("8kHz "); + if (freq & AAC_SAMPLING_FREQ_11025) + bt_shell_printf("11.025kHz "); + if (freq & AAC_SAMPLING_FREQ_12000) + bt_shell_printf("12kHz "); + if (freq & AAC_SAMPLING_FREQ_16000) + bt_shell_printf("16kHz "); + if (freq & AAC_SAMPLING_FREQ_22050) + bt_shell_printf("22.05kHz "); + if (freq & AAC_SAMPLING_FREQ_24000) + bt_shell_printf("24kHz "); + if (freq & AAC_SAMPLING_FREQ_32000) + bt_shell_printf("32kHz "); + if (freq & AAC_SAMPLING_FREQ_44100) + bt_shell_printf("44.1kHz "); + if (freq & AAC_SAMPLING_FREQ_48000) + bt_shell_printf("48kHz "); + if (freq & AAC_SAMPLING_FREQ_64000) + bt_shell_printf("64kHz "); + if (freq & AAC_SAMPLING_FREQ_88200) + bt_shell_printf("88.2kHz "); + if (freq & AAC_SAMPLING_FREQ_96000) + bt_shell_printf("96kHz "); + + bt_shell_printf("\n\tChannels: "); + if (aac->channels & AAC_CHANNELS_1) + bt_shell_printf("1 "); + if (aac->channels & AAC_CHANNELS_2) + bt_shell_printf("2 "); + + bt_shell_printf("\n\tBitrate: %u", bitrate); + + bt_shell_printf("\n\tVBR: %s", aac->vbr ? "Yes\n" : "No\n"); +} + +static void print_mpeg12(a2dp_mpeg_t *mpeg, uint8_t size) +{ + uint16_t bitrate; + + if (size < sizeof(*mpeg)) { + bt_shell_printf("\tMedia Codec: MPEG12 (broken)\n"); + return; + } + + bitrate = MPEG_GET_BITRATE(*mpeg); + + bt_shell_printf("\tMedia Codec: MPEG12\n\tChannel Modes: "); + + if (mpeg->channel_mode & MPEG_CHANNEL_MODE_MONO) + bt_shell_printf("Mono "); + if (mpeg->channel_mode & MPEG_CHANNEL_MODE_DUAL_CHANNEL) + bt_shell_printf("DualChannel "); + if (mpeg->channel_mode & MPEG_CHANNEL_MODE_STEREO) + bt_shell_printf("Stereo "); + if (mpeg->channel_mode & MPEG_CHANNEL_MODE_JOINT_STEREO) + bt_shell_printf("JointStereo"); + + bt_shell_printf("\n\tFrequencies: "); + if (mpeg->frequency & MPEG_SAMPLING_FREQ_16000) + bt_shell_printf("16Khz "); + if (mpeg->frequency & MPEG_SAMPLING_FREQ_22050) + bt_shell_printf("22.05Khz "); + if (mpeg->frequency & MPEG_SAMPLING_FREQ_24000) + bt_shell_printf("24Khz "); + if (mpeg->frequency & MPEG_SAMPLING_FREQ_32000) + bt_shell_printf("32Khz "); + if (mpeg->frequency & MPEG_SAMPLING_FREQ_44100) + bt_shell_printf("44.1Khz "); + if (mpeg->frequency & MPEG_SAMPLING_FREQ_48000) + bt_shell_printf("48Khz "); + + bt_shell_printf("\n\tCRC: %s", mpeg->crc ? "Yes" : "No"); + + bt_shell_printf("\n\tLayer: "); + if (mpeg->layer & MPEG_LAYER_MP1) + bt_shell_printf("1 "); + if (mpeg->layer & MPEG_LAYER_MP2) + bt_shell_printf("2 "); + if (mpeg->layer & MPEG_LAYER_MP3) + bt_shell_printf("3 "); + + if (bitrate & MPEG_BIT_RATE_FREE) { + bt_shell_printf("\n\tBit Rate: Free format"); + } else { + if (mpeg->layer & MPEG_LAYER_MP1) { + bt_shell_printf("\n\tLayer 1 Bit Rate: "); + if (bitrate & MPEG_MP1_BIT_RATE_32000) + bt_shell_printf("32kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_64000) + bt_shell_printf("64kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_96000) + bt_shell_printf("96kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_128000) + bt_shell_printf("128kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_160000) + bt_shell_printf("160kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_192000) + bt_shell_printf("192kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_224000) + bt_shell_printf("224kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_256000) + bt_shell_printf("256kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_320000) + bt_shell_printf("320kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_352000) + bt_shell_printf("352kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_384000) + bt_shell_printf("384kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_416000) + bt_shell_printf("416kbps "); + if (bitrate & MPEG_MP1_BIT_RATE_448000) + bt_shell_printf("448kbps "); + } + + if (mpeg->layer & MPEG_LAYER_MP2) { + bt_shell_printf("\n\tLayer 2 Bit Rate: "); + if (bitrate & MPEG_MP2_BIT_RATE_32000) + bt_shell_printf("32kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_48000) + bt_shell_printf("48kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_56000) + bt_shell_printf("56kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_64000) + bt_shell_printf("64kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_80000) + bt_shell_printf("80kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_96000) + bt_shell_printf("96kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_112000) + bt_shell_printf("112kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_128000) + bt_shell_printf("128kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_160000) + bt_shell_printf("160kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_192000) + bt_shell_printf("192kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_224000) + bt_shell_printf("224kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_256000) + bt_shell_printf("256kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_320000) + bt_shell_printf("320kbps "); + if (bitrate & MPEG_MP2_BIT_RATE_384000) + bt_shell_printf("384kbps "); + } + + if (mpeg->layer & MPEG_LAYER_MP3) { + bt_shell_printf("\n\tLayer 3 Bit Rate: "); + if (bitrate & MPEG_MP3_BIT_RATE_32000) + bt_shell_printf("32kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_40000) + bt_shell_printf("40kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_48000) + bt_shell_printf("48kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_56000) + bt_shell_printf("56kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_64000) + bt_shell_printf("64kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_80000) + bt_shell_printf("80kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_96000) + bt_shell_printf("96kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_112000) + bt_shell_printf("112kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_128000) + bt_shell_printf("128kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_160000) + bt_shell_printf("160kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_192000) + bt_shell_printf("192kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_224000) + bt_shell_printf("224kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_256000) + bt_shell_printf("256kbps "); + if (bitrate & MPEG_MP3_BIT_RATE_320000) + bt_shell_printf("320kbps "); + } + } + + bt_shell_printf("\n\tVBR: %s", mpeg->vbr ? "Yes" : "No"); + + bt_shell_printf("\n\tPayload Format: "); + if (mpeg->mpf) + bt_shell_printf("RFC-2250 RFC-3119\n"); + else + bt_shell_printf("RFC-2250\n"); +} + +static void print_sbc(a2dp_sbc_t *sbc, uint8_t size) +{ + if (size < sizeof(*sbc)) { + bt_shell_printf("\tMedia Codec: SBC (broken)\n"); + return; + } + + bt_shell_printf("\tMedia Codec: SBC\n\tChannel Modes: "); + + if (sbc->channel_mode & SBC_CHANNEL_MODE_MONO) + bt_shell_printf("Mono "); + if (sbc->channel_mode & SBC_CHANNEL_MODE_DUAL_CHANNEL) + bt_shell_printf("DualChannel "); + if (sbc->channel_mode & SBC_CHANNEL_MODE_STEREO) + bt_shell_printf("Stereo "); + if (sbc->channel_mode & SBC_CHANNEL_MODE_JOINT_STEREO) + bt_shell_printf("JointStereo"); + + bt_shell_printf("\n\tFrequencies: "); + if (sbc->frequency & SBC_SAMPLING_FREQ_16000) + bt_shell_printf("16Khz "); + if (sbc->frequency & SBC_SAMPLING_FREQ_32000) + bt_shell_printf("32Khz "); + if (sbc->frequency & SBC_SAMPLING_FREQ_44100) + bt_shell_printf("44.1Khz "); + if (sbc->frequency & SBC_SAMPLING_FREQ_48000) + bt_shell_printf("48Khz "); + + bt_shell_printf("\n\tSubbands: "); + if (sbc->allocation_method & SBC_SUBBANDS_4) + bt_shell_printf("4 "); + if (sbc->allocation_method & SBC_SUBBANDS_8) + bt_shell_printf("8"); + + bt_shell_printf("\n\tBlocks: "); + if (sbc->block_length & SBC_BLOCK_LENGTH_4) + bt_shell_printf("4 "); + if (sbc->block_length & SBC_BLOCK_LENGTH_8) + bt_shell_printf("8 "); + if (sbc->block_length & SBC_BLOCK_LENGTH_12) + bt_shell_printf("12 "); + if (sbc->block_length & SBC_BLOCK_LENGTH_16) + bt_shell_printf("16 "); + + bt_shell_printf("\n\tBitpool Range: %d-%d\n", + sbc->min_bitpool, sbc->max_bitpool); +} + +static int print_a2dp_codec(uint8_t codec, void *data, uint8_t size) +{ + int i; + + switch (codec) { + case A2DP_CODEC_SBC: + print_sbc(data, size); + break; + case A2DP_CODEC_MPEG12: + print_mpeg12(data, size); + break; + case A2DP_CODEC_MPEG24: + print_mpeg24(data, size); + break; + case A2DP_CODEC_VENDOR: + print_vendor(data, size); + break; + default: + bt_shell_printf("\tMedia Codec: Unknown\n"); + bt_shell_printf("\t\tCodec Data:"); + for (i = 0; i < size - 2; ++i) + bt_shell_printf(" 0x%.02x", ((unsigned char *)data)i); + bt_shell_printf("\n"); + } + + return 0; +} + +static void print_hexdump(const char *label, struct iovec *iov) +{ + if (!iov) + return; + + bt_shell_printf("%s:\n", label); + bt_shell_hexdump(iov->iov_base, iov->iov_len); +} + +static void print_codec(const char *uuid, uint8_t codec, struct iovec *caps, + struct iovec *meta) +{ + if (!strcasecmp(uuid, A2DP_SINK_UUID) || + !strcasecmp(uuid, A2DP_SOURCE_UUID)) { + print_a2dp_codec(codec, caps->iov_base, caps->iov_len); + return; + } if (codec != LC3_ID) { - print_property(proxy, "Capabilities"); + print_hexdump("Capabilities", caps); + print_hexdump("Metadata", meta); return; } - if (!g_dbus_proxy_get_property(proxy, "Capabilities", &iter)) + print_lc3_caps(caps->iov_base, caps->iov_len); + + if (!meta) return; - dbus_message_iter_recurse(&iter, &subiter); + print_lc3_meta(meta->iov_base, meta->iov_len); +} - dbus_message_iter_get_fixed_array(&subiter, &data, &len); +static void print_capabilities(GDBusProxy *proxy) +{ + DBusMessageIter iter, subiter; + const char *uuid; + uint8_t codec; + struct iovec caps, meta; + + if (!g_dbus_proxy_get_property(proxy, "UUID", &iter)) + return; - print_lc3_caps(data, len); + dbus_message_iter_get_basic(&iter, &uuid); - if (!g_dbus_proxy_get_property(proxy, "Metadata", &iter)) + if (!g_dbus_proxy_get_property(proxy, "Codec", &iter)) + return; + + dbus_message_iter_get_basic(&iter, &codec); + + if (!g_dbus_proxy_get_property(proxy, "Capabilities", &iter)) return; dbus_message_iter_recurse(&iter, &subiter); - dbus_message_iter_get_fixed_array(&subiter, &data, &len); + dbus_message_iter_get_fixed_array(&subiter, &caps.iov_base, + (int *)&caps.iov_len); - print_lc3_meta(data, len); + if (g_dbus_proxy_get_property(proxy, "Metadata", &iter)) { + dbus_message_iter_recurse(&iter, &subiter); + dbus_message_iter_get_fixed_array(&subiter, &meta.iov_base, + (int *)&meta.iov_len); + } else { + meta.iov_base = NULL; + meta.iov_len = 0; + } + + print_codec(uuid, codec, &caps, &meta); +} + +static void print_local_endpoint(struct endpoint *ep) +{ + bt_shell_printf("Endpoint %s\n", ep->path); + bt_shell_printf("\tUUID %s\n", ep->uuid); + bt_shell_printf("\tCodec 0x%02x (%u)\n", ep->codec, ep->codec); + if (ep->caps) + print_codec(ep->uuid, ep->codec, ep->caps, ep->meta); + if (ep->locations) + bt_shell_printf("\tLocations 0x%08x (%u)\n", ep->locations, + ep->locations); + if (ep->supported_context) + bt_shell_printf("\tSupportedContext 0x%08x (%u)\n", + ep->supported_context, ep->supported_context); + if (ep->context) + bt_shell_printf("\tContext 0x%08x (%u)\n", ep->context, + ep->context); } static void cmd_show_endpoint(int argc, char *argv) @@ -2290,6 +2762,12 @@ proxy = g_dbus_proxy_lookup(endpoints, NULL, argv1, BLUEZ_MEDIA_ENDPOINT_INTERFACE); if (!proxy) { + struct endpoint *ep; + + ep = endpoint_find(argv1); + if (ep) + return print_local_endpoint(ep); + bt_shell_printf("Endpoint %s not found\n", argv1); return bt_shell_noninteractive_quit(EXIT_SUCCESS); } @@ -2332,17 +2810,8 @@ { struct endpoint *ep = data; - if (ep->caps) { - if (ep->caps->iov_base) - g_free(ep->caps->iov_base); - g_free(ep->caps); - } - - if (ep->meta) { - if (ep->meta->iov_base) - g_free(ep->meta->iov_base); - g_free(ep->meta); - } + util_iov_free(ep->caps, 1); + util_iov_free(ep->meta, 1); if (ep->msg) dbus_message_unref(ep->msg); @@ -2704,12 +3173,8 @@ ep->iso_group = value; } - if (!ep->broadcast) - bt_shell_prompt_input(ep->path, "CIS (auto/value):", - endpoint_iso_stream, ep); - else - bt_shell_prompt_input(ep->path, "BIS (auto/value):", - endpoint_iso_stream, ep); + bt_shell_prompt_input(ep->path, "CIS (auto/value):", + endpoint_iso_stream, ep); } static void endpoint_context(const char *input, void *user_data) @@ -2727,12 +3192,8 @@ ep->context = value; - if (ep->broadcast) - bt_shell_prompt_input(ep->path, "BIG (auto/value):", - endpoint_iso_group, ep); - else - bt_shell_prompt_input(ep->path, "CIG (auto/value):", - endpoint_iso_group, ep); + bt_shell_prompt_input(ep->path, "CIG (auto/value):", + endpoint_iso_group, ep); } static void endpoint_supported_context(const char *input, void *user_data) @@ -2750,6 +3211,11 @@ ep->supported_context = value; + if (ep->broadcast) { + endpoint_register(ep); + return; + } + bt_shell_prompt_input(ep->path, "Context (value):", endpoint_context, ep); } @@ -2799,13 +3265,6 @@ { struct endpoint *ep = user_data; - if (!strcmp(ep->uuid, BCAA_SERVICE_UUID) || - !strcmp(ep->uuid, BAA_SERVICE_UUID)) { - ep->broadcast = true; - } else { - ep->broadcast = false; - } - if (!strcasecmp(input, "y") || !strcasecmp(input, "yes")) { ep->auto_accept = true; bt_shell_prompt_input(ep->path, "Max Transports (auto/value):", @@ -2825,20 +3284,18 @@ static void endpoint_set_metadata(const char *input, void *user_data) { struct endpoint *ep = user_data; + struct iovec iov; if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) { - free(ep->meta->iov_base); + util_iov_free(ep->meta, 1); ep->meta = NULL; goto done; } - if (!ep->meta) - ep->meta = g_new0(struct iovec, 1); - - ep->meta->iov_base = str2bytearray((char *) input, &ep->meta->iov_len); - if (!ep->meta->iov_base) { - free(ep->meta); - ep->meta = NULL; + iov.iov_base = str2bytearray((char *) input, &iov.iov_len); + if (iov.iov_base) { + util_iov_free(ep->meta, 1); + ep->meta = util_iov_dup(&iov, 1); } done: @@ -2849,22 +3306,21 @@ static void endpoint_set_capabilities(const char *input, void *user_data) { struct endpoint *ep = user_data; + struct iovec iov; + + if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) { + util_iov_free(ep->caps, 1); + ep->caps = NULL; + goto done; + } - if (ep->caps && ep->caps->iov_base) { - g_free(ep->caps->iov_base); - ep->caps = g_new0(struct iovec, 1); - } else - ep->caps = g_new0(struct iovec, 1); - - ep->caps->iov_base = str2bytearray((char *) input, &ep->caps->iov_len); - - if (ep->caps->iov_len == 0x01 && - (*(uint8_t *)(ep->caps->iov_base)) == 0x00) { - g_free(ep->caps->iov_base); - ep->caps->iov_base = NULL; - ep->caps->iov_len = 0x00; + iov.iov_base = str2bytearray((char *) input, &iov.iov_len); + if (iov.iov_base) { + util_iov_free(ep->caps, 1); + ep->caps = util_iov_dup(&iov, 1); } +done: bt_shell_prompt_input(ep->path, "Enter Metadata (value/no):", endpoint_set_metadata, ep); } @@ -2923,6 +3379,13 @@ g_list_length(local_endpoints)); local_endpoints = g_list_append(local_endpoints, ep); + if (!strcmp(ep->uuid, BCAA_SERVICE_UUID) || + !strcmp(ep->uuid, BAA_SERVICE_UUID)) { + ep->broadcast = true; + } else { + ep->broadcast = false; + } + if (strrchr(argv2, ':')) { ep->codec = 0xff; parse_vendor_codec(argv2, &ep->cid, &ep->vid); @@ -2940,12 +3403,13 @@ cap = find_capabilities(ep->uuid, ep->codec); if (cap) { - if (ep->caps) - ep->caps->iov_len = 0; - /* Copy capabilities */ - iov_append(&ep->caps, cap->data.iov_base, - cap->data.iov_len); + util_iov_free(ep->caps, 1); + ep->caps = util_iov_dup(&cap->data, 1); + + /* Copy metadata */ + util_iov_free(ep->meta, 1); + ep->meta = util_iov_dup(&cap->meta, 1); bt_shell_prompt_input(ep->path, "Auto Accept (yes/no):", endpoint_auto_accept, ep); @@ -3063,7 +3527,7 @@ data = str2bytearray((char *) input, &len); - iov_append(&cfg->caps, data, len); + util_iov_append(cfg->caps, data, len); free(data); endpoint_set_config(cfg); @@ -3071,14 +3535,132 @@ static struct endpoint *endpoint_new(const struct capabilities *cap); +static void endpoint_set_metadata_cfg(const char *input, void *user_data) +{ + struct endpoint_config *cfg = user_data; + + if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) + goto done; + + if (!cfg->meta) + cfg->meta = g_new0(struct iovec, 1); + + cfg->meta->iov_base = str2bytearray((char *) input, + &cfg->meta->iov_len); + if (!cfg->meta->iov_base) { + free(cfg->meta); + cfg->meta = NULL; + } + +done: + endpoint_set_config(cfg); +} + +static void config_endpoint_channel_location(const char *input, void *user_data) +{ + struct endpoint_config *cfg = user_data; + char *endptr = NULL; + uint32_t location; + uint8_t channels = 1; + + if (!strcasecmp(input, "n") || !strcasecmp(input, "no")) + goto add_meta; + + location = strtol(input, &endptr, 0); + + if (!endptr || *endptr != '\0') { + bt_shell_printf("Invalid argument: %s\n", input); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + /* Add Channel Allocation LTV in capabilities */ + location = cpu_to_le32(location); + util_ltv_push(cfg->caps, LC3_CONFIG_CHAN_ALLOC_LEN - 1, + LC3_CONFIG_CHAN_ALLOC, &location); + + /* Adjust the SDU size based on the number of + * locations/channels that is being requested. + */ + channels = __builtin_popcount(location); + if (channels > 1) + cfg->qos.bcast.io_qos.sdu *= channels; + +add_meta: + /* Add metadata */ + bt_shell_prompt_input(cfg->ep->path, "Enter Metadata (value/no):", + endpoint_set_metadata_cfg, cfg); +} + +static void ltv_find(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data) +{ + bool *found = user_data; + + *found = true; +} + +static void config_endpoint_iso_group(const char *input, void *user_data) +{ + struct endpoint_config *cfg = user_data; + char *endptr = NULL; + int value; + uint8_t type = LC3_CONFIG_CHAN_ALLOC; + bool found = false; + + if (!strcasecmp(input, "a") || !strcasecmp(input, "auto")) { + cfg->ep->iso_group = BT_ISO_QOS_GROUP_UNSET; + } else { + value = strtol(input, &endptr, 0); + + if (!endptr || *endptr != '\0' || value > UINT8_MAX) { + bt_shell_printf("Invalid argument: %s\n", input); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + cfg->ep->iso_group = value; + } + + /* Check if Channel Allocation is present in caps */ + util_ltv_foreach(cfg->caps->iov_base, + cfg->caps->iov_len, &type, + ltv_find, &found); + + /* Add Channel Allocation if it is not present in caps */ + if (!found) { + bt_shell_prompt_input(cfg->ep->path, + "Enter channel location (value/no):", + config_endpoint_channel_location, cfg); + } else { + /* Add metadata */ + bt_shell_prompt_input(cfg->ep->path, + "Enter Metadata (value/no):", + endpoint_set_metadata_cfg, cfg); + } +} + +static void endpoint_set_config_bcast(struct endpoint_config *cfg) +{ + cfg->ep->bcode = g_new0(struct iovec, 1); + util_iov_append(cfg->ep->bcode, bcast_code, + sizeof(bcast_code)); + + if ((strcmp(cfg->ep->uuid, BAA_SERVICE_UUID) == 0)) { + /* A broadcast sink endpoint config does not need + * user input. + */ + endpoint_set_config(cfg); + return; + } + + bt_shell_prompt_input(cfg->ep->path, + "BIG (auto/value):", + config_endpoint_iso_group, cfg); +} + static void cmd_config_endpoint(int argc, char *argv) { struct endpoint_config *cfg; const struct codec_preset *preset; - const struct capabilities *cap; - char *uuid; - uint8_t codec_id; - bool broadcast = false; cfg = new0(struct endpoint_config, 1); @@ -3093,52 +3675,30 @@ /* Search for the local endpoint */ cfg->ep = endpoint_find(argv2); if (!cfg->ep) { - - /* When the local endpoint was not found either we received - * UUID, or the provided local endpoint is not available - */ - uuid = argv2; - codec_id = strtol(argv3, NULL, 0); - cap = find_capabilities(uuid, codec_id); - if (cap) { - broadcast = true; - cfg->ep = endpoint_new(cap); - cfg->ep->preset = find_presets_name(uuid, argv3); - if (!cfg->ep->preset) - bt_shell_printf("Preset not found\n"); - } else { - bt_shell_printf("Local Endpoint %s," - "or capabilities not found\n", uuid); - goto fail; - } + bt_shell_printf("Local Endpoint %s not found\n", argv2); + goto fail; } - if (((broadcast == false) && (argc > 3)) || - ((broadcast == true) && (argc > 4))) { - char *preset_name = (broadcast == false)?argv3:argv4; - - preset = preset_find_name(cfg->ep->preset, preset_name); + if (argc > 3) { + preset = preset_find_name(cfg->ep->preset, argv3); if (!preset) { - bt_shell_printf("Preset %s not found\n", preset_name); + bt_shell_printf("Preset %s not found\n", argv3); goto fail; } - if (cfg->ep->broadcast) { - iov_append(&cfg->ep->bcode, bcast_qos.bcast.bcode, - sizeof(bcast_qos.bcast.bcode)); - /* Copy capabilities for broadcast*/ - iov_append(&cfg->caps, base_lc3_16_2_1, - sizeof(base_lc3_16_2_1)); - } else { - /* Copy capabilities */ - iov_append(&cfg->caps, preset->data.iov_base, - preset->data.iov_len); - } + cfg->caps = g_new0(struct iovec, 1); + /* Copy capabilities */ + util_iov_append(cfg->caps, preset->data.iov_base, + preset->data.iov_len); /* Set QoS parameters */ - cfg->qos = &preset->qos; + cfg->qos = preset->qos; + + if (cfg->ep->broadcast) + endpoint_set_config_bcast(cfg); + else + endpoint_set_config(cfg); - endpoint_set_config(cfg); return; } @@ -3155,10 +3715,14 @@ static void custom_delay(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_qos *qos = (void *)&p->qos; char *endptr = NULL; - qos->delay = strtol(input, &endptr, 0); + if (!p->target_latency) + qos->bcast.delay = strtol(input, &endptr, 0); + else + qos->ucast.delay = strtol(input, &endptr, 0); + if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3170,10 +3734,14 @@ static void custom_latency(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_qos *qos = (void *)&p->qos; char *endptr = NULL; - qos->latency = strtol(input, &endptr, 0); + if (!p->target_latency) + qos->bcast.io_qos.latency = strtol(input, &endptr, 0); + else + qos->ucast.io_qos.latency = strtol(input, &endptr, 0); + if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3186,10 +3754,14 @@ static void custom_rtn(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_qos *qos = (void *)&p->qos; char *endptr = NULL; - qos->rtn = strtol(input, &endptr, 0); + if (!p->target_latency) + qos->bcast.io_qos.rtn = strtol(input, &endptr, 0); + else + qos->ucast.io_qos.rtn = strtol(input, &endptr, 0); + if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3202,10 +3774,14 @@ static void custom_sdu(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_qos *qos = (void *)&p->qos; char *endptr = NULL; - qos->sdu = strtol(input, &endptr, 0); + if (!p->target_latency) + qos->bcast.io_qos.sdu = strtol(input, &endptr, 0); + else + qos->ucast.io_qos.sdu = strtol(input, &endptr, 0); + if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3217,7 +3793,12 @@ static void custom_phy(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + struct bt_bap_io_qos *qos; + + if (!p->target_latency) + qos = &p->qos.bcast.io_qos; + else + qos = &p->qos.ucast.io_qos; if (!strcmp(input, "1M")) qos->phy = 0x01; @@ -3249,16 +3830,21 @@ static void custom_framing(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; + uint8_t *framing; + + if (!p->target_latency) + framing = &p->qos.bcast.framing; + else + framing = &p->qos.ucast.framing; if (!strcasecmp(input, "Unframed")) - qos->framing = 0x00; + *framing = 0x00; else if (!strcasecmp(input, "Framed")) - qos->framing = 0x01; + *framing = 0x01; else { char *endptr = NULL; - qos->framing = strtol(input, &endptr, 0); + *framing = strtol(input, &endptr, 0); if (!endptr || *endptr != '\0') { bt_shell_printf("Invalid argument: %s\n", input); return bt_shell_noninteractive_quit(EXIT_FAILURE); @@ -3272,8 +3858,13 @@ static void custom_interval(const char *input, void *user_data) { struct codec_preset *p = user_data; - struct codec_qos *qos = (void *)&p->qos; char *endptr = NULL; + struct bt_bap_io_qos *qos; + + if (!p->target_latency) + qos = &p->qos.bcast.io_qos; + else + qos = &p->qos.ucast.io_qos; qos->interval = strtol(input, &endptr, 0); if (!endptr || *endptr != '\0') { @@ -3326,7 +3917,7 @@ ltv2 = len; ltv3 = len >> 8; - iov_append(&iov, ltv, sizeof(ltv)); + util_iov_append(iov, ltv, sizeof(ltv)); bt_shell_prompt_input("QoS", "Enter Target Latency " "(Low, Balance, High):", @@ -3352,7 +3943,7 @@ location = cpu_to_le32(location); memcpy(<v2, &location, sizeof(location)); - iov_append(&iov, ltv, sizeof(ltv)); + util_iov_append(iov, ltv, sizeof(ltv)); } bt_shell_prompt_input("Codec", "Enter frame length:", @@ -3395,7 +3986,7 @@ return bt_shell_noninteractive_quit(EXIT_FAILURE); } - iov_append(&iov, ltv, sizeof(ltv)); + util_iov_append(iov, ltv, sizeof(ltv)); bt_shell_prompt_input("Codec", "Enter channel allocation:", custom_location, user_data); @@ -3463,7 +4054,7 @@ free(iov->iov_base); iov->iov_base = NULL; iov->iov_len = 0; - iov_append(&iov, ltv, sizeof(ltv)); + util_iov_append(iov, ltv, sizeof(ltv)); bt_shell_prompt_input("Codec", "Enter frame duration (ms):", custom_duration, user_data); @@ -3538,8 +4129,7 @@ { "unregister", "<UUID/object>", cmd_unregister_endpoint, "Register Endpoint", local_endpoint_generator }, - { "config", - "<endpoint> local endpoint/UUID preset/codec id preset", + { "config", "<endpoint> local endpoint preset", cmd_config_endpoint, "Configure Endpoint", endpoint_generator }, @@ -3550,6 +4140,30 @@ {} }, }; +static void endpoint_init_bcast(struct endpoint *ep) +{ + if (!strcmp(ep->uuid, BAA_SERVICE_UUID)) { + ep->locations = EP_SNK_LOCATIONS; + ep->supported_context = EP_SUPPORTED_SNK_CTXT; + } else { + ep->locations = EP_SRC_LOCATIONS; + ep->supported_context = EP_SUPPORTED_SRC_CTXT; + } +} + +static void endpoint_init_ucast(struct endpoint *ep) +{ + if (!strcmp(ep->uuid, PAC_SINK_UUID)) { + ep->locations = EP_SNK_LOCATIONS; + ep->supported_context = EP_SUPPORTED_SNK_CTXT; + ep->context = EP_SNK_CTXT; + } else if (!strcmp(ep->uuid, PAC_SOURCE_UUID)) { + ep->locations = EP_SRC_LOCATIONS; + ep->supported_context = EP_SUPPORTED_SRC_CTXT; + ep->context = EP_SRC_CTXT; + } +} + static void endpoint_init_defaults(struct endpoint *ep) { ep->preset = find_presets(ep->uuid, ep->codec, ep->vid, ep->cid); @@ -3565,18 +4179,11 @@ ep->broadcast = (strcmp(ep->uuid, BCAA_SERVICE_UUID) && strcmp(ep->uuid, BAA_SERVICE_UUID)) ? false : true; - if (ep->broadcast) - return; - if (!strcmp(ep->uuid, PAC_SINK_UUID)) { - ep->locations = EP_SNK_LOCATIONS; - ep->supported_context = EP_SUPPORTED_SNK_CTXT; - ep->context = EP_SNK_CTXT; - } else if (!strcmp(ep->uuid, PAC_SOURCE_UUID)) { - ep->locations = EP_SRC_LOCATIONS; - ep->supported_context = EP_SUPPORTED_SRC_CTXT; - ep->context = EP_SRC_CTXT; - } + if (ep->broadcast) + endpoint_init_bcast(ep); + else + endpoint_init_ucast(ep); } static struct endpoint *endpoint_new(const struct capabilities *cap) @@ -3586,10 +4193,13 @@ ep = new0(struct endpoint, 1); ep->uuid = g_strdup(cap->uuid); ep->codec = cap->codec_id; - ep->path = g_strdup_printf("%s/ep%u", BLUEZ_MEDIA_ENDPOINT_PATH, - g_list_length(local_endpoints)); + ep->path = g_strdup_printf("%s/%s", BLUEZ_MEDIA_ENDPOINT_PATH, + cap->name); /* Copy capabilities */ - iov_append(&ep->caps, cap->data.iov_base, cap->data.iov_len); + ep->caps = util_iov_dup(&cap->data, 1); + /* Copy metadata */ + ep->meta = util_iov_dup(&cap->meta, 1); + local_endpoints = g_list_append(local_endpoints, ep); return ep; @@ -4128,19 +4738,20 @@ static void print_configuration(GDBusProxy *proxy) { DBusMessageIter iter, subiter; + const char *uuid; uint8_t codec; uint8_t *data; int len; - if (!g_dbus_proxy_get_property(proxy, "Codec", &iter)) + if (!g_dbus_proxy_get_property(proxy, "UUID", &iter)) return; - dbus_message_iter_get_basic(&iter, &codec); + dbus_message_iter_get_basic(&iter, &uuid); - if (codec != LC3_ID) { - print_property(proxy, "Configuration"); + if (!g_dbus_proxy_get_property(proxy, "Codec", &iter)) return; - } + + dbus_message_iter_get_basic(&iter, &codec); if (!g_dbus_proxy_get_property(proxy, "Configuration", &iter)) return; @@ -4149,6 +4760,17 @@ dbus_message_iter_get_fixed_array(&subiter, &data, &len); + if (!strcasecmp(uuid, A2DP_SINK_UUID) || + !strcasecmp(uuid, A2DP_SOURCE_UUID)) { + print_a2dp_codec(codec, (void *)data, len); + return; + } + + if (codec != LC3_ID) { + print_property(proxy, "Configuration"); + return; + } + print_lc3_cfg(data, len); if (!g_dbus_proxy_get_property(proxy, "Metadata", &iter)) @@ -4388,13 +5010,17 @@ struct bt_iso_qos qos; socklen_t len; int ret, fd; - uint32_t num; uint64_t exp; if (transport->fd < 0) return false; fd = io_get_fd(io); + if (fd < 0) { + bt_shell_printf("io_get_fd() returned %d\n", fd); + return false; + } + ret = read(fd, &exp, sizeof(exp)); if (ret < 0) { bt_shell_printf("Failed to read: %s (%d)\n", strerror(errno), @@ -4412,10 +5038,7 @@ return false; } - /* num of packets = latency (ms) / interval (us) */ - num = (qos.ucast.out.latency * 1000 / qos.ucast.out.interval); - - ret = transport_send_seq(transport, transport->fd, num); + ret = transport_send_seq(transport, transport->fd, transport->num); if (ret < 0) { bt_shell_printf("Unable to send: %s (%d)\n", strerror(-ret), ret); @@ -4431,7 +5054,7 @@ } static int transport_send(struct transport *transport, int fd, - struct bt_iso_qos *qos) + struct bt_iso_io_qos *qos) { struct itimerspec ts; int timer_fd; @@ -4448,20 +5071,30 @@ if (timer_fd < 0) return -errno; + /* Send data in bursts of + * num = ROUND_CLOSEST(Transport_Latency (ms) / SDU_Interval (us)) + * with average data rate = 1 packet / SDU_Interval + */ + transport->num = ROUND_CLOSEST(qos->latency * 1000, qos->interval); + if (!transport->num) + transport->num = 1; + memset(&ts, 0, sizeof(ts)); - ts.it_value.tv_nsec = qos->ucast.out.latency * 1000000; - ts.it_interval.tv_nsec = qos->ucast.out.latency * 1000000; + ts.it_value.tv_nsec = 1; + ts.it_interval.tv_nsec = transport->num * qos->interval * 1000; - if (timerfd_settime(timer_fd, TFD_TIMER_ABSTIME, &ts, NULL) < 0) + if (timerfd_settime(timer_fd, TFD_TIMER_ABSTIME, &ts, NULL) < 0) { + close(timer_fd); return -errno; + } transport->fd = fd; - transport->timer_io = io_new(timer_fd); io_set_read_handler(transport->timer_io, transport_timer_read, transport, NULL); + /* One extra packet to buffers immediately */ return transport_send_seq(transport, fd, 1); } @@ -4510,11 +5143,24 @@ bt_shell_printf("Unable to getsockopt(BT_ISO_QOS): %s", strerror(errno)); err = transport_send(transport, fd, NULL); - } else - err = transport_send(transport, fd, &qos); + } else { + struct sockaddr_iso addr; + socklen_t optlen = sizeof(addr); + + err = getpeername(transport->sk, + (struct sockaddr *)&addr, &optlen); + if (!err) { + if (!(bacmp(&addr.iso_bdaddr, BDADDR_ANY))) + err = transport_send(transport, fd, + &qos.bcast.out); + else + err = transport_send(transport, fd, + &qos.ucast.out); + } + } if (err < 0) { - bt_shell_printf("Unable to send: %s (%d)", + bt_shell_printf("Unable to send: %s (%d)\n", strerror(-err), -err); close(fd); return bt_shell_noninteractive_quit(EXIT_FAILURE);
View file
_service:tar_scm:bluez-5.71.tar.xz/config.h.in -> _service:tar_scm:bluez-5.77.tar.xz/config.h.in
Changed
@@ -6,6 +6,9 @@ /* Directory for the configuration files */ #undef CONFIGDIR +/* Define if external plugin support is required */ +#undef EXTERNAL_PLUGINS + /* Define to 1 if you have the backtrace support. */ #undef HAVE_BACKTRACE_SUPPORT @@ -72,8 +75,8 @@ /* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H -/* Define to 1 if you have the udev_hwdb_new() function. */ -#undef HAVE_UDEV_HWDB_NEW +/* Define to 1 if udev is required */ +#undef HAVE_UDEV /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H
View file
_service:tar_scm:bluez-5.71.tar.xz/configure -> _service:tar_scm:bluez-5.77.tar.xz/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for bluez 5.71. +# Generated by GNU Autoconf 2.71 for bluez 5.77. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -618,8 +618,8 @@ # Identity of this package. PACKAGE_NAME='bluez' PACKAGE_TARNAME='bluez' -PACKAGE_VERSION='5.71' -PACKAGE_STRING='bluez 5.71' +PACKAGE_VERSION='5.77' +PACKAGE_STRING='bluez 5.77' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -673,6 +673,7 @@ ANDROID_TRUE MESH_STORAGEDIR CONFIGDIR +PKGLIBEXECDIR ADMIN_FALSE ADMIN_TRUE LOGGER_FALSE @@ -681,6 +682,8 @@ HID2HCI_TRUE SIXAXIS_FALSE SIXAXIS_TRUE +EXTERNAL_PLUGINS_FALSE +EXTERNAL_PLUGINS_TRUE DEPRECATED_FALSE DEPRECATED_TRUE EXPERIMENTAL_FALSE @@ -718,29 +721,32 @@ ALSA_CFLAGS MIDI_FALSE MIDI_TRUE -JSON_LIBS -JSON_CFLAGS JSONC_LIBS JSONC_CFLAGS MESH_FALSE MESH_TRUE +CUPS_SERVERBIN +CUPS_SERVERBIN_FALSE +CUPS_SERVERBIN_TRUE CUPS_FALSE CUPS_TRUE UDEV_DIR -UDEV_FALSE -UDEV_TRUE UDEV_LIBS UDEV_CFLAGS MONITOR_FALSE MONITOR_TRUE TOOLS_FALSE TOOLS_TRUE +ASHA_FALSE +ASHA_TRUE CSIP_FALSE CSIP_TRUE MICP_FALSE MICP_TRUE VCP_FALSE VCP_TRUE +CCP_FALSE +CCP_TRUE MCP_FALSE MCP_TRUE BASS_FALSE @@ -956,9 +962,11 @@ enable_bap enable_bass enable_mcp +enable_ccp enable_vcp enable_micp enable_csip +enable_asha enable_tools enable_monitor enable_udev @@ -978,6 +986,7 @@ enable_testing enable_experimental enable_deprecated +enable_external_plugins enable_sixaxis enable_hid2hci enable_logger @@ -1569,7 +1578,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bluez 5.71 to adapt to many kinds of systems. +\`configure' configures bluez 5.77 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1640,7 +1649,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bluez 5.71:";; + short | recursive ) echo "Configuration of bluez 5.77:";; esac cat <<\_ACEOF @@ -1683,9 +1692,11 @@ --disable-bap disable BAP profile --disable-bass disable BASS service --disable-mcp disable MCP profile + --disable-ccp disable CCP profile --disable-vcp disable VCP profile --disable-micp disable MICP profile --disable-csip disable CSIP profile + --disable-asha disable ASHA support --disable-tools disable Bluetooth tools --disable-monitor disable Bluetooth monitor --disable-udev disable udev device support @@ -1702,6 +1713,8 @@ --enable-testing enable testing tools --enable-experimental enable experimental tools --enable-deprecated enable deprecated tools + --enable-external-plugins + enable support for external plugins --enable-sixaxis enable sixaxis plugin --enable-hid2hci enable hid2hci tool --enable-logger enable HCI logger service @@ -1849,7 +1862,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bluez configure 5.71 +bluez configure 5.77 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2067,7 +2080,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bluez $as_me 5.71, which was +It was created by bluez $as_me 5.77, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3337,7 +3350,7 @@ # Define the identity of the package. PACKAGE='bluez' - VERSION='5.71' + VERSION='5.77' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -14618,6 +14631,8 @@ misc_cflags="$misc_cflags --coverage" misc_ldflags="$misc_ldflags --coverage" fi + misc_cflags="$misc_cflags -ffunction-sections -fdata-sections" + misc_ldflags="$misc_ldflags -Wl,--gc-sections" MISC_CFLAGS=$misc_cflags MISC_LDFLAGS=$misc_ldflags @@ -14894,20 +14909,38 @@ # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 - as_fn_error $? "GLib >= 2.28 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (glib-2.0 >= 2.28) were not met: + +$GLIB_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GLIB_CFLAGS +and GLIB_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "GLib >= 2.28 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GLIB_CFLAGS +and GLIB_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - +fi if (test "${enable_threads}" = "yes"); then @@ -14972,17 +15005,37 @@ # Put the nasty error message in config.log where it belongs echo "$GTHREAD_PKG_ERRORS" >&5 - as_fn_error $? "GThread >= 2.16 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (gthread-2.0 >= 2.16) were not met: + +$GTHREAD_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables GTHREAD_CFLAGS +and GTHREAD_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "GThread >= 2.16 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables GTHREAD_CFLAGS +and GTHREAD_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else GTHREAD_CFLAGS=$pkg_cv_GTHREAD_CFLAGS GTHREAD_LIBS=$pkg_cv_GTHREAD_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes + fi GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" @@ -15047,20 +15100,38 @@ # Put the nasty error message in config.log where it belongs echo "$DBUS_PKG_ERRORS" >&5 - as_fn_error $? "D-Bus >= 1.10 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (dbus-1 >= 1.10) were not met: + +$DBUS_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables DBUS_CFLAGS +and DBUS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "D-Bus >= 1.10 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables DBUS_CFLAGS +and DBUS_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS DBUS_LIBS=$pkg_cv_DBUS_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - +fi # Check whether --with-dbusconfdir was given. @@ -15368,6 +15439,21 @@ fi +# Check whether --enable-ccp was given. +if test ${enable_ccp+y} +then : + enableval=$enable_ccp; enable_ccp=${enableval} +fi + + if test "${enable_ccp}" != "no"; then + CCP_TRUE= + CCP_FALSE='#' +else + CCP_TRUE='#' + CCP_FALSE= +fi + + # Check whether --enable-vcp was given. if test ${enable_vcp+y} then : @@ -15413,6 +15499,21 @@ fi +# Check whether --enable-asha was given. +if test ${enable_asha+y} +then : + enableval=$enable_asha; enable_asha=${enableval} +fi + + if test "${enable_asha}" != "no"; then + ASHA_TRUE= + ASHA_FALSE='#' +else + ASHA_TRUE='#' + ASHA_FALSE= +fi + + # Check whether --enable-tools was given. if test ${enable_tools+y} then : @@ -15449,22 +15550,22 @@ enableval=$enable_udev; enable_udev=${enableval} fi -if (test "${enable_tools}" != "no" && test "${enable_udev}" != "no"); then +if (test "${enable_udev}" != "no"); then pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libudev >= 172" >&5 -printf %s "checking for libudev >= 172... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libudev >= 196" >&5 +printf %s "checking for libudev >= 196... " >&6; } if test -n "$UDEV_CFLAGS"; then pkg_cv_UDEV_CFLAGS="$UDEV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 172\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libudev >= 172") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 196\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libudev >= 196") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 172" 2>/dev/null` + pkg_cv_UDEV_CFLAGS=`$PKG_CONFIG --cflags "libudev >= 196" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -15476,12 +15577,12 @@ pkg_cv_UDEV_LIBS="$UDEV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 172\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libudev >= 172") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libudev >= 196\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libudev >= 196") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "libudev >= 172" 2>/dev/null` + pkg_cv_UDEV_LIBS=`$PKG_CONFIG --libs "libudev >= 196" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -15502,78 +15603,49 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev >= 172" 2>&1` + UDEV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libudev >= 196" 2>&1` else - UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev >= 172" 2>&1` + UDEV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libudev >= 196" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$UDEV_PKG_ERRORS" >&5 - as_fn_error $? "libudev >= 172 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (libudev >= 196) were not met: + +$UDEV_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables UDEV_CFLAGS +and UDEV_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "libudev >= 172 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables UDEV_CFLAGS +and UDEV_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else UDEV_CFLAGS=$pkg_cv_UDEV_CFLAGS UDEV_LIBS=$pkg_cv_UDEV_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for udev_hwdb_new in -ludev" >&5 -printf %s "checking for udev_hwdb_new in -ludev... " >&6; } -if test ${ac_cv_lib_udev_udev_hwdb_new+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-ludev $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char udev_hwdb_new (); -int -main (void) -{ -return udev_hwdb_new (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO" -then : - ac_cv_lib_udev_udev_hwdb_new=yes -else $as_nop - ac_cv_lib_udev_udev_hwdb_new=no fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_udev_udev_hwdb_new" >&5 -printf "%s\n" "$ac_cv_lib_udev_udev_hwdb_new" >&6; } -if test "x$ac_cv_lib_udev_udev_hwdb_new" = xyes -then : - -printf "%s\n" "#define HAVE_UDEV_HWDB_NEW 1" >>confdefs.h -fi +printf "%s\n" "#define HAVE_UDEV 1" >>confdefs.h fi - if test "${enable_udev}" != "no"; then - UDEV_TRUE= - UDEV_FALSE='#' -else - UDEV_TRUE='#' - UDEV_FALSE= -fi - # Check whether --with-udevdir was given. @@ -15609,6 +15681,28 @@ CUPS_FALSE= fi +if (test "${enable_cups}" != "no"); then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking cups directory" >&5 +printf %s "checking cups directory... " >&6; } + cups_serverbin=`$PKG_CONFIG cups --variable=cups_serverbin` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${cups_serverbin}" >&5 +printf "%s\n" "${cups_serverbin}" >&6; } +fi + if test "${cups_serverbin}" != ""; then + CUPS_SERVERBIN_TRUE= + CUPS_SERVERBIN_FALSE='#' +else + CUPS_SERVERBIN_TRUE='#' + CUPS_SERVERBIN_FALSE= +fi + +if test "${cups_serverbin}" != "" +then : + + CUPS_SERVERBIN=${cups_serverbin} + + +fi # Check whether --enable-mesh was given. if test ${enable_mesh+y} @@ -15685,21 +15779,39 @@ # Put the nasty error message in config.log where it belongs echo "$JSONC_PKG_ERRORS" >&5 - as_fn_error $? "json-c >= 0.13 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (json-c >= 0.13) were not met: + +$JSONC_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables JSONC_CFLAGS +and JSONC_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "json-c >= 0.13 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables JSONC_CFLAGS +and JSONC_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else JSONC_CFLAGS=$pkg_cv_JSONC_CFLAGS JSONC_LIBS=$pkg_cv_JSONC_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - fi +fi # Check whether --enable-midi was given. if test ${enable_midi+y} @@ -15776,21 +15888,39 @@ # Put the nasty error message in config.log where it belongs echo "$ALSA_PKG_ERRORS" >&5 - as_fn_error $? "ALSA lib is required for MIDI support" "$LINENO" 5 + as_fn_error $? "Package requirements (alsa) were not met: + +$ALSA_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables ALSA_CFLAGS +and ALSA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "ALSA lib is required for MIDI support" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables ALSA_CFLAGS +and ALSA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else ALSA_CFLAGS=$pkg_cv_ALSA_CFLAGS ALSA_LIBS=$pkg_cv_ALSA_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - fi +fi # Check whether --enable-obex was given. if test ${enable_obex+y} @@ -15858,21 +15988,39 @@ # Put the nasty error message in config.log where it belongs echo "$ICAL_PKG_ERRORS" >&5 - as_fn_error $? "libical is required" "$LINENO" 5 + as_fn_error $? "Package requirements (libical) were not met: + +$ICAL_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables ICAL_CFLAGS +and ICAL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "libical is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables ICAL_CFLAGS +and ICAL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else ICAL_CFLAGS=$pkg_cv_ICAL_CFLAGS ICAL_LIBS=$pkg_cv_ICAL_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - fi +fi if test "${enable_obex}" != "no"; then OBEX_TRUE= OBEX_FALSE='#' @@ -15963,21 +16111,39 @@ # Put the nasty error message in config.log where it belongs echo "$ELL_PKG_ERRORS" >&5 - as_fn_error $? "Embedded Linux library >= 0.39 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (ell >= 0.39) were not met: + +$ELL_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables ELL_CFLAGS +and ELL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "Embedded Linux library >= 0.39 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables ELL_CFLAGS +and ELL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else ELL_CFLAGS=$pkg_cv_ELL_CFLAGS ELL_LIBS=$pkg_cv_ELL_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - fi +fi if (test "${enable_external_ell}" != "yes" && (test "${enable_btpclient}" = "yes" || test "${enable_mesh}" = "yes")); then if (test ! -f ${srcdir}/ell/ell.h) && @@ -16235,6 +16401,30 @@ fi +# Check whether --enable-external-plugins was given. +if test ${enable_external_plugins+y} +then : + enableval=$enable_external_plugins; enable_external_plugins=${enableval} +fi + + if test "${enable_external_plugins}" = "yes"; then + EXTERNAL_PLUGINS_TRUE= + EXTERNAL_PLUGINS_FALSE='#' +else + EXTERNAL_PLUGINS_TRUE='#' + EXTERNAL_PLUGINS_FALSE= +fi + +if (test "${enable_external_plugins}" = "yes"); then + +printf "%s\n" "#define EXTERNAL_PLUGINS 1" >>confdefs.h + +else + +printf "%s\n" "#define EXTERNAL_PLUGINS 0" >>confdefs.h + +fi + # Check whether --enable-sixaxis was given. if test ${enable_sixaxis+y} then : @@ -16306,6 +16496,25 @@ prefix="${ac_default_prefix}" fi +if (test "${exec_prefix}" = "NONE"); then + # exec_prefix defaults to prefix, although our manual handling of the + # latter (above) confuses autoconf. Manually set the exec_prefix. + exec_prefix="${prefix}" +fi + +# Expand any variables containing relative references like ${prefix} and co. +# +# Otherwise we'll end up with literal references in the final binaries or +# manuals, which is not something we really want. + +if (test "$libexecdir" = '${exec_prefix}/libexec'); then + pkglibexecdir="${exec_prefix}/libexec/bluetooth" +else + pkglibexecdir="${libexecdir}/bluetooth" +fi +PKGLIBEXECDIR="${pkglibexecdir}" + + if (test "$localstatedir" = '${prefix}/var'); then storagedir="${prefix}/var/lib/bluetooth" else @@ -16407,21 +16616,39 @@ # Put the nasty error message in config.log where it belongs echo "$SBC_PKG_ERRORS" >&5 - as_fn_error $? "SBC library >= 1.2 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (sbc >= 1.2) were not met: + +$SBC_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables SBC_CFLAGS +and SBC_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "SBC library >= 1.2 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables SBC_CFLAGS +and SBC_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else SBC_CFLAGS=$pkg_cv_SBC_CFLAGS SBC_LIBS=$pkg_cv_SBC_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - fi +fi if (test "${enable_android}" = "yes"); then @@ -16483,21 +16710,39 @@ # Put the nasty error message in config.log where it belongs echo "$SPEEXDSP_PKG_ERRORS" >&5 - as_fn_error $? "SPEEXDSP library >= 1.2 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (speexdsp >= 1.2) were not met: + +$SPEEXDSP_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables SPEEXDSP_CFLAGS +and SPEEXDSP_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "SPEEXDSP library >= 1.2 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables SPEEXDSP_CFLAGS +and SPEEXDSP_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else SPEEXDSP_CFLAGS=$pkg_cv_SPEEXDSP_CFLAGS SPEEXDSP_LIBS=$pkg_cv_SPEEXDSP_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - fi +fi printf "%s\n" "#define ANDROID_STORAGEDIR \"${storagedir}/android\"" >>confdefs.h @@ -16574,20 +16819,38 @@ # Put the nasty error message in config.log where it belongs echo "$LIBEBOOK_PKG_ERRORS" >&5 - as_fn_error $? "libebook >= 3.3 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (libebook-1.2 >= 3.3) were not met: + +$LIBEBOOK_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables LIBEBOOK_CFLAGS +and LIBEBOOK_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "libebook >= 3.3 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables LIBEBOOK_CFLAGS +and LIBEBOOK_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else LIBEBOOK_CFLAGS=$pkg_cv_LIBEBOOK_CFLAGS LIBEBOOK_LIBS=$pkg_cv_LIBEBOOK_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - +fi pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libedataserver-1.2 >= 3.3" >&5 @@ -16647,25 +16910,43 @@ # Put the nasty error message in config.log where it belongs echo "$LIBEDATESERVER_PKG_ERRORS" >&5 - as_fn_error $? "libedataserver >= 3.3 is required" "$LINENO" 5 + as_fn_error $? "Package requirements (libedataserver-1.2 >= 3.3) were not met: + +$LIBEDATESERVER_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables LIBEDATESERVER_CFLAGS +and LIBEDATESERVER_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "libedataserver >= 3.3 is required" "$LINENO" 5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables LIBEDATESERVER_CFLAGS +and LIBEDATESERVER_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see <http://pkg-config.freedesktop.org/>. +See \`config.log' for more details" "$LINENO" 5; } else LIBEDATESERVER_CFLAGS=$pkg_cv_LIBEDATESERVER_CFLAGS LIBEDATESERVER_LIBS=$pkg_cv_LIBEDATESERVER_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - dummy=yes -fi - fi +fi PLUGIN_PHONEBOOK=${plugin_phonebook} -ac_config_files="$ac_config_files Makefile src/bluetoothd.rst lib/bluez.pc mesh/bluetooth-meshd.rst" +ac_config_files="$ac_config_files lib/bluez.pc Makefile mesh/bluetooth-meshd.rst mesh/bluetooth-mesh.service obexd/src/obex.service obexd/src/org.bluez.obex.service src/bluetoothd.rst src/bluetooth.service tools/bluetooth-logger.service" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16876,6 +17157,10 @@ as_fn_error $? "conditional \"MCP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${CCP_TRUE}" && test -z "${CCP_FALSE}"; then + as_fn_error $? "conditional \"CCP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${VCP_TRUE}" && test -z "${VCP_FALSE}"; then as_fn_error $? "conditional \"VCP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -16888,6 +17173,10 @@ as_fn_error $? "conditional \"CSIP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ASHA_TRUE}" && test -z "${ASHA_FALSE}"; then + as_fn_error $? "conditional \"ASHA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${TOOLS_TRUE}" && test -z "${TOOLS_FALSE}"; then as_fn_error $? "conditional \"TOOLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -16896,14 +17185,14 @@ as_fn_error $? "conditional \"MONITOR\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${UDEV_TRUE}" && test -z "${UDEV_FALSE}"; then - as_fn_error $? "conditional \"UDEV\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${CUPS_TRUE}" && test -z "${CUPS_FALSE}"; then as_fn_error $? "conditional \"CUPS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${CUPS_SERVERBIN_TRUE}" && test -z "${CUPS_SERVERBIN_FALSE}"; then + as_fn_error $? "conditional \"CUPS_SERVERBIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${MESH_TRUE}" && test -z "${MESH_FALSE}"; then as_fn_error $? "conditional \"MESH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -16964,6 +17253,10 @@ as_fn_error $? "conditional \"DEPRECATED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${EXTERNAL_PLUGINS_TRUE}" && test -z "${EXTERNAL_PLUGINS_FALSE}"; then + as_fn_error $? "conditional \"EXTERNAL_PLUGINS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${SIXAXIS_TRUE}" && test -z "${SIXAXIS_FALSE}"; then as_fn_error $? "conditional \"SIXAXIS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -17374,7 +17667,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bluez $as_me 5.71, which was +This file was extended by bluez $as_me 5.77, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17442,7 +17735,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -bluez config.status 5.71 +bluez config.status 5.77 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" @@ -17859,10 +18152,15 @@ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/bluetoothd.rst") CONFIG_FILES="$CONFIG_FILES src/bluetoothd.rst" ;; "lib/bluez.pc") CONFIG_FILES="$CONFIG_FILES lib/bluez.pc" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "mesh/bluetooth-meshd.rst") CONFIG_FILES="$CONFIG_FILES mesh/bluetooth-meshd.rst" ;; + "mesh/bluetooth-mesh.service") CONFIG_FILES="$CONFIG_FILES mesh/bluetooth-mesh.service" ;; + "obexd/src/obex.service") CONFIG_FILES="$CONFIG_FILES obexd/src/obex.service" ;; + "obexd/src/org.bluez.obex.service") CONFIG_FILES="$CONFIG_FILES obexd/src/org.bluez.obex.service" ;; + "src/bluetoothd.rst") CONFIG_FILES="$CONFIG_FILES src/bluetoothd.rst" ;; + "src/bluetooth.service") CONFIG_FILES="$CONFIG_FILES src/bluetooth.service" ;; + "tools/bluetooth-logger.service") CONFIG_FILES="$CONFIG_FILES tools/bluetooth-logger.service" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac
View file
_service:tar_scm:bluez-5.71.tar.xz/configure.ac -> _service:tar_scm:bluez-5.77.tar.xz/configure.ac
Changed
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 AC_PREREQ(2.60) -AC_INIT(bluez, 5.71) +AC_INIT(bluez, 5.77) AM_INIT_AUTOMAKE(foreign subdir-objects color-tests silent-rules tar-pax no-dist-gzip dist-xz) @@ -72,23 +72,16 @@ AC_CHECK_HEADERS(linux/types.h linux/if_alg.h linux/uinput.h linux/uhid.h sys/random.h) -PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes, - AC_MSG_ERROR(GLib >= 2.28 is required)) -AC_SUBST(GLIB_CFLAGS) -AC_SUBST(GLIB_LIBS) +PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28) if (test "${enable_threads}" = "yes"); then AC_DEFINE(NEED_THREADS, 1, Define if threading support is required) - PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, - AC_MSG_ERROR(GThread >= 2.16 is required)) + PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16) GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" fi -PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.10, dummy=yes, - AC_MSG_ERROR(D-Bus >= 1.10 is required)) -AC_SUBST(DBUS_CFLAGS) -AC_SUBST(DBUS_LIBS) +PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.10) AC_ARG_WITH(dbusconfdir, AS_HELP_STRING(--with-dbusconfdir=DIR, path to D-Bus configuration directory), @@ -207,6 +200,10 @@ disable MCP profile), enable_mcp=${enableval}) AM_CONDITIONAL(MCP, test "${enable_mcp}" != "no") +AC_ARG_ENABLE(ccp, AS_HELP_STRING(--disable-ccp, + disable CCP profile), enable_ccp=${enableval}) +AM_CONDITIONAL(CCP, test "${enable_ccp}" != "no") + AC_ARG_ENABLE(vcp, AS_HELP_STRING(--disable-vcp, disable VCP profile), enable_vcp=${enableval}) AM_CONDITIONAL(VCP, test "${enable_vcp}" != "no") @@ -219,6 +216,10 @@ disable CSIP profile), enable_csip=${enableval}) AM_CONDITIONAL(CSIP, test "${enable_csip}" != "no") +AC_ARG_ENABLE(asha, AS_HELP_STRING(--disable-asha, + disable ASHA support), enable_asha=${enableval}) +AM_CONDITIONAL(ASHA, test "${enable_asha}" != "no") + AC_ARG_ENABLE(tools, AS_HELP_STRING(--disable-tools, disable Bluetooth tools), enable_tools=${enableval}) AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no") @@ -229,16 +230,10 @@ AC_ARG_ENABLE(udev, AS_HELP_STRING(--disable-udev, disable udev device support), enable_udev=${enableval}) -if (test "${enable_tools}" != "no" && test "${enable_udev}" != "no"); then - PKG_CHECK_MODULES(UDEV, libudev >= 172, dummy=yes, - AC_MSG_ERROR(libudev >= 172 is required)) - AC_SUBST(UDEV_CFLAGS) - AC_SUBST(UDEV_LIBS) - AC_CHECK_LIB(udev, udev_hwdb_new, - AC_DEFINE(HAVE_UDEV_HWDB_NEW, 1, - Define to 1 if you have the udev_hwdb_new() function.)) +if (test "${enable_udev}" != "no"); then + PKG_CHECK_MODULES(UDEV, libudev >= 196) + AC_DEFINE(HAVE_UDEV, 1, Define to 1 if udev is required) fi -AM_CONDITIONAL(UDEV, test "${enable_udev}" != "no") AC_ARG_WITH(udevdir, AS_HELP_STRING(--with-udevdir=DIR, path to udev directory), path_udevdir=${withval}) @@ -255,16 +250,22 @@ AC_ARG_ENABLE(cups, AS_HELP_STRING(--disable-cups, disable CUPS printer support), enable_cups=${enableval}) AM_CONDITIONAL(CUPS, test "${enable_cups}" != "no") +if (test "${enable_cups}" != "no"); then + AC_MSG_CHECKING(cups directory) + cups_serverbin=`$PKG_CONFIG cups --variable=cups_serverbin` + AC_MSG_RESULT(${cups_serverbin}) +fi +AM_CONDITIONAL(CUPS_SERVERBIN, test "${cups_serverbin}" != "") +AS_IF(test "${cups_serverbin}" != "", + AC_SUBST(CUPS_SERVERBIN, ${cups_serverbin}) +) AC_ARG_ENABLE(mesh, AS_HELP_STRING(--enable-mesh, enable Mesh profile support), enable_mesh=${enableval}) AM_CONDITIONAL(MESH, test "${enable_mesh}" = "yes") if (test "${enable_mesh}" = "yes"); then - PKG_CHECK_MODULES(JSONC, json-c >= 0.13, dummy=yes, - AC_MSG_ERROR(json-c >= 0.13 is required)) - AC_SUBST(JSON_CFLAGS) - AC_SUBST(JSON_LIBS) + PKG_CHECK_MODULES(JSONC, json-c >= 0.13) fi AC_ARG_ENABLE(midi, AS_HELP_STRING(--enable-midi, @@ -272,19 +273,13 @@ AM_CONDITIONAL(MIDI, test "${enable_midi}" = "yes") if (test "${enable_midi}" = "yes"); then - PKG_CHECK_MODULES(ALSA, alsa, dummy=yes, - AC_MSG_ERROR(ALSA lib is required for MIDI support)) - AC_SUBST(ALSA_CFLAGS) - AC_SUBST(ALSA_LIBS) + PKG_CHECK_MODULES(ALSA, alsa) fi AC_ARG_ENABLE(obex, AS_HELP_STRING(--disable-obex, disable OBEX profile support), enable_obex=${enableval}) if (test "${enable_obex}" != "no"); then - PKG_CHECK_MODULES(ICAL, libical, dummy=yes, - AC_MSG_ERROR(libical is required)) - AC_SUBST(ICAL_CFLAGS) - AC_SUBST(ICAL_LIBS) + PKG_CHECK_MODULES(ICAL, libical) fi AM_CONDITIONAL(OBEX, test "${enable_obex}" != "no") @@ -296,10 +291,7 @@ enable external Embedded Linux library), enable_external_ell=${enableval}) if (test "${enable_external_ell}" = "yes"); then - PKG_CHECK_MODULES(ELL, ell >= 0.39, dummy=yes, - AC_MSG_ERROR(Embedded Linux library >= 0.39 is required)) - AC_SUBST(ELL_CFLAGS) - AC_SUBST(ELL_LIBS) + PKG_CHECK_MODULES(ELL, ell >= 0.39) fi if (test "${enable_external_ell}" != "yes" && (test "${enable_btpclient}" = "yes" || test "${enable_mesh}" = "yes")); then @@ -389,6 +381,16 @@ enable_deprecated=${enableval}) AM_CONDITIONAL(DEPRECATED, test "${enable_deprecated}" = "yes") +AC_ARG_ENABLE(external-plugins, AS_HELP_STRING(--enable-external-plugins, + enable support for external plugins), + enable_external_plugins=${enableval}) +AM_CONDITIONAL(EXTERNAL_PLUGINS, test "${enable_external_plugins}" = "yes") +if (test "${enable_external_plugins}" = "yes"); then + AC_DEFINE(EXTERNAL_PLUGINS, 1, Define if external plugin support is required) +else + AC_DEFINE(EXTERNAL_PLUGINS, 0, Define if external plugin support is required) +fi + AC_ARG_ENABLE(sixaxis, AS_HELP_STRING(--enable-sixaxis, enable sixaxis plugin), enable_sixaxis=${enableval}) AM_CONDITIONAL(SIXAXIS, test "${enable_sixaxis}" = "yes" && @@ -416,6 +418,24 @@ prefix="${ac_default_prefix}" fi +if (test "${exec_prefix}" = "NONE"); then + # exec_prefix defaults to prefix, although our manual handling of the + # latter (above) confuses autoconf. Manually set the exec_prefix. + exec_prefix="${prefix}" +fi + +# Expand any variables containing relative references like ${prefix} and co. +# +# Otherwise we'll end up with literal references in the final binaries or +# manuals, which is not something we really want. + +if (test "$libexecdir" = '${exec_prefix}/libexec'); then + pkglibexecdir="${exec_prefix}/libexec/bluetooth" +else + pkglibexecdir="${libexecdir}/bluetooth" +fi +AC_SUBST(PKGLIBEXECDIR, "${pkglibexecdir}") + if (test "$localstatedir" = '${prefix}/var'); then storagedir="${prefix}/var/lib/bluetooth" else @@ -443,17 +463,11 @@ AM_CONDITIONAL(ANDROID, test "${enable_android}" = "yes") if (test "${enable_android}" = "yes"); then - PKG_CHECK_MODULES(SBC, sbc >= 1.2, dummy=yes, - AC_MSG_ERROR(SBC library >= 1.2 is required)) - AC_SUBST(SBC_CFLAGS) - AC_SUBST(SBC_LIBS) + PKG_CHECK_MODULES(SBC, sbc >= 1.2) fi if (test "${enable_android}" = "yes"); then - PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2, dummy=yes, - AC_MSG_ERROR(SPEEXDSP library >= 1.2 is required)) - AC_SUBST(SPEEXDSP_CFLAGS) - AC_SUBST(SPEEXDSP_LIBS) + PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2) fi AC_DEFINE_UNQUOTED(ANDROID_STORAGEDIR, "${storagedir}/android", @@ -467,17 +481,20 @@ fi if (test "${plugin_phonebook}" = "ebook"); then - PKG_CHECK_MODULES(LIBEBOOK, libebook-1.2 >= 3.3, dummy=yes, - AC_MSG_ERROR(libebook >= 3.3 is required)) - AC_SUBST(LIBEBOOK_CFLAGS) - AC_SUBST(LIBEBOOK_LIBS) - PKG_CHECK_MODULES(LIBEDATESERVER, libedataserver-1.2 >= 3.3, - dummy=yes, - AC_MSG_ERROR(libedataserver >= 3.3 is required)) - AC_SUBST(LIBEDATESERVER_CFLAGS) - AC_SUBST(LIBEDATESERVER_LIBS) + PKG_CHECK_MODULES(LIBEBOOK, libebook-1.2 >= 3.3) + PKG_CHECK_MODULES(LIBEDATESERVER, libedataserver-1.2 >= 3.3) fi AC_SUBST(PLUGIN_PHONEBOOK, ${plugin_phonebook}) -AC_CONFIG_FILES(Makefile src/bluetoothd.rst lib/bluez.pc mesh/bluetooth-meshd.rst) +AC_CONFIG_FILES( + lib/bluez.pc + Makefile + mesh/bluetooth-meshd.rst + mesh/bluetooth-mesh.service + obexd/src/obex.service + obexd/src/org.bluez.obex.service + src/bluetoothd.rst + src/bluetooth.service + tools/bluetooth-logger.service +) AC_OUTPUT
View file
_service:tar_scm:bluez-5.77.tar.xz/doc/l2cap.7
Added
@@ -0,0 +1,592 @@ +'\" t +.\" Man page generated from reStructuredText. +. +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\nan-margin +level \\nrst2man-indent-level +level margin: \\nrst2man-indent\\nrst2man-indent-level +- +\\nrst2man-indent0 +\\nrst2man-indent1 +\\nrst2man-indent2 +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\nrst2man-indent-level \\nan-margin +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\nan-margin +.\" old: \\nrst2man-indent\\nrst2man-indent-level +.nr rst2man-indent-level -1 +.\" new: \\nrst2man-indent\\nrst2man-indent-level +.in \\nrst2man-indent\\nrst2man-indent-levelu +.. +.TH "L2CAP" 7 "May 2024" "BlueZ" "Linux System Administration" +.SH NAME +l2cap \- L2CAP protocol +.SH SYNOPSIS +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +#include <sys/socket.h> +#include <bluetooth/bluetooth.h> +#include <bluetooth/l2cap.h> + +l2cap_socket = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); +.EE +.UNINDENT +.UNINDENT +.SH DESCRIPTION +.sp +L2CAP is a protocol that provides an interface for higher\-level protocols to +send and receive data over a Bluetooth connection. L2CAP sits on top of the +Bluetooth Host Controller Interface (HCI) and provides a set of channels that +can be used by higher\-level protocols to transmit data. +.sp +L2CAP provides a number of services to higher\-level protocols, including +segmentation and reassembly of large data packets and flow control to prevent +overloading of the receiver. L2CAP also supports multiple channels per +connection, allowing for concurrent data transmission using different protocols. +.SH SOCKET ADDRESS +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +struct sockaddr_l2 { + sa_family_t l2_family; + unsigned short l2_psm; + bdaddr_t l2_bdaddr; + unsigned short l2_cid; + uint8_t l2_bdaddr_type; +}; +.EE +.UNINDENT +.UNINDENT +.sp +Example: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +struct sockaddr_l2 addr; + +memset(&addr, 0, sizeof(addr)); +addr\&.l2_family = AF_BLUETOOTH; +bacpy(&addr\&.l2_bdaddr, bdaddr); + +if (cid) + addr\&.l2_cid = htobs(cid); +else + addr\&.l2_psm = htobs(psm); + +addr\&.l2_bdaddr_type = bdaddr_type; +.EE +.UNINDENT +.UNINDENT +.SH SOCKET OPTIONS +.sp +The socket options listed below can be set by using \fBsetsockopt(2)\fP and read +with \fBgetsockopt(2)\fP with the socket level set to SOL_BLUETOOTH. +.SS BT_SECURITY (since Linux 2.6.30) +.sp +Channel security level, possible values: +.TS +center; +|l|l|l|l|. +_ +T{ +Value +T} T{ +Security Level +T} T{ +Link Key Type +T} T{ +Encryption +T} +_ +T{ +\fBBT_SECURITY_SDP\fP +T} T{ +0 (SDP Only) +T} T{ +None +T} T{ +Not required +T} +_ +T{ +\fBBT_SECURITY_LOW\fP +T} T{ +1 (Low) +T} T{ +Unauthenticated +T} T{ +Not required +T} +_ +T{ +\fBBT_SECURITY_MEDIUM\fP +T} T{ +2 (Medium \- default) +T} T{ +Unauthenticated +T} T{ +Desired +T} +_ +T{ +\fBBT_SECURITY_HIGH\fP +T} T{ +3 (High) +T} T{ +Authenticated +T} T{ +Required +T} +_ +T{ +\fBBT_SECURITY_FIPS\fP (since Linux 3.15) +T} T{ +4 (Secure Only) +T} T{ +Authenticated (P\-256 based Secure Simple Pairing and Secure Authentication) +T} T{ +Required +T} +_ +.TE +.sp +Example: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +int level = BT_SECURITY_HIGH; +int err = setsockopt(l2cap_socket, SOL_BLUETOOTH, BT_SECURITY, &level, + sizeof(level)); +if (err == \-1) { + perror(\(dqsetsockopt\(dq); + return 1; +} +.EE +.UNINDENT +.UNINDENT +.SS BT_DEFER_SETUP (since Linux 2.6.30) +.sp +Channel defer connection setup, this control if the connection procedure +needs to be authorized by userspace before responding which allows +authorization at profile level, possible values: +.TS +center; +|l|l|l|. +_ +T{ +Value +T} T{ +Description +T} T{ +Authorization +T} +_ +T{ +\fB0\fP +T} T{ +Disable (default) +T} T{ +Not required +T} +_ +T{ +\fB1\fP +T} T{ +Enable +T} T{ +Required +T} +_ +.TE +.sp +Example: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +int defer_setup = 1; +int err = setsockopt(l2cap_socket, SOL_BLUETOOTH, BT_DEFER_SETUP, + &defer_setup, sizeof(defer_setup)); +if (err == \-1) { + perror(\(dqsetsockopt\(dq); + return err; +} + +err = listen(l2cap_socket, 5); +if (err) { + perror(\(dqlisten\(dq); + return err; +} + +struct sockaddr_l2 remote_addr = {0}; +socklen_t addr_len = sizeof(remote_addr); +int new_socket = accept(l2cap_socket, (struct sockaddr*)&remote_addr, + &addr_len); +if (new_socket < 0) { + perror(\(dqaccept\(dq); + return new_socket; +} + +/* To complete the connection setup of new_socket read 1 byte */ +char c; +struct pollfd pfd; + +memset(&pfd, 0, sizeof(pfd)); +pfd\&.fd = new_socket; +pfd\&.events = POLLOUT; + +err = poll(&pfd, 1, 0); +if (err) { + perror(\(dqpoll\(dq); + return err; +} + +if (!(pfd\&.revents & POLLOUT)) { + err = read(sk, &c, 1); + if (err < 0) { + perror(\(dqread\(dq); + return err; + } +} +.EE +.UNINDENT +.UNINDENT +.SS BT_FLUSHABLE (since Linux 2.6.39) +.sp +Channel flushable flag, this control if the channel data can be flushed or +not, possible values: +.TS +center; +|l|l|l|. +_ +T{ +Define +T} T{ +Value +T} T{ +Description +T} +_ +T{ +\fBBT_FLUSHABLE_OFF\fP +T} T{ +0x00 (default) +T} T{ +Do not flush data +T} +_ +T{ +\fBBT_FLUSHABLE_ON\fP +T} T{ +0x01 +T} T{ +Flush data +T} +_ +.TE +.SS BT_POWER (since Linux 3.1) +.sp +Channel power policy, this control if the channel shall force exit of sniff +mode or not, possible values: +.TS +center; +|l|l|l|. +_ +T{ +Define +T} T{ +Value +T} T{ +Description +T} +_ +T{ +\fBBT_POWER_FORCE_ACTIVE_OFF\fP +T} T{ +0x00 (default) +T} T{ +Don\(aqt force exit of sniff mode +T} +_ +T{ +\fBBT_POWER_FORCE_ACTIVE_ON\fP +T} T{ +0x01 +T} T{ +Force exit of sniff mode +T} +_ +.TE +.SS BT_CHANNEL_POLICY (since Linux 3.10) +.sp +High\-speed (AMP) channel policy, possible values: +.TS +center; +|l|l|l|. +_ +T{ +Define +T} T{ +Value +T} T{ +Description +T} +_ +T{ +\fBBT_CHANNEL_POLICY_BREDR_ONLY\fP +T} T{ +0 (default) +T} T{ +BR/EDR only +T} +_ +T{ +\fBBT_CHANNEL_POLICY_BREDR_PREFERRED\fP +T} T{ +1 +T} T{ +BR/EDR Preferred +T} +_ +T{ +\fBBT_CHANNEL_POLICY_BREDR_PREFERRED\fP +T} T{ +2 +T} T{ +AMP Preferred +T} +_ +.TE +.SS BT_PHY (since Linux 5.10) +.sp +Channel supported PHY(s), possible values: +.TS +center; +|l|l|l|. +_ +T{ +Define +T} T{ +Value +T} T{ +Description +T} +_ +T{ +\fBBT_PHY_BR_1M_1SLOT\fP +T} T{ +BIT 0 +T} T{ +BR 1Mbps 1SLOT +T} +_ +T{ +\fBBT_PHY_BR_1M_3SLOT\fP +T} T{ +BIT 1 +T} T{ +BR 1Mbps 3SLOT +T} +_ +T{ +\fBBT_PHY_BR_1M_5SLOT\fP +T} T{ +BIT 2 +T} T{ +BR 1Mbps 5SLOT +T} +_ +T{ +\fBBT_PHY_BR_2M_1SLOT\fP +T} T{ +BIT 3 +T} T{ +EDR 2Mbps 1SLOT +T} +_ +T{ +\fBBT_PHY_BR_2M_3SLOT\fP +T} T{ +BIT 4 +T} T{ +EDR 2Mbps 3SLOT +T} +_ +T{ +\fBBT_PHY_BR_2M_5SLOT\fP +T} T{ +BIT 5 +T} T{ +EDR 2Mbps 5SLOT +T} +_ +T{ +\fBBT_PHY_BR_3M_1SLOT\fP +T} T{ +BIT 6 +T} T{ +EDR 3Mbps 1SLOT +T} +_ +T{ +\fBBT_PHY_BR_3M_3SLOT\fP +T} T{ +BIT 7 +T} T{ +EDR 3Mbps 3SLOT +T} +_ +T{ +\fBBT_PHY_BR_3M_5SLOT\fP +T} T{ +BIT 8 +T} T{ +EDR 3Mbps 5SLOT +T} +_ +T{ +\fBBT_PHY_LE_1M_TX\fP +T} T{ +BIT 9 +T} T{ +LE 1Mbps TX +T} +_ +T{ +\fBBT_PHY_LE_1M_RX\fP +T} T{ +BIT 10 +T} T{ +LE 1Mbps RX +T} +_ +T{ +\fBBT_PHY_LE_2M_TX\fP +T} T{ +BIT 11 +T} T{ +LE 2Mbps TX +T} +_ +T{ +\fBBT_PHY_LE_2M_RX\fP +T} T{ +BIT 12 +T} T{ +LE 2Mbps RX +T} +_ +T{ +\fBBT_PHY_LE_CODED_TX\fP +T} T{ +BIT 13 +T} T{ +LE Coded TX +T} +_ +T{ +\fBBT_PHY_LE_CODED_RX\fP +T} T{ +BIT 14 +T} T{ +LE Coded RX +T} +_ +.TE +.SS BT_MODE (since Linux 5.10) +.sp +Channel Mode, possible values: +.TS +center; +|l|l|l|l|. +_ +T{ +Define +T} T{ +Value +T} T{ +Description +T} T{ +Link +T} +_ +T{ +\fBBT_MODE_BASIC\fP +T} T{ +0x00 (default) +T} T{ +Basic mode +T} T{ +Any +T} +_ +T{ +\fBBT_MODE_ERTM\fP +T} T{ +0x01 +T} T{ +Enhanced Retransmission mode +T} T{ +BR/EDR +T} +_ +T{ +\fBBT_MODE_STREAM\fP +T} T{ +0x02 +T} T{ +Stream mode +T} T{ +BR/EDR +T} +_ +T{ +\fBBT_MODE_LE_FLOWCTL\fP +T} T{ +0x03 +T} T{ +Credit based flow control mode +T} T{ +LE +T} +_ +T{ +\fBBT_MODE_EXT_FLOWCTL\fP +T} T{ +0x04 +T} T{ +Extended Credit based flow control mode +T} T{ +Any +T} +_ +.TE +.SH RESOURCES +.sp +\fI\%http://www.bluez.org\fP +.SH REPORTING BUGS +.sp +\fI\%linux\-bluetooth@vger.kernel.org\fP +.SH SEE ALSO +.sp +socket(7), l2test(1) +.SH COPYRIGHT +Free use of this software is granted under ther terms of the GNU +Lesser General Public Licenses (LGPL). +.\" Generated by docutils manpage writer. +.
View file
_service:tar_scm:bluez-5.77.tar.xz/doc/l2cap.rst
Added
@@ -0,0 +1,258 @@ +===== +l2cap +===== + +-------------- +L2CAP protocol +-------------- + +:Version: BlueZ +:Copyright: Free use of this software is granted under ther terms of the GNU + Lesser General Public Licenses (LGPL). +:Date: May 2024 +:Manual section: 7 +:Manual group: Linux System Administration + +SYNOPSIS +======== + +.. code-block:: c + + #include <sys/socket.h> + #include <bluetooth/bluetooth.h> + #include <bluetooth/l2cap.h> + + l2cap_socket = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP); + +DESCRIPTION +=========== + +L2CAP is a protocol that provides an interface for higher-level protocols to +send and receive data over a Bluetooth connection. L2CAP sits on top of the +Bluetooth Host Controller Interface (HCI) and provides a set of channels that +can be used by higher-level protocols to transmit data. + +L2CAP provides a number of services to higher-level protocols, including +segmentation and reassembly of large data packets and flow control to prevent +overloading of the receiver. L2CAP also supports multiple channels per +connection, allowing for concurrent data transmission using different protocols. + +SOCKET ADDRESS +============== + +.. code-block:: c + + struct sockaddr_l2 { + sa_family_t l2_family; + unsigned short l2_psm; + bdaddr_t l2_bdaddr; + unsigned short l2_cid; + uint8_t l2_bdaddr_type; + }; + +Example: + +.. code-block:: c + + struct sockaddr_l2 addr; + + memset(&addr, 0, sizeof(addr)); + addr.l2_family = AF_BLUETOOTH; + bacpy(&addr.l2_bdaddr, bdaddr); + + if (cid) + addr.l2_cid = htobs(cid); + else + addr.l2_psm = htobs(psm); + + addr.l2_bdaddr_type = bdaddr_type; + +SOCKET OPTIONS +============== + +The socket options listed below can be set by using **setsockopt(2)** and read +with **getsockopt(2)** with the socket level set to SOL_BLUETOOTH. + +BT_SECURITY (since Linux 2.6.30) +-------------------------------- + +Channel security level, possible values: + +.. csv-table:: + :header: "Value", "Security Level", "Link Key Type", "Encryption" + :widths: auto + + **BT_SECURITY_SDP**, 0 (SDP Only), None, Not required + **BT_SECURITY_LOW**, 1 (Low), Unauthenticated, Not required + **BT_SECURITY_MEDIUM**, 2 (Medium - default), Unauthenticated, Desired + **BT_SECURITY_HIGH**, 3 (High), Authenticated, Required + **BT_SECURITY_FIPS** (since Linux 3.15), 4 (Secure Only), Authenticated (P-256 based Secure Simple Pairing and Secure Authentication), Required + +Example: + +.. code-block:: c + + int level = BT_SECURITY_HIGH; + int err = setsockopt(l2cap_socket, SOL_BLUETOOTH, BT_SECURITY, &level, + sizeof(level)); + if (err == -1) { + perror("setsockopt"); + return 1; + } + +BT_DEFER_SETUP (since Linux 2.6.30) +----------------------------------- + +Channel defer connection setup, this control if the connection procedure +needs to be authorized by userspace before responding which allows +authorization at profile level, possible values: + +.. csv-table:: + :header: "Value", "Description", "Authorization" + :widths: auto + + **0**, Disable (default), Not required + **1**, Enable, Required + +Example: + +.. code-block:: c + + int defer_setup = 1; + int err = setsockopt(l2cap_socket, SOL_BLUETOOTH, BT_DEFER_SETUP, + &defer_setup, sizeof(defer_setup)); + if (err == -1) { + perror("setsockopt"); + return err; + } + + err = listen(l2cap_socket, 5); + if (err) { + perror("listen"); + return err; + } + + struct sockaddr_l2 remote_addr = {0}; + socklen_t addr_len = sizeof(remote_addr); + int new_socket = accept(l2cap_socket, (struct sockaddr*)&remote_addr, + &addr_len); + if (new_socket < 0) { + perror("accept"); + return new_socket; + } + + /* To complete the connection setup of new_socket read 1 byte */ + char c; + struct pollfd pfd; + + memset(&pfd, 0, sizeof(pfd)); + pfd.fd = new_socket; + pfd.events = POLLOUT; + + err = poll(&pfd, 1, 0); + if (err) { + perror("poll"); + return err; + } + + if (!(pfd.revents & POLLOUT)) { + err = read(sk, &c, 1); + if (err < 0) { + perror("read"); + return err; + } + } + +BT_FLUSHABLE (since Linux 2.6.39) +--------------------------------- + +Channel flushable flag, this control if the channel data can be flushed or +not, possible values: + +.. csv-table:: + :header: "Define", "Value", "Description" + :widths: auto + + **BT_FLUSHABLE_OFF**, 0x00 (default), Do not flush data + **BT_FLUSHABLE_ON**, 0x01, Flush data + +BT_POWER (since Linux 3.1) +-------------------------- + +Channel power policy, this control if the channel shall force exit of sniff +mode or not, possible values: + +.. csv-table:: + :header: "Define", "Value", "Description" + :widths: auto + + **BT_POWER_FORCE_ACTIVE_OFF**, 0x00 (default), Don't force exit of sniff mode + **BT_POWER_FORCE_ACTIVE_ON**, 0x01, Force exit of sniff mode + +BT_CHANNEL_POLICY (since Linux 3.10) +------------------------------------ + +High-speed (AMP) channel policy, possible values: + +.. csv-table:: + :header: "Define", "Value", "Description" + :widths: auto + + **BT_CHANNEL_POLICY_BREDR_ONLY**, 0 (default), BR/EDR only + **BT_CHANNEL_POLICY_BREDR_PREFERRED**, 1, BR/EDR Preferred + **BT_CHANNEL_POLICY_BREDR_PREFERRED**, 2, AMP Preferred + +BT_PHY (since Linux 5.10) +------------------------- + +Channel supported PHY(s), possible values: + +.. csv-table:: + :header: "Define", "Value", "Description" + :widths: auto + + **BT_PHY_BR_1M_1SLOT**, BIT 0, BR 1Mbps 1SLOT + **BT_PHY_BR_1M_3SLOT**, BIT 1, BR 1Mbps 3SLOT + **BT_PHY_BR_1M_5SLOT**, BIT 2, BR 1Mbps 5SLOT + **BT_PHY_BR_2M_1SLOT**, BIT 3, EDR 2Mbps 1SLOT + **BT_PHY_BR_2M_3SLOT**, BIT 4, EDR 2Mbps 3SLOT + **BT_PHY_BR_2M_5SLOT**, BIT 5, EDR 2Mbps 5SLOT + **BT_PHY_BR_3M_1SLOT**, BIT 6, EDR 3Mbps 1SLOT + **BT_PHY_BR_3M_3SLOT**, BIT 7, EDR 3Mbps 3SLOT + **BT_PHY_BR_3M_5SLOT**, BIT 8, EDR 3Mbps 5SLOT + **BT_PHY_LE_1M_TX**, BIT 9, LE 1Mbps TX + **BT_PHY_LE_1M_RX**, BIT 10, LE 1Mbps RX + **BT_PHY_LE_2M_TX**, BIT 11, LE 2Mbps TX + **BT_PHY_LE_2M_RX**, BIT 12, LE 2Mbps RX + **BT_PHY_LE_CODED_TX**, BIT 13, LE Coded TX + **BT_PHY_LE_CODED_RX**, BIT 14, LE Coded RX + +BT_MODE (since Linux 5.10) +-------------------------- + +Channel Mode, possible values: + +.. csv-table:: + :header: "Define", "Value", "Description", "Link" + :widths: auto + + **BT_MODE_BASIC**, 0x00 (default), Basic mode, Any + **BT_MODE_ERTM**, 0x01, Enhanced Retransmission mode, BR/EDR + **BT_MODE_STREAM**, 0x02, Stream mode, BR/EDR + **BT_MODE_LE_FLOWCTL**, 0x03, Credit based flow control mode, LE + **BT_MODE_EXT_FLOWCTL**, 0x04, Extended Credit based flow control mode, Any + +RESOURCES +========= + +http://www.bluez.org + +REPORTING BUGS +============== + +linux-bluetooth@vger.kernel.org + +SEE ALSO +======== + +socket(7), l2test(1)
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.GattCharacteristic.5 -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.GattCharacteristic.5
Changed
@@ -163,6 +163,8 @@ .B org.bluez.Error.NotAuthorized .TP .B org.bluez.Error.NotSupported +.TP +.B org.bluez.Error.ImproperlyConfigured .UNINDENT .UNINDENT .UNINDENT
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.GattCharacteristic.rst -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.GattCharacteristic.rst
Changed
@@ -133,6 +133,7 @@ :org.bluez.Error.InvalidValueLength: :org.bluez.Error.NotAuthorized: :org.bluez.Error.NotSupported: + :org.bluez.Error.ImproperlyConfigured: fd, uint16 AcquireWrite(dict options) optional ````````````````````````````````````````````````
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.GattDescriptor.5 -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.GattDescriptor.5
Changed
@@ -153,6 +153,8 @@ .B org.bluez.Error.NotAuthorized .TP .B org.bluez.Error.NotSupported +.TP +.B org.bluez.Error.ImproperlyConfigured .UNINDENT .UNINDENT .UNINDENT
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.GattDescriptor.rst -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.GattDescriptor.rst
Changed
@@ -115,6 +115,7 @@ :org.bluez.Error.InvalidValueLength: :org.bluez.Error.NotAuthorized: :org.bluez.Error.NotSupported: + :org.bluez.Error.ImproperlyConfigured: Properties ----------
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.LEAdvertisement.5 -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.LEAdvertisement.5
Changed
@@ -110,7 +110,7 @@ with the data. .UNINDENT .UNINDENT -.SS dict Data Experimental +.SS dict Data .INDENT 0.0 .INDENT 3.5 Advertising Data to include. Key is the advertising type and value is @@ -132,7 +132,7 @@ .UNINDENT .UNINDENT .UNINDENT -.SS bool Discoverable Experimental +.SS bool Discoverable .INDENT 0.0 .INDENT 3.5 Advertise as general discoverable. When present this will override @@ -142,7 +142,7 @@ \(dqbroadcast\(dq. .UNINDENT .UNINDENT -.SS uint16 DiscoverableTimeout Experimental +.SS uint16 DiscoverableTimeout .INDENT 0.0 .INDENT 3.5 The discoverable timeout in seconds. A value of zero means that the @@ -196,7 +196,7 @@ the advertisement. .UNINDENT .UNINDENT -.SS string SecondaryChannel Experimental +.SS string SecondaryChannel .INDENT 0.0 .INDENT 3.5 Secondary channel to be used. Primary channel is always set to \(dq1M\(dq @@ -213,7 +213,7 @@ .UNINDENT .UNINDENT .UNINDENT -.SS uint32 MinInterval Experimental +.SS uint32 MinInterval .INDENT 0.0 .INDENT 3.5 Minimum advertising interval to be used by the advertising set, in @@ -222,7 +222,7 @@ the registration will return failure. .UNINDENT .UNINDENT -.SS uint32 MaxInterval Experimental +.SS uint32 MaxInterval .INDENT 0.0 .INDENT 3.5 Maximum advertising interval to be used by the advertising set, in @@ -231,7 +231,7 @@ registration will return failure. .UNINDENT .UNINDENT -.SS int16 TxPower Experimental +.SS int16 TxPower .INDENT 0.0 .INDENT 3.5 Requested transmission power of this advertising set. The provided value
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.LEAdvertisement.rst -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.LEAdvertisement.rst
Changed
@@ -83,8 +83,8 @@ Service Data elements to include. The keys are the UUID to associate with the data. -dict Data Experimental -```````````````````````` +dict Data +````````` Advertising Data to include. Key is the advertising type and value is the data as byte array. @@ -101,8 +101,8 @@ <Transport Discovery> <Organization Flags...> 0x26 0x01 0x01... -bool Discoverable Experimental -```````````````````````````````` +bool Discoverable +````````````````` Advertise as general discoverable. When present this will override adapter Discoverable property. @@ -110,8 +110,8 @@ Note: This property shall not be set when **Type** is set to "broadcast". -uint16 DiscoverableTimeout Experimental -````````````````````````````````````````` +uint16 DiscoverableTimeout +`````````````````````````` The discoverable timeout in seconds. A value of zero means that the timeout is disabled and it will stay in discoverable/limited mode @@ -158,8 +158,8 @@ Timeout of the advertisement in seconds. This defines the lifetime of the advertisement. -string SecondaryChannel Experimental -`````````````````````````````````````` +string SecondaryChannel +``````````````````````` Secondary channel to be used. Primary channel is always set to "1M" except when "Coded" is set. @@ -170,24 +170,24 @@ :"2M": :"Coded": -uint32 MinInterval Experimental -````````````````````````````````` +uint32 MinInterval +`````````````````` Minimum advertising interval to be used by the advertising set, in milliseconds. Acceptable values are in the range 20ms, 10,485s. If the provided MinInterval is larger than the provided MaxInterval, the registration will return failure. -uint32 MaxInterval Experimental -````````````````````````````````` +uint32 MaxInterval +`````````````````` Maximum advertising interval to be used by the advertising set, in milliseconds. Acceptable values are in the range 20ms, 10,485s. If the provided MinInterval is larger than the provided MaxInterval, the registration will return failure. -int16 TxPower Experimental -```````````````````````````` +int16 TxPower +````````````` Requested transmission power of this advertising set. The provided value is used only if the "CanSetTxPower" feature is enabled on the
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.LEAdvertisingManager.5 -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.LEAdvertisingManager.5
Changed
@@ -120,7 +120,7 @@ .UNINDENT .UNINDENT .UNINDENT -.SS array{string} SupportedSecondaryChannels readonly, Experimental +.SS array{string} SupportedSecondaryChannels readonly .INDENT 0.0 .INDENT 3.5 List of supported Secondary channels. Secondary channels can be used to @@ -137,7 +137,7 @@ .UNINDENT .UNINDENT .UNINDENT -.SS dict SupportedCapabilities readonly, Experimental +.SS dict SupportedCapabilities readonly .INDENT 0.0 .INDENT 3.5 Enumerates Advertising\-related controller capabilities useful to the @@ -166,7 +166,7 @@ .UNINDENT .UNINDENT .UNINDENT -.SS array{string} SupportedFeatures readonly,optional,Experimental +.SS array{string} SupportedFeatures readonly,optional .INDENT 0.0 .INDENT 3.5 List of supported platform features. If no features are available on
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.LEAdvertisingManager.rst -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.LEAdvertisingManager.rst
Changed
@@ -89,8 +89,8 @@ :"local-name": :"rsi": -array{string} SupportedSecondaryChannels readonly, Experimental -````````````````````````````````````````````````````````````````` +array{string} SupportedSecondaryChannels readonly +``````````````````````````````````````````````````` List of supported Secondary channels. Secondary channels can be used to advertise with the corresponding PHY. @@ -101,8 +101,8 @@ :"2M": :"Coded": -dict SupportedCapabilities readonly, Experimental -``````````````````````````````````````````````````` +dict SupportedCapabilities readonly +````````````````````````````````````` Enumerates Advertising-related controller capabilities useful to the client. @@ -125,8 +125,8 @@ Max advertising tx power (dBm) -array{string} SupportedFeatures readonly,optional,Experimental -```````````````````````````````````````````````````````````````` +array{string} SupportedFeatures readonly,optional +``````````````````````````````````````````````````` List of supported platform features. If no features are available on the platform, the SupportedFeatures array will be empty.
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.MediaEndpoint.5 -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.MediaEndpoint.5
Changed
@@ -101,6 +101,8 @@ .TP .B uint32 Locations .TP +.B uint32_t ChannelAllocation +.TP .B dict QoS .INDENT 7.0 .TP
View file
_service:tar_scm:bluez-5.71.tar.xz/doc/org.bluez.MediaEndpoint.rst -> _service:tar_scm:bluez-5.77.tar.xz/doc/org.bluez.MediaEndpoint.rst
Changed
@@ -79,6 +79,8 @@ :uint32 Locations: + :uint32_t ChannelAllocation: + :dict QoS: :byte Framing:
View file
_service:tar_scm:bluez-5.77.tar.xz/doc/rfcomm.7
Added
@@ -0,0 +1,464 @@ +'\" t +.\" Man page generated from reStructuredText. +. +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\nan-margin +level \\nrst2man-indent-level +level margin: \\nrst2man-indent\\nrst2man-indent-level +- +\\nrst2man-indent0 +\\nrst2man-indent1 +\\nrst2man-indent2 +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\nrst2man-indent-level \\nan-margin +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\nan-margin +.\" old: \\nrst2man-indent\\nrst2man-indent-level +.nr rst2man-indent-level -1 +.\" new: \\nrst2man-indent\\nrst2man-indent-level +.in \\nrst2man-indent\\nrst2man-indent-levelu +.. +.TH "RFCOMM" 7 "May 2024" "BlueZ" "Linux System Administration" +.SH NAME +rfcomm \- RFCOMM protocol +.SH SYNOPSIS +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +#include <sys/socket.h> +#include <bluetooth/bluetooth.h> +#include <bluetooth/rfcomm.h> + +rfcomm_socket = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); +.EE +.UNINDENT +.UNINDENT +.SH DESCRIPTION +.sp +The RFCOMM protocol provides emulation of serial ports over the L2CAP(7) +protocol. The protocol is based on the ETSI standard TS 07.10. +.sp +RFCOMM is a simple transport protocol, with additional provisions for emulating +the 9 circuits of RS\-232 (EIATIA\-232\-E) serial ports. +.SH SOCKET ADDRESS +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +struct sockaddr_rc { + sa_family_t rc_family; + unsigned short rc_bdaddr; + unsigned char rc_channel; +}; +.EE +.UNINDENT +.UNINDENT +.sp +Example: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +struct sockaddr_rc addr; + +memset(&addr, 0, sizeof(addr)); +addr\&.rc_family = AF_BLUETOOTH; +bacpy(&addr\&.rc_bdaddr, bdaddr); +addr\&.rc_channel = channel; +.EE +.UNINDENT +.UNINDENT +.SH SOCKET OPTIONS +.sp +The socket options listed below can be set by using \fBsetsockopt(2)\fP and read +with \fBgetsockopt(2)\fP with the socket level set to SOL_BLUETOOTH. +.SS BT_SECURITY (since Linux 2.6.30) +.sp +Channel security level, possible values: +.TS +center; +|l|l|l|l|. +_ +T{ +Value +T} T{ +Security Level +T} T{ +Link Key Type +T} T{ +Encryption +T} +_ +T{ +\fBBT_SECURITY_SDP\fP +T} T{ +0 (SDP Only) +T} T{ +None +T} T{ +Not required +T} +_ +T{ +\fBBT_SECURITY_LOW\fP +T} T{ +1 (Low) +T} T{ +Unauthenticated +T} T{ +Not required +T} +_ +T{ +\fBBT_SECURITY_MEDIUM\fP +T} T{ +2 (Medium \- default) +T} T{ +Unauthenticated +T} T{ +Desired +T} +_ +T{ +\fBBT_SECURITY_HIGH\fP +T} T{ +3 (High) +T} T{ +Authenticated +T} T{ +Required +T} +_ +T{ +\fBBT_SECURITY_FIPS\fP (since Linux 3.15) +T} T{ +4 (Secure Only) +T} T{ +Authenticated (P\-256 based Secure Simple Pairing and Secure Authentication) +T} T{ +Required +T} +_ +.TE +.sp +Example: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +int level = BT_SECURITY_HIGH; +int err = setsockopt(rfcomm_socket, SOL_BLUETOOTH, BT_SECURITY, &level, + sizeof(level)); +if (err == \-1) { + perror(\(dqsetsockopt\(dq); + return 1; +} +.EE +.UNINDENT +.UNINDENT +.SS BT_DEFER_SETUP (since Linux 2.6.30) +.sp +Channel defer connection setup, this control if the connection procedure +needs to be authorized by userspace before responding which allows +authorization at profile level, possible values: +.TS +center; +|l|l|l|. +_ +T{ +Value +T} T{ +Description +T} T{ +Authorization +T} +_ +T{ +\fB0\fP +T} T{ +Disable (default) +T} T{ +Not required +T} +_ +T{ +\fB1\fP +T} T{ +Enable +T} T{ +Required +T} +_ +.TE +.sp +Example: +.INDENT 0.0 +.INDENT 3.5 +.sp +.EX +int defer_setup = 1; +int err = setsockopt(rfcomm_socket, SOL_BLUETOOTH, BT_DEFER_SETUP, + &defer_setup, sizeof(defer_setup)); +if (err == \-1) { + perror(\(dqsetsockopt\(dq); + return err; +} + +err = listen(rfcomm_socket, 5); +if (err) { + perror(\(dqlisten\(dq); + return err; +} + +struct sockaddr_rc remote_addr = {0}; +socklen_t addr_len = sizeof(remote_addr); +int new_socket = accept(rfcomm_socket, (struct sockaddr*)&remote_addr, + &addr_len); +if (new_socket < 0) { + perror(\(dqaccept\(dq); + return new_socket; +} + +/* To complete the connection setup of new_socket read 1 byte */ +char c; +struct pollfd pfd; + +memset(&pfd, 0, sizeof(pfd)); +pfd\&.fd = new_socket; +pfd\&.events = POLLOUT; + +err = poll(&pfd, 1, 0); +if (err) { + perror(\(dqpoll\(dq); + return err; +} + +if (!(pfd\&.revents & POLLOUT)) { + err = read(sk, &c, 1); + if (err < 0) { + perror(\(dqread\(dq); + return err; + } +} +.EE +.UNINDENT +.UNINDENT +.SS BT_FLUSHABLE (since Linux 2.6.39) +.sp +Channel flushable flag, this control if the channel data can be flushed or +not, possible values: +.TS +center; +|l|l|l|. +_ +T{ +Define +T} T{ +Value +T} T{ +Description +T} +_ +T{ +\fBBT_FLUSHABLE_OFF\fP +T} T{ +0x00 (default) +T} T{ +Do not flush data +T} +_ +T{ +\fBBT_FLUSHABLE_ON\fP +T} T{ +0x01 +T} T{ +Flush data +T} +_ +.TE +.SS BT_POWER (since Linux 3.1) +.sp +Channel power policy, this control if the channel shall force exit of sniff +mode or not, possible values: +.TS +center; +|l|l|l|. +_ +T{ +Define +T} T{ +Value +T} T{ +Description +T} +_ +T{ +\fBBT_POWER_FORCE_ACTIVE_OFF\fP +T} T{ +0x00 (default) +T} T{ +Don\(aqt force exit of sniff mode +T} +_ +T{ +\fBBT_POWER_FORCE_ACTIVE_ON\fP +T} T{ +0x01 +T} T{ +Force exit of sniff mode +T} +_ +.TE +.SS BT_CHANNEL_POLICY (since Linux 3.10) +.sp +High\-speed (AMP) channel policy, possible values: +.TS +center; +|l|l|l|. +_ +T{ +Define +T} T{ +Value +T} T{ +Description +T} +_ +T{ +\fBBT_CHANNEL_POLICY_BREDR_ONLY\fP +T} T{ +0 (default) +T} T{ +BR/EDR only +T} +_ +T{ +\fBBT_CHANNEL_POLICY_BREDR_PREFERRED\fP +T} T{ +1 +T} T{ +BR/EDR Preferred +T} +_ +T{ +\fBBT_CHANNEL_POLICY_BREDR_PREFERRED\fP +T} T{ +2 +T} T{ +AMP Preferred +T} +_ +.TE +.SS BT_PHY (since Linux 5.10) +.sp +Channel supported PHY(s), possible values: +.TS +center; +|l|l|l|. +_ +T{ +Define +T} T{ +Value +T} T{ +Description +T} +_ +T{ +\fBBT_PHY_BR_1M_1SLOT\fP +T} T{ +BIT 0 +T} T{ +BR 1Mbps 1SLOT +T} +_ +T{ +\fBBT_PHY_BR_1M_3SLOT\fP +T} T{ +BIT 1 +T} T{ +BR 1Mbps 3SLOT +T} +_ +T{ +\fBBT_PHY_BR_1M_5SLOT\fP +T} T{ +BIT 2 +T} T{ +BR 1Mbps 5SLOT +T} +_ +T{ +\fBBT_PHY_BR_2M_1SLOT\fP +T} T{ +BIT 3 +T} T{ +EDR 2Mbps 1SLOT +T} +_ +T{ +\fBBT_PHY_BR_2M_3SLOT\fP +T} T{ +BIT 4 +T} T{ +EDR 2Mbps 3SLOT +T} +_ +T{ +\fBBT_PHY_BR_2M_5SLOT\fP +T} T{ +BIT 5 +T} T{ +EDR 2Mbps 5SLOT +T} +_ +T{ +\fBBT_PHY_BR_3M_1SLOT\fP +T} T{ +BIT 6 +T} T{ +EDR 3Mbps 1SLOT +T} +_ +T{ +\fBBT_PHY_BR_3M_3SLOT\fP +T} T{ +BIT 7 +T} T{ +EDR 3Mbps 3SLOT +T} +_ +T{ +\fBBT_PHY_BR_3M_5SLOT\fP +T} T{ +BIT 8 +T} T{ +EDR 3Mbps 5SLOT +T} +_ +.TE +.SH RESOURCES +.sp +\fI\%http://www.bluez.org\fP +.SH REPORTING BUGS +.sp +\fI\%linux\-bluetooth@vger.kernel.org\fP +.SH SEE ALSO +.sp +socket(7), rctest(1) +.SH COPYRIGHT +Free use of this software is granted under ther terms of the GNU +Lesser General Public Licenses (LGPL). +.\" Generated by docutils manpage writer. +.
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/cert.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/cert.c
Changed
@@ -1658,7 +1658,6 @@ { const uint8_t *seq; size_t seq_len; - const uint8_t *elem_data; size_t elem_len; uint8_t tag; @@ -1674,8 +1673,7 @@ * to add any more formats we'll probably need to start guessing * from the filename suffix. */ - if (!(elem_data = asn1_der_find_elem(seq, seq_len, - 0, &tag, &elem_len))) + if (!asn1_der_find_elem(seq, seq_len,0, &tag, &elem_len)) return -ENOMSG; if (tag == ASN1_ID_SEQUENCE) {
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/cleanup.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/cleanup.h
Changed
@@ -7,6 +7,9 @@ #pragma once +#define __L_AUTODESTRUCT(func) \ + __attribute((cleanup(_l_ ## func ## _cleanup))) + #define DEFINE_CLEANUP_FUNC(func) \ inline __attribute__((always_inline)) \ - void func ## _cleanup(void *p) { func(*(void **) p); } + void _l_ ## func ## _cleanup(void *p) { func(*(void **) p); }
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/dbus.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/dbus.c
Changed
@@ -15,8 +15,10 @@ #include <unistd.h> #include <stdlib.h> #include <string.h> +#include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> +#include <netdb.h> #include <errno.h> #include "util.h" @@ -1133,6 +1135,112 @@ return setup_dbus1(fd, guid); } +static bool setup_tcp_cb(struct l_io *io, void *user_data) +{ + static const unsigned char creds = 0x00; + struct l_dbus *dbus = user_data; + struct l_dbus_classic *classic; + ssize_t written; + int fd = l_io_get_fd(io); + + /* Send special credentials-passing nul byte */ + written = L_TFR(send(fd, &creds, 1, 0)); + if (written < 1) { + l_util_debug(dbus->debug_handler, dbus->debug_handler, + "error writing NUL byte"); + close(fd); + return false; + } + + dbus->driver = &classic_ops; + dbus->negotiate_unix_fd = false; + dbus->support_unix_fd = false; + + classic = l_container_of(dbus, struct l_dbus_classic, super); + classic->match_strings = l_hashmap_new(); + classic->auth_command = l_strdup("AUTH ANONYMOUS\r\n"); + classic->auth_state = WAITING_FOR_OK; + + l_io_set_read_handler(dbus->io, auth_read_handler, dbus, NULL); + l_io_set_write_handler(dbus->io, auth_write_handler, dbus, NULL); + + return auth_write_handler(dbus->io, dbus); +} + +static struct l_dbus *setup_tcp(char *params) +{ + char *host = NULL; + char *port = NULL; + char *family = NULL; + struct addrinfo hints = { 0 }; + struct addrinfo *res; + struct addrinfo *iter; + struct l_dbus *dbus = NULL; + + while (params) { + char *key = strsep(¶ms, ","); + char *value; + + value = strchr(key, '='); + if (!value) + continue; + + *value++ = '\0'; + + if (!strcmp(key, "host")) + host = value; + else if (!strcmp(key, "port")) + port = value; + else if (!strcmp(key, "family")) + family = value; + } + + if (!host || !port) + return NULL; + + if (!family) + hints.ai_family = AF_UNSPEC; + else if (!strcmp(family, "ipv4")) + hints.ai_family = AF_INET; + else if (!strcmp(family, "ipv6")) + hints.ai_family = AF_INET6; + else + return NULL; + + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV; + hints.ai_protocol = IPPROTO_TCP; + + if (getaddrinfo(host, port, &hints, &res) != 0) + return NULL; + + for (iter = res; iter; iter = iter->ai_next) { + int fd; + struct l_dbus_classic *classic; + + fd = socket(iter->ai_family, iter->ai_socktype | SOCK_NONBLOCK, + iter->ai_protocol); + if (fd < 0) + continue; + + if (connect(fd, iter->ai_addr, iter->ai_addrlen) < 0) { + if (errno != EINPROGRESS) { + close(fd); + continue; + } + } + + classic = l_new(struct l_dbus_classic, 1); + dbus = &classic->super; + dbus_init(dbus, fd); + l_io_set_write_handler(dbus->io, setup_tcp_cb, dbus, NULL); + break; + } + + freeaddrinfo(res); + return dbus; +} + static struct l_dbus *setup_address(const char *address) { struct l_dbus *dbus = NULL; @@ -1155,6 +1263,9 @@ /* Function will modify params string */ dbus = setup_unix(params); break; + } else if (!strcmp(transport, "tcp")) { + dbus = setup_tcp(params); + break; } } @@ -1689,8 +1800,7 @@ va_start(args, member); rule_len = 0; - while ((type = va_arg(args, enum l_dbus_match_type)) != - L_DBUS_MATCH_NONE) + while (va_arg(args, enum l_dbus_match_type) != L_DBUS_MATCH_NONE) rule_len++; va_end(args);
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/ecc.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/ecc.c
Changed
@@ -806,9 +806,17 @@ return NULL; } +LIB_EXPORT struct l_ecc_scalar *l_ecc_scalar_clone(const struct l_ecc_scalar *s) +{ + if (!s) + return NULL; + + return l_memdup(s, sizeof(*s)); +} + /* * Build a scalar = value modulo p where p is the prime number for a given - * curve. bytes can contain a numer with up to 2x number of digits as the + * curve. bytes can contain a number with up to 2x number of digits as the * curve. This is used in Hash to Curve calculations. */ LIB_EXPORT struct l_ecc_scalar *l_ecc_scalar_new_modp(
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/ecc.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/ecc.h
Changed
@@ -62,6 +62,7 @@ struct l_ecc_scalar *l_ecc_scalar_new(const struct l_ecc_curve *curve, const void *buf, size_t len); +struct l_ecc_scalar *l_ecc_scalar_clone(const struct l_ecc_scalar *s); struct l_ecc_scalar *l_ecc_scalar_new_random( const struct l_ecc_curve *curve); struct l_ecc_scalar *l_ecc_scalar_new_modp(const struct l_ecc_curve *curve,
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/ecdh.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/ecdh.c
Changed
@@ -16,6 +16,7 @@ #include "ecc.h" #include "ecdh.h" #include "random.h" +#include "useful.h" /* * Some sane maximum for calculating the public key. @@ -41,6 +42,9 @@ int iter = 0; uint64_t p2L_ECC_MAX_DIGITS; + if (unlikely(!curve || !out_private || !out_public)) + return false; + _ecc_calculate_p2(curve, p2); *out_public = l_ecc_point_new(curve); @@ -77,6 +81,9 @@ struct l_ecc_scalar *z; struct l_ecc_point *product; + if (unlikely(!private_key || !other_public || !secret)) + return false; + z = l_ecc_scalar_new_random(curve); product = l_ecc_point_new(curve);
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/gvariant-util.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/gvariant-util.c
Changed
@@ -843,7 +843,6 @@ offset_size = offset_length(builder->body_pos, container->offset_index); - i = container->offset_index - 1; start = grow_body(builder, offset_size * container->offset_index, 1);
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/hashmap.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/hashmap.c
Changed
@@ -32,7 +32,7 @@ /** * l_hashmap: * - * Opague object representing the hash table. + * Opaque object representing the hash table. */ struct l_hashmap { l_hashmap_hash_func_t hash_func; @@ -296,7 +296,7 @@ * @hashmap: hash table object * @destroy: destroy function * - * Free hash table and call @destory on all remaining entries. + * Free hash table and call @destroy on all remaining entries. * * NOTE: While the destroy is in progress, the hashmap is assumed to be * invariant. The behavior of adding or removing entries while a destroy
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/idle.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/idle.c
Changed
@@ -28,7 +28,7 @@ /** * l_idle: * - * Opague object representing the idle time event. + * Opaque object representing the idle time event. */ struct l_idle { union {
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/io.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/io.c
Changed
@@ -29,7 +29,7 @@ /** * l_io: * - * Opague object representing the IO. + * Opaque object representing the IO. */ struct l_io { int fd;
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/log.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/log.h
Changed
@@ -17,6 +17,7 @@ #define L_LOG_ERR 3 #define L_LOG_WARNING 4 +#define L_LOG_NOTICE 5 #define L_LOG_INFO 6 #define L_LOG_DEBUG 7 @@ -84,6 +85,7 @@ #define l_error(format, ...) l_log(L_LOG_ERR, format, ##__VA_ARGS__) #define l_warn(format, ...) l_log(L_LOG_WARNING, format, ##__VA_ARGS__) +#define l_notice(format, ...) l_log(L_LOG_NOTICE, format, ##__VA_ARGS__) #define l_info(format, ...) l_log(L_LOG_INFO, format, ##__VA_ARGS__) #define l_debug(format, ...) L_DEBUG_SYMBOL(__debug_desc, format, ##__VA_ARGS__)
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/main.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/main.c
Changed
@@ -568,7 +568,7 @@ /** * l_main_quit: * - * Teminate the running main loop + * Terminate the running main loop * * Returns: #true when terminating the main loop or #false in case of failure **/
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/pem.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/pem.c
Changed
@@ -148,7 +148,7 @@ *base64_len = buf_ptr - base64_data; if (endp) { - if (eol == buf + buf_len) + if (eol == buf_ptr + buf_len) *endp = eol; else *endp = eol + 1;
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/queue.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/queue.c
Changed
@@ -23,7 +23,7 @@ /** * l_queue: * - * Opague object representing the queue. + * Opaque object representing the queue. */ struct l_queue { struct l_queue_entry *head; @@ -59,7 +59,7 @@ * @queue: queue object * @destroy: destroy function * - * Free queue and call @destory on all remaining entries. + * Free queue and call @destroy on all remaining entries. **/ LIB_EXPORT void l_queue_destroy(struct l_queue *queue, l_queue_destroy_func_t destroy) @@ -73,7 +73,7 @@ * @queue: queue object * @destroy: destroy function * - * Clear queue and call @destory on all remaining entries. + * Clear queue and call @destroy on all remaining entries. **/ LIB_EXPORT void l_queue_clear(struct l_queue *queue, l_queue_destroy_func_t destroy) @@ -511,8 +511,6 @@ if (!entry->next) queue->tail = prev; - entry = entry->next; - data = tmp->data; l_free(tmp);
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/queue.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/queue.h
Changed
@@ -18,7 +18,7 @@ typedef void (*l_queue_destroy_func_t) (void *data); typedef int (*l_queue_compare_func_t) (const void *a, const void *b, void *user_data); -typedef bool (*l_queue_match_func_t) (const void *a, const void *b); +typedef bool (*l_queue_match_func_t) (const void *data, const void *user_data); typedef bool (*l_queue_remove_func_t) (void *data, void *user_data); struct l_queue;
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/random.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/random.h
Changed
@@ -8,14 +8,14 @@ #ifndef __ELL_RANDOM_H #define __ELL_RANDOM_H -#ifdef __cplusplus -extern "C" { -#endif - #include <stddef.h> #include <stdbool.h> #include <stdint.h> +#ifdef __cplusplus +extern "C" { +#endif + bool l_getrandom(void *buf, size_t len); bool l_getrandom_is_supported(void);
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/signal.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/signal.c
Changed
@@ -33,7 +33,7 @@ /** * l_signal: * - * Opague object representing the signal. + * Opaque object representing the signal. */ struct l_signal { struct signal_desc *desc;
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/string.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/string.c
Changed
@@ -26,7 +26,7 @@ /** * l_string: * - * Opague object representing the string buffer. + * Opaque object representing the string buffer. */ struct l_string { size_t max;
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/strv.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/strv.c
Changed
@@ -190,7 +190,7 @@ /** * l_strv_new: * - * Returns: new emptry string array + * Returns: new empty string array **/ LIB_EXPORT char **l_strv_new(void) {
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/tester.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/tester.h
Changed
@@ -8,14 +8,14 @@ #ifndef __ELL_TESTER_H #define __ELL_TESTER_H -#ifdef __cplusplus -extern "C" { -#endif - #include <stdbool.h> #include <stddef.h> #include <stdint.h> +#ifdef __cplusplus +extern "C" { +#endif + struct l_tester; enum l_tester_stage {
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/time.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/time.h
Changed
@@ -8,13 +8,13 @@ #ifndef __ELL_TIME_H #define __ELL_TIME_H +#include <stdint.h> +#include <stdbool.h> + #ifdef __cplusplus extern "C" { #endif -#include <stdint.h> -#include <stdbool.h> - #define L_USEC_PER_SEC 1000000ULL #define L_MSEC_PER_SEC 1000ULL #define L_USEC_PER_MSEC 1000ULL
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/timeout.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/timeout.c
Changed
@@ -34,7 +34,7 @@ /** * l_timeout: * - * Opague object representing the timeout. + * Opaque object representing the timeout. */ struct l_timeout { int fd;
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/timeout.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/timeout.h
Changed
@@ -8,12 +8,12 @@ #ifndef __ELL_TIMEOUT_H #define __ELL_TIMEOUT_H +#include <stdint.h> + #ifdef __cplusplus extern "C" { #endif -#include <stdint.h> - struct l_timeout; typedef void (*l_timeout_notify_cb_t) (struct l_timeout *timeout,
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/tls-extensions.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/tls-extensions.c
Changed
@@ -955,7 +955,7 @@ /* * The normal policy otherwise is that the extension must be - * present in renegotation if the previous Client or Server Hello + * present in renegotiation if the previous Client or Server Hello * did include this extension, or the SCSV in the Client Hello case. */ return !tls->ready || !tls->renegotiation_info.secure_renegotiation;
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/tls.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/tls.c
Changed
@@ -1311,7 +1311,7 @@ * Note: could handle NULL client_write with non-NULL * server_handle or server_handle_absent as "server-oriented" * extension (7.4.1.4) and write empty extension_data and - * simliarly require empty extension_data in + * similarly require empty extension_data in * tls_handle_client_hello if client_handle NULL. */ if (!ext_write) @@ -3299,7 +3299,7 @@ * * * (RSA key exchange algorithm case) the correct * receival of this Finished message confirms the - * posession of the master secret, it is verified by + * possession of the master secret, it is verified by * both the successful decryption and the MAC of this * message (either should be enough) because we entered * the TLS_HANDSHAKE_WAIT_FINISHED state only after
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/useful.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/useful.h
Changed
@@ -5,11 +5,6 @@ * SPDX-License-Identifier: LGPL-2.1-or-later */ -#include <unistd.h> -#include <errno.h> - -#include <ell/util.h> - #define align_len(len, boundary) (((len)+(boundary)-1) & ~((boundary)-1)) #define likely(x) __builtin_expect(!!(x), 1) @@ -64,20 +59,10 @@ _x / _d; \ }) -#define __AUTODESTRUCT(func) \ - __attribute((cleanup(func ## _cleanup))) - +#ifndef _auto_ #define _auto_(func) \ - __AUTODESTRUCT(func) - -/* Enables declaring _auto_(close) int fd = <-1 or L_TFR(open(...))>; */ -inline __attribute__((always_inline)) void close_cleanup(void *p) -{ - int fd = *(int *) p; - - if (fd >= 0) - L_TFR(close(fd)); -} + __L_AUTODESTRUCT(func) +#endif /* * Trick the compiler into thinking that var might be changed somehow by
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/utf8.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/utf8.c
Changed
@@ -1,6 +1,7 @@ /* * Embedded Linux library * Copyright (C) 2011-2014 Intel Corporation + * Copyright (C) 2024 Cruise, LLC * * SPDX-License-Identifier: LGPL-2.1-or-later */ @@ -42,6 +43,70 @@ 0x80 ... 0xFF = 0, }; +/** + * l_ascii_strdown + * @str: a pointer to an ASCII string + * @len: maximum bytes to process or negative if string is null terminated + * + * Returns: Newly allocated string with all upper case characters converted + * to lower case. + **/ +LIB_EXPORT char *l_ascii_strdown(const char *str, ssize_t len) +{ + size_t slen; + size_t i; + char *ret; + + if (!str) + return NULL; + + if (len < 0) + slen = strlen(str); + else + slen = len; + + ret = l_malloc(slen + 1); + + for (i = 0; i < slen && stri; i++) + reti = l_ascii_tolower(stri); + + reti = '\0'; + + return ret; +} + +/** + * l_ascii_strup + * @str: a pointer to an ASCII string + * @len: maximum bytes to process or negative if string is null terminated + * + * Returns: Newly allocated string with all lower case characters converted + * to upper case. + **/ +LIB_EXPORT char *l_ascii_strup(const char *str, ssize_t len) +{ + size_t slen; + size_t i; + char *ret; + + if (!str) + return NULL; + + if (len < 0) + slen = strlen(str); + else + slen = len; + + ret = l_malloc(slen + 1); + + for (i = 0; i < slen && stri; i++) + reti = l_ascii_toupper(stri); + + reti = '\0'; + + return ret; +} + static inline bool __attribute__ ((always_inline)) valid_unicode(wchar_t c) {
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/utf8.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/utf8.h
Changed
@@ -1,6 +1,7 @@ /* * Embedded Linux library * Copyright (C) 2011-2014 Intel Corporation + * Copyright (C) 2024 Cruise, LLC * * SPDX-License-Identifier: LGPL-2.1-or-later */ @@ -86,6 +87,25 @@ return false; } +static inline __attribute__ ((always_inline)) char l_ascii_toupper(char c) +{ + if (!l_ascii_islower(c)) + return c; + + return c - 32; +} + +static inline __attribute__ ((always_inline)) char l_ascii_tolower(char c) +{ + if (!l_ascii_isupper(c)) + return c; + + return c + 32; +} + +char *l_ascii_strdown(const char *str, ssize_t len); +char *l_ascii_strup(const char *str, ssize_t len); + bool l_utf8_validate(const char *src, size_t len, const char **end); size_t l_utf8_strlen(const char *str);
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/util.c -> _service:tar_scm:bluez-5.77.tar.xz/ell/util.c
Changed
@@ -127,7 +127,7 @@ * l_strdup: * @str: string pointer * - * Allocates and duplicates sring + * Allocates and duplicates string * * Returns: a newly allocated string **/ @@ -153,7 +153,7 @@ * @str: string pointer * @max: Maximum number of characters to copy * - * Allocates and duplicates sring. If the string is longer than @max + * Allocates and duplicates string. If the string is longer than @max * characters, only @max are copied and a null terminating character * is added. *
View file
_service:tar_scm:bluez-5.71.tar.xz/ell/util.h -> _service:tar_scm:bluez-5.77.tar.xz/ell/util.h
Changed
@@ -14,6 +14,8 @@ #include <inttypes.h> #include <endian.h> #include <byteswap.h> +#include <unistd.h> +#include <errno.h> #include <sys/uio.h> #include <ell/cleanup.h> @@ -41,6 +43,27 @@ r; \ }) +/* + * If ELL headers and iterfaces end up getting compiled in a C++ + * environment, even though ELL itself is a C source based and is + * compiled as such, certain assignments may be flagged by the C++ + * compiler as errors or warnings. The following portable casts should + * be used in such cases, with a preference towards L_PERMISSIVE_CAST + * where possible since it is not a cast in C and, therefore, will not + * mask otherwise-legitimate warnings in that environment. + */ +#ifdef __cplusplus +#define L_CONST_CAST(t, v) const_cast<t>(v) +#define L_REINTERPRET_CAST(t, v) reinterpret_cast<t>(v) +#define L_STATIC_CAST(t, v) static_cast<t>(v) +#define L_PERMISSIVE_CAST(t, v) L_STATIC_CAST(t, v) +#else +#define L_CONST_CAST(t, v) ((t)(v)) +#define L_REINTERPRET_CAST(t, v) ((t)(v)) +#define L_STATIC_CAST(t, v) ((t)(v)) +#define L_PERMISSIVE_CAST(t, v) (v) +#endif + #define L_PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p))) #define L_UINT_TO_PTR(u) ((void *) ((uintptr_t) (u))) @@ -314,11 +337,20 @@ while (__result == -1L && errno == EINTR); \ __result; })) +/* Enables declaring _auto_(close) int fd = <-1 or L_TFR(open(...))>; */ +inline __attribute__((always_inline)) void _l_close_cleanup(void *p) +{ + int fd = *(int *) p; + + if (fd >= 0) + L_TFR(close(fd)); +} + #define _L_IN_SET_CMP(val, type, cmp, ...) __extension__ ({ \ const type __v = (val); \ const typeof(__v) __elems = {__VA_ARGS__}; \ - unsigned int __i; \ - static const unsigned int __n = L_ARRAY_SIZE(__elems); \ + size_t __i; \ + const size_t __n = L_ARRAY_SIZE(__elems); \ bool __r = false; \ for (__i = 0; __i < __n && !__r; __i++) \ __r = (cmp); \ @@ -334,6 +366,50 @@ (__v && __elems__i && \ !strcmp(__v, __elems__i)), ##__VA_ARGS__) +#define _L_BIT_TO_MASK(bits, nr) __extension__ ({ \ + typeof(*(bits)) _one = 1U; \ + const unsigned int _shift = (nr) % (sizeof(_one) * 8); \ + _one << _shift; \ +}) + +#define _L_BIT_TO_OFFSET(bits, nr) __extension__ ({ \ + __auto_type _bits = (bits); \ + const size_t _offset = (nr) / (sizeof(*_bits) * 8); \ + _bits + _offset; \ +}) + +#define L_BIT_SET(bits, nr) __extension__ ({ \ + size_t _nr = (nr); \ + __auto_type _offset = _L_BIT_TO_OFFSET(bits, _nr); \ + *_offset |= _L_BIT_TO_MASK(_offset, _nr); \ +}) + +#define L_BIT_CLEAR(bits, nr) __extension__ ({ \ + size_t _nr = (nr); \ + __auto_type _offset = _L_BIT_TO_OFFSET(bits, _nr); \ + *_offset &= ~_L_BIT_TO_MASK(_offset, _nr); \ +}) + +#define L_BIT_TEST(bits, nr) __extension__ ({ \ + size_t _nr = (nr); \ + __auto_type _offset = _L_BIT_TO_OFFSET(bits, _nr); \ + (*_offset & _L_BIT_TO_MASK(_offset, _nr)) != 0; \ +}) + +#define L_BITS_SET(bits, ...) __extension__ ({ \ + const unsigned int __elems = {__VA_ARGS__}; \ + size_t __i; \ + for (__i = 0; __i < L_ARRAY_SIZE(__elems); __i++) \ + L_BIT_SET(bits, __elems__i); \ +}) + +#define L_BITS_CLEAR(bits, ...) __extension__ ({ \ + const unsigned int __elems = {__VA_ARGS__}; \ + size_t __i; \ + for (__i = 0; __i < L_ARRAY_SIZE(__elems); __i++) \ + L_BIT_CLEAR(bits, __elems__i); \ +}) + /* * Taken from https://github.com/chmike/cst_time_memcmp, adding a volatile to * ensure the compiler does not try to optimize the constant time behavior. @@ -370,8 +446,10 @@ static inline int l_secure_memcmp(const void *a, const void *b, size_t size) { - const volatile uint8_t *aa = a; - const volatile uint8_t *bb = b; + const volatile uint8_t *aa = + L_PERMISSIVE_CAST(const volatile uint8_t *, a); + const volatile uint8_t *bb = + L_PERMISSIVE_CAST(const volatile uint8_t *, b); int res = 0, diff, mask; /* @@ -422,9 +500,9 @@ const void *left, const void *right, void *out, size_t len) { - const uint8_t *l = left; - const uint8_t *r = right; - uint8_t *o = out; + const uint8_t *l = L_PERMISSIVE_CAST(const uint8_t *, left); + const uint8_t *r = L_PERMISSIVE_CAST(const uint8_t *, right); + uint8_t *o = L_PERMISSIVE_CAST(uint8_t *, out); uint8_t mask = -(!!select_left); size_t i;
View file
_service:tar_scm:bluez-5.71.tar.xz/emulator/amp.c -> _service:tar_scm:bluez-5.77.tar.xz/emulator/amp.c
Changed
@@ -680,7 +680,8 @@ { const struct bt_hci_cmd_read_local_amp_assoc *cmd = data; struct bt_hci_rsp_read_local_amp_assoc rsp; - uint16_t len_so_far, remain_assoc_len, fragment_len; + uint16_t len_so_far, remain_assoc_len; + size_t fragment_len; if (cmd->phy_handle != amp->phy_handle) { cmd_status(amp, BT_HCI_ERR_INVALID_PARAMETERS,
View file
_service:tar_scm:bluez-5.71.tar.xz/emulator/btdev.c -> _service:tar_scm:bluez-5.77.tar.xz/emulator/btdev.c
Changed
@@ -5,7 +5,7 @@ * * Copyright (C) 2011-2012 Intel Corporation * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -44,6 +44,8 @@ #define BIS_SIZE 3 #define CIG_SIZE 3 +#define MAX_PA_DATA_LEN 252 + #define has_bredr(btdev) (!((btdev)->features4 & 0x20)) #define has_le(btdev) (!!((btdev)->features4 & 0x40)) @@ -146,6 +148,8 @@ uint8_t feat_page_28; uint16_t acl_mtu; uint16_t acl_max_pkt; + uint16_t sco_mtu; + uint16_t sco_max_pkt; uint16_t iso_mtu; uint16_t iso_max_pkt; uint8_t country_code; @@ -207,7 +211,7 @@ uint16_t le_pa_min_interval; uint16_t le_pa_max_interval; uint8_t le_pa_data_len; - uint8_t le_pa_data31; + uint8_t le_pa_dataMAX_PA_DATA_LEN; struct bt_hci_cmd_le_pa_create_sync pa_sync_cmd; uint16_t le_pa_sync_handle; uint8_t big_handle; @@ -317,6 +321,18 @@ return index; } +static inline bool valid_btdev(struct btdev *btdev) +{ + int i; + + for (i = 0; i < MAX_BTDEV_ENTRIES; i++) { + if (btdev_listi == btdev) + return true; + } + + return false; +} + static inline struct btdev *find_btdev_by_bdaddr(const uint8_t *bdaddr) { int i; @@ -562,6 +578,8 @@ btdev->le_scan_enable = 0x00; btdev->le_adv_enable = 0x00; btdev->le_pa_enable = 0x00; + btdev->le_pa_sync_handle = 0x0000; + btdev->big_handle = 0xff; al_clear(btdev); rl_clear(btdev); @@ -637,9 +655,9 @@ rsp.status = BT_HCI_ERR_SUCCESS; rsp.acl_mtu = cpu_to_le16(dev->acl_mtu); - rsp.sco_mtu = 0; + rsp.sco_mtu = cpu_to_le16(dev->sco_mtu); rsp.acl_max_pkt = cpu_to_le16(dev->acl_max_pkt); - rsp.sco_max_pkt = cpu_to_le16(0); + rsp.sco_max_pkt = cpu_to_le16(dev->sco_max_pkt); cmd_complete(dev, BT_HCI_CMD_READ_BUFFER_SIZE, &rsp, sizeof(rsp)); @@ -1245,6 +1263,9 @@ struct bt_hci_evt_conn_complete cc; struct btdev *remote = find_btdev_by_bdaddr(bdaddr); + if (!remote) + return; + if (!status) { struct btdev_conn *conn; @@ -1280,6 +1301,28 @@ send_event(btdev, BT_HCI_EVT_CONN_COMPLETE, &cc, sizeof(cc)); } +struct page_timeout_data { + struct btdev *btdev; + uint8_t bdaddr6; + unsigned int timeout_id; +}; + +static bool page_timeout(void *user_data) +{ + struct page_timeout_data *pt_data = user_data; + struct btdev *btdev = pt_data->btdev; + const uint8_t *bdaddr = pt_data->bdaddr; + + timeout_remove(pt_data->timeout_id); + pt_data->timeout_id = 0; + + if (valid_btdev(btdev)) + conn_complete(btdev, bdaddr, BT_HCI_ERR_PAGE_TIMEOUT); + + free(pt_data); + return false; +} + static int cmd_create_conn_complete(struct btdev *dev, const void *data, uint8_t len) { @@ -1297,7 +1340,18 @@ send_event(remote, BT_HCI_EVT_CONN_REQUEST, &cr, sizeof(cr)); } else { - conn_complete(dev, cmd->bdaddr, BT_HCI_ERR_PAGE_TIMEOUT); + struct page_timeout_data *pt_data = + new0(struct page_timeout_data, 1); + + pt_data->btdev = dev; + memcpy(pt_data->bdaddr, cmd->bdaddr, 6); + + /* Send page timeout after 5.12 seconds to emulate real + * paging. + */ + pt_data->timeout_id = timeout_add(5120, + page_timeout, + pt_data, NULL); } return 0; @@ -2712,6 +2766,8 @@ goto done; } + /* TODO: HCI_Connection_Request connection flow */ + cc.status = BT_HCI_ERR_SUCCESS; memcpy(cc.bdaddr, conn->link->dev->bdaddr, 6); @@ -5177,9 +5233,13 @@ { const struct bt_hci_cmd_le_set_pa_data *cmd = data; uint8_t status = BT_HCI_ERR_SUCCESS; + uint8_t data_len = cmd->data_len; - dev->le_pa_data_len = cmd->data_len; - memcpy(dev->le_pa_data, cmd->data, 31); + if (data_len > MAX_PA_DATA_LEN) + data_len = MAX_PA_DATA_LEN; + + dev->le_pa_data_len = data_len; + memcpy(dev->le_pa_data, cmd->data, data_len); cmd_complete(dev, BT_HCI_CMD_LE_SET_PA_DATA, &status, sizeof(status)); @@ -5225,7 +5285,7 @@ { struct __packed { struct bt_hci_le_pa_report ev; - uint8_t data31; + uint8_t data247; } pdu; memset(&pdu.ev, 0, sizeof(pdu.ev)); @@ -6424,9 +6484,13 @@ 0x16); conn_remove(conn); + break; } done: + if (rsp.status == BT_HCI_ERR_SUCCESS) + dev->big_handle = 0xff; + cmd_complete(dev, BT_HCI_CMD_LE_BIG_TERM_SYNC, &rsp, sizeof(rsp)); return 0; @@ -7113,6 +7177,9 @@ btdev->acl_mtu = 192; btdev->acl_max_pkt = 1; + btdev->sco_mtu = 72; + btdev->sco_max_pkt = 1; + btdev->iso_mtu = 251; btdev->iso_max_pkt = 1; btdev->big_handle = 0xff;
View file
_service:tar_scm:bluez-5.71.tar.xz/emulator/bthost.c -> _service:tar_scm:bluez-5.77.tar.xz/emulator/bthost.c
Changed
@@ -5,7 +5,7 @@ * * Copyright (C) 2011-2012 Intel Corporation * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -27,6 +27,7 @@ #include "src/shared/util.h" #include "src/shared/tester.h" #include "src/shared/queue.h" +#include "src/shared/ad.h" #include "monitor/bt.h" #include "monitor/rfcomm.h" #include "bthost.h" @@ -59,7 +60,7 @@ /* RFCOMM FCS calculation */ #define CRC(data) (rfcomm_crc_tablerfcomm_crc_table0xff ^ data0 ^ data1) -static unsigned char rfcomm_crc_table256 = { +static const unsigned char rfcomm_crc_table256 = { 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75, 0x0e, 0x9f, 0xed, 0x7c, 0x09, 0x98, 0xea, 0x7b, 0x1c, 0x8d, 0xff, 0x6e, 0x1b, 0x8a, 0xf8, 0x69, @@ -162,11 +163,21 @@ void *recv_data; }; +enum l2cap_mode { + L2CAP_MODE_OTHER, + L2CAP_MODE_LE_CRED, + L2CAP_MODE_LE_ENH_CRED, +}; + struct l2conn { + struct l2conn *next; uint16_t scid; uint16_t dcid; uint16_t psm; - struct l2conn *next; + enum l2cap_mode mode; + uint16_t data_len; + uint16_t recv_len; + void *recv_data; }; struct rcconn { @@ -184,6 +195,9 @@ struct l2cap_conn_cb_data { uint16_t psm; + uint16_t mtu; + uint16_t mps; + uint16_t credits; bthost_l2cap_connect_cb func; bthost_l2cap_disconnect_cb disconn_func; void *user_data; @@ -275,6 +289,7 @@ static void l2conn_free(struct l2conn *conn) { + free(conn->recv_data); free(conn); } @@ -360,6 +375,7 @@ l2conn->psm = psm; l2conn->scid = scid; l2conn->dcid = dcid; + l2conn->mode = L2CAP_MODE_OTHER; l2conn->next = conn->l2conns; conn->l2conns = l2conn; @@ -415,6 +431,19 @@ return NULL; } +static struct l2conn *btconn_find_l2cap_conn_by_dcid(struct btconn *conn, + uint16_t dcid) +{ + struct l2conn *l2conn; + + for (l2conn = conn->l2conns; l2conn != NULL; l2conn = l2conn->next) { + if (l2conn->dcid == dcid) + return l2conn; + } + + return NULL; +} + static struct l2cap_conn_cb_data *bthost_find_l2cap_cb_by_psm( struct bthost *bthost, uint16_t psm) { @@ -609,14 +638,24 @@ } static void send_acl(struct bthost *bthost, uint16_t handle, uint16_t cid, - const void *data, uint16_t len) + bool sdu_hdr, const void *data, uint16_t len) { - struct iovec iov; + struct iovec iov2; + uint16_t sdu; + int num = 0; - iov.iov_base = (void *) data; - iov.iov_len = len; + if (sdu_hdr) { + sdu = cpu_to_le16(len); + iovnum.iov_base = &sdu; + iovnum.iov_len = sizeof(sdu); + num++; + } - send_iov(bthost, handle, cid, &iov, 1); + iovnum.iov_base = (void *) data; + iovnum.iov_len = len; + num++; + + send_iov(bthost, handle, cid, iov, num); } static uint8_t l2cap_sig_send(struct bthost *bthost, struct btconn *conn, @@ -711,12 +750,19 @@ const void *data, uint16_t len) { struct btconn *conn; + struct l2conn *l2conn; + bool sdu_hdr = false; conn = bthost_find_conn(bthost, handle); if (!conn) return; - send_acl(bthost, handle, cid, data, len); + l2conn = btconn_find_l2cap_conn_by_dcid(conn, cid); + if (l2conn && (l2conn->mode == L2CAP_MODE_LE_CRED || + l2conn->mode == L2CAP_MODE_LE_ENH_CRED)) + sdu_hdr = true; + + send_acl(bthost, handle, cid, sdu_hdr, data, len); } void bthost_send_cid_v(struct bthost *bthost, uint16_t handle, uint16_t cid, @@ -1779,7 +1825,7 @@ cmd.length = RFCOMM_LEN8(0); cmd.fcs = rfcomm_fcs2((uint8_t *)&cmd); - send_acl(bthost, conn->handle, l2conn->dcid, &cmd, sizeof(cmd)); + send_acl(bthost, conn->handle, l2conn->dcid, false, &cmd, sizeof(cmd)); } static bool l2cap_conn_rsp(struct bthost *bthost, struct btconn *conn, @@ -2110,6 +2156,7 @@ uint8_t ident, const void *data, uint16_t len) { const struct bt_l2cap_pdu_le_conn_req *req = data; + struct l2cap_conn_cb_data *cb_data; struct bt_l2cap_pdu_le_conn_rsp rsp; uint16_t psm; @@ -2120,18 +2167,32 @@ memset(&rsp, 0, sizeof(rsp)); - rsp.mtu = 23; - rsp.mps = 23; - rsp.credits = 1; - - if (bthost_find_l2cap_cb_by_psm(bthost, psm)) + cb_data = bthost_find_l2cap_cb_by_psm(bthost, psm); + if (cb_data) { rsp.dcid = cpu_to_le16(conn->next_cid++); - else + rsp.mtu = cpu_to_le16(cb_data->mtu) ? : cpu_to_le16(23); + rsp.mps = cpu_to_le16(cb_data->mps) ? : cpu_to_le16(23); + rsp.credits = cpu_to_le16(cb_data->credits) ? : cpu_to_le16(1); + } else rsp.result = cpu_to_le16(0x0002); /* PSM Not Supported */ l2cap_sig_send(bthost, conn, BT_L2CAP_PDU_LE_CONN_RSP, ident, &rsp, sizeof(rsp)); + if (!rsp.result) { + struct l2conn *l2conn; + + l2conn = bthost_add_l2cap_conn(bthost, conn, + le16_to_cpu(rsp.dcid), + le16_to_cpu(req->scid), + le16_to_cpu(psm)); + l2conn->mode = L2CAP_MODE_LE_CRED; + + if (cb_data && l2conn->psm == cb_data->psm && cb_data->func) + cb_data->func(conn->handle, l2conn->dcid, + cb_data->user_data); + } + return true; } @@ -2139,11 +2200,14 @@ uint8_t ident, const void *data, uint16_t len) { const struct bt_l2cap_pdu_le_conn_rsp *rsp = data; + struct l2conn *l2conn; if (len < sizeof(*rsp)) return false; /* TODO add L2CAP connection before with proper PSM */ - bthost_add_l2cap_conn(bthost, conn, 0, le16_to_cpu(rsp->dcid), 0); + l2conn = bthost_add_l2cap_conn(bthost, conn, 0, + le16_to_cpu(rsp->dcid), 0); + l2conn->mode = L2CAP_MODE_LE_CRED; return true; } @@ -2196,16 +2260,19 @@ uint16_t scid5; } __attribute__ ((packed)) *rsp = data; int num_scid, i; + struct l2conn *l2conn; if (len < sizeof(*rsp)) return false; num_scid = len / sizeof(*rsp->scid); - for (i = 0; i < num_scid; i++) + for (i = 0; i < num_scid; i++) { /* TODO add L2CAP connection before with proper PSM */ - bthost_add_l2cap_conn(bthost, conn, 0, + l2conn = bthost_add_l2cap_conn(bthost, conn, 0, le16_to_cpu(rsp->scidi), 0); + l2conn->mode = L2CAP_MODE_LE_ENH_CRED; + } return true; @@ -2333,7 +2400,7 @@ cmd.length = RFCOMM_LEN8(0); cmd.fcs = rfcomm_fcs2((uint8_t *)&cmd); - send_acl(bthost, conn->handle, l2conn->dcid, &cmd, sizeof(cmd)); + send_acl(bthost, conn->handle, l2conn->dcid, false, &cmd, sizeof(cmd)); } static void rfcomm_dm_send(struct bthost *bthost, struct btconn *conn, @@ -2347,7 +2414,7 @@ cmd.length = RFCOMM_LEN8(0); cmd.fcs = rfcomm_fcs2((uint8_t *)&cmd); - send_acl(bthost, conn->handle, l2conn->dcid, &cmd, sizeof(cmd)); + send_acl(bthost, conn->handle, l2conn->dcid, false, &cmd, sizeof(cmd)); } static void rfcomm_sabm_recv(struct bthost *bthost, struct btconn *conn, @@ -2636,12 +2703,97 @@ } } +static void append_l2conn_data(struct bthost *bthost, struct l2conn *conn, + const void *data, uint16_t len) +{ + if (!conn->recv_data) { + bthost_debug(bthost, "Unexpected L2CAP SDU data: sCID 0x%4.4x ", + conn->scid); + return; + } + + if (conn->recv_len + len > conn->data_len) { + bthost_debug(bthost, "Unexpected L2CAP SDU data: sCID 0x%4.4x ", + conn->scid); + return; + } + + memcpy(conn->recv_data + conn->recv_len, data, len); + conn->recv_len += len; + + bthost_debug(bthost, "L2CAP SDU data: %u/%u bytes", conn->recv_len, + conn->data_len); +} + +static void free_l2conn_data(struct l2conn *conn) +{ + free(conn->recv_data); + conn->recv_data = NULL; + conn->recv_len = 0; + conn->data_len = 0; +} + +static void new_l2conn_data(struct bthost *bthost, struct l2conn *conn, + uint16_t len) +{ + free(conn->recv_data); + conn->recv_data = malloc(len); + conn->recv_len = 0; + conn->data_len = len; +} + +static bool process_l2cap_conn(struct bthost *bthost, struct btconn *conn, + struct l2conn *l2conn, struct iovec *data) +{ + struct bt_l2cap_pdu_le_flowctl_creds creds; + uint16_t sdu; + + if (!l2conn) + return true; + + switch (l2conn->mode) { + case L2CAP_MODE_LE_CRED: + case L2CAP_MODE_LE_ENH_CRED: + break; + case L2CAP_MODE_OTHER: + return true; + } + + /* Credit-based flow control */ + + creds.cid = cpu_to_le16(l2conn->scid); + creds.credits = cpu_to_le16(1); + l2cap_sig_send(bthost, conn, BT_L2CAP_PDU_LE_FLOWCTL_CREDS, 0, + &creds, sizeof(creds)); + + if (!l2conn->data_len) { + if (!util_iov_pull_le16(data, &sdu)) { + free_l2conn_data(l2conn); + bthost_debug(bthost, "L2CAP invalid SDU"); + return false; + } + new_l2conn_data(bthost, l2conn, sdu); + } + + append_l2conn_data(bthost, l2conn, data->iov_base, data->iov_len); + + if (l2conn->recv_len < l2conn->data_len) + return false; /* SDU incomplete */ + + l2conn->data_len = 0; + data->iov_base = l2conn->recv_data; + data->iov_len = l2conn->recv_len; + + return true; +} + static void process_l2cap(struct bthost *bthost, struct btconn *conn, - const void *data, uint16_t len) + const void *buf, uint16_t len) { - const struct bt_l2cap_hdr *l2_hdr = data; + const struct bt_l2cap_hdr *l2_hdr = buf; struct cid_hook *hook; struct l2conn *l2conn; + struct iovec data; uint16_t cid, l2_len; l2_len = le16_to_cpu(l2_hdr->len); @@ -2654,31 +2806,37 @@ bthost_debug(bthost, "L2CAP data: %u bytes", l2_len); cid = le16_to_cpu(l2_hdr->cid); + l2conn = btconn_find_l2cap_conn_by_scid(conn, cid); + + data.iov_base = (void *)l2_hdr->data; + data.iov_len = l2_len; + + if (!process_l2cap_conn(bthost, conn, l2conn, &data)) + return; hook = find_cid_hook(conn, cid); if (hook) { - hook->func(l2_hdr->data, l2_len, hook->user_data); + hook->func(data.iov_base, data.iov_len, hook->user_data); return; } switch (cid) { case 0x0001: - l2cap_sig(bthost, conn, l2_hdr->data, l2_len); + l2cap_sig(bthost, conn, data.iov_base, data.iov_len); break; case 0x0005: - l2cap_le_sig(bthost, conn, l2_hdr->data, l2_len); + l2cap_le_sig(bthost, conn, data.iov_base, data.iov_len); break; case 0x0006: - smp_data(conn->smp_data, l2_hdr->data, l2_len); + smp_data(conn->smp_data, data.iov_base, data.iov_len); break; case 0x0007: - smp_bredr_data(conn->smp_data, l2_hdr->data, l2_len); + smp_bredr_data(conn->smp_data, data.iov_base, data.iov_len); break; default: - l2conn = btconn_find_l2cap_conn_by_scid(conn, cid); if (l2conn && l2conn->psm == 0x0003) - process_rfcomm(bthost, conn, l2conn, l2_hdr->data, - l2_len); + process_rfcomm(bthost, conn, l2conn, data.iov_base, + data.iov_len); else bthost_debug(bthost, "Packet for unknown CID 0x%04x (%u)", @@ -3127,6 +3285,73 @@ send_command(bthost, BT_HCI_CMD_LE_SET_PA_PARAMS, &cp, sizeof(cp)); } +static void set_pa_data(struct bthost *bthost, const uint8_t *data, + uint8_t len, uint8_t offset) +{ + struct bt_hci_cmd_le_set_pa_data *cp; + uint8_t bufsizeof(*cp) + BT_PA_MAX_DATA_LEN; + size_t data_len; + + cp = (void *)buf; + + memset(cp, 0, sizeof(*cp)); + memset(cp->data, 0, BT_PA_MAX_DATA_LEN); + + cp->handle = 1; + + if (len - offset > BT_PA_MAX_DATA_LEN) { + data_len = BT_PA_MAX_DATA_LEN; + + if (!offset) + cp->operation = 0x01; + else + cp->operation = 0x00; + } else { + data_len = len - offset; + + if (!offset) + cp->operation = 0x03; + else + cp->operation = 0x02; + } + + memcpy(cp->data, data + offset, data_len); + cp->data_len = data_len; + + send_command(bthost, BT_HCI_CMD_LE_SET_PA_DATA, buf, + sizeof(*cp) + cp->data_len); + + if (cp->operation == 0x01 || cp->operation == 0x00) { + offset += cp->data_len; + set_pa_data(bthost, data, len, offset); + } +} + +void bthost_set_pa_data(struct bthost *bthost, const uint8_t *data, + uint8_t len) +{ + set_pa_data(bthost, data, len, 0); +} + +void bthost_set_base(struct bthost *bthost, const uint8_t *data, uint8_t len) +{ + struct bt_ad *ad; + bt_uuid_t uuid; + uint8_t *pa_data; + size_t pa_len; + + bt_uuid16_create(&uuid, BAA_SERVICE); + + ad = bt_ad_new(); + bt_ad_set_max_len(ad, BT_PA_MAX_DATA_LEN); + bt_ad_add_service_data(ad, &uuid, (void *)data, len); + + pa_data = bt_ad_generate(ad, &pa_len); + bthost_set_pa_data(bthost, pa_data, pa_len); + + bt_ad_unref(ad); +} + void bthost_set_pa_enable(struct bthost *bthost, uint8_t enable) { struct bt_hci_cmd_le_set_pa_enable cp; @@ -3290,7 +3515,8 @@ return conn->fixed_chan; } -void bthost_add_l2cap_server(struct bthost *bthost, uint16_t psm, +void bthost_add_l2cap_server_custom(struct bthost *bthost, uint16_t psm, + uint16_t mtu, uint16_t mps, uint16_t credits, bthost_l2cap_connect_cb func, bthost_l2cap_disconnect_cb disconn_func, void *user_data) @@ -3302,6 +3528,9 @@ return; data->psm = psm; + data->mtu = mtu; + data->mps = mps; + data->credits = credits; data->user_data = user_data; data->func = func; data->disconn_func = disconn_func; @@ -3310,6 +3539,15 @@ bthost->new_l2cap_conn_data = data; } +void bthost_add_l2cap_server(struct bthost *bthost, uint16_t psm, + bthost_l2cap_connect_cb func, + bthost_l2cap_disconnect_cb disconn_func, + void *user_data) +{ + bthost_add_l2cap_server_custom(bthost, psm, 0, 0, 0, func, + disconn_func, user_data); +} + void bthost_set_sc_support(struct bthost *bthost, bool enable) { struct bt_hci_cmd_write_secure_conn_support cmd; @@ -3494,7 +3732,7 @@ } uih_frameuih_len - 1 = rfcomm_fcs((void *)hdr); - send_acl(bthost, handle, rcconn->scid, uih_frame, uih_len); + send_acl(bthost, handle, rcconn->scid, false, uih_frame, uih_len); free(uih_frame); }
View file
_service:tar_scm:bluez-5.71.tar.xz/emulator/bthost.h -> _service:tar_scm:bluez-5.77.tar.xz/emulator/bthost.h
Changed
@@ -5,7 +5,7 @@ * * Copyright (C) 2011-2012 Intel Corporation * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org> - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -102,6 +102,9 @@ void bthost_set_ext_adv_params(struct bthost *bthost); void bthost_set_ext_adv_enable(struct bthost *bthost, uint8_t enable); void bthost_set_pa_params(struct bthost *bthost); +void bthost_set_pa_data(struct bthost *bthost, const uint8_t *data, + uint8_t len); +void bthost_set_base(struct bthost *bthost, const uint8_t *data, uint8_t len); void bthost_set_pa_enable(struct bthost *bthost, uint8_t enable); void bthost_create_big(struct bthost *bthost, uint8_t num_bis, uint8_t enc, const uint8_t *bcode); @@ -133,6 +136,11 @@ bthost_l2cap_connect_cb func, bthost_l2cap_disconnect_cb disconn_func, void *user_data); +void bthost_add_l2cap_server_custom(struct bthost *bthost, uint16_t psm, + uint16_t mtu, uint16_t mps, uint16_t credits, + bthost_l2cap_connect_cb func, + bthost_l2cap_disconnect_cb disconn_func, + void *user_data); void bthost_set_sc_support(struct bthost *bthost, bool enable);
View file
_service:tar_scm:bluez-5.71.tar.xz/gdbus/gdbus.h -> _service:tar_scm:bluez-5.77.tar.xz/gdbus/gdbus.h
Changed
@@ -72,6 +72,7 @@ enum GDBusFlags { G_DBUS_FLAG_ENABLE_EXPERIMENTAL = (1 << 0), + G_DBUS_FLAG_ENABLE_TESTING = (1 << 1), }; enum GDBusMethodFlags { @@ -79,16 +80,19 @@ G_DBUS_METHOD_FLAG_NOREPLY = (1 << 1), G_DBUS_METHOD_FLAG_ASYNC = (1 << 2), G_DBUS_METHOD_FLAG_EXPERIMENTAL = (1 << 3), + G_DBUS_METHOD_FLAG_TESTING = (1 << 4), }; enum GDBusSignalFlags { G_DBUS_SIGNAL_FLAG_DEPRECATED = (1 << 0), G_DBUS_SIGNAL_FLAG_EXPERIMENTAL = (1 << 1), + G_DBUS_SIGNAL_FLAG_TESTING = (1 << 2), }; enum GDBusPropertyFlags { G_DBUS_PROPERTY_FLAG_DEPRECATED = (1 << 0), G_DBUS_PROPERTY_FLAG_EXPERIMENTAL = (1 << 1), + G_DBUS_PROPERTY_FLAG_TESTING = (1 << 2), }; enum GDBusSecurityFlags { @@ -186,6 +190,20 @@ .function = _function, \ .flags = G_DBUS_METHOD_FLAG_ASYNC | G_DBUS_METHOD_FLAG_EXPERIMENTAL +#define GDBUS_TESTING_METHOD(_name, _in_args, _out_args, _function) \ + .name = _name, \ + .in_args = _in_args, \ + .out_args = _out_args, \ + .function = _function, \ + .flags = G_DBUS_METHOD_FLAG_TESTING + +#define GDBUS_TESTING_ASYNC_METHOD(_name, _in_args, _out_args, _function) \ + .name = _name, \ + .in_args = _in_args, \ + .out_args = _out_args, \ + .function = _function, \ + .flags = G_DBUS_METHOD_FLAG_ASYNC | G_DBUS_METHOD_FLAG_TESTING + #define GDBUS_NOREPLY_METHOD(_name, _in_args, _out_args, _function) \ .name = _name, \ .in_args = _in_args, \ @@ -207,6 +225,11 @@ .args = _args, \ .flags = G_DBUS_SIGNAL_FLAG_EXPERIMENTAL +#define GDBUS_TESTING_SIGNAL(_name, _args) \ + .name = _name, \ + .args = _args, \ + .flags = G_DBUS_SIGNAL_FLAG_EXPERIMENTAL + void g_dbus_set_flags(int flags); int g_dbus_get_flags(void);
View file
_service:tar_scm:bluez-5.71.tar.xz/gdbus/object.c -> _service:tar_scm:bluez-5.77.tar.xz/gdbus/object.c
Changed
@@ -14,6 +14,7 @@ #include <stdio.h> #include <string.h> +#include <stdbool.h> #include <glib.h> #include <dbus/dbus.h> @@ -115,6 +116,14 @@ return !(global_flags & G_DBUS_FLAG_ENABLE_EXPERIMENTAL); } +static bool check_testing(int flags, int flag) +{ + if (!(flags & flag)) + return false; + + return !(global_flags & G_DBUS_FLAG_ENABLE_TESTING); +} + static void generate_interface_xml(GString *gstr, struct interface_data *iface) { const GDBusMethodTable *method; @@ -126,6 +135,9 @@ G_DBUS_METHOD_FLAG_EXPERIMENTAL)) continue; + if (check_testing(method->flags, G_DBUS_METHOD_FLAG_TESTING)) + continue; + g_string_append_printf(gstr, "<method name=\"%s\">", method->name); print_arguments(gstr, method->in_args, "in"); @@ -146,6 +158,9 @@ G_DBUS_SIGNAL_FLAG_EXPERIMENTAL)) continue; + if (check_testing(signal->flags, G_DBUS_SIGNAL_FLAG_TESTING)) + continue; + g_string_append_printf(gstr, "<signal name=\"%s\">", signal->name); print_arguments(gstr, signal->args, NULL); @@ -163,6 +178,10 @@ G_DBUS_PROPERTY_FLAG_EXPERIMENTAL)) continue; + if (check_testing(property->flags, + G_DBUS_PROPERTY_FLAG_TESTING)) + continue; + g_string_append_printf(gstr, "<property name=\"%s\"" " type=\"%s\" access=\"%s%s\">", property->name, property->type, @@ -518,6 +537,9 @@ G_DBUS_PROPERTY_FLAG_EXPERIMENTAL)) continue; + if (check_testing(p->flags, G_DBUS_PROPERTY_FLAG_TESTING)) + continue; + if (p->get == NULL) continue; @@ -749,6 +771,9 @@ G_DBUS_PROPERTY_FLAG_EXPERIMENTAL)) break; + if (check_testing(p->flags, G_DBUS_PROPERTY_FLAG_TESTING)) + break; + return p; } @@ -1061,6 +1086,9 @@ G_DBUS_METHOD_FLAG_EXPERIMENTAL)) return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + if (check_testing(method->flags, G_DBUS_METHOD_FLAG_TESTING)) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + if (g_dbus_args_have_signature(method->in_args, message) == FALSE) continue; @@ -1190,18 +1218,26 @@ if (!check_experimental(method->flags, G_DBUS_METHOD_FLAG_EXPERIMENTAL)) goto done; + + if (!check_testing(method->flags, G_DBUS_METHOD_FLAG_TESTING)) + goto done; } for (signal = signals; signal && signal->name; signal++) { if (!check_experimental(signal->flags, G_DBUS_SIGNAL_FLAG_EXPERIMENTAL)) goto done; + if (!check_testing(signal->flags, G_DBUS_SIGNAL_FLAG_TESTING)) + goto done; } for (property = properties; property && property->name; property++) { if (!check_experimental(property->flags, G_DBUS_PROPERTY_FLAG_EXPERIMENTAL)) goto done; + if (!check_testing(property->flags, + G_DBUS_PROPERTY_FLAG_TESTING)) + goto done; } /* Nothing to register */
View file
_service:tar_scm:bluez-5.71.tar.xz/gdbus/watch.c -> _service:tar_scm:bluez-5.77.tar.xz/gdbus/watch.c
Changed
@@ -123,29 +123,51 @@ return NULL; } -static void format_rule(struct filter_data *data, char *rule, size_t size) +static gboolean format_rule(struct filter_data *data, char *rule, size_t size) { const char *sender; - int offset; + int offset, ret; offset = snprintf(rule, size, "type='signal'"); + if (offset < 0) + return FALSE; sender = data->name ? : data->owner; - if (sender) - offset += snprintf(rule + offset, size - offset, + if (sender) { + ret = snprintf(rule + offset, size - offset, ",sender='%s'", sender); - if (data->path) - offset += snprintf(rule + offset, size - offset, + if (ret < 0) + return FALSE; + offset += ret; + } + if (data->path) { + ret = snprintf(rule + offset, size - offset, ",path='%s'", data->path); - if (data->interface) - offset += snprintf(rule + offset, size - offset, + if (ret < 0) + return FALSE; + offset += ret; + } + if (data->interface) { + ret = snprintf(rule + offset, size - offset, ",interface='%s'", data->interface); - if (data->member) - offset += snprintf(rule + offset, size - offset, + if (ret < 0) + return FALSE; + offset += ret; + } + if (data->member) { + ret = snprintf(rule + offset, size - offset, ",member='%s'", data->member); - if (data->argument) - snprintf(rule + offset, size - offset, + if (ret < 0) + return FALSE; + offset += ret; + } + if (data->argument) { + ret = snprintf(rule + offset, size - offset, ",arg0='%s'", data->argument); + if (ret < 0) + return FALSE; + } + return TRUE; } static gboolean add_match(struct filter_data *data,
View file
_service:tar_scm:bluez-5.71.tar.xz/gobex/gobex.c -> _service:tar_scm:bluez-5.77.tar.xz/gobex/gobex.c
Changed
@@ -122,7 +122,7 @@ guint8 constants; } __attribute__ ((packed)); -static struct error_code { +static const struct error_code { guint8 code; const char *name; } obex_errors = { @@ -169,7 +169,7 @@ const char *g_obex_strerror(guint8 err_code) { - struct error_code *error; + const struct error_code *error; for (error = obex_errors; error->name != NULL; error++) { if (error->code == err_code) @@ -1423,7 +1423,7 @@ return FALSE; } -static GDebugKey keys = { +static const GDebugKey keys = { { "error", G_OBEX_DEBUG_ERROR }, { "command", G_OBEX_DEBUG_COMMAND }, { "transfer", G_OBEX_DEBUG_TRANSFER }, @@ -1443,7 +1443,8 @@ const char *env = g_getenv("GOBEX_DEBUG"); if (env) { - gobex_debug = g_parse_debug_string(env, keys, 7); + gobex_debug = g_parse_debug_string(env, keys, + G_N_ELEMENTS(keys)); g_setenv("G_MESSAGES_DEBUG", "gobex", FALSE); } else gobex_debug = G_OBEX_DEBUG_NONE; @@ -1610,7 +1611,7 @@ memset(&data, 0, sizeof(data)); - if (path != NULL && strncmp("..", path, 2) == 0) { + if (path != NULL && strlen(path) >= 2 && strncmp("..", path, 2) == 0) { data.flags = 0x03; folder = (path2 == '/') ? &path3 : NULL; } else {
View file
_service:tar_scm:bluez-5.71.tar.xz/lib/bluetooth.h -> _service:tar_scm:bluez-5.77.tar.xz/lib/bluetooth.h
Changed
@@ -141,6 +141,7 @@ #define BT_PKT_STATUS 16 #define BT_SCM_PKT_STATUS 0x03 +#define BT_SCM_ERROR 0x04 #define BT_ISO_QOS 17 @@ -150,6 +151,8 @@ #define BT_ISO_QOS_BIG_UNSET 0xff #define BT_ISO_QOS_BIS_UNSET 0xff +#define BT_ISO_SYNC_TIMEOUT 0x07d0 /* 20 secs */ + #define BT_ISO_QOS_GROUP_UNSET 0xff #define BT_ISO_QOS_STREAM_UNSET 0xff @@ -237,6 +240,8 @@ #define BT_ISO_BASE 20 +#define BT_POLL_ERRQUEUE 21 + /* Byte order conversions */ #if __BYTE_ORDER == __LITTLE_ENDIAN #define htobs(d) (d)
View file
_service:tar_scm:bluez-5.71.tar.xz/lib/hci.c -> _service:tar_scm:bluez-5.77.tar.xz/lib/hci.c
Changed
@@ -42,7 +42,7 @@ unsigned int val; } hci_map; -static char *hci_bit2str(hci_map *m, unsigned int val) +static char *hci_bit2str(const hci_map *m, unsigned int val) { char *str = malloc(120); char *ptr = str; @@ -59,10 +59,10 @@ return str; } -static int hci_str2bit(hci_map *map, char *str, unsigned int *val) +static int hci_str2bit(const hci_map *map, char *str, unsigned int *val) { char *t, *ptr; - hci_map *m; + const hci_map *m; int set; if (!str || !(str = ptr = strdup(str))) @@ -83,7 +83,7 @@ return set; } -static char *hci_uint2str(hci_map *m, unsigned int val) +static char *hci_uint2str(const hci_map *m, unsigned int val) { char *str = malloc(50); char *ptr = str; @@ -102,10 +102,10 @@ return str; } -static int hci_str2uint(hci_map *map, char *str, unsigned int *val) +static int hci_str2uint(const hci_map *map, char *str, unsigned int *val) { char *t, *ptr; - hci_map *m; + const hci_map *m; int set = 0; if (!str) @@ -127,7 +127,7 @@ return set; } -char *hci_bustostr(int bus) +const char *hci_bustostr(int bus) { switch (bus) { case HCI_VIRTUAL: @@ -157,7 +157,7 @@ } } -char *hci_dtypetostr(int type) +const char *hci_dtypetostr(int type) { return hci_bustostr(type & 0x0f); } @@ -175,7 +175,7 @@ } /* HCI dev flags mapping */ -static hci_map dev_flags_map = { +static const hci_map dev_flags_map = { { "UP", HCI_UP }, { "INIT", HCI_INIT }, { "RUNNING", HCI_RUNNING }, @@ -192,7 +192,7 @@ { char *str = bt_malloc(50); char *ptr = str; - hci_map *m = dev_flags_map; + const hci_map *m = dev_flags_map; if (!str) return NULL; @@ -211,7 +211,7 @@ } /* HCI packet type mapping */ -static hci_map pkt_type_map = { +static const hci_map pkt_type_map = { { "DM1", HCI_DM1 }, { "DM3", HCI_DM3 }, { "DM5", HCI_DM5 }, @@ -230,7 +230,7 @@ { NULL } }; -static hci_map sco_ptype_map = { +static const hci_map sco_ptype_map = { { "HV1", 0x0001 }, { "HV2", 0x0002 }, { "HV3", 0x0004 }, @@ -265,7 +265,7 @@ } /* Link policy mapping */ -static hci_map link_policy_map = { +static const hci_map link_policy_map = { { "NONE", 0 }, { "RSWITCH", HCI_LP_RSWITCH }, { "HOLD", HCI_LP_HOLD }, @@ -285,7 +285,7 @@ } /* Link mode mapping */ -static hci_map link_mode_map = { +static const hci_map link_mode_map = { { "NONE", 0 }, { "ACCEPT", HCI_LM_ACCEPT }, { "CENTRAL", HCI_LM_MASTER }, @@ -332,7 +332,7 @@ } /* Command mapping */ -static hci_map commands_map = { +static const hci_map commands_map = { { "Inquiry", 0 }, { "Inquiry Cancel", 1 }, { "Periodic Inquiry Mode", 2 }, @@ -605,7 +605,7 @@ char *hci_commandstostr(uint8_t *commands, char *pref, int width) { unsigned int maxwidth = width - 3; - hci_map *m; + const hci_map *m; char *off, *ptr, *str; int size = 10; @@ -645,7 +645,7 @@ } /* Version mapping */ -static hci_map ver_map = { +static const hci_map ver_map = { { "1.0b", 0x00 }, { "1.1", 0x01 }, { "1.2", 0x02 }, @@ -683,7 +683,7 @@ return hci_str2uint(ver_map, str, ver); } -static hci_map pal_map = { +static const hci_map pal_map = { { "3.0", 0x01 }, { NULL } }; @@ -699,7 +699,7 @@ } /* LMP features mapping */ -static hci_map lmp_features_map89 = { +static const hci_map lmp_features_map89 = { { /* Byte 0 */ { "<3-slot packets>", LMP_3SLOT }, /* Bit 0 */ { "<5-slot packets>", LMP_5SLOT }, /* Bit 1 */ @@ -794,7 +794,7 @@ int i, size = 10; for (i = 0; i < 8; i++) { - hci_map *m = lmp_features_mapi; + const hci_map *m = lmp_features_mapi; while (m->str) { if (m->val & featuresi) @@ -816,7 +816,7 @@ off = ptr; for (i = 0; i < 8; i++) { - hci_map *m = lmp_features_mapi; + const hci_map *m = lmp_features_mapi; while (m->str) { if (m->val & featuresi) {
View file
_service:tar_scm:bluez-5.71.tar.xz/lib/hci_lib.h -> _service:tar_scm:bluez-5.77.tar.xz/lib/hci_lib.h
Changed
@@ -132,9 +132,9 @@ int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg); int hci_get_route(bdaddr_t *bdaddr); -char *hci_bustostr(int bus); +const char *hci_bustostr(int bus); char *hci_typetostr(int type); -char *hci_dtypetostr(int type); +const char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); char *hci_ptypetostr(unsigned int ptype); int hci_strtoptype(char *str, unsigned int *val);
View file
_service:tar_scm:bluez-5.71.tar.xz/lib/sdp.c -> _service:tar_scm:bluez-5.77.tar.xz/lib/sdp.c
Changed
@@ -47,7 +47,7 @@ #define SDPDBG(fmt...) #endif -static uint128_t bluetooth_base_uuid = { +static const uint128_t bluetooth_base_uuid = { .data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB } }; @@ -65,10 +65,10 @@ /* Message structure. */ struct tupla { int index; - char *str; + const char *str; }; -static struct tupla Protocol = { +static const struct tupla Protocol = { { SDP_UUID, "SDP" }, { UDP_UUID, "UDP" }, { RFCOMM_UUID, "RFCOMM" }, @@ -97,7 +97,7 @@ { 0 } }; -static struct tupla ServiceClass = { +static const struct tupla ServiceClass = { { SDP_SERVER_SVCLASS_ID, "SDP Server" }, { BROWSE_GRP_DESC_SVCLASS_ID, "Browse Group Descriptor" }, { PUBLIC_BROWSE_GROUP, "Public Browse Group" }, @@ -176,9 +176,9 @@ #define Profile ServiceClass -static char *string_lookup(struct tupla *pt0, int index) +static const char *string_lookup(const struct tupla *pt0, int index) { - struct tupla *pt; + const struct tupla *pt; for (pt = pt0; pt->index; pt++) if (pt->index == index) @@ -187,7 +187,8 @@ return ""; } -static char *string_lookup_uuid(struct tupla *pt0, const uuid_t *uuid) +static const char *string_lookup_uuid(const struct tupla *pt0, + const uuid_t *uuid) { uuid_t tmp_uuid; @@ -209,9 +210,10 @@ * Prints into a string the Protocol UUID * coping a maximum of n characters. */ -static int uuid2str(struct tupla *message, const uuid_t *uuid, char *str, size_t n) +static int uuid2str(const struct tupla *message, const uuid_t *uuid, char *str, + size_t n) { - char *str2; + const char *str2; if (!uuid) { snprintf(str, n, "NULL"); @@ -504,15 +506,17 @@ for (i = 0; i < len; i++) { sdp_data_t *data; - int8_t dtd = *(uint8_t *) dtdsi; + uint8_t dtd = *(uint8_t *) dtdsi; if (dtd >= SDP_SEQ8 && dtd <= SDP_ALT32) data = (sdp_data_t *) valuesi; else data = sdp_data_alloc_with_length(dtd, valuesi, lengthi); - if (!data) + if (!data) { + sdp_data_free(seq); return NULL; + } if (curr) curr->next = data; @@ -539,8 +543,10 @@ else data = sdp_data_alloc(dtd, valuesi); - if (!data) + if (!data) { + sdp_data_free(seq); return NULL; + } if (curr) curr->next = data; @@ -576,6 +582,8 @@ if (p) return -1; + if (!d) + return -1; d->attrId = attr; rec->attrlist = sdp_list_insert_sorted(rec->attrlist, d, sdp_attrid_comp_func); @@ -958,6 +966,8 @@ void sdp_data_free(sdp_data_t *d) { + if (!d) + return; switch (d->dtd) { case SDP_SEQ8: case SDP_SEQ16: @@ -1532,6 +1542,11 @@ value = sdp_data_value(tmp, &len); datatmp = sdp_data_alloc_with_length(tmp->dtd, value, len); + if (!datatmp) { + sdp_data_free(seq); + return NULL; + } + if (cur) cur->next = datatmp; else @@ -2297,7 +2312,7 @@ sdp_list_t *p; seqlen = sdp_list_len(proto); - seqDTDs = malloc(seqlen * sizeof(void *)); + seqDTDs = bt_malloc0(seqlen * sizeof(void *)); if (!seqDTDs) return NULL; @@ -2763,7 +2778,7 @@ */ int sdp_uuid128_to_uuid(uuid_t *uuid) { - uint128_t *b = &bluetooth_base_uuid; + const uint128_t *b = &bluetooth_base_uuid; uint128_t *u = &uuid->value.uuid128; uint32_t data; unsigned int i; @@ -3602,7 +3617,7 @@ /* get attr seq PDU form */ seqlen = gen_attridseq_pdu(pdata, attrids, reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16 : SDP_UINT32); - if (seqlen == -1) { + if (seqlen < 0) { errno = EINVAL; goto end; } @@ -3957,7 +3972,7 @@ /* get attr seq PDU form */ seqlen = gen_attridseq_pdu(pdata, attrid_list, reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16 : SDP_UINT32); - if (seqlen == -1) { + if (seqlen < 0) { t->err = EINVAL; goto end; } @@ -4079,7 +4094,7 @@ /* get attr seq PDU form */ seqlen = gen_attridseq_pdu(pdata, attrid_list, reqtype == SDP_ATTR_REQ_INDIVIDUAL ? SDP_UINT16 : SDP_UINT32); - if (seqlen == -1) { + if (seqlen < 0) { t->err = EINVAL; goto end; } @@ -4463,7 +4478,7 @@ /* get attr seq PDU form */ seqlen = gen_attridseq_pdu(pdata, attrids, reqtype == SDP_ATTR_REQ_INDIVIDUAL ? SDP_UINT16 : SDP_UINT32); - if (seqlen == -1) { + if (seqlen < 0) { errno = EINVAL; status = -1; goto end;
View file
_service:tar_scm:bluez-5.71.tar.xz/lib/uuid.c -> _service:tar_scm:bluez-5.77.tar.xz/lib/uuid.c
Changed
@@ -120,6 +120,15 @@ return bt_uuid128_cmp(&u1, &u2); } +int bt_uuid16_cmp(const bt_uuid_t *uuid1, uint16_t uuid2) +{ + + if (!uuid1 || (uuid1->type != BT_UUID16)) + return 0; + + return (uuid1->value.u16 == uuid2); +} + /* * convert the UUID to string, copying a maximum of n characters. */
View file
_service:tar_scm:bluez-5.71.tar.xz/lib/uuid.h -> _service:tar_scm:bluez-5.77.tar.xz/lib/uuid.h
Changed
@@ -163,6 +163,9 @@ #define BAA_SERVICE 0x1851 #define BAA_SERVICE_UUID "00001851-0000-1000-8000-00805f9b34fb" +#define ASHA_SERVICE 0xFDF0 +#define ASHA_PROFILE_UUID "0000FDF0-0000-1000-8000-00805f9b34fb" + #define PAC_CONTEXT 0x2bcd #define PAC_SUPPORTED_CONTEXT 0x2bce @@ -187,6 +190,13 @@ #define VOCS_CP_CHRC_UUID 0x2B82 #define VOCS_AUDIO_OP_DESC_CHAR_UUID 0x2B83 +#define AICS_INPUT_STATE_CHAR_UUID 0x2B77 +#define AICS_GAIN_SETTING_PROP_CHAR_UUID 0x2B78 +#define AICS_AUDIO_INPUT_TYPE_CHAR_UUID 0x2B79 +#define AICS_INPUT_STATUS_CHAR_UUID 0X2B7A +#define AICS_AUDIO_INPUT_CP_CHRC_UUID 0X2B7B +#define AICS_INPUT_DESCR_CHAR_UUID 0X2B7C + #define GMCS_UUID 0x1849 #define MEDIA_PLAYER_NAME_CHRC_UUID 0x2b93 #define MEDIA_TRACK_CHNGD_CHRC_UUID 0x2b96 @@ -214,6 +224,27 @@ #define MICS_UUID 0x184D #define MUTE_CHRC_UUID 0x2BC3 +/* Call Control Service(TBS/CCS) */ +#define TBS_UUID 0x184B +#define GTBS_UUID 0x184C + +#define BEARER_PROVIDER_NAME_CHRC_UUID 0x2bb3 +#define BEARER_UCI_CHRC_UUID 0x2bb4 +#define BEARER_TECH_CHRC_UUID 0x2bb5 +#define BEARER_URI_SCHEME_CHRC_UUID 0x2bb6 +#define BEARER_SIGNAL_STR_CHRC_UUID 0x2bb7 +#define BEARER_SIGNAL_INTRVL_CHRC_UUID 0x2bb8 +#define CURR_CALL_LIST_CHRC_UUID 0x2bb9 +#define BEARER_CCID_CHRC_UUID 0x2bba +#define CALL_STATUS_FLAG_CHRC_UUID 0x2bbb +#define INCOM_CALL_TARGET_URI_CHRC_UUID 0x2bbc +#define CALL_STATE_CHRC_UUID 0x2bbd +#define CALL_CTRL_POINT_CHRC_UUID 0x2bbe +#define CALL_CTRL_POINT_OPT_OPCODE_CHRC_UUID 0x2bbf +#define TERMINATION_REASON_CHRC_UUID 0x2bc0 +#define INCOMING_CALL_CHRC_UUID 0x2bc1 +#define CALL_FRIENDLY_NAME_CHRC_UUID 0x2bc2 + typedef struct { enum { BT_UUID_UNSPEC = 0, @@ -235,6 +266,7 @@ int bt_uuid128_create(bt_uuid_t *btuuid, uint128_t value); int bt_uuid_cmp(const bt_uuid_t *uuid1, const bt_uuid_t *uuid2); +int bt_uuid16_cmp(const bt_uuid_t *uuid1, uint16_t uuid2); void bt_uuid_to_uuid128(const bt_uuid_t *src, bt_uuid_t *dst); #define MAX_LEN_UUID_STR 37
View file
_service:tar_scm:bluez-5.71.tar.xz/mesh/agent.c -> _service:tar_scm:bluez-5.77.tar.xz/mesh/agent.c
Changed
@@ -61,7 +61,7 @@ uint16_t mask; }; -static struct prov_action cap_table = { +static const struct prov_action cap_table = { {"blink", 0x0001, 0x0000, 1}, {"beep", 0x0002, 0x0000, 1}, {"vibrate", 0x0004, 0x0000, 1}, @@ -73,7 +73,7 @@ {"in-alpha", 0x0000, 0x0008, 8} }; -static struct oob_info oob_table = { +static const struct oob_info oob_table = { {"other", 0x0001}, {"uri", 0x0002}, {"machine-code-2d", 0x0004},
View file
_service:tar_scm:bluez-5.71.tar.xz/mesh/bluetooth-mesh.service.in -> _service:tar_scm:bluez-5.77.tar.xz/mesh/bluetooth-mesh.service.in
Changed
@@ -5,7 +5,7 @@ Service Type=dbus BusName=org.bluez.mesh -ExecStart=@pkglibexecdir@/bluetooth-meshd +ExecStart=@PKGLIBEXECDIR@/bluetooth-meshd NotifyAccess=main LimitNPROC=1 ProtectHome=true
View file
_service:tar_scm:bluez-5.71.tar.xz/mesh/pb-adv.c -> _service:tar_scm:bluez-5.77.tar.xz/mesh/pb-adv.c
Changed
@@ -166,7 +166,7 @@ consumed = init_size; for (i = 1; i <= max_seg; i++) { - uint8_t seg_size; /* Amount of payload data being sent */ + size_t seg_size; /* Amount of payload data being sent */ if (size - consumed > PB_ADV_MTU - 1) seg_size = PB_ADV_MTU - 1;
View file
_service:tar_scm:bluez-5.71.tar.xz/mesh/prov-initiator.c -> _service:tar_scm:bluez-5.77.tar.xz/mesh/prov-initiator.c
Changed
@@ -673,8 +673,13 @@ goto failure; } - if (type >= L_ARRAY_SIZE(expected_pdu_size) || - len != expected_pdu_sizetype) { + if (type >= L_ARRAY_SIZE(expected_pdu_size)) { + l_error("Invalid PDU type %2.2x", type); + fail_code1 = PROV_ERR_INVALID_FORMAT; + goto failure; + } + + if (len != expected_pdu_sizetype) { l_error("Expected PDU size %d, Got %d (type: %2.2x)", expected_pdu_sizetype, len, type); fail_code1 = PROV_ERR_INVALID_FORMAT;
View file
_service:tar_scm:bluez-5.71.tar.xz/mesh/rpl.c -> _service:tar_scm:bluez-5.77.tar.xz/mesh/rpl.c
Changed
@@ -31,7 +31,7 @@ #include "mesh/util.h" #include "mesh/rpl.h" -const char *rpl_dir = "/rpl"; +static const char *rpl_dir = "/rpl"; bool rpl_put_entry(struct mesh_node *node, uint16_t src, uint32_t iv_index, uint32_t seq)
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/a2dp.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/a2dp.c
Changed
@@ -47,6 +47,8 @@ #define APTX_HD_CODEC_ID 0x0024 #define LDAC_VENDOR_ID 0x0000012d #define LDAC_CODEC_ID 0x00aa +#define OPUS_G_VENDOR_ID 0x000000e0 +#define OPUS_G_CODEC_ID 0x0001 struct bit_desc { uint8_t bit_num; @@ -201,6 +203,24 @@ { } }; +static const struct bit_desc opus_g_frequency_table = { + { 7, "48000" }, + { } +}; + +static const struct bit_desc opus_g_duration_table = { + { 3, "10 ms" }, + { 4, "20 ms" }, + { } +}; + +static const struct bit_desc opus_g_channels_table = { + { 0, "Mono" }, + { 1, "Stereo" }, + { 2, "Dual Mono" }, + { } +}; + static void print_value_bits(uint8_t indent, uint32_t value, const struct bit_desc *table) { @@ -244,6 +264,7 @@ static bool codec_vendor_aptx_hd_cap(uint8_t losc, struct l2cap_frame *frame); static bool codec_vendor_aptx_hd_cfg(uint8_t losc, struct l2cap_frame *frame); static bool codec_vendor_ldac(uint8_t losc, struct l2cap_frame *frame); +static bool codec_vendor_opus_g(uint8_t losc, struct l2cap_frame *frame); static const struct vndcodec vndcodecs = { { APTX_VENDOR_ID, APTX_CODEC_ID, "aptX", @@ -256,6 +277,8 @@ codec_vendor_aptx_hd_cap, codec_vendor_aptx_hd_cfg }, { LDAC_VENDOR_ID, LDAC_CODEC_ID, "LDAC", codec_vendor_ldac, codec_vendor_ldac }, + { OPUS_G_VENDOR_ID, OPUS_G_CODEC_ID, "Opus (Google)", + codec_vendor_opus_g, codec_vendor_opus_g }, { } }; @@ -685,6 +708,31 @@ return true; } +static bool codec_vendor_opus_g(uint8_t losc, struct l2cap_frame *frame) +{ + uint8_t cap = 0; + + if (losc != 1) + return false; + + l2cap_frame_get_u8(frame, &cap); + + print_field("%*cFrequency: 0x%02x", BASE_INDENT + 2, ' ', cap & 0x80); + print_value_bits(BASE_INDENT + 2, cap, opus_g_frequency_table); + + print_field("%*cFrame Duration: 0x%02x", BASE_INDENT + 2, ' ', + cap & 0x18); + print_value_bits(BASE_INDENT + 2, cap, opus_g_duration_table); + + print_field("%*cChannel Mode: 0x%02x", BASE_INDENT + 2, ' ', + cap & 0x07); + print_value_bits(BASE_INDENT + 2, cap, opus_g_channels_table); + + print_field("%*cReserved: 0x%02x", BASE_INDENT + 2, ' ', cap & 0x60); + + return true; +} + static bool codec_vendor_cap(uint8_t losc, struct l2cap_frame *frame) { uint32_t vendor_id = 0;
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/att.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/att.c
Changed
@@ -46,10 +46,12 @@ #include "keys.h" struct att_read { + struct att_conn_data *conn; struct gatt_db_attribute *attr; bool in; uint16_t chan; void (*func)(const struct l2cap_frame *frame); + struct iovec *iov; }; struct att_conn_data { @@ -58,6 +60,7 @@ struct gatt_db *rdb; struct timespec rdb_mtim; struct queue *reads; + uint16_t mtu; }; static void print_uuid(const char *label, const void *data, uint16_t size) @@ -210,6 +213,15 @@ print_field("Handle: 0x%4.4x", handle); } +static void att_read_free(struct att_read *read) +{ + if (!read) + return; + + util_iov_free(read->iov, 1); + free(read); +} + static void print_data_list(const char *label, uint8_t length, const struct l2cap_frame *frame) { @@ -231,7 +243,7 @@ print_hex_field("Value", frame->data, length - 2); - if (read) { + if (read && read->func) { struct l2cap_frame f; l2cap_frame_clone_size(&f, frame, length - 2); @@ -244,7 +256,7 @@ } packet_hexdump(frame->data, frame->size); - free(read); + att_read_free(read); } static void print_attribute_info(uint16_t type, const void *data, uint16_t len) @@ -370,7 +382,7 @@ */ if (pdu->request == 0x08 || pdu->request == 0x0a || pdu->request == 0x10) - free(att_get_read(frame)); + att_read_free(att_get_read(frame)); } static const struct bitfield_data chrc_prop_table = { @@ -494,6 +506,7 @@ static struct gatt_db_attribute *insert_chrc(const struct l2cap_frame *frame, uint16_t handle, + uint16_t value_handle, bt_uuid_t *uuid, uint8_t prop, bool rsp) { @@ -503,8 +516,8 @@ if (!db) return NULL; - return gatt_db_insert_characteristic(db, handle, uuid, 0, prop, NULL, - NULL, NULL); + return gatt_db_insert_characteristic(db, handle, value_handle, uuid, 0, + prop, NULL, NULL, NULL); } static int bt_uuid_from_data(bt_uuid_t *uuid, const void *data, uint16_t size) @@ -603,7 +616,7 @@ print_uuid(" Value UUID", frame->data, frame->size); bt_uuid_from_data(&uuid, frame->data, frame->size); - insert_chrc(frame, handle, &uuid, prop, true); + insert_chrc(frame, handle - 1, handle, &uuid, prop, true); } static void chrc_read(const struct l2cap_frame *frame) @@ -683,7 +696,8 @@ } static bool print_ase_lv(const struct l2cap_frame *frame, const char *label, - struct util_ltv_debugger *decoder, size_t decoder_len) + const struct util_ltv_debugger *decoder, + size_t decoder_len) { struct bt_hci_lv_data *lv; @@ -705,7 +719,8 @@ } static bool print_ase_cc(const struct l2cap_frame *frame, const char *label, - struct util_ltv_debugger *decoder, size_t decoder_len) + const struct util_ltv_debugger *decoder, + size_t decoder_len) { return print_ase_lv(frame, label, decoder, decoder_len); } @@ -813,7 +828,7 @@ print_hex_field(" Data", frame.data, frame.size); } -struct util_ltv_debugger ase_metadata_table = { +static const struct util_ltv_debugger ase_metadata_table = { UTIL_LTV_DEBUG(0x01, ase_debug_preferred_context), UTIL_LTV_DEBUG(0x02, ase_debug_context), UTIL_LTV_DEBUG(0x03, ase_debug_program_info), @@ -994,7 +1009,7 @@ print_hex_field(" Data", frame.data, frame.size); } -struct util_ltv_debugger pac_cap_table = { +static const struct util_ltv_debugger pac_cap_table = { UTIL_LTV_DEBUG(0x01, pac_decode_freq), UTIL_LTV_DEBUG(0x02, pac_decode_duration), UTIL_LTV_DEBUG(0x03, pac_decode_channels), @@ -1336,7 +1351,7 @@ print_hex_field(" Data", frame.data, frame.size); } -struct util_ltv_debugger ase_cc_table = { +static const struct util_ltv_debugger ase_cc_table = { UTIL_LTV_DEBUG(0x01, ase_debug_freq), UTIL_LTV_DEBUG(0x02, ase_debug_duration), UTIL_LTV_DEBUG(0x03, ase_debug_location), @@ -1710,7 +1725,7 @@ .func = _func, \ } -struct ase_cmd { +static const struct ase_cmd { const char *desc; bool (*func)(const struct l2cap_frame *frame); } ase_cmd_table = { @@ -1732,7 +1747,7 @@ ASE_CMD(0x08, "Release", ase_release_cmd), }; -static struct ase_cmd *ase_get_cmd(uint8_t op) +static const struct ase_cmd *ase_get_cmd(uint8_t op) { if (op > ARRAY_SIZE(ase_cmd_table)) return NULL; @@ -1743,7 +1758,7 @@ static void print_ase_cmd(const struct l2cap_frame *frame) { uint8_t op, num, i; - struct ase_cmd *cmd; + const struct ase_cmd *cmd; if (!l2cap_frame_get_u8((void *)frame, &op)) { print_text(COLOR_ERROR, "opcode: invalid size"); @@ -1911,7 +1926,7 @@ static void print_ase_cp_rsp(const struct l2cap_frame *frame) { uint8_t op, num, i; - struct ase_cmd *cmd; + const struct ase_cmd *cmd; if (!l2cap_frame_get_u8((void *)frame, &op)) { print_text(COLOR_ERROR, " opcode: invalid size"); @@ -2161,7 +2176,7 @@ .func = _func, \ } -struct vcs_cmd { +static const struct vcs_cmd { const char *desc; bool (*func)(const struct l2cap_frame *frame); } vcs_cmd_table = { @@ -2181,7 +2196,7 @@ VCS_CMD(0x06, "Mute", vcs_config_cmd), }; -static struct vcs_cmd *vcs_get_cmd(uint8_t op) +static const struct vcs_cmd *vcs_get_cmd(uint8_t op) { if (op > ARRAY_SIZE(vcs_cmd_table)) return NULL; @@ -2192,7 +2207,7 @@ static void print_vcs_cmd(const struct l2cap_frame *frame) { uint8_t op; - struct vcs_cmd *cmd; + const struct vcs_cmd *cmd; if (!l2cap_frame_get_u8((void *)frame, &op)) { print_text(COLOR_ERROR, "opcode: invalid size"); @@ -2276,6 +2291,8 @@ name = name2utf8((uint8_t *)frame->data, frame->size); print_field(" Media Player Name: %s", name); + + g_free(name); } static void mp_name_read(const struct l2cap_frame *frame) @@ -2305,6 +2322,8 @@ name = name2utf8((uint8_t *)frame->data, frame->size); print_field(" Track Title: %s", name); + + g_free(name); } static void track_title_read(const struct l2cap_frame *frame) @@ -2431,6 +2450,668 @@ print_seeking_speed(frame); } +static void print_bearer_name(const struct l2cap_frame *frame) +{ + char *name; + + name = name2utf8((uint8_t *)frame->data, frame->size); + + print_field(" Bearer Name: %s", name); + + g_free(name); +} + +static void bearer_name_read(const struct l2cap_frame *frame) +{ + print_bearer_name(frame); +} + +static void bearer_name_notify(const struct l2cap_frame *frame) +{ + print_bearer_name(frame); +} + +static void bearer_uci_read(const struct l2cap_frame *frame) +{ + char *name; + + name = name2utf8((uint8_t *)frame->data, frame->size); + + print_field(" Bearer Uci Name: %s", name); + + g_free(name); +} + +static void print_technology_name(const struct l2cap_frame *frame) +{ + int8_t tech_id; + const char *str; + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&tech_id)) { + print_text(COLOR_ERROR, " Technology id:: invalid size"); + goto done; + } + + switch (tech_id) { + case 0x01: + str = "3G"; + break; + case 0x02: + str = "4G"; + break; + case 0x03: + str = "LTE"; + break; + case 0x04: + str = "WiFi"; + break; + case 0x05: + str = "5G"; + break; + case 0x06: + str = "GSM"; + break; + case 0x07: + str = "CDMA"; + break; + case 0x08: + str = "2G"; + break; + case 0x09: + str = "WCDMA"; + break; + default: + str = "Reserved"; + break; + } + + print_field("Technology: %s (0x%2.2x)", str, tech_id); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void bearer_technology_read(const struct l2cap_frame *frame) +{ + print_technology_name(frame); +} + +static void bearer_technology_notify(const struct l2cap_frame *frame) +{ + print_technology_name(frame); +} + +static void print_uri_scheme_list(const struct l2cap_frame *frame) +{ + char *name; + + name = name2utf8((uint8_t *)frame->data, frame->size); + + print_field(" Uri scheme Name: %s", name); + + g_free(name); +} + +static void bearer_uri_schemes_list_read(const struct l2cap_frame *frame) +{ + print_uri_scheme_list(frame); +} + +static void print_signal_strength(const struct l2cap_frame *frame) +{ + uint8_t signal_strength; + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&signal_strength)) { + print_text(COLOR_ERROR, " signal_strength:: invalid size"); + goto done; + } + + print_field(" signal_strength: %x", signal_strength); + + if (signal_strength == 0) + print_field(" No Service"); + else if (signal_strength == 0x64) + print_field(" Maximum signal strength"); + else if ((signal_strength > 0) && (signal_strength < 0x64)) + print_field(" Implementation specific"); + else if (signal_strength == 0xFF) + print_field(" Signal strength is unavailable"); + else + print_field(" RFU"); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void bearer_signal_strength_read(const struct l2cap_frame *frame) +{ + print_signal_strength(frame); +} + +static void bearer_signal_strength_notify(const struct l2cap_frame *frame) +{ + print_signal_strength(frame); +} + +static void +print_signal_strength_rep_intrvl(const struct l2cap_frame *frame) +{ + int8_t reporting_intrvl; + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&reporting_intrvl)) { + print_text(COLOR_ERROR, "Reporting_interval:: invalid size"); + goto done; + } + + print_field(" Reporting_interval: 0x%x", reporting_intrvl); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void +bearer_signal_strength_rep_intrvl_read(const struct l2cap_frame *frame) +{ + print_signal_strength_rep_intrvl(frame); +} + +static void +bearer_signal_strength_rep_intrvl_write(const struct l2cap_frame *frame) +{ + print_signal_strength_rep_intrvl(frame); +} + +static void print_call_list(const struct l2cap_frame *frame) +{ + uint8_t list_item_length; + uint8_t call_index; + uint8_t call_state; + uint8_t call_flag; + char *call_uri; + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&list_item_length)) { + print_text(COLOR_ERROR, " list_item_length:: invalid size"); + goto done; + } + + print_field(" list_item_length: 0x%x", list_item_length); + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&call_index)) { + print_text(COLOR_ERROR, " call_index:: invalid size"); + goto done; + } + + print_field(" call_index: 0x%x", call_index); + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&call_state)) { + print_text(COLOR_ERROR, " call_state:: invalid size"); + goto done; + } + + print_field(" call_state: 0x%x", call_state); + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&call_flag)) { + print_text(COLOR_ERROR, " call_flag:: invalid size"); + goto done; + } + + print_field(" call_flag: 0x%x", call_flag); + + call_uri = name2utf8((uint8_t *)frame->data, frame->size); + + print_field(" call_uri: %s", call_uri); + + g_free(call_uri); + +done: + if (frame->size) + print_hex_field(" call_list Data", frame->data, frame->size); +} + +static void bearer_current_call_list_read(const struct l2cap_frame *frame) +{ + print_call_list(frame); +} + +static void bearer_current_call_list_notify(const struct l2cap_frame *frame) +{ + print_call_list(frame); +} + +static void print_ccid(const struct l2cap_frame *frame) +{ + int8_t ccid; + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&ccid)) { + print_text(COLOR_ERROR, " ccid:: invalid size"); + goto done; + } + + print_field(" ccid: %x", ccid); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void call_content_control_id_read(const struct l2cap_frame *frame) +{ + print_ccid(frame); +} + +static void print_status_flag(const struct l2cap_frame *frame) +{ + int16_t flag; + + if (!l2cap_frame_get_le16((void *)frame, (uint16_t *)&flag)) { + print_text(COLOR_ERROR, " status flag:: invalid size"); + goto done; + } + + print_field(" status flag:"); + + if (flag & 0x1) + print_field(" Inband Ringtone Enabled:"); + else + print_field(" Inband Ringtone Disabled:"); + + if (flag & 0x2) + print_field(" Server in silent Mode"); + else + print_field(" Server Not in silent Mode"); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void status_flag_read(const struct l2cap_frame *frame) +{ + print_status_flag(frame); +} + +static void status_flag_notify(const struct l2cap_frame *frame) +{ + print_status_flag(frame); +} + +static void print_target_uri(const struct l2cap_frame *frame) +{ + char *name; + uint8_t call_idx; + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&call_idx)) { + print_text(COLOR_ERROR, " call_idx:: invalid size"); + goto done; + } + + print_field(" call_idx: %x", call_idx); + + name = name2utf8((uint8_t *)frame->data, frame->size); + + print_field(" Uri: %s", name); + + g_free(name); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void incom_target_bearer_uri_read(const struct l2cap_frame *frame) +{ + print_target_uri(frame); +} + +static void incom_target_bearer_uri_notify(const struct l2cap_frame *frame) +{ + print_target_uri(frame); +} + +static void print_call_state(const struct l2cap_frame *frame) +{ + uint8_t call_Index; + uint8_t call_state; + uint8_t call_flag; + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&call_Index)) { + print_text(COLOR_ERROR, " call_Index:: invalid index"); + goto done; + } + + print_field(" call_Index: 0x%2.2x", call_Index); + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&call_state)) { + print_text(COLOR_ERROR, " call_state:: invalid state"); + goto done; + } + + print_field(" call_state: 0x%2.2x", call_state); + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&call_flag)) { + print_text(COLOR_ERROR, " call_flag:: invalid flag"); + goto done; + } + + print_field(" call_flag: 0x%2.2x", call_flag); + +done: + if (frame->size) + print_hex_field(" call_state Data", frame->data, frame->size); +} + +static void call_state_read(const struct l2cap_frame *frame) +{ + print_call_state(frame); +} + +static void call_state_notify(const struct l2cap_frame *frame) +{ + print_call_state(frame); +} + +static void print_call_cp(const struct l2cap_frame *frame) +{ + uint8_t opcode; + uint8_t parameter; + const char *str; + char *name; + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&opcode)) { + print_text(COLOR_ERROR, " opcode:: invalid size"); + goto done; + } + + print_field(" opcode: 0x%2.2x", opcode); + + switch (opcode) { + case 0x00: + str = "Accept"; + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)¶meter)) { + print_text(COLOR_ERROR, " parameter:: invalid size"); + goto done; + } + print_field(" Operation: %s (0x%2.2x)", str, parameter); + break; + case 0x01: + str = "Terminate"; + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)¶meter)) { + print_text(COLOR_ERROR, " parameter:: invalid size"); + goto done; + } + print_field(" Operation: %s (0x%2.2x)", str, parameter); + break; + case 0x02: + str = "Local Hold"; + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)¶meter)) { + print_text(COLOR_ERROR, " parameter:: invalid size"); + goto done; + } + print_field(" Operation: %s (0x%2.2x)", str, parameter); + break; + case 0x03: + str = "Local Retrieve"; + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)¶meter)) { + print_text(COLOR_ERROR, " parameter:: invalid size"); + goto done; + } + print_field(" Operation: %s (0x%2.2x)", str, parameter); + break; + case 0x04: + str = "Originate"; + name = name2utf8((uint8_t *)frame->data, frame->size); + print_field(" Operation: %s Uri: %s", str, name); + g_free(name); + break; + case 0x05: + str = "Join"; + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)¶meter)) { + print_text(COLOR_ERROR, " parameter:: invalid size"); + goto done; + } + print_field(" Operation: %s (0x%2.2x)", str, parameter); + break; + default: + str = "RFU"; + print_field(" Operation: %s", str); + break; + } + +done: + if (frame->size) + print_hex_field("call_cp Data", frame->data, frame->size); +} + +static void print_call_cp_notification(const struct l2cap_frame *frame) +{ + uint8_t opcode; + uint8_t result_code; + const char *str; + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&opcode)) { + print_text(COLOR_ERROR, " result_code:: invalid opcode"); + goto done; + } + + print_field(" opcode: 0x%2.2x", opcode); + + if (!l2cap_frame_get_u8((void *)frame, (uint8_t *)&result_code)) { + print_text(COLOR_ERROR, " result_code:: invalid result_code"); + goto done; + } + + print_field(" result_code: 0x%2.2x", result_code); + + switch (result_code) { + case 0x00: + str = "SUCCESS"; + break; + case 0x01: + str = "OPCODE NOT SUPPORTED"; + break; + case 0x02: + str = "OPERATION NOT POSSIBLE"; + break; + case 0x03: + str = "INVALID CALL INDEX"; + break; + case 0x04: + str = "STATE MISMATCH"; + break; + case 0x05: + str = "LACK OF RESOURCES"; + break; + case 0x06: + str = "INVALID OUTGOING URI"; + break; + default: + str = "RFU"; + break; + } + + print_field(" Status: %s", str); + +done: + if (frame->size) + print_hex_field(" call_cp Data", frame->data, frame->size); +} + +static void call_cp_write(const struct l2cap_frame *frame) +{ + print_call_cp(frame); +} + +static void call_cp_notify(const struct l2cap_frame *frame) +{ + print_call_cp_notification(frame); +} + +static void print_call_cp_opt(const struct l2cap_frame *frame) +{ + uint16_t operation; + + if (!l2cap_frame_get_le16((void *)frame, (uint16_t *)&operation)) { + print_text(COLOR_ERROR, " status operation:: invalid size"); + goto done; + } + + print_field(" operation: 0x%2x", operation); + + if (operation & 0x1) { + print_field(" Local Hold and Local Retrieve " + "Call Control Point Opcodes supported"); + } else { + print_field(" Local Hold and Local Retrieve " + "Call Control Point Opcodes not supported"); + } + + if (operation & 0x2) + print_field(" Join Call Control Point Opcode supported"); + else + print_field(" Join Call Control Point Opcode not supported"); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void call_cp_opt_opcodes_read(const struct l2cap_frame *frame) +{ + print_call_cp_opt(frame); +} + +static void print_term_reason(const struct l2cap_frame *frame) +{ + uint8_t call_id, reason; + + if (!l2cap_frame_get_u8((void *)frame, &call_id)) { + print_text(COLOR_ERROR, "Call Index: invalid size"); + goto done; + } + print_field(" call Index: %u", call_id); + + if (!l2cap_frame_get_u8((void *)frame, &reason)) { + print_text(COLOR_ERROR, "Reason: invalid size"); + goto done; + } + + print_field(" Reason:"); + + switch (reason) { + case 0x00: + print_field(" Improper URI"); + break; + case 0x01: + print_field(" Call Failed"); + break; + case 0x02: + print_field(" Remote party ended the call"); + break; + case 0x03: + print_field(" Server ended the call"); + break; + case 0x04: + print_field(" Line was Busy"); + break; + case 0x05: + print_field(" Network Congestion"); + break; + case 0x06: + print_field(" Client terminated the call"); + break; + case 0x07: + print_field(" No service"); + break; + case 0x08: + print_field(" No answer"); + break; + case 0x09: + print_field(" Unspecified"); + break; + default: + print_field(" RFU"); + break; + } + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void call_termination_reason_notify(const struct l2cap_frame *frame) +{ + print_term_reason(frame); +} + +static void print_incom_call(const struct l2cap_frame *frame) +{ + char *name; + uint8_t call_id; + + if (!l2cap_frame_get_u8((void *)frame, &call_id)) { + print_text(COLOR_ERROR, "Call Index: invalid size"); + goto done; + } + + print_field(" Call Index: %u", call_id); + + name = name2utf8((uint8_t *)frame->data, frame->size); + + print_field(" call_string: %s", name); + + g_free(name); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void incoming_call_read(const struct l2cap_frame *frame) +{ + print_incom_call(frame); +} + +static void incoming_call_notify(const struct l2cap_frame *frame) +{ + print_incom_call(frame); +} + +static void print_call_friendly_name(const struct l2cap_frame *frame) +{ + char *name; + uint8_t call_id; + + if (!l2cap_frame_get_u8((void *)frame, &call_id)) { + print_text(COLOR_ERROR, "Call Index: invalid size"); + goto done; + } + + print_field(" Call Index: %u", call_id); + + name = name2utf8((uint8_t *)frame->data, frame->size); + + print_field(" Friendly Name: %s", name); + + g_free(name); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void call_friendly_name_read(const struct l2cap_frame *frame) +{ + print_call_friendly_name(frame); +} + +static void call_friendly_name_notify(const struct l2cap_frame *frame) +{ + print_call_friendly_name(frame); +} + static const char *play_order_str(uint8_t order) { switch (order) { @@ -2581,7 +3262,7 @@ print_media_state(frame); } -struct media_cp_opcode { +static const struct media_cp_opcode { uint8_t opcode; const char *opcode_str; } media_cp_opcode_table = { @@ -2739,7 +3420,7 @@ static const struct pa_sync_state_decoder { uint8_t code; - char *value; + const char *value; } pa_sync_state_decoders = { { 0x00, "Not synchronized to PA" }, { 0x01, "SyncInfo Request" }, @@ -2750,7 +3431,7 @@ static const struct cp_pa_sync_state_decoder { uint8_t code; - char *value; + const char *value; } cp_pa_sync_state_decoders = { { 0x00, "Do not synchronize to PA" }, { 0x01, "Synchronize to PA - PAST available" }, @@ -2759,7 +3440,7 @@ static const struct big_enc_decoder { uint8_t code; - char *value; + const char *value; } big_enc_decoders = { { 0x00, "Not encrypted" }, { 0x01, "Broadcast_Code required" }, @@ -2769,7 +3450,7 @@ static bool print_subgroup_lv(const struct l2cap_frame *frame, const char *label, - struct util_ltv_debugger *debugger, + const struct util_ltv_debugger *debugger, size_t debugger_len) { struct bt_hci_lv_data *lv; @@ -3135,7 +3816,7 @@ print_field(" Source_ID: %u", id); } -struct bcast_audio_scan_cp_cmd { +static const struct bcast_audio_scan_cp_cmd { const char *desc; void (*func)(const struct l2cap_frame *frame); } bcast_audio_scan_cp_cmd_table = { @@ -3157,7 +3838,8 @@ bcast_audio_scan_cp_remove_src_cmd), }; -static struct bcast_audio_scan_cp_cmd *bcast_audio_scan_cp_get_cmd(uint8_t op) +static const struct bcast_audio_scan_cp_cmd * +bcast_audio_scan_cp_get_cmd(uint8_t op) { if (op > ARRAY_SIZE(bcast_audio_scan_cp_cmd_table)) return NULL; @@ -3168,7 +3850,7 @@ static void print_bcast_audio_scan_cp_cmd(const struct l2cap_frame *frame) { uint8_t op; - struct bcast_audio_scan_cp_cmd *cmd; + const struct bcast_audio_scan_cp_cmd *cmd; if (!l2cap_frame_get_u8((void *)frame, &op)) { print_text(COLOR_ERROR, "Opcode: invalid size"); @@ -3340,7 +4022,7 @@ .notify = _notify \ } -struct gatt_handler { +static const struct gatt_handler { bt_uuid_t uuid; void (*read)(const struct l2cap_frame *frame); void (*write)(const struct l2cap_frame *frame); @@ -3389,10 +4071,32 @@ GATT_HANDLER(0x2bc7, NULL, bcast_audio_scan_cp_write, NULL), GATT_HANDLER(0x2bc8, bcast_recv_state_read, NULL, bcast_recv_state_notify), + GATT_HANDLER(0x2bb3, bearer_name_read, NULL, bearer_name_notify), + GATT_HANDLER(0x2bb4, bearer_uci_read, NULL, NULL), + GATT_HANDLER(0x2bb5, bearer_technology_read, NULL, + bearer_technology_notify), + GATT_HANDLER(0x2bb6, bearer_uri_schemes_list_read, NULL, NULL), + GATT_HANDLER(0x2bb7, bearer_signal_strength_read, NULL, + bearer_signal_strength_notify), + GATT_HANDLER(0x2bb8, bearer_signal_strength_rep_intrvl_read, + bearer_signal_strength_rep_intrvl_write, NULL), + GATT_HANDLER(0x2bb9, bearer_current_call_list_read, NULL, + bearer_current_call_list_notify), + GATT_HANDLER(0x2bba, call_content_control_id_read, NULL, NULL), + GATT_HANDLER(0x2bbb, status_flag_read, NULL, status_flag_notify), + GATT_HANDLER(0x2bbc, incom_target_bearer_uri_read, NULL, + incom_target_bearer_uri_notify), + GATT_HANDLER(0x2bbd, call_state_read, NULL, call_state_notify), + GATT_HANDLER(0x2bbe, NULL, call_cp_write, call_cp_notify), + GATT_HANDLER(0x2bbf, call_cp_opt_opcodes_read, NULL, NULL), + GATT_HANDLER(0x2bc0, NULL, NULL, call_termination_reason_notify), + GATT_HANDLER(0x2bc1, incoming_call_read, NULL, incoming_call_notify), + GATT_HANDLER(0x2bc2, call_friendly_name_read, NULL, + call_friendly_name_notify), GMAS }; -static struct gatt_handler *get_handler_uuid(const bt_uuid_t *uuid) +static const struct gatt_handler *get_handler_uuid(const bt_uuid_t *uuid) { size_t i; @@ -3400,7 +4104,7 @@ return NULL; for (i = 0; i < ARRAY_SIZE(gatt_handlers); i++) { - struct gatt_handler *handler = &gatt_handlersi; + const struct gatt_handler *handler = &gatt_handlersi; if (!bt_uuid_cmp(&handler->uuid, uuid)) return handler; @@ -3409,7 +4113,7 @@ return NULL; } -static struct gatt_handler *get_handler(struct gatt_db_attribute *attr) +static const struct gatt_handler *get_handler(struct gatt_db_attribute *attr) { return get_handler_uuid(gatt_db_attribute_get_type(attr)); } @@ -3423,9 +4127,23 @@ static void att_exchange_mtu_rsp(const struct l2cap_frame *frame) { - const struct bt_l2cap_att_exchange_mtu_rsp *pdu = frame->data; + struct packet_conn_data *conn; + struct att_conn_data *data; + uint16_t mtu; + + if (!l2cap_frame_get_le16((void *)frame, &mtu)) { + print_text(COLOR_ERROR, " invalid size"); + return; + } - print_field("Server RX MTU: %d", le16_to_cpu(pdu->mtu)); + print_field("Server RX MTU: %d", mtu); + + conn = packet_get_conn_data(frame->handle); + data = att_get_conn_data(conn); + if (!data) + return; + + data->mtu = mtu; } static void att_find_info_req(const struct l2cap_frame *frame) @@ -3580,7 +4298,7 @@ struct att_conn_data *data; struct att_read *read; struct gatt_db_attribute *attr = NULL; - struct gatt_handler *handler; + const struct gatt_handler *handler; if (handle) { attr = get_attribute(frame, handle, false); @@ -3589,8 +4307,6 @@ } handler = attr ? get_handler(attr) : get_handler_uuid(uuid); - if (!handler || !handler->read) - return; conn = packet_get_conn_data(frame->handle); data = att_get_conn_data(conn); @@ -3601,10 +4317,11 @@ data->reads = queue_new(); read = new0(struct att_read, 1); + read->conn = data; read->attr = attr; read->in = frame->in; read->chan = frame->chan; - read->func = handler->read; + read->func = handler ? handler->read : NULL; queue_push_tail(data->reads, read); } @@ -3662,31 +4379,95 @@ queue_read(frame, NULL, handle); } +static void att_read_append(struct att_read *read, + const struct l2cap_frame *frame) +{ + if (!read->iov) + read->iov = new0(struct iovec, 1); + util_iov_append(read->iov, frame->data, frame->size); +} + +static void att_read_func(struct att_read *read, + const struct l2cap_frame *frame) +{ + att_read_append(read, frame); + + print_attribute(read->attr); + print_hex_field("Value", read->iov->iov_base, read->iov->iov_len); + + if (read->func) { + struct l2cap_frame f = *frame; + + f.data = read->iov->iov_base; + f.size = read->iov->iov_len; + + read->func(&f); + } + + att_read_free(read); +} + static void att_read_rsp(const struct l2cap_frame *frame) { struct att_read *read; + print_hex_field("Value", frame->data, frame->size); + read = att_get_read(frame); if (!read) return; - print_attribute(read->attr); - print_hex_field("Value", frame->data, frame->size); - - read->func(frame); + /* Check if the data size is equal to the MTU then read long procedure + * maybe used. + */ + if (frame->size == read->conn->mtu - 1) { + att_read_append(read, frame); + print_hex_field("Long Value", read->iov->iov_base, + read->iov->iov_len); + queue_push_head(read->conn->reads, read); + return; + } - free(read); + att_read_func(read, frame); } static void att_read_blob_req(const struct l2cap_frame *frame) { - print_handle(frame, get_le16(frame->data), false); - print_field("Offset: 0x%4.4x", get_le16(frame->data + 2)); + uint16_t handle, offset; + struct att_read *read; + + if (!l2cap_frame_get_le16((void *)frame, &handle)) { + print_text(COLOR_ERROR, "invalid size"); + return; + } + + if (!l2cap_frame_get_le16((void *)frame, &offset)) { + print_text(COLOR_ERROR, "invalid size"); + return; + } + + print_handle(frame, handle, false); + print_field("Offset: 0x%4.4x", offset); + + read = att_get_read(frame); + if (!read) + return; + + /* Check if attribute handle and offset match so the read object shall + * be keeped. + */ + if (gatt_db_attribute_get_handle(read->attr) == handle && + offset == read->iov->iov_len) { + queue_push_head(read->conn->reads, read); + return; + } + + att_read_func(read, frame); } static void att_read_blob_rsp(const struct l2cap_frame *frame) { - packet_hexdump(frame->data, frame->size); + att_read_rsp(frame); } static void att_read_multiple_req(const struct l2cap_frame *frame) @@ -3731,7 +4512,7 @@ print_handle_range("Handle range", frame->data); print_uuid("UUID", frame->data + 4, length - 4); - if (read) { + if (read && read->func) { struct l2cap_frame f; l2cap_frame_clone_size(&f, frame, length); @@ -3744,7 +4525,7 @@ } packet_hexdump(frame->data, frame->size); - free(read); + att_read_free(read); } static void att_read_group_type_rsp(const struct l2cap_frame *frame) @@ -3761,7 +4542,7 @@ size_t len) { struct gatt_db_attribute *attr; - struct gatt_handler *handler; + const struct gatt_handler *handler; print_handle(frame, handle, false); @@ -3837,7 +4618,7 @@ size_t len) { struct gatt_db_attribute *attr; - struct gatt_handler *handler; + const struct gatt_handler *handler; struct l2cap_frame clone; print_handle(frame, handle, true);
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/avctp.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/avctp.c
Changed
@@ -1802,7 +1802,7 @@ } -static struct { +static const struct { const char *str; bool reserved; } features_table = {
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/display.h -> _service:tar_scm:bluez-5.77.tar.xz/monitor/display.h
Changed
@@ -87,7 +87,7 @@ for (i = 0; i < len; i++) sprintf(str + (i * 2), "%2.2x", datai); - print_field("%s: %s", label, str); + print_field("%s%u: %s", label, len, str); } void set_default_pager_num_columns(int num_columns);
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/hwdb.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/hwdb.c
Changed
@@ -19,7 +19,7 @@ #include "hwdb.h" -#ifdef HAVE_UDEV_HWDB_NEW +#ifdef HAVE_UDEV #include <libudev.h> bool hwdb_get_vendor_model(const char *modalias, char **vendor, char **model)
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/intel.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/intel.c
Changed
@@ -171,25 +171,25 @@ }; static void print_version_tlv_u32(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): 0x%8.8x", type_str, tlv->type, get_le32(tlv->val)); } static void print_version_tlv_u16(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): 0x%4.4x", type_str, tlv->type, get_le16(tlv->val)); } static void print_version_tlv_u8(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): 0x%2.2x", type_str, tlv->type, get_u8(tlv->val)); } static void print_version_tlv_enabled(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): %s(%u)", type_str, tlv->type, tlv->val0 ? "Enabled" : "Disabled", @@ -197,7 +197,7 @@ } static void print_version_tlv_img_type(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { const char *str; @@ -217,34 +217,34 @@ } static void print_version_tlv_timestamp(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): %u-%u", type_str, tlv->type, tlv->val1, tlv->val0); } static void print_version_tlv_min_fw(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): %u-%u.%u", type_str, tlv->type, tlv->val0, tlv->val1, 2000 + tlv->val2); } static void print_version_tlv_otp_bdaddr(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { packet_print_addr(type_str, tlv->val, 0x00); } static void print_version_tlv_unknown(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { print_field("%s(%u): ", type_str, tlv->type); packet_hexdump(tlv->val, tlv->len); } static void print_version_tlv_mfg(const struct intel_version_tlv *tlv, - char *type_str) + const char *type_str) { uint16_t mfg_id = get_le16(tlv->val); @@ -254,8 +254,8 @@ static const struct intel_version_tlv_desc { uint8_t type; - char *type_str; - void (*func)(const struct intel_version_tlv *tlv, char *type_str); + const char *type_str; + void (*func)(const struct intel_version_tlv *tlv, const char *type_str); } intel_version_tlv_table = { { 16, "CNVi TOP", print_version_tlv_u32 }, { 17, "CNVr TOP", print_version_tlv_u32 }, @@ -365,7 +365,7 @@ static void read_version_cmd(uint16_t index, const void *data, uint8_t size) { - char *str; + const char *str; uint8_t type; /* This is the legacy read version command format and no further action @@ -1798,7 +1798,7 @@ { } }; -const uint8_t intel_vendor_prefix = {0x87, 0x80}; +static const uint8_t intel_vendor_prefix = {0x87, 0x80}; #define INTEL_VENDOR_PREFIX_SIZE sizeof(intel_vendor_prefix) /*
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/jlink.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/jlink.c
Changed
@@ -47,6 +47,7 @@ }; static struct rtt_desc rtt_desc; +static void *so = NULL; typedef int (*jlink_emu_selectbyusbsn_func) (unsigned int sn); typedef int (*jlink_open_func) (void); @@ -80,7 +81,6 @@ int jlink_init(void) { - void *so; unsigned int i; for (i = 0; i < NELEM(jlink_so_name); i++) { @@ -109,6 +109,7 @@ !jlink.emu_getproductname || !jlink.rtterminal_control || !jlink.rtterminal_read) { dlclose(so); + so = NULL; return -EIO; }
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/l2cap.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/l2cap.c
Changed
@@ -718,7 +718,7 @@ print_field("Result: %s (0x%4.4x)", str, le16_to_cpu(result)); } -static struct { +static const struct { uint8_t type; uint8_t len; const char *str;
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/packet.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/packet.c
Changed
@@ -189,59 +189,66 @@ return NULL; } -static void assign_handle(uint16_t index, uint16_t handle, uint8_t type, - uint8_t *dst, uint8_t dst_type) +static struct packet_conn_data *release_handle(uint16_t handle) { int i; for (i = 0; i < MAX_CONN; i++) { - if (conn_listi.handle == 0xffff) { - hci_devba(index, (bdaddr_t *)conn_listi.src); - - conn_listi.index = index; - conn_listi.handle = handle; - conn_listi.type = type; - - if (!dst) { - struct packet_conn_data *p; - - /* If destination is not set attempt to use the - * parent one if that exists. - */ - p = lookup_parent(handle); - if (p) { - memcpy(conn_listi.dst, p->dst, - sizeof(conn_listi.dst)); - conn_listi.dst_type = p->dst_type; - } + struct packet_conn_data *conn = &conn_listi; - break; - } + if (conn->handle == handle) { + if (conn->destroy) + conn->destroy(conn->data); - memcpy(conn_listi.dst, dst, sizeof(conn_listi.dst)); - conn_listi.dst_type = dst_type; - break; + queue_destroy(conn->tx_q, free); + queue_destroy(conn->chan_q, free); + memset(conn, 0, sizeof(*conn)); + conn->handle = 0xffff; + return conn; } } + + return NULL; } -static void release_handle(uint16_t handle) +static void assign_handle(uint16_t index, uint16_t handle, uint8_t type, + uint8_t *dst, uint8_t dst_type) { + struct packet_conn_data *conn = release_handle(handle); int i; - for (i = 0; i < MAX_CONN; i++) { - struct packet_conn_data *conn = &conn_listi; + if (!conn) { + for (i = 0; i < MAX_CONN; i++) { + if (conn_listi.handle == 0xffff) { + conn = &conn_listi; + break; + } + } + } - if (conn->handle == handle) { - if (conn->destroy) - conn->destroy(conn->data); + if (!conn) + return; - queue_destroy(conn->tx_q, free); - queue_destroy(conn->chan_q, free); - memset(conn, 0, sizeof(*conn)); - conn->handle = 0xffff; - break; + hci_devba(index, (bdaddr_t *)conn->src); + + conn->index = index; + conn->handle = handle; + conn->type = type; + + if (!dst) { + struct packet_conn_data *p; + + /* If destination is not set attempt to use the parent one if + * that exists. + */ + p = lookup_parent(handle); + if (p) { + memcpy(conn->dst, p->dst, sizeof(conn->dst)); + conn->dst_type = p->dst_type; } + } else { + memcpy(conn->dst, dst, sizeof(conn->dst)); + conn->dst_type = dst_type; } } @@ -3772,7 +3779,7 @@ print_field(" Provider Only"); break; case 0x03: - print_field(" Both Seeker an Provider"); + print_field(" Both Seeker and Provider"); break; } @@ -4286,10 +4293,26 @@ */ index_listindex.msft_opcode = 0xFC1E; break; + case 29: + /* + * Qualcomm controllers that support the + * Microsoft vendor extensions are using + * 0xFD70 for VsMsftOpCode. + */ + index_listindex.msft_opcode = 0xFD70; + break; + case 70: + /* + * Mediatek controllers that support the + * Microsoft vendor extensions are using + * 0xFD30 for VsMsftOpCode. + */ + index_listindex.msft_opcode = 0xFD30; + break; case 93: /* * Realtek controllers that support the - * Microsoft vendor extenions are using + * Microsoft vendor extensions are using * 0xFCF0 for VsMsftOpCode. */ index_listindex.msft_opcode = 0xFCF0; @@ -4298,7 +4321,7 @@ /* * Emulator controllers use Linux Foundation as * manufacturer and support the - * Microsoft vendor extenions using + * Microsoft vendor extensions using * 0xFC1E for VsMsftOpCode. */ index_listindex.msft_opcode = 0xFC1E; @@ -10060,7 +10083,7 @@ const struct bt_hci_evt_conn_complete *evt = data; print_status(evt->status); - print_handle(evt->handle); + print_field("Handle: %d", le16_to_cpu(evt->handle)); print_bdaddr(evt->bdaddr); print_link_type(evt->link_type); print_enable("Encryption", evt->encr_mode); @@ -10632,7 +10655,7 @@ const struct bt_hci_evt_sync_conn_complete *evt = data; print_status(evt->status); - print_handle(evt->handle); + print_field("Handle: %d", le16_to_cpu(evt->handle)); print_bdaddr(evt->bdaddr); print_link_type(evt->link_type); print_field("Transmission interval: 0x%2.2x", evt->tx_interval); @@ -11061,7 +11084,7 @@ const struct bt_hci_evt_le_conn_complete *evt = data; print_status(evt->status); - print_handle(evt->handle); + print_field("Handle: %d", le16_to_cpu(evt->handle)); print_role(evt->role); print_peer_addr_type("Peer address type", evt->peer_addr_type); print_addr("Peer address", evt->peer_addr, evt->peer_addr_type); @@ -11190,7 +11213,7 @@ const struct bt_hci_evt_le_enhanced_conn_complete *evt = data; print_status(evt->status); - print_handle(evt->handle); + print_field("Handle: %d", le16_to_cpu(evt->handle)); print_role(evt->role); print_peer_addr_type("Peer address type", evt->peer_addr_type); print_addr("Peer address", evt->peer_addr, evt->peer_addr_type); @@ -11497,7 +11520,7 @@ print_field("Data status: %s%s%s", color_on, str, COLOR_OFF); print_field("Data length: 0x%2.2x", evt->data_len); - packet_hexdump(evt->data, evt->data_len); + print_eir(evt->data, evt->data_len, true); } static void le_pa_sync_lost_evt(struct timeval *tv, uint16_t index, @@ -13315,6 +13338,57 @@ print_enable("Low Energy", enable); } +static void mgmt_set_blocked_keys_cmd(const void *data, uint16_t size) +{ + struct iovec frame = { (void *)data, size }; + uint16_t num_keys; + int i; + + if (!util_iov_pull_le16(&frame, &num_keys)) { + print_field("Keys: invalid size"); + return; + } + + print_field("Keys: %u", num_keys); + + for (i = 0; i < num_keys; i++) { + uint8_t type; + uint8_t *key; + + if (!util_iov_pull_u8(&frame, &type)) { + print_field("Key type%u: invalid size", i); + return; + } + + switch (type) { + case 0x00: + print_field("type: Link Key (0x00)"); + break; + case 0x01: + print_field("type: Long Term Key (0x01)"); + break; + case 0x02: + print_field("type: Identity Resolving Key (0x02)"); + break; + } + + key = util_iov_pull_mem(&frame, 16); + if (!key) { + print_field("Key%u: invalid size", i); + return; + } + + print_link_key(key); + } +} + +static void mgmt_set_wbs_cmd(const void *data, uint16_t size) +{ + uint8_t enable = get_u8(data); + + print_enable("Wideband Speech", enable); +} + static void mgmt_new_settings_rsp(const void *data, uint16_t size) { uint32_t current_settings = get_le32(data); @@ -14770,8 +14844,12 @@ { 0x0045, "Set PHY Configuration", mgmt_set_phy_cmd, 4, true, mgmt_null_rsp, 0, true }, - { 0x0046, "Load Blocked Keys" }, - { 0x0047, "Set Wideband Speech" }, + { 0x0046, "Set Blocked Keys", + mgmt_set_blocked_keys_cmd, 2, false, + mgmt_null_rsp, 0, true }, + { 0x0047, "Set Wideband Speech", + mgmt_set_wbs_cmd, 1, true, + mgmt_new_settings_rsp, 4, true }, { 0x0048, "Read Controller Capabilities" }, { 0x0049, "Read Experimental Features Information", mgmt_null_cmd, 0, true,
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/rfcomm.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/rfcomm.c
Changed
@@ -32,7 +32,7 @@ #include "sdp.h" #include "rfcomm.h" -static char *cr_str = { +static const char *cr_str = { "RSP", "CMD" };
View file
_service:tar_scm:bluez-5.71.tar.xz/monitor/sdp.c -> _service:tar_scm:bluez-5.77.tar.xz/monitor/sdp.c
Changed
@@ -148,9 +148,9 @@ #define SIZES(args...) ((uint8_t) { args, 0xff } ) -static struct { +static const struct { uint8_t value; - uint8_t *sizes; + const uint8_t *sizes; bool recurse; const char *str; void (*print) (uint8_t indent, const uint8_t *data, uint32_t size); @@ -167,7 +167,7 @@ { } }; -static struct { +static const struct { uint8_t index; uint8_t bits; uint8_t size; @@ -184,7 +184,7 @@ { } }; -static bool valid_size(uint8_t size, uint8_t *sizes) +static bool valid_size(uint8_t size, const uint8_t *sizes) { int i; @@ -322,7 +322,7 @@ return 0; } -static struct { +static const struct { uint16_t id; const char *str; } attribute_table = {
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/client/manager.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/client/manager.c
Changed
@@ -241,7 +241,7 @@ static DBusConnection *conn = NULL; -static struct obc_module { +static const struct obc_module { const char *name; int (*init) (void); void (*exit) (void); @@ -258,7 +258,7 @@ int client_manager_init(void) { DBusError derr; - struct obc_module *module; + const struct obc_module *module; dbus_error_init(&derr); @@ -289,7 +289,7 @@ void client_manager_exit(void) { - struct obc_module *module; + const struct obc_module *module; if (conn == NULL) return;
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/client/map.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/client/map.c
Changed
@@ -1060,7 +1060,7 @@ MAP_MSG_INTERFACE, "Protected"); } -static struct map_msg_parser { +static const struct map_msg_parser { const char *name; void (*func) (struct map_msg *msg, const char *value); } msg_parsers = { @@ -1120,7 +1120,7 @@ &msg->path); for (i = 0, key = namesi; key; key = names++i) { - struct map_msg_parser *parser; + const struct map_msg_parser *parser; for (parser = msg_parsers; parser && parser->name; parser++) { if (strcasecmp(key, parser->name) == 0) {
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/client/mns.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/client/mns.c
Changed
@@ -233,7 +233,7 @@ event->priority = g_strdup(value); } -static struct map_event_report_parser { +static const struct map_event_report_parser { const char *name; void (*func) (struct map_event *event, const char *value); } event_report_parsers = { @@ -262,7 +262,7 @@ return; for (i = 0, key = namesi; key; key = names++i) { - struct map_event_report_parser *parser; + const struct map_event_report_parser *parser; for (parser = event_report_parsers; parser && parser->name; parser++) { @@ -346,7 +346,7 @@ return count; } -static struct obex_service_driver mns = { +static const struct obex_service_driver mns = { .name = "Message Notification server", .service = OBEX_MNS, .target = MNS_TARGET, @@ -356,7 +356,7 @@ .disconnect = mns_disconnect, }; -static struct obex_mime_type_driver mime_event_report = { +static const struct obex_mime_type_driver mime_event_report = { .target = MNS_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-bt/MAP-event-report",
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/bluetooth.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/bluetooth.c
Changed
@@ -41,7 +41,7 @@ struct bluetooth_profile { struct obex_server *server; - struct obex_service_driver *driver; + const struct obex_service_driver *driver; char *uuid; char *path; }; @@ -355,7 +355,7 @@ const GSList *l; for (l = server->drivers; l; l = l->next) { - struct obex_service_driver *driver = l->data; + const struct obex_service_driver *driver = l->data; struct bluetooth_profile *profile; const char *uuid; @@ -416,7 +416,7 @@ return 0; } -static struct obex_transport_driver driver = { +static const struct obex_transport_driver driver = { .name = "bluetooth", .start = bluetooth_start, .getpeername = bluetooth_getpeername,
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/filesystem.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/filesystem.c
Changed
@@ -113,6 +113,7 @@ { char perm51, atime18, ctime18, mtime18; char *escaped, *ret = NULL; + struct tm a_gmtime, c_gmtime, m_gmtime; snprintf(perm, 50, "user-perm=\"%s%s%s\" group-perm=\"%s%s%s\" " "other-perm=\"%s%s%s\"", @@ -126,9 +127,16 @@ (fstat->st_mode & 0002 ? "W" : ""), (dstat->st_mode & 0002 ? "D" : "")); - strftime(atime, 17, "%Y%m%dT%H%M%SZ", gmtime(&fstat->st_atime)); - strftime(ctime, 17, "%Y%m%dT%H%M%SZ", gmtime(&fstat->st_ctime)); - strftime(mtime, 17, "%Y%m%dT%H%M%SZ", gmtime(&fstat->st_mtime)); + if (!gmtime_r(&fstat->st_atime, &a_gmtime) || + !gmtime_r(&fstat->st_ctime, &c_gmtime) || + !gmtime_r(&fstat->st_mtime, &m_gmtime)) { + error("gmtime_r() returned NULL"); + return ret; + } + + strftime(atime, 17, "%Y%m%dT%H%M%SZ", &a_gmtime); + strftime(ctime, 17, "%Y%m%dT%H%M%SZ", &c_gmtime); + strftime(mtime, 17, "%Y%m%dT%H%M%SZ", &m_gmtime); escaped = g_markup_escape_text(filename, -1); @@ -416,6 +424,7 @@ } object->buffer = g_string_new(buf); + g_free(buf); if (size) *size = object->buffer->len; @@ -642,7 +651,7 @@ return err; } -static struct obex_mime_type_driver file = { +static const struct obex_mime_type_driver file = { .open = filesystem_open, .close = filesystem_close, .read = filesystem_read, @@ -652,7 +661,7 @@ .copy = filesystem_copy, }; -static struct obex_mime_type_driver capability = { +static const struct obex_mime_type_driver capability = { .target = FTP_TARGET, .target_size = FTP_TARGET_SIZE, .mimetype = "x-obex/capability", @@ -661,7 +670,7 @@ .read = capability_read, }; -static struct obex_mime_type_driver folder = { +static const struct obex_mime_type_driver folder = { .target = FTP_TARGET, .target_size = FTP_TARGET_SIZE, .mimetype = "x-obex/folder-listing", @@ -670,7 +679,7 @@ .read = folder_read, }; -static struct obex_mime_type_driver pcsuite = { +static const struct obex_mime_type_driver pcsuite = { .target = FTP_TARGET, .target_size = FTP_TARGET_SIZE, .who = PCSUITE_WHO,
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/ftp.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/ftp.c
Changed
@@ -494,7 +494,7 @@ manager_emit_transfer_completed(ftp->transfer); } -static struct obex_service_driver ftp = { +static const struct obex_service_driver ftp = { .name = "File Transfer server", .service = OBEX_FTP, .target = FTP_TARGET,
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/irmc.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/irmc.c
Changed
@@ -419,7 +419,7 @@ return len; } -static struct obex_mime_type_driver irmc_driver = { +static const struct obex_mime_type_driver irmc_driver = { .target = IRMC_TARGET, .target_size = IRMC_TARGET_SIZE, .open = irmc_open, @@ -427,7 +427,7 @@ .read = irmc_read, }; -static struct obex_service_driver irmc = { +static const struct obex_service_driver irmc = { .name = "IRMC Sync server", .service = OBEX_IRMC, .target = IRMC_TARGET,
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/mas.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/mas.c
Changed
@@ -781,7 +781,7 @@ return mas; } -static struct obex_service_driver mas = { +static const struct obex_service_driver mas = { .name = "Message Access server", .service = OBEX_MAS, .target = MAS_TARGET, @@ -793,7 +793,7 @@ .disconnect = mas_disconnect, }; -static struct obex_mime_type_driver mime_map = { +static const struct obex_mime_type_driver mime_map = { .target = MAS_TARGET, .target_size = TARGET_SIZE, .mimetype = NULL, @@ -803,7 +803,7 @@ .write = any_write, }; -static struct obex_mime_type_driver mime_message = { +static const struct obex_mime_type_driver mime_message = { .target = MAS_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-bt/message", @@ -813,7 +813,7 @@ .write = any_write, }; -static struct obex_mime_type_driver mime_folder_listing = { +static const struct obex_mime_type_driver mime_folder_listing = { .target = MAS_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-obex/folder-listing", @@ -824,7 +824,7 @@ .write = any_write, }; -static struct obex_mime_type_driver mime_msg_listing = { +static const struct obex_mime_type_driver mime_msg_listing = { .target = MAS_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-bt/MAP-msg-listing", @@ -835,7 +835,7 @@ .write = any_write, }; -static struct obex_mime_type_driver mime_notification_registration = { +static const struct obex_mime_type_driver mime_notification_registration = { .target = MAS_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-bt/MAP-NotificationRegistration", @@ -845,7 +845,7 @@ .write = any_write, }; -static struct obex_mime_type_driver mime_message_status = { +static const struct obex_mime_type_driver mime_message_status = { .target = MAS_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-bt/messageStatus", @@ -855,7 +855,7 @@ .write = any_write, }; -static struct obex_mime_type_driver mime_message_update = { +static const struct obex_mime_type_driver mime_message_update = { .target = MAS_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-bt/MAP-messageUpdate", @@ -865,7 +865,7 @@ .write = any_write, }; -static struct obex_mime_type_driver *map_drivers = { +static const struct obex_mime_type_driver *map_drivers = { &mime_map, &mime_message, &mime_folder_listing,
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/messages-dummy.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/messages-dummy.c
Changed
@@ -359,36 +359,45 @@ for (i = 0 ; namesi; ++i) { if (g_strcmp0(namesi, "handle") == 0) { + g_free(entry->handle); entry->handle = g_strdup(valuesi); mld->size++; continue; } if (g_strcmp0(namesi, "attachment_size") == 0) { + g_free(entry->attachment_size); entry->attachment_size = g_strdup(valuesi); continue; } if (g_strcmp0(namesi, "datetime") == 0) { + g_free(entry->datetime); entry->datetime = g_strdup(valuesi); continue; } if (g_strcmp0(namesi, "subject") == 0) { + g_free(entry->subject); entry->subject = g_strdup(valuesi); continue; } if (g_strcmp0(namesi, "recipient_addressing") == 0) { + g_free(entry->recipient_addressing); entry->recipient_addressing = g_strdup(valuesi); continue; } if (g_strcmp0(namesi, "sender_addressing") == 0) { + g_free(entry->sender_addressing); entry->sender_addressing = g_strdup(valuesi); continue; } if (g_strcmp0(namesi, "type") == 0) { + g_free(entry->type); entry->type = g_strdup(valuesi); continue; } - if (g_strcmp0(namesi, "reception_status") == 0) + if (g_strcmp0(namesi, "reception_status") == 0) { + g_free(entry->reception_status); entry->reception_status = g_strdup(valuesi); + } } if (mld->size > mld->offset) @@ -397,6 +406,7 @@ g_free(entry->reception_status); g_free(entry->type); g_free(entry->sender_addressing); + g_free(entry->recipient_addressing); g_free(entry->subject); g_free(entry->datetime); g_free(entry->attachment_size);
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/opp.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/opp.c
Changed
@@ -155,7 +155,7 @@ manager_emit_transfer_completed(user_data); } -static struct obex_service_driver driver = { +static const struct obex_service_driver driver = { .name = "Object Push server", .service = OBEX_OPP, .connect = opp_connect,
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/pbap.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/pbap.c
Changed
@@ -634,7 +634,7 @@ return -EBADR; } -static struct obex_service_driver pbap = { +static const struct obex_service_driver pbap = { .name = "Phonebook Access server", .service = OBEX_PBAP, .target = PBAP_TARGET, @@ -929,7 +929,7 @@ return string_read(obj->buffer, buf, count); } -static struct obex_mime_type_driver mime_pull = { +static const struct obex_mime_type_driver mime_pull = { .target = PBAP_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-bt/phonebook", @@ -939,7 +939,7 @@ .get_next_header = vobject_pull_get_next_header, }; -static struct obex_mime_type_driver mime_list = { +static const struct obex_mime_type_driver mime_list = { .target = PBAP_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-bt/vcard-listing", @@ -949,7 +949,7 @@ .get_next_header = vobject_list_get_next_header, }; -static struct obex_mime_type_driver mime_vcard = { +static const struct obex_mime_type_driver mime_vcard = { .target = PBAP_TARGET, .target_size = TARGET_SIZE, .mimetype = "x-bt/vcard",
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/pcsuite.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/pcsuite.c
Changed
@@ -231,7 +231,7 @@ g_free(pcsuite); } -static struct obex_service_driver pcsuite = { +static const struct obex_service_driver pcsuite = { .name = "Nokia OBEX PC Suite Services", .service = OBEX_PCSUITE, .channel = PCSUITE_CHANNEL, @@ -376,6 +376,7 @@ obj->error_code = 0; if (send_backup_dbus_message("open", obj, size) == FALSE) { + g_free(obj->cmd); g_free(obj); obj = NULL; } @@ -467,7 +468,7 @@ return 0; } -static struct obex_mime_type_driver backup = { +static const struct obex_mime_type_driver backup = { .target = FTP_TARGET, .target_size = TARGET_SIZE, .mimetype = "application/vnd.nokia-backup",
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/plugins/phonebook-ebook.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/plugins/phonebook-ebook.c
Changed
@@ -55,7 +55,7 @@ gboolean canceled; }; -static char *attribute_mask = { +static const char *attribute_mask = { /* 0 */ "VERSION", "FN", "N",
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/genbuiltin -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/genbuiltin
Changed
@@ -2,11 +2,11 @@ for i in $* do - echo "extern struct obex_plugin_desc __obex_builtin_$i;" + echo "extern const struct obex_plugin_desc __obex_builtin_$i;" done echo -echo "static struct obex_plugin_desc *__obex_builtin = {" +echo "static const struct obex_plugin_desc *__obex_builtin = {" for i in $* do
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/main.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/main.c
Changed
@@ -138,7 +138,7 @@ return TRUE; } -static GOptionEntry options = { +static const GOptionEntry options = { { "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, parse_debug, "Enable debug information output", "DEBUG" },
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/manager.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/manager.c
Changed
@@ -525,11 +525,16 @@ void manager_emit_transfer_property(struct obex_transfer *transfer, char *name) { - if (!transfer->path) + if (transfer->path == NULL) return; - g_dbus_emit_property_changed(connection, transfer->path, - TRANSFER_INTERFACE, name); + if (strcasecmp("Size", name) == 0) + g_dbus_emit_property_changed_full(connection, transfer->path, + TRANSFER_INTERFACE, name, + G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH); + else + g_dbus_emit_property_changed(connection, transfer->path, + TRANSFER_INTERFACE, name); } void manager_emit_transfer_started(struct obex_transfer *transfer) @@ -542,9 +547,6 @@ static void emit_transfer_completed(struct obex_transfer *transfer, gboolean success) { - if (transfer->path == NULL) - return; - transfer->status = success ? TRANSFER_STATUS_COMPLETE : TRANSFER_STATUS_ERROR;
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/mimetype.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/mimetype.c
Changed
@@ -73,7 +73,7 @@ return NULL; } -static void reset_io_watch(void *object) +void obex_object_reset_io_watch(void *object) { struct io_watch *watch; @@ -85,16 +85,11 @@ g_free(watch); } -static int set_io_watch(void *object, obex_object_io_func func, +int obex_object_set_io_watch(void *object, obex_object_io_func func, void *user_data) { struct io_watch *watch; - if (func == NULL) { - reset_io_watch(object); - return 0; - } - watch = find_io_watch(object); if (watch) return -EPERM; @@ -109,7 +104,7 @@ return 0; } -static struct obex_mime_type_driver *find_driver(const uint8_t *target, +static const struct obex_mime_type_driver *find_driver(const uint8_t *target, unsigned int target_size, const char *mimetype, const uint8_t *who, unsigned int who_size) @@ -117,7 +112,7 @@ GSList *l; for (l = drivers; l; l = l->next) { - struct obex_mime_type_driver *driver = l->data; + const struct obex_mime_type_driver *driver = l->data; if (memncmp0(target, target_size, driver->target, driver->target_size)) continue; @@ -139,12 +134,12 @@ return NULL; } -struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target, - unsigned int target_size, +const struct obex_mime_type_driver * +obex_mime_type_driver_find(const uint8_t *target, unsigned int target_size, const char *mimetype, const uint8_t *who, unsigned int who_size) { - struct obex_mime_type_driver *driver; + const struct obex_mime_type_driver *driver; driver = find_driver(target, target_size, mimetype, who, who_size); if (driver == NULL) { @@ -167,7 +162,7 @@ return driver; } -int obex_mime_type_driver_register(struct obex_mime_type_driver *driver) +int obex_mime_type_driver_register(const struct obex_mime_type_driver *driver) { if (!driver) { error("Invalid driver"); @@ -181,17 +176,15 @@ return -EPERM; } - if (driver->set_io_watch == NULL) - driver->set_io_watch = set_io_watch; - DBG("driver %p mimetype %s registered", driver, driver->mimetype); - drivers = g_slist_append(drivers, driver); + drivers = g_slist_append(drivers, (gpointer)driver); return 0; } -void obex_mime_type_driver_unregister(struct obex_mime_type_driver *driver) +void +obex_mime_type_driver_unregister(const struct obex_mime_type_driver *driver) { if (!g_slist_find(drivers, driver)) { error("Unable to unregister: No such driver %p", driver);
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/mimetype.h -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/mimetype.h
Changed
@@ -28,15 +28,19 @@ int (*copy) (const char *name, const char *destname); int (*move) (const char *name, const char *destname); int (*remove) (const char *name); - int (*set_io_watch) (void *object, obex_object_io_func func, - void *user_data); }; -int obex_mime_type_driver_register(struct obex_mime_type_driver *driver); -void obex_mime_type_driver_unregister(struct obex_mime_type_driver *driver); -struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target, +int obex_mime_type_driver_register(const struct obex_mime_type_driver *driver); +void +obex_mime_type_driver_unregister(const struct obex_mime_type_driver *driver); +const struct obex_mime_type_driver * +obex_mime_type_driver_find(const uint8_t *target, unsigned int target_size, const char *mimetype, const uint8_t *who, unsigned int who_size); void obex_object_set_io_flags(void *object, int flags, int err); + +void obex_object_reset_io_watch(void *object); +int obex_object_set_io_watch(void *object, obex_object_io_func func, + void *user_data);
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/obex-priv.h -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/obex-priv.h
Changed
@@ -33,12 +33,12 @@ void *object; gboolean aborted; int err; - struct obex_service_driver *service; + const struct obex_service_driver *service; void *service_data; struct obex_server *server; gboolean checked; GObex *obex; - struct obex_mime_type_driver *driver; + const struct obex_mime_type_driver *driver; gboolean headers_sent; };
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/obex.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/obex.c
Changed
@@ -55,7 +55,7 @@ } __attribute__ ((packed)); /* Possible commands */ -static struct { +static const struct { int cmd; const char *name; } obex_command = { @@ -119,7 +119,7 @@ os_session_mark_aborted(os); if (os->object) { - os->driver->set_io_watch(os->object, NULL, NULL); + obex_object_reset_io_watch(os->object); os->driver->close(os->object); if (os->aborted && os->cmd == G_OBEX_OP_PUT && os->path && os->driver->remove) @@ -357,7 +357,7 @@ if (len == -ENOSTR) return 0; if (len == -EAGAIN) - os->driver->set_io_watch(os->object, handle_async_io, + obex_object_set_io_watch(os->object, handle_async_io, os); } @@ -395,7 +395,7 @@ if (os->object && os->driver && os->driver->flush) { if (os->driver->flush(os->object) == -EAGAIN) { g_obex_suspend(os->obex); - os->driver->set_io_watch(os->object, handle_async_io, + obex_object_set_io_watch(os->object, handle_async_io, os); return; } @@ -525,7 +525,7 @@ if (ret == -EAGAIN) { g_obex_suspend(os->obex); - os->driver->set_io_watch(os->object, handle_async_io, os); + obex_object_set_io_watch(os->object, handle_async_io, os); return TRUE; } @@ -699,7 +699,7 @@ return err; g_obex_suspend(os->obex); - os->driver->set_io_watch(os->object, handle_async_io, os); + obex_object_set_io_watch(os->object, handle_async_io, os); return 0; } @@ -772,7 +772,7 @@ break; case -EAGAIN: g_obex_suspend(os->obex); - os->driver->set_io_watch(os->object, handle_async_io, os); + obex_object_set_io_watch(os->object, handle_async_io, os); return TRUE; default: os_set_response(os, ret); @@ -1085,7 +1085,7 @@ int obex_getpeername(struct obex_session *os, char **name) { - struct obex_transport_driver *transport = os->server->transport; + const struct obex_transport_driver *transport = os->server->transport; if (transport == NULL || transport->getpeername == NULL) return -ENOTSUP; @@ -1095,7 +1095,7 @@ int obex_getsockname(struct obex_session *os, char **name) { - struct obex_transport_driver *transport = os->server->transport; + const struct obex_transport_driver *transport = os->server->transport; if (transport == NULL || transport->getsockname == NULL) return -ENOTSUP;
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/obex.service.in -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/obex.service.in
Changed
@@ -4,7 +4,7 @@ Service Type=dbus BusName=org.bluez.obex -ExecStart=@pkglibexecdir@/obexd +ExecStart=@PKGLIBEXECDIR@/obexd Install Alias=dbus-org.bluez.obex.service
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/obexd.h -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/obexd.h
Changed
@@ -18,7 +18,7 @@ #define OBEX_MAS (1 << 8) #define OBEX_MNS (1 << 9) -gboolean plugin_init(const char *pattern, const char *exclude); +void plugin_init(const char *pattern, const char *exclude); void plugin_cleanup(void); gboolean manager_init(void);
View file
_service:tar_scm:bluez-5.77.tar.xz/obexd/src/org.bluez.obex.service.in
Added
@@ -0,0 +1,4 @@ +D-BUS Service +Name=org.bluez.obex +Exec=@PKGLIBEXECDIR@/obexd +SystemdService=dbus-org.bluez.obex.service
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/plugin.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/plugin.c
Changed
@@ -34,14 +34,17 @@ #define PLUGINFLAG (RTLD_NOW) #endif +#define IS_ENABLED(x) (x) + static GSList *plugins = NULL; struct obex_plugin { void *handle; - struct obex_plugin_desc *desc; + const struct obex_plugin_desc *desc; }; -static gboolean add_plugin(void *handle, struct obex_plugin_desc *desc) +static gboolean add_external_plugin(void *handle, + const struct obex_plugin_desc *desc) { struct obex_plugin *plugin; @@ -66,7 +69,26 @@ return TRUE; } -static gboolean check_plugin(struct obex_plugin_desc *desc, +static void add_plugin(const struct obex_plugin_desc *desc) +{ + struct obex_plugin *plugin; + + plugin = g_try_new0(struct obex_plugin, 1); + if (plugin == NULL) + return; + + plugin->desc = desc; + + if (desc->init() < 0) { + g_free(plugin); + return; + } + + plugins = g_slist_append(plugins, plugin); + DBG("Plugin %s loaded", desc->name); +} + +static gboolean check_plugin(const struct obex_plugin_desc *desc, char **patterns, char **excludes) { if (excludes) { @@ -93,46 +115,26 @@ } -#include "builtin.h" - -gboolean plugin_init(const char *pattern, const char *exclude) +static void external_plugin_init(char **patterns, char **excludes) { - char **patterns = NULL; - char **excludes = NULL; GDir *dir; const char *file; - unsigned int i; - if (strlen(PLUGINDIR) == 0) - return FALSE; + info("Using external plugins is not officially supported.\n"); + info("Consider upstreaming your plugins into the BlueZ project."); - if (pattern) - patterns = g_strsplit_set(pattern, ":, ", -1); - - if (exclude) - excludes = g_strsplit_set(exclude, ":, ", -1); - - DBG("Loading builtin plugins"); - - for (i = 0; __obex_builtini; i++) { - if (check_plugin(__obex_builtini, - patterns, excludes) == FALSE) - continue; - - add_plugin(NULL, __obex_builtini); - } + if (strlen(PLUGINDIR) == 0) + return; DBG("Loading plugins %s", PLUGINDIR); dir = g_dir_open(PLUGINDIR, 0, NULL); if (!dir) { - g_strfreev(patterns); - g_strfreev(excludes); - return FALSE; + return; } while ((file = g_dir_read_name(dir)) != NULL) { - struct obex_plugin_desc *desc; + const struct obex_plugin_desc *desc; void *handle; char *filename; @@ -164,15 +166,42 @@ continue; } - if (add_plugin(handle, desc) == FALSE) + if (add_external_plugin(handle, desc) == FALSE) dlclose(handle); } g_dir_close(dir); +} + +#include "builtin.h" + +void plugin_init(const char *pattern, const char *exclude) +{ + char **patterns = NULL; + char **excludes = NULL; + unsigned int i; + + if (pattern) + patterns = g_strsplit_set(pattern, ":, ", -1); + + if (exclude) + excludes = g_strsplit_set(exclude, ":, ", -1); + + DBG("Loading builtin plugins"); + + for (i = 0; __obex_builtini; i++) { + if (check_plugin(__obex_builtini, + patterns, excludes) == FALSE) + continue; + + add_plugin(__obex_builtini); + } + + if IS_ENABLED(EXTERNAL_PLUGINS) + external_plugin_init(patterns, excludes); + g_strfreev(patterns); g_strfreev(excludes); - - return TRUE; } void plugin_cleanup(void)
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/plugin.h -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/plugin.h
Changed
@@ -16,14 +16,18 @@ #ifdef OBEX_PLUGIN_BUILTIN #define OBEX_PLUGIN_DEFINE(name, init, exit) \ - struct obex_plugin_desc __obex_builtin_ ## name = { \ + const struct obex_plugin_desc __obex_builtin_ ## name = { \ #name, init, exit \ }; #else +#if EXTERNAL_PLUGINS #define OBEX_PLUGIN_DEFINE(name,init,exit) \ extern struct obex_plugin_desc obex_plugin_desc \ __attribute__ ((visibility("default"))); \ - struct obex_plugin_desc obex_plugin_desc = { \ + const struct obex_plugin_desc obex_plugin_desc = { \ #name, init, exit \ }; +#else +#error "Requested non built-in plugin, while external plugins is disabled" +#endif #endif
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/server.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/server.c
Changed
@@ -34,12 +34,12 @@ static GSList *servers = NULL; -static void init_server(uint16_t service, GSList *transports) +static void init_server(uint16_t service, const GSList *transports) { - GSList *l; + const GSList *l; for (l = transports; l; l = l->next) { - struct obex_transport_driver *transport = l->data; + const struct obex_transport_driver *transport = l->data; struct obex_server *server; int err; @@ -66,7 +66,7 @@ int obex_server_init(void) { GSList *drivers; - GSList *transports; + const GSList *transports; GSList *l; drivers = obex_service_driver_list(0); @@ -82,7 +82,7 @@ } for (l = drivers; l; l = l->next) { - struct obex_service_driver *driver = l->data; + const struct obex_service_driver *driver = l->data; init_server(driver->service, transports); }
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/server.h -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/server.h
Changed
@@ -10,7 +10,7 @@ */ struct obex_server { - struct obex_transport_driver *transport; + const struct obex_transport_driver *transport; void *transport_data; GSList *drivers; };
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/service.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/service.c
Changed
@@ -26,14 +26,14 @@ static GSList *drivers = NULL; -struct obex_service_driver *obex_service_driver_find(GSList *drivers, +const struct obex_service_driver *obex_service_driver_find(GSList *drivers, const uint8_t *target, unsigned int target_size, const uint8_t *who, unsigned int who_size) { GSList *l; for (l = drivers; l; l = l->next) { - struct obex_service_driver *driver = l->data; + const struct obex_service_driver *driver = l->data; /* who is optional, so only check for it if not NULL */ if (who != NULL && memncmp0(who, who_size, driver->who, @@ -57,10 +57,10 @@ return drivers; for (l = drivers; l && services; l = l->next) { - struct obex_service_driver *driver = l->data; + const struct obex_service_driver *driver = l->data; if (driver->service & services) { - list = g_slist_append(list, driver); + list = g_slist_append(list, (gpointer)driver); services &= ~driver->service; } } @@ -68,12 +68,12 @@ return list; } -static struct obex_service_driver *find_driver(uint16_t service) +static const struct obex_service_driver *find_driver(uint16_t service) { GSList *l; for (l = drivers; l; l = l->next) { - struct obex_service_driver *driver = l->data; + const struct obex_service_driver *driver = l->data; if (driver->service == service) return driver; @@ -82,7 +82,7 @@ return NULL; } -int obex_service_driver_register(struct obex_service_driver *driver) +int obex_service_driver_register(const struct obex_service_driver *driver) { if (!driver) { error("Invalid driver"); @@ -99,14 +99,14 @@ /* Drivers that support who has priority */ if (driver->who) - drivers = g_slist_prepend(drivers, driver); + drivers = g_slist_prepend(drivers, (gpointer)driver); else - drivers = g_slist_append(drivers, driver); + drivers = g_slist_append(drivers, (gpointer)driver); return 0; } -void obex_service_driver_unregister(struct obex_service_driver *driver) +void obex_service_driver_unregister(const struct obex_service_driver *driver) { if (!g_slist_find(drivers, driver)) { error("Unable to unregister: No such driver %p", driver);
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/service.h -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/service.h
Changed
@@ -32,9 +32,9 @@ void (*reset) (struct obex_session *os, void *user_data); }; -int obex_service_driver_register(struct obex_service_driver *driver); -void obex_service_driver_unregister(struct obex_service_driver *driver); +int obex_service_driver_register(const struct obex_service_driver *driver); +void obex_service_driver_unregister(const struct obex_service_driver *driver); GSList *obex_service_driver_list(uint16_t services); -struct obex_service_driver *obex_service_driver_find(GSList *drivers, +const struct obex_service_driver *obex_service_driver_find(GSList *drivers, const uint8_t *target, unsigned int target_size, const uint8_t *who, unsigned int who_size);
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/transport.c -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/transport.c
Changed
@@ -27,13 +27,13 @@ static GSList *drivers = NULL; -static struct obex_transport_driver *obex_transport_driver_find( - const char *name) +static const struct obex_transport_driver * +obex_transport_driver_find(const char *name) { - GSList *l; + const GSList *l; for (l = drivers; l; l = l->next) { - struct obex_transport_driver *driver = l->data; + const struct obex_transport_driver *driver = l->data; if (g_strcmp0(name, driver->name) == 0) return driver; @@ -42,12 +42,12 @@ return NULL; } -GSList *obex_transport_driver_list(void) +const GSList *obex_transport_driver_list(void) { return drivers; } -int obex_transport_driver_register(struct obex_transport_driver *driver) +int obex_transport_driver_register(const struct obex_transport_driver *driver) { if (!driver) { error("Invalid driver"); @@ -62,12 +62,13 @@ DBG("driver %p transport %s registered", driver, driver->name); - drivers = g_slist_prepend(drivers, driver); + drivers = g_slist_prepend(drivers, (gpointer)driver); return 0; } -void obex_transport_driver_unregister(struct obex_transport_driver *driver) +void +obex_transport_driver_unregister(const struct obex_transport_driver *driver) { if (!g_slist_find(drivers, driver)) { error("Unable to unregister: No such driver %p", driver);
View file
_service:tar_scm:bluez-5.71.tar.xz/obexd/src/transport.h -> _service:tar_scm:bluez-5.77.tar.xz/obexd/src/transport.h
Changed
@@ -17,6 +17,7 @@ void (*stop) (void *data); }; -int obex_transport_driver_register(struct obex_transport_driver *driver); -void obex_transport_driver_unregister(struct obex_transport_driver *driver); -GSList *obex_transport_driver_list(void); +int obex_transport_driver_register(const struct obex_transport_driver *driver); +void +obex_transport_driver_unregister(const struct obex_transport_driver *driver); +const GSList *obex_transport_driver_list(void);
View file
_service:tar_scm:bluez-5.71.tar.xz/plugins/policy.c -> _service:tar_scm:bluez-5.77.tar.xz/plugins/policy.c
Changed
@@ -74,6 +74,7 @@ static unsigned int service_id = 0; static GSList *devices = NULL; +static const bool default_auto_enable = true; static bool auto_enable = false; struct policy_data { @@ -858,6 +859,7 @@ sizeof(*reconnect_intervals); reconnect_intervals = util_memdup(default_intervals, sizeof(default_intervals)); + auto_enable = default_auto_enable; goto done; } @@ -895,7 +897,7 @@ &gerr); if (gerr) { g_clear_error(&gerr); - auto_enable = true; + auto_enable = default_auto_enable; } resume_delay = g_key_file_get_integer(
View file
_service:tar_scm:bluez-5.71.tar.xz/plugins/sixaxis.c -> _service:tar_scm:bluez-5.77.tar.xz/plugins/sixaxis.c
Changed
@@ -346,6 +346,11 @@ device = btd_adapter_get_device(adapter, &device_bdaddr, BDADDR_BREDR); + if (!device) { + error("sixaxis: unable to set up a new device"); + return false; + } + info("sixaxis: setting up new device"); btd_device_device_set_name(device, cp->name);
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/a2dp-codecs.h -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/a2dp-codecs.h
Changed
@@ -250,6 +250,18 @@ #define LDAC_CHANNEL_MODE_DUAL 0x02 #define LDAC_CHANNEL_MODE_STEREO 0x01 +#define OPUS_G_VENDOR_ID 0x000000e0 +#define OPUS_G_CODEC_ID 0x0001 + +#define OPUS_G_FREQUENCY_48000 0x80 + +#define OPUS_G_DURATION_100 0x08 +#define OPUS_G_DURATION_200 0x10 + +#define OPUS_G_CHANNELS_MONO 0x01 +#define OPUS_G_CHANNELS_STEREO 0x02 +#define OPUS_G_CHANNELS_DUAL 0x04 + typedef struct { uint8_t vendor_id4; uint8_t vendor_id3; @@ -420,3 +432,8 @@ uint8_t reserved2; uint8_t reserved3; } __attribute__ ((packed)) a2dp_aptx_hd_t; + +typedef struct { + a2dp_vendor_codec_t info; + uint8_t data; +} __attribute__ ((packed)) a2dp_opus_g_t;
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/a2dp.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/a2dp.c
Changed
@@ -222,6 +222,7 @@ avdtp_unref(s->session); g_slist_free_full(s->cb, g_free); g_slist_free_full(s->caps, g_free); + g_free(s->err); g_free(s); } @@ -270,17 +271,34 @@ g_free(cb); } +static void setup_error_set(struct a2dp_setup *setup, struct avdtp_error *err) +{ + if (!err) { + g_free(setup->err); + setup->err = NULL; + } else { + if (!setup->err) + setup->err = g_new0(struct avdtp_error, 1); + memcpy(setup->err, err, sizeof(struct avdtp_error)); + } +} + +static void setup_error_init(struct a2dp_setup *setup, uint8_t type, int id) +{ + struct avdtp_error err; + + avdtp_error_init(&err, type, id); + setup_error_set(setup, &err); +} + static void finalize_setup_errno(struct a2dp_setup *s, int err, GSourceFunc cb1, ...) { GSourceFunc finalize; va_list args; - struct avdtp_error avdtp_err; - if (err < 0) { - avdtp_error_init(&avdtp_err, AVDTP_ERRNO, -err); - s->err = &avdtp_err; - } + if (err < 0) + setup_error_init(s, AVDTP_ERRNO, -err); va_start(args, cb1); finalize = cb1; @@ -576,10 +594,7 @@ finalize_config(setup); - if (setup->err) { - g_free(setup->err); - setup->err = NULL; - } + setup_error_set(setup, NULL); setup_unref(setup); @@ -588,11 +603,9 @@ static void endpoint_setconf_cb(struct a2dp_setup *setup, gboolean ret) { - if (ret == FALSE) { - setup->err = g_new(struct avdtp_error, 1); - avdtp_error_init(setup->err, AVDTP_MEDIA_CODEC, + if (ret == FALSE) + setup_error_init(setup, AVDTP_MEDIA_CODEC, AVDTP_UNSUPPORTED_CONFIGURATION); - } auto_config(setup); setup_unref(setup); @@ -671,8 +684,7 @@ if (cap->category == AVDTP_DELAY_REPORTING && !a2dp_sep->delay_reporting) { - setup->err = g_new(struct avdtp_error, 1); - avdtp_error_init(setup->err, AVDTP_DELAY_REPORTING, + setup_error_init(setup, AVDTP_DELAY_REPORTING, AVDTP_UNSUPPORTED_CONFIGURATION); goto done; } @@ -683,8 +695,7 @@ codec = (struct avdtp_media_codec_capability *) cap->data; if (codec->media_codec_type != a2dp_sep->codec) { - setup->err = g_new(struct avdtp_error, 1); - avdtp_error_init(setup->err, AVDTP_MEDIA_CODEC, + setup_error_init(setup, AVDTP_MEDIA_CODEC, AVDTP_UNSUPPORTED_CONFIGURATION); goto done; } @@ -704,10 +715,9 @@ return TRUE; } - setup_unref(setup); - setup->err = g_new(struct avdtp_error, 1); - avdtp_error_init(setup->err, AVDTP_MEDIA_CODEC, + setup_error_init(setup, AVDTP_MEDIA_CODEC, AVDTP_UNSUPPORTED_CONFIGURATION); + setup_unref(setup); break; } @@ -886,7 +896,7 @@ /* Set error to -EAGAIN so the likes of policy plugin can * reattempt to connect. */ - avdtp_error_init(setup->err, AVDTP_ERRNO, -EAGAIN); + setup_error_init(setup, AVDTP_ERRNO, -EAGAIN); } } @@ -910,10 +920,10 @@ if (err) { if (setup) { setup_ref(setup); - setup->err = err; + setup_error_set(setup, err); invalidate_remote_cache(setup, err); finalize_config(setup); - setup->err = NULL; + setup_error_set(setup, NULL); setup_unref(setup); } @@ -1116,7 +1126,7 @@ if (err) { setup->stream = NULL; - setup->err = err; + setup_error_set(setup, err); if (setup->start) finalize_resume(setup); } else if (setup->chan) @@ -1191,7 +1201,7 @@ if (err) { setup->stream = NULL; - setup->err = err; + setup_error_set(setup, err); } finalize_resume(setup); @@ -1270,7 +1280,7 @@ if (err) { setup->stream = NULL; - setup->err = err; + setup_error_set(setup, err); } finalize_suspend(setup); @@ -1317,6 +1327,9 @@ { struct avdtp_remote_sep *rsep; + if (!chan || !sep) + return NULL; + rsep = avdtp_find_remote_sep(chan->session, sep->lsep); return queue_find(chan->seps, match_remote_sep, rsep); @@ -1418,7 +1431,7 @@ if (err) { setup->stream = NULL; - setup->err = err; + setup_error_set(setup, err); finalize_config(setup); return; } @@ -1528,7 +1541,7 @@ if (err) { setup->stream = NULL; - setup->err = err; + setup_error_set(setup, err); } finalize_config(setup); @@ -2885,7 +2898,7 @@ setup->seps = seps; if (err) - setup->err = err; + setup_error_set(setup, err); if (!err) { g_slist_foreach(seps, foreach_register_remote_sep, setup->chan);
View file
_service:tar_scm:bluez-5.77.tar.xz/profiles/audio/asha.c
Added
@@ -0,0 +1,525 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2024 Asymptotic Inc. + * + * Author: Arun Raghavan <arun@asymptotic.io> + * + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#define _GNU_SOURCE +#include <errno.h> + +#include <stdbool.h> +#include <stdint.h> +#include <unistd.h> +#include <sys/socket.h> + +#include <dbus/dbus.h> +#include <glib.h> + +#include "btio/btio.h" +#include "gdbus/gdbus.h" +#include "lib/bluetooth.h" +#include "lib/l2cap.h" +#include "lib/uuid.h" + +#include "src/dbus-common.h" +#include "src/adapter.h" +#include "src/device.h" +#include "src/log.h" +#include "src/plugin.h" +#include "src/profile.h" +#include "src/service.h" +#include "src/shared/util.h" + +#include "profiles/audio/asha.h" +#include "profiles/audio/media.h" +#include "profiles/audio/transport.h" + +#define MEDIA_ENDPOINT_INTERFACE "org.bluez.MediaEndpoint1" + +/* 2 byte SDU length, 1 byte sequence number, and then 20ms of G.722 */ +#define ASHA_MIN_MTU 163 +/* The default of 672 does not work */ +#define ASHA_CONNECTION_MTU 512 + +struct bt_asha_device { + struct bt_asha *asha; + struct btd_device *device; + struct media_transport *transport; + + GIOChannel *io; + uint16_t imtu, omtu; + + unsigned int resume_id; +}; + +static char *make_endpoint_path(struct bt_asha_device *asha_dev) +{ + char *path; + int err; + + err = asprintf(&path, "%s/asha", device_get_path(asha_dev->device)); + if (err < 0) { + error("Could not allocate path for remote %s", + device_get_path(asha_dev->device)); + return NULL; + } + + return path; +} + +struct connect_data { + struct bt_asha_device *asha_dev; + bt_asha_cb_t cb; + void *cb_user_data; +}; + +static void connect_cb(GIOChannel *io, GError *err, gpointer user_data) +{ + struct connect_data *conn_data = user_data; + struct bt_asha_device *asha_dev = conn_data->asha_dev; + GError *gerr = NULL; + + if (!bt_io_get(io, &gerr, + BT_IO_OPT_IMTU, &asha_dev->imtu, + BT_IO_OPT_OMTU, &asha_dev->omtu, + BT_IO_OPT_INVALID)) { + /* Let this be non-fatal? */ + asha_dev->omtu = ASHA_MIN_MTU; + asha_dev->imtu = ASHA_CONNECTION_MTU; + error("Could not get L2CAP CoC socket MTU: %s", err->message); + g_error_free(gerr); + } + + asha_dev->io = io; + + bt_asha_start(asha_dev->asha, conn_data->cb, + conn_data->cb_user_data); +} + +static int asha_connect_socket(struct bt_asha_device *asha_dev, + bt_asha_cb_t cb, void *user_data) +{ + GError *gerr = NULL; + const bdaddr_t *src_addr; + struct connect_data *conn_data; + + if (asha_dev->asha->state != ASHA_STOPPED) { + error("ASHA device connect failed. Bad state %d", + asha_dev->asha->state); + return 0; + } + + conn_data = g_new0(struct connect_data, 1); + conn_data->asha_dev = asha_dev; + conn_data->cb = cb; + conn_data->cb_user_data = user_data; + + src_addr = btd_adapter_get_address( + device_get_adapter(asha_dev->device)); + + if (!bt_io_connect(connect_cb, conn_data, + g_free, &gerr, + BT_IO_OPT_MODE, BT_IO_MODE_LE_FLOWCTL, + BT_IO_OPT_SOURCE_TYPE, BDADDR_LE_PUBLIC, + BT_IO_OPT_SOURCE_BDADDR, src_addr, + BT_IO_OPT_DEST_TYPE, BDADDR_LE_PUBLIC, + BT_IO_OPT_DEST_BDADDR, + device_get_address(asha_dev->device), + BT_IO_OPT_PSM, asha_dev->asha->psm, + BT_IO_OPT_OMTU, ASHA_MIN_MTU, + BT_IO_OPT_IMTU, ASHA_CONNECTION_MTU, + BT_IO_OPT_INVALID)) { + error("Could not open L2CAP CoC socket: %s", gerr->message); + g_error_free(gerr); + goto error; + } + + DBG("L2CAP CoC socket is open"); + return 0; + +error: + return -1; +} + +unsigned int bt_asha_device_start(struct bt_asha_device *asha_dev, + bt_asha_cb_t cb, void *user_data) +{ + int ret; + + btd_device_set_conn_param(asha_dev->device, + 0x0010 /* min interval = 1.25ms intervals => 20ms */, + 0x0010 /* max interval = 1.25ms intervals => 20ms */, + 0x000A /* 10 events' latency */, + 0x0064 /* 1s timeout */); + + ret = asha_connect_socket(asha_dev, cb, user_data); + + if (ret < 0) + return 0; + else + return (++asha_dev->resume_id); +} + +unsigned int bt_asha_device_stop(struct bt_asha_device *asha_dev, + bt_asha_cb_t cb, void *user_data) +{ + bt_asha_stop(asha_dev->asha, cb, user_data); + + if (asha_dev->io) { + g_io_channel_shutdown(asha_dev->io, TRUE, NULL); + g_io_channel_unref(asha_dev->io); + asha_dev->io = NULL; + }; + + return asha_dev->resume_id; +} + +void bt_asha_device_state_reset(struct bt_asha_device *asha_dev) +{ + if (asha_dev->io) { + g_io_channel_shutdown(asha_dev->io, TRUE, NULL); + g_io_channel_unref(asha_dev->io); + asha_dev->io = NULL; + }; + + bt_asha_state_reset(asha_dev->asha); + + asha_dev->resume_id = 0; +} + +unsigned int bt_asha_device_device_get_resume_id( + struct bt_asha_device *asha_dev) +{ + return asha_dev->resume_id; +} + +enum bt_asha_state_t bt_asha_device_get_state( + struct bt_asha_device *asha_dev) +{ + return asha_dev->asha->state; +} + +uint16_t bt_asha_device_get_render_delay(struct bt_asha_device *asha_dev) +{ + return asha_dev->asha->render_delay; +} + +int8_t bt_asha_device_get_volume(struct bt_asha_device *asha_dev) +{ + return asha_dev->asha->volume; +} + +bool bt_asha_device_set_volume(struct bt_asha_device *asha_dev, int8_t volume) +{ + return bt_asha_set_volume(asha_dev->asha, volume); +} + +int bt_asha_device_get_fd(struct bt_asha_device *asha_dev) +{ + return g_io_channel_unix_get_fd(asha_dev->io); +} + +uint16_t bt_asha_device_get_imtu(struct bt_asha_device *asha_dev) +{ + return asha_dev->imtu; +} + +uint16_t bt_asha_device_get_omtu(struct bt_asha_device *asha_dev) +{ + return asha_dev->omtu; +} + + +static gboolean get_uuid(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + const char *uuid; + + uuid = ASHA_PROFILE_UUID; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &uuid); + + return TRUE; +} + +static gboolean get_side(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct bt_asha_device *asha_dev = data; + const char *side = asha_dev->asha->right_side ? "right" : "left"; + + /* Use a string in case we want to support more types in the future */ + dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &side); + + return TRUE; +} + + +static gboolean get_binaural(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct bt_asha_device *asha_dev = data; + dbus_bool_t binaural = asha_dev->asha->binaural; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &binaural); + + return TRUE; +} + +static gboolean get_hisyncid(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct bt_asha_device *asha_dev = data; + DBusMessageIter array; + uint8_t *hisyncid = asha_dev->asha->hisyncid; + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_BYTE_AS_STRING, &array); + + dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE, + &hisyncid, sizeof(asha_dev->asha->hisyncid)); + + dbus_message_iter_close_container(iter, &array); + + return TRUE; +} + +static gboolean get_codecs(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct bt_asha_device *asha_dev = data; + dbus_uint16_t codecs = asha_dev->asha->codec_ids; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &codecs); + + return TRUE; +} + +static gboolean get_device(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct bt_asha_device *asha_dev = data; + const char *path; + + path = device_get_path(asha_dev->device); + + dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path); + + return TRUE; +} + +static gboolean get_transport(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct bt_asha_device *asha_dev = data; + const char *path; + + path = media_transport_get_path(asha_dev->transport); + + dbus_message_iter_append_basic(iter, DBUS_TYPE_OBJECT_PATH, &path); + + return TRUE; +} + +static int asha_source_device_probe(struct btd_service *service) +{ + struct bt_asha_device *asha_dev; + struct btd_device *device = btd_service_get_device(service); + char addr18; + + ba2str(device_get_address(device), addr); + DBG("Probing ASHA device %s", addr); + + asha_dev = g_new0(struct bt_asha_device, 1); + + asha_dev->device = device; + asha_dev->asha = bt_asha_new(); + asha_dev->io = NULL; + + btd_service_set_user_data(service, asha_dev); + + return 0; +} + +static void asha_source_device_remove(struct btd_service *service) +{ + struct bt_asha_device *asha_dev; + struct btd_device *device = btd_service_get_device(service); + char addr18; + + ba2str(device_get_address(device), addr); + DBG("Removing ASHA device %s", addr); + + asha_dev = btd_service_get_user_data(service); + if (!asha_dev) { + /* Can this actually happen? */ + DBG("Not handlihng ASHA profile"); + return; + } + + bt_asha_free(asha_dev->asha); + g_free(asha_dev); +} + +static const GDBusMethodTable asha_ep_methods = { + { }, +}; + +static const GDBusPropertyTable asha_ep_properties = { + { "UUID", "s", get_uuid, NULL, NULL, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "Side", "s", get_side, NULL, NULL, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "Binaural", "b", get_binaural, NULL, NULL, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "HiSyncId", "ay", get_hisyncid, NULL, NULL, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "Codecs", "q", get_codecs, NULL, NULL, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "Device", "o", get_device, NULL, NULL, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "Transport", "o", get_transport, NULL, NULL, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { } +}; + +static void asha_source_endpoint_register(struct bt_asha_device *asha_dev) +{ + char *path; + const struct media_endpoint *asha_ep; + + path = make_endpoint_path(asha_dev); + if (!path) + goto error; + + if (g_dbus_register_interface(btd_get_dbus_connection(), + path, MEDIA_ENDPOINT_INTERFACE, + asha_ep_methods, NULL, + asha_ep_properties, + asha_dev, NULL) == FALSE) { + error("Could not register remote ep %s", path); + goto error; + } + + asha_ep = media_endpoint_get_asha(); + asha_dev->transport = media_transport_create(asha_dev->device, path, + NULL, 0, (void *) asha_ep, asha_dev); + +error: + if (path) + free(path); +} + +static void asha_source_endpoint_unregister(struct bt_asha_device *asha) +{ + char *path; + + path = make_endpoint_path(asha); + if (!path) + goto error; + + g_dbus_unregister_interface(btd_get_dbus_connection(), + path, MEDIA_ENDPOINT_INTERFACE); + + if (asha->transport) { + media_transport_destroy(asha->transport); + asha->transport = NULL; + } + +error: + if (path) + free(path); +} + +static int asha_source_accept(struct btd_service *service) +{ + struct btd_device *device = btd_service_get_device(service); + struct gatt_db *db = btd_device_get_gatt_db(device); + struct bt_gatt_client *client = btd_device_get_gatt_client(device); + struct bt_asha_device *asha_dev = btd_service_get_user_data(service); + char addr18; + + ba2str(device_get_address(device), addr); + DBG("Accepting ASHA connection on %s", addr); + + if (!asha_dev) { + /* Can this actually happen? */ + DBG("Not handling ASHA profile"); + return -1; + } + + if (!bt_asha_probe(asha_dev->asha, db, client)) + return -1; + + asha_source_endpoint_register(asha_dev); + + btd_service_connecting_complete(service, 0); + + return 0; +} + +static int asha_source_disconnect(struct btd_service *service) +{ + struct btd_device *device = btd_service_get_device(service); + struct bt_asha_device *asha_dev = btd_service_get_user_data(service); + char addr18; + + ba2str(device_get_address(device), addr); + DBG("Disconnecting ASHA on %s", addr); + + if (!asha_dev) { + /* Can this actually happen? */ + DBG("Not handlihng ASHA profile"); + return -1; + } + + asha_source_endpoint_unregister(asha_dev); + bt_asha_reset(asha_dev->asha); + + btd_service_disconnecting_complete(service, 0); + + return 0; +} + +static struct btd_profile asha_source_profile = { + .name = "asha-source", + .priority = BTD_PROFILE_PRIORITY_MEDIUM, + .remote_uuid = ASHA_PROFILE_UUID, + .experimental = true, + + .device_probe = asha_source_device_probe, + .device_remove = asha_source_device_remove, + + .auto_connect = true, + .accept = asha_source_accept, + .disconnect = asha_source_disconnect, +}; + +static int asha_init(void) +{ + int err; + + err = btd_profile_register(&asha_source_profile); + if (err) + return err; + + return 0; +} + +static void asha_exit(void) +{ + btd_profile_unregister(&asha_source_profile); +} + +BLUETOOTH_PLUGIN_DEFINE(asha, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, + asha_init, asha_exit)
View file
_service:tar_scm:bluez-5.77.tar.xz/profiles/audio/asha.h
Added
@@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2024 Asymptotic Inc. + * + * Author: Arun Raghavan <arun@asymptotic.io> + * + * + */ + +#include <stdbool.h> +#include <stdint.h> + +#include "src/shared/asha.h" + +struct bt_asha_device; + +unsigned int bt_asha_device_start(struct bt_asha_device *asha_dev, + bt_asha_cb_t cb, void *user_data); +unsigned int bt_asha_device_stop(struct bt_asha_device *asha_dev, + bt_asha_cb_t cb, void *user_data); + +void bt_asha_device_state_reset(struct bt_asha_device *asha_dev); +unsigned int bt_asha_device_device_get_resume_id( + struct bt_asha_device *asha_dev); + +uint16_t bt_asha_device_get_render_delay(struct bt_asha_device *asha_dev); +enum bt_asha_state_t bt_asha_device_get_state( + struct bt_asha_device *asha_dev); + +int bt_asha_device_get_fd(struct bt_asha_device *asha_dev); +uint16_t bt_asha_device_get_omtu(struct bt_asha_device *asha_dev); +uint16_t bt_asha_device_get_imtu(struct bt_asha_device *asha_dev); + +int8_t bt_asha_device_get_volume(struct bt_asha_device *asha_dev); +bool bt_asha_device_set_volume(struct bt_asha_device *asha_dev, int8_t volume);
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/avctp.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/avctp.c
Changed
@@ -228,7 +228,7 @@ GDestroyNotify destroy; }; -static struct { +static const struct { const char *name; uint8_t avc; uint16_t uinput;
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/avdtp.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/avdtp.c
Changed
@@ -184,13 +184,17 @@ } __attribute__ ((packed)); struct start_req { - struct seid first_seid; - struct seid other_seids0; + union { + struct seid required1; + struct seid seids0; + }; } __attribute__ ((packed)); struct suspend_req { - struct seid first_seid; - struct seid other_seids0; + union { + struct seid required1; + struct seid seids0; + }; } __attribute__ ((packed)); struct seid_rej { @@ -286,7 +290,6 @@ gboolean active; int no_of_packets; uint8_t transaction; - uint8_t message_type; uint8_t signal_id; uint8_t buf1024; uint8_t data_size; @@ -397,7 +400,8 @@ uint16_t imtu; uint16_t omtu; - struct in_buf in; + struct in_buf in_resp; + struct in_buf in_cmd; char *buf; @@ -1462,15 +1466,16 @@ if (err != NULL) { rej.error = AVDTP_UNSUPPORTED_CONFIGURATION; rej.category = err->err.error_code; - avdtp_send(session, session->in.transaction, - AVDTP_MSG_TYPE_REJECT, AVDTP_SET_CONFIGURATION, - &rej, sizeof(rej)); + avdtp_send(session, session->in_cmd.transaction, + AVDTP_MSG_TYPE_REJECT, AVDTP_SET_CONFIGURATION, + &rej, sizeof(rej)); stream_free(stream); return; } - if (!avdtp_send(session, session->in.transaction, AVDTP_MSG_TYPE_ACCEPT, - AVDTP_SET_CONFIGURATION, NULL, 0)) { + if (!avdtp_send(session, session->in_cmd.transaction, + AVDTP_MSG_TYPE_ACCEPT, + AVDTP_SET_CONFIGURATION, NULL, 0)) { stream_free(stream); return; } @@ -1671,12 +1676,12 @@ static void check_start_collision(struct pending_req *req, uint8_t id) { struct start_req *start = req->data; - struct seid *seid = &start->first_seid; int count = 1 + req->data_size - sizeof(struct start_req); int i; - for (i = 0; i < count; i++, seid++) { - if (seid->seid == id) { + for (i = 0; i < count; i++) { + struct seid seid = start->seidsi; + if (seid.seid == id) { req->collided = TRUE; return; } @@ -1686,12 +1691,12 @@ static void check_suspend_collision(struct pending_req *req, uint8_t id) { struct suspend_req *suspend = req->data; - struct seid *seid = &suspend->first_seid; int count = 1 + req->data_size - sizeof(struct suspend_req); int i; - for (i = 0; i < count; i++, seid++) { - if (seid->seid == id) { + for (i = 0; i < count; i++) { + struct seid seid = suspend->seidsi; + if (seid.seid == id) { req->collided = TRUE; return; } @@ -1784,7 +1789,6 @@ struct avdtp_local_sep *sep; struct avdtp_stream *stream; struct stream_rej rej; - struct seid *seid; uint8_t err, failed_seid; int seid_count, i; @@ -1795,12 +1799,12 @@ seid_count = 1 + size - sizeof(struct start_req); - seid = &req->first_seid; + for (i = 0; i < seid_count; i++) { + struct seid seid = req->seidsi; - for (i = 0; i < seid_count; i++, seid++) { - failed_seid = seid->seid; + failed_seid = seid.seid; - sep = find_local_sep_by_seid(session, seid->seid); + sep = find_local_sep_by_seid(session, seid.seid); if (!sep || !sep->stream) { err = AVDTP_BAD_ACP_SEID; goto failed; @@ -1897,7 +1901,6 @@ struct avdtp_local_sep *sep; struct avdtp_stream *stream; struct stream_rej rej; - struct seid *seid; uint8_t err, failed_seid; int seid_count, i; @@ -1908,12 +1911,11 @@ seid_count = 1 + size - sizeof(struct suspend_req); - seid = &req->first_seid; - - for (i = 0; i < seid_count; i++, seid++) { - failed_seid = seid->seid; + for (i = 0; i < seid_count; i++) { + struct seid seid = req->seidsi; + failed_seid = seid.seid; - sep = find_local_sep_by_seid(session, seid->seid); + sep = find_local_sep_by_seid(session, seid.seid); if (!sep || !sep->stream) { err = AVDTP_BAD_ACP_SEID; goto failed; @@ -2092,6 +2094,12 @@ struct avdtp_start_header *start = (void *) session->buf; void *payload; gsize payload_size; + struct in_buf *in; + + if (header->message_type == AVDTP_MSG_TYPE_COMMAND) + in = &session->in_cmd; + else + in = &session->in_resp; switch (header->packet_type) { case AVDTP_PKT_TYPE_SINGLE: @@ -2099,7 +2107,7 @@ error("Received too small single packet (%zu bytes)", size); return PARSE_ERROR; } - if (session->in.active) { + if (in->active) { error("SINGLE: Invalid AVDTP packet fragmentation"); return PARSE_ERROR; } @@ -2107,12 +2115,11 @@ payload = session->buf + sizeof(*single); payload_size = size - sizeof(*single); - session->in.active = TRUE; - session->in.data_size = 0; - session->in.no_of_packets = 1; - session->in.transaction = header->transaction; - session->in.message_type = header->message_type; - session->in.signal_id = single->signal_id; + in->active = TRUE; + in->data_size = 0; + in->no_of_packets = 1; + in->transaction = header->transaction; + in->signal_id = single->signal_id; break; case AVDTP_PKT_TYPE_START: @@ -2120,17 +2127,16 @@ error("Received too small start packet (%zu bytes)", size); return PARSE_ERROR; } - if (session->in.active) { + if (in->active) { error("START: Invalid AVDTP packet fragmentation"); return PARSE_ERROR; } - session->in.active = TRUE; - session->in.data_size = 0; - session->in.transaction = header->transaction; - session->in.message_type = header->message_type; - session->in.no_of_packets = start->no_of_packets; - session->in.signal_id = start->signal_id; + in->active = TRUE; + in->data_size = 0; + in->transaction = header->transaction; + in->no_of_packets = start->no_of_packets; + in->signal_id = start->signal_id; payload = session->buf + sizeof(*start); payload_size = size - sizeof(*start); @@ -2142,15 +2148,15 @@ size); return PARSE_ERROR; } - if (!session->in.active) { + if (!in->active) { error("CONTINUE: Invalid AVDTP packet fragmentation"); return PARSE_ERROR; } - if (session->in.transaction != header->transaction) { + if (in->transaction != header->transaction) { error("Continue transaction id doesn't match"); return PARSE_ERROR; } - if (session->in.no_of_packets <= 1) { + if (in->no_of_packets <= 1) { error("Too few continue packets"); return PARSE_ERROR; } @@ -2164,15 +2170,15 @@ error("Received too small end packet (%zu bytes)", size); return PARSE_ERROR; } - if (!session->in.active) { + if (!in->active) { error("END: Invalid AVDTP packet fragmentation"); return PARSE_ERROR; } - if (session->in.transaction != header->transaction) { + if (in->transaction != header->transaction) { error("End transaction id doesn't match"); return PARSE_ERROR; } - if (session->in.no_of_packets > 1) { + if (in->no_of_packets > 1) { error("Got an end packet too early"); return PARSE_ERROR; } @@ -2186,23 +2192,23 @@ return PARSE_ERROR; } - if (session->in.data_size + payload_size > - sizeof(session->in.buf)) { + if (in->data_size + payload_size > + sizeof(in->buf)) { error("Not enough incoming buffer space!"); return PARSE_ERROR; } - memcpy(session->in.buf + session->in.data_size, payload, payload_size); - session->in.data_size += payload_size; + memcpy(in->buf + in->data_size, payload, payload_size); + in->data_size += payload_size; - if (session->in.no_of_packets > 1) { - session->in.no_of_packets--; + if (in->no_of_packets > 1) { + in->no_of_packets--; DBG("Received AVDTP fragment. %d to go", - session->in.no_of_packets); + in->no_of_packets); return PARSE_FRAGMENT; } - session->in.active = FALSE; + in->active = FALSE; return PARSE_SUCCESS; } @@ -2246,11 +2252,11 @@ break; } - if (session->in.message_type == AVDTP_MSG_TYPE_COMMAND) { - if (!avdtp_parse_cmd(session, session->in.transaction, - session->in.signal_id, - session->in.buf, - session->in.data_size)) { + if (header->message_type == AVDTP_MSG_TYPE_COMMAND) { + if (!avdtp_parse_cmd(session, session->in_cmd.transaction, + session->in_cmd.signal_id, + session->in_cmd.buf, + session->in_cmd.data_size)) { error("Unable to handle command. Disconnecting"); goto failed; } @@ -2273,7 +2279,7 @@ return TRUE; } - if (session->in.signal_id != session->req->signal_id) { + if (session->in_resp.signal_id != session->req->signal_id) { error("Response signal doesn't match"); return TRUE; } @@ -2284,20 +2290,20 @@ switch (header->message_type) { case AVDTP_MSG_TYPE_ACCEPT: if (!avdtp_parse_resp(session, session->req->stream, - session->in.transaction, - session->in.signal_id, - session->in.buf, - session->in.data_size)) { + session->in_resp.transaction, + session->in_resp.signal_id, + session->in_resp.buf, + session->in_resp.data_size)) { error("Unable to parse accept response"); goto failed; } break; case AVDTP_MSG_TYPE_REJECT: if (!avdtp_parse_rej(session, session->req->stream, - session->in.transaction, - session->in.signal_id, - session->in.buf, - session->in.data_size)) { + session->in_resp.transaction, + session->in_resp.signal_id, + session->in_resp.buf, + session->in_resp.data_size)) { error("Unable to parse reject response"); goto failed; } @@ -3658,7 +3664,7 @@ } memset(&req, 0, sizeof(req)); - req.first_seid.seid = stream->rseid; + req.required->seid = stream->rseid; ret = send_request(session, FALSE, stream, AVDTP_START, &req, sizeof(req)); @@ -3913,6 +3919,9 @@ gboolean avdtp_has_stream(struct avdtp *session, struct avdtp_stream *stream) { + if (!session || !stream) + return FALSE; + return g_slist_find(session->streams, stream) ? TRUE : FALSE; }
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/avrcp.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/avrcp.c
Changed
@@ -290,7 +290,7 @@ uint8_t transaction); }; -static struct { +static const struct { uint8_t feature_bit; uint8_t avc; } passthrough_map = { @@ -361,7 +361,7 @@ static uint8_t default_features16; /* Company IDs supported by this device */ -static uint32_t company_ids = { +static const uint32_t company_ids = { IEEEID_BTSIG, }; @@ -1210,6 +1210,10 @@ GUINT_TO_POINTER(str_to_metadata(key))); } + if (attrs == NULL) + return g_list_prepend(NULL, + GUINT_TO_POINTER(AVRCP_MEDIA_ATTRIBUTE_TITLE)); + return attrs; } @@ -2118,7 +2122,7 @@ pdu->param_len = cpu_to_be16(1); } -static struct browsing_pdu_handler { +static const struct browsing_pdu_handler { uint8_t pdu_id; void (*func) (struct avrcp *session, struct avrcp_browsing_header *pdu, uint8_t transaction); @@ -2147,7 +2151,7 @@ size_t operand_count, void *user_data) { struct avrcp *session = user_data; - struct browsing_pdu_handler *handler; + const struct browsing_pdu_handler *handler; struct avrcp_browsing_header *pdu = (void *) operands; DBG("AVRCP Browsing PDU 0x%02X, len 0x%04X", pdu->pdu_id, @@ -2551,11 +2555,10 @@ uid = get_be64(&operands0); + memset(name, 0, sizeof(name)); namelen = MIN(get_be16(&operands11), sizeof(name) - 1); - if (namelen > 0) { + if (namelen > 0) memcpy(name, &operands13, namelen); - namenamelen = '\0'; - } player = session->controller->player; mp = player->user_data; @@ -2588,11 +2591,10 @@ type = operands8; playable = operands9; + memset(name, 0, sizeof(name)); namelen = MIN(get_be16(&operands12), sizeof(name) - 1); - if (namelen > 0) { + if (namelen > 0) memcpy(name, &operands14, namelen); - namenamelen = '\0'; - } item = media_player_create_folder(mp, name, type, uid); if (!item)
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/bap.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/bap.c
Changed
@@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. All rights reserved. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -62,27 +62,51 @@ #define MEDIA_ENDPOINT_INTERFACE "org.bluez.MediaEndpoint1" #define MEDIA_INTERFACE "org.bluez.Media1" -struct bap_ep { - char *path; - struct bap_data *data; - struct bt_bap_pac *lpac; - struct bt_bap_pac *rpac; +/* Periodic advertisments are performed by an idle timer, which, + * at every tick, checks a queue for pending PA requests. + * When there is no pending requests, an item is popped from the + * queue, marked as pending and then it gets processed. + */ +#define PA_IDLE_TIMEOUT 2 + +struct bap_setup { + struct bap_ep *ep; struct bt_bap_stream *stream; + struct bt_bap_qos qos; + int (*qos_parser)(struct bap_setup *setup, const char *key, int var, + DBusMessageIter *iter); GIOChannel *io; unsigned int io_id; bool recreate; bool cig_active; struct iovec *caps; struct iovec *metadata; - struct bt_bap_qos qos; unsigned int id; - DBusMessage *msg; struct iovec *base; + DBusMessage *msg; + void (*destroy)(struct bap_setup *setup); +}; + +struct bap_ep { + char *path; + struct bap_data *data; + struct bt_bap_pac *lpac; + struct bt_bap_pac *rpac; + uint32_t locations; + uint16_t supported_context; + uint16_t context; + struct queue *setups; +}; + +struct bap_adapter { + struct btd_adapter *adapter; + unsigned int pa_timer_id; + struct queue *bcast_pa_requests; }; struct bap_data { struct btd_device *device; - struct btd_adapter *adapter; + struct bap_adapter *adapter; struct btd_service *service; struct bt_bap *bap; unsigned int ready_id; @@ -91,13 +115,68 @@ struct queue *srcs; struct queue *snks; struct queue *bcast; + struct queue *bcast_snks; struct queue *streams; GIOChannel *listen_io; int selecting; void *user_data; }; +enum { + BAP_PA_SHORT_REQ = 0, /* Request for short PA sync */ + BAP_PA_BIG_SYNC_REQ, /* Request for PA Sync and BIG Sync */ +}; + +struct bap_bcast_pa_req { + uint8_t type; + bool in_progress; + union { + struct btd_service *service; + struct bap_setup *setup; + } data; +}; + static struct queue *sessions; +static struct queue *adapters; + +/* Structure holding the parameters for Periodic Advertisement create sync. + * The full QOS is populated at the time the user selects and endpoint and + * configures it using SetConfiguration. + */ +static struct bt_iso_qos bap_sink_pa_qos = { + .bcast = { + .options = 0x00, + .skip = 0x0000, + .sync_timeout = BT_ISO_SYNC_TIMEOUT, + .sync_cte_type = 0x00, + /* TODO: The following parameters are not needed for PA Sync. + * They will be removed when the kernel checks will be removed. + */ + .big = BT_ISO_QOS_BIG_UNSET, + .bis = BT_ISO_QOS_BIS_UNSET, + .encryption = 0x00, + .bcode = {0x00}, + .mse = 0x00, + .timeout = BT_ISO_SYNC_TIMEOUT, + .sync_factor = 0x07, + .packing = 0x00, + .framing = 0x00, + .in = { + .interval = 10000, + .latency = 10, + .sdu = 40, + .phy = 0x02, + .rtn = 2, + }, + .out = { + .interval = 10000, + .latency = 10, + .sdu = 40, + .phy = 0x02, + .rtn = 2, + } + } +}; static bool bap_data_set_user_data(struct bap_data *data, void *user_data) { @@ -124,6 +203,8 @@ MEDIA_ENDPOINT_INTERFACE); } +static void setup_free(void *data); + static void bap_data_free(struct bap_data *data) { if (data->listen_io) { @@ -140,6 +221,7 @@ queue_destroy(data->srcs, ep_unregister); queue_destroy(data->bcast, ep_unregister); queue_destroy(data->streams, NULL); + queue_destroy(data->bcast_snks, setup_free); bt_bap_ready_unregister(data->bap, data->ready_id); bt_bap_state_unregister(data->bap, data->state_id); bt_bap_pac_unregister(data->bap, data->pac_id); @@ -207,7 +289,13 @@ struct bap_ep *ep = data; uint8_t codec; - bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL); + /* For broadcast source, rpac is null so the codec + * is retrieved from the lpac + */ + if (ep->rpac == NULL) + bt_bap_pac_get_codec(ep->lpac, &codec, NULL, NULL); + else + bt_bap_pac_get_codec(ep->rpac, &codec, NULL, NULL); dbus_message_iter_append_basic(iter, DBUS_TYPE_BYTE, &codec); @@ -247,6 +335,39 @@ return TRUE; } +static gboolean has_metadata(const GDBusPropertyTable *property, void *data) +{ + struct bap_ep *ep = data; + struct iovec *d = NULL; + + bt_bap_pac_get_codec(ep->rpac, NULL, NULL, &d); + + if (d) + return TRUE; + + return FALSE; +} + +static gboolean get_metadata(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct bap_ep *ep = data; + DBusMessageIter array; + struct iovec *d; + + bt_bap_pac_get_codec(ep->rpac, NULL, NULL, &d); + + dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, + DBUS_TYPE_BYTE_AS_STRING, &array); + + dbus_message_iter_append_fixed_array(&array, DBUS_TYPE_BYTE, + &d->iov_base, d->iov_len); + + dbus_message_iter_close_container(iter, &array); + + return TRUE; +} + static gboolean get_device(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { @@ -254,7 +375,7 @@ const char *path; if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SOURCE) - path = adapter_get_path(ep->data->adapter); + path = adapter_get_path(ep->data->adapter->adapter); else path = device_get_path(ep->data->device); @@ -267,9 +388,10 @@ DBusMessageIter *iter, void *data) { struct bap_ep *ep = data; - uint32_t locations = bt_bap_pac_get_locations(ep->rpac); - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &locations); + ep->locations = bt_bap_pac_get_locations(ep->rpac); + + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32, &ep->locations); return TRUE; } @@ -278,9 +400,11 @@ DBusMessageIter *iter, void *data) { struct bap_ep *ep = data; - uint16_t context = bt_bap_pac_get_supported_context(ep->rpac); - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &context); + ep->supported_context = bt_bap_pac_get_supported_context(ep->rpac); + + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, + &ep->supported_context); return TRUE; } @@ -289,9 +413,10 @@ DBusMessageIter *iter, void *data) { struct bap_ep *ep = data; - uint16_t context = bt_bap_pac_get_context(ep->rpac); - dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &context); + ep->context = bt_bap_pac_get_context(ep->rpac); + + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &ep->context); return TRUE; } @@ -352,6 +477,8 @@ G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, { "Capabilities", "ay", get_capabilities, NULL, has_capabilities, G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "Metadata", "ay", get_metadata, NULL, has_metadata, + G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, { "Device", "o", get_device, NULL, NULL, G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, { "Locations", "u", get_locations, NULL, NULL, @@ -379,103 +506,6 @@ return 0; } -static bool parse_base(void *data, size_t len, util_debug_func_t func, - uint32_t *presDelay, uint8_t *numSubgroups, uint8_t *numBis, - struct bt_bap_codec *codec, struct iovec **caps, - struct iovec **meta) -{ - struct iovec iov = { - .iov_base = data, - .iov_len = len, - }; - - uint8_t capsLen, metaLen; - uint8_t *hexstream; - - if (presDelay) { - if (!util_iov_pull_le24(&iov, presDelay)) - return false; - util_debug(func, NULL, "PresentationDelay %d", *presDelay); - } - - if (numSubgroups) { - if (!util_iov_pull_u8(&iov, numSubgroups)) - return false; - util_debug(func, NULL, "NumSubgroups %d", *numSubgroups); - } - - if (numBis) { - if (!util_iov_pull_u8(&iov, numBis)) - return false; - util_debug(func, NULL, "NumBis %d", *numBis); - } - - if (codec) { - codec = util_iov_pull_mem(&iov, sizeof(*codec)); - if (!codec) - return false; - util_debug(func, NULL, "%s: ID %d CID 0x%2.2x VID 0x%2.2x", - "Codec", codec->id, codec->cid, codec->vid); - } - - if (!util_iov_pull_u8(&iov, &capsLen)) - return false; - util_debug(func, NULL, "CC Len %d", capsLen); - - if (!capsLen) - return false; - if (caps) { - if (!(*caps)) - *caps = new0(struct iovec, 1); - (*caps)->iov_len = capsLen; - (*caps)->iov_base = iov.iov_base; - } - - for (int i = 0; capsLen > 1; i++) { - struct bt_ltv *ltv = util_iov_pull_mem(&iov, sizeof(*ltv)); - uint8_t *caps; - - if (!ltv) { - util_debug(func, NULL, "Unable to parse %s", - "Capabilities"); - return false; - } - - util_debug(func, NULL, "%s #%u: len %u type %u", - "CC", i, ltv->len, ltv->type); - - caps = util_iov_pull_mem(&iov, ltv->len - 1); - if (!caps) { - util_debug(func, NULL, "Unable to parse %s", - "CC"); - return false; - } - util_hexdump(' ', caps, ltv->len - 1, func, NULL); - - capsLen -= (ltv->len + 1); - } - - if (!util_iov_pull_u8(&iov, &metaLen)) - return false; - util_debug(func, NULL, "Metadata Len %d", metaLen); - - if (!metaLen) - return false; - if (meta) { - if (!(*meta)) - *meta = new0(struct iovec, 1); - (*meta)->iov_len = metaLen; - (*meta)->iov_base = iov.iov_base; - } - - hexstream = util_iov_pull_mem(&iov, metaLen); - if (!hexstream) - return false; - util_hexdump(' ', hexstream, metaLen, func, NULL); - - return true; -} - static int parse_io_qos(const char *key, int var, DBusMessageIter *iter, struct bt_bap_io_qos *qos) { @@ -509,9 +539,11 @@ return 0; } -static int parse_ucast_qos(const char *key, int var, DBusMessageIter *iter, - struct bt_bap_qos *qos) +static int setup_parse_ucast_qos(struct bap_setup *setup, const char *key, + int var, DBusMessageIter *iter) { + struct bt_bap_qos *qos = &setup->qos; + if (!strcasecmp(key, "CIG")) { if (var != DBUS_TYPE_BYTE) return -EINVAL; @@ -548,14 +580,28 @@ return 0; } -static int parse_bcast_qos(const char *key, int var, DBusMessageIter *iter, - struct bt_bap_qos *qos) +static void setup_bcast_destroy(struct bap_setup *setup) +{ + struct bt_bap_qos *qos = &setup->qos; + + util_iov_free(qos->bcast.bcode, 1); +} + +static int setup_parse_bcast_qos(struct bap_setup *setup, const char *key, + int var, DBusMessageIter *iter) { + struct bt_bap_qos *qos = &setup->qos; + if (!strcasecmp(key, "Encryption")) { if (var != DBUS_TYPE_BYTE) return -EINVAL; dbus_message_iter_get_basic(iter, &qos->bcast.encryption); + } else if (!strcasecmp(key, "BIG")) { + if (var != DBUS_TYPE_BYTE) + return -EINVAL; + + dbus_message_iter_get_basic(iter, &qos->bcast.big); } else if (!strcasecmp(key, "Options")) { if (var != DBUS_TYPE_BYTE) return -EINVAL; @@ -591,14 +637,26 @@ return -EINVAL; dbus_message_iter_get_basic(iter, &qos->bcast.timeout); + } else if (!strcasecmp(key, "PresentationDelay")) { + if (var != DBUS_TYPE_UINT32) + return -EINVAL; + + dbus_message_iter_get_basic(iter, &qos->bcast.delay); } else if (!strcasecmp(key, "BCode")) { struct iovec iov; if (var != DBUS_TYPE_ARRAY) return -EINVAL; + memset(&iov, 0, sizeof(iov)); + parse_array(iter, &iov); + if (iov.iov_len != 16) { + error("Invalid size for BCode: %zu != 16", iov.iov_len); + return -EINVAL; + } + util_iov_free(qos->bcast.bcode, 1); qos->bcast.bcode = util_iov_dup(&iov, 1); } else { @@ -612,18 +670,10 @@ return 0; } -static int parse_qos(DBusMessageIter *iter, struct bt_bap_qos *qos, - struct iovec **base) +static int setup_parse_qos(struct bap_setup *setup, DBusMessageIter *iter) { DBusMessageIter array; const char *key; - int (*parser)(const char *key, int var, DBusMessageIter *iter, - struct bt_bap_qos *qos); - - if (*base) - parser = parse_bcast_qos; - else - parser = parse_ucast_qos; dbus_message_iter_recurse(iter, &array); @@ -639,7 +689,7 @@ var = dbus_message_iter_get_arg_type(&value); - err = parser(key, var, &value, qos); + err = setup->qos_parser(setup, key, var, &value); if (err) { DBG("Failed parsing %s", key); return err; @@ -651,9 +701,8 @@ return 0; } -static int parse_configuration(DBusMessageIter *props, struct iovec **caps, - struct iovec **metadata, struct iovec **base, - struct bt_bap_qos *qos) +static int setup_parse_configuration(struct bap_setup *setup, + DBusMessageIter *props) { const char *key; struct iovec iov; @@ -679,8 +728,8 @@ if (parse_array(&value, &iov)) goto fail; - util_iov_free(*caps, 1); - *caps = util_iov_dup(&iov, 1); + util_iov_free(setup->caps, 1); + setup->caps = util_iov_dup(&iov, 1); } else if (!strcasecmp(key, "Metadata")) { if (var != DBUS_TYPE_ARRAY) goto fail; @@ -688,124 +737,202 @@ if (parse_array(&value, &iov)) goto fail; - util_iov_free(*metadata, 1); - *metadata = util_iov_dup(&iov, 1); + util_iov_free(setup->metadata, 1); + setup->metadata = util_iov_dup(&iov, 1); } else if (!strcasecmp(key, "QoS")) { if (var != DBUS_TYPE_ARRAY) goto fail; - if (parse_qos(&value, qos, base)) + if (setup_parse_qos(setup, &value)) goto fail; } dbus_message_iter_next(props); } - if (*base) { - uint32_t presDelay; - uint8_t numSubgroups, numBis; - struct bt_bap_codec codec; - - util_iov_memcpy(*base, (*caps)->iov_base, (*caps)->iov_len); - parse_base((*caps)->iov_base, (*caps)->iov_len, bap_debug, - &presDelay, &numSubgroups, &numBis, &codec, - caps, NULL); - } - return 0; fail: DBG("Failed parsing %s", key); - if (*caps) { - free(*caps); - *caps = NULL; - } - return -EINVAL; } static void qos_cb(struct bt_bap_stream *stream, uint8_t code, uint8_t reason, void *user_data) { - struct bap_ep *ep = user_data; + struct bap_setup *setup = user_data; DBusMessage *reply; DBG("stream %p code 0x%02x reason 0x%02x", stream, code, reason); - ep->id = 0; + setup->id = 0; - if (!ep->msg) + if (!setup->msg) return; if (!code) - reply = dbus_message_new_method_return(ep->msg); + reply = dbus_message_new_method_return(setup->msg); else - reply = btd_error_failed(ep->msg, "Unable to configure"); + reply = btd_error_failed(setup->msg, "Unable to configure"); g_dbus_send_message(btd_get_dbus_connection(), reply); - dbus_message_unref(ep->msg); - ep->msg = NULL; + dbus_message_unref(setup->msg); + setup->msg = NULL; } static void config_cb(struct bt_bap_stream *stream, uint8_t code, uint8_t reason, void *user_data) { - struct bap_ep *ep = user_data; + struct bap_setup *setup = user_data; DBusMessage *reply; DBG("stream %p code 0x%02x reason 0x%02x", stream, code, reason); - ep->id = 0; + setup->id = 0; + + if (!code) { + /* Check state is already set to config then proceed to qos */ + if (bt_bap_stream_get_state(stream) == + BT_BAP_STREAM_STATE_CONFIG) { + setup->id = bt_bap_stream_qos(stream, &setup->qos, + qos_cb, setup); + if (!setup->id) { + error("Failed to Configure QoS"); + bt_bap_stream_release(stream, NULL, NULL); + } + } - if (!code) return; + } - if (!ep->msg) + if (!setup->msg) return; - reply = btd_error_failed(ep->msg, "Unable to configure"); + reply = btd_error_failed(setup->msg, "Unable to configure"); g_dbus_send_message(btd_get_dbus_connection(), reply); - dbus_message_unref(ep->msg); - ep->msg = NULL; + dbus_message_unref(setup->msg); + setup->msg = NULL; } -static void bap_io_close(struct bap_ep *ep) +static void setup_io_close(void *data, void *user_data) { + struct bap_setup *setup = data; int fd; - if (ep->io_id) { - g_source_remove(ep->io_id); - ep->io_id = 0; + if (setup->io_id) { + g_source_remove(setup->io_id); + setup->io_id = 0; } - if (!ep->io) + if (!setup->io) return; - DBG("ep %p", ep); + DBG("setup %p", setup); - fd = g_io_channel_unix_get_fd(ep->io); + fd = g_io_channel_unix_get_fd(setup->io); close(fd); - g_io_channel_unref(ep->io); - ep->io = NULL; - ep->cig_active = false; + g_io_channel_unref(setup->io); + setup->io = NULL; + setup->cig_active = false; + + bt_bap_stream_io_connecting(setup->stream, -1); +} + +static void ep_close(struct bap_ep *ep) +{ + if (!ep) + return; + + queue_foreach(ep->setups, setup_io_close, NULL); +} + +static struct bap_setup *setup_new(struct bap_ep *ep) +{ + struct bap_setup *setup; + + setup = new0(struct bap_setup, 1); + setup->ep = ep; + + /* Broadcast Source has endpoints in bcast list, Broadcast Sink + * does not have endpoints + */ + if (((ep != NULL) && queue_find(ep->data->bcast, NULL, ep)) || + (ep == NULL)) { + /* Mark BIG and BIS to be auto assigned */ + setup->qos.bcast.big = BT_ISO_QOS_BIG_UNSET; + setup->qos.bcast.bis = BT_ISO_QOS_BIS_UNSET; + setup->qos.bcast.sync_factor = 0x01; + setup->qos.bcast.sync_timeout = BT_ISO_SYNC_TIMEOUT; + setup->qos.bcast.timeout = BT_ISO_SYNC_TIMEOUT; + setup->qos_parser = setup_parse_bcast_qos; + setup->destroy = setup_bcast_destroy; + } else { + /* Mark CIG and CIS to be auto assigned */ + setup->qos.ucast.cig_id = BT_ISO_QOS_CIG_UNSET; + setup->qos.ucast.cis_id = BT_ISO_QOS_CIS_UNSET; + setup->qos_parser = setup_parse_ucast_qos; + } + + if (ep) { + if (!ep->setups) + ep->setups = queue_new(); + + queue_push_tail(ep->setups, setup); + + DBG("ep %p setup %p", ep, setup); + } + + return setup; +} + +static void setup_free(void *data) +{ + struct bap_setup *setup = data; + DBusMessage *reply; + + DBG("%p", setup); + + if (setup->stream && setup->id) { + bt_bap_stream_cancel(setup->stream, setup->id); + setup->id = 0; + } + + if (setup->msg) { + reply = btd_error_failed(setup->msg, "Canceled"); + g_dbus_send_message(btd_get_dbus_connection(), reply); + dbus_message_unref(setup->msg); + setup->msg = NULL; + } + + if (setup->ep) + queue_remove(setup->ep->setups, setup); + + setup_io_close(setup, NULL); + + util_iov_free(setup->caps, 1); + util_iov_free(setup->metadata, 1); + util_iov_free(setup->base, 1); + + if (setup->destroy) + setup->destroy(setup); + + free(setup); } static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, void *data) { struct bap_ep *ep = data; + struct bap_setup *setup; const char *path; DBusMessageIter args, props; - if (ep->msg) - return btd_error_busy(msg); - dbus_message_iter_init(msg, &args); dbus_message_iter_get_basic(&args, &path); @@ -815,59 +942,46 @@ if (dbus_message_iter_get_arg_type(&props) != DBUS_TYPE_DICT_ENTRY) return btd_error_invalid_args(msg); - /* Disconnect IO if connecting since QoS is going to be reconfigured */ - if (bt_bap_stream_io_is_connecting(ep->stream, NULL)) { - bap_io_close(ep); - bt_bap_stream_io_connecting(ep->stream, -1); - } + /* Broadcast source supports multiple setups, each setup will be BIS + * and will be configured with the set_configuration command + * TO DO reconfiguration of a BIS. + */ + if (bt_bap_pac_get_type(ep->lpac) != BT_BAP_BCAST_SOURCE) + ep_close(ep); - if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SOURCE) { - /* Mark BIG and BIS to be auto assigned */ - ep->qos.bcast.big = BT_ISO_QOS_BIG_UNSET; - ep->qos.bcast.bis = BT_ISO_QOS_BIS_UNSET; - } else { - /* Mark CIG and CIS to be auto assigned */ - ep->qos.ucast.cig_id = BT_ISO_QOS_CIG_UNSET; - ep->qos.ucast.cis_id = BT_ISO_QOS_CIS_UNSET; - } + setup = setup_new(ep); - if (parse_configuration(&props, &ep->caps, &ep->metadata, - &ep->base, &ep->qos) < 0) { + if (setup_parse_configuration(setup, &props) < 0) { DBG("Unable to parse configuration"); + setup_free(setup); return btd_error_invalid_args(msg); } - /* TODO: Check if stream capabilities match add support for Latency - * and PHY. - */ - if (!ep->stream) - ep->stream = bt_bap_stream_new(ep->data->bap, ep->lpac, - ep->rpac, &ep->qos, ep->caps); - - ep->id = bt_bap_stream_config(ep->stream, &ep->qos, ep->caps, - config_cb, ep); - if (!ep->id) { + setup->stream = bt_bap_stream_new(ep->data->bap, ep->lpac, ep->rpac, + &setup->qos, setup->caps); + bt_bap_stream_set_user_data(setup->stream, ep->path); + setup->id = bt_bap_stream_config(setup->stream, &setup->qos, + setup->caps, config_cb, setup); + if (!setup->id) { DBG("Unable to config stream"); - free(ep->caps); - ep->caps = NULL; + setup_free(setup); return btd_error_invalid_args(msg); } - bt_bap_stream_set_user_data(ep->stream, ep->path); - - if (ep->metadata && ep->metadata->iov_len) - bt_bap_stream_metadata(ep->stream, ep->metadata, NULL, NULL); + if (setup->metadata && setup->metadata->iov_len) + bt_bap_stream_metadata(setup->stream, setup->metadata, NULL, + NULL); - switch (bt_bap_stream_get_type(ep->stream)) { + switch (bt_bap_stream_get_type(setup->stream)) { case BT_BAP_STREAM_TYPE_UCAST: - ep->msg = dbus_message_ref(msg); + setup->msg = dbus_message_ref(msg); break; case BT_BAP_STREAM_TYPE_BCAST: /* No message sent over the air for broadcast */ - if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SINK) - ep->msg = dbus_message_ref(msg); - else - ep->id = 0; + setup->id = 0; + + if (ep->data->service) + service_set_connecting(ep->data->service); return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } @@ -875,118 +989,273 @@ return NULL; } -static void update_bcast_qos(struct bt_iso_qos *qos, - struct bt_bap_qos *bap_qos) +static void iso_bcast_confirm_cb(GIOChannel *io, GError *err, void *user_data) { - bap_qos->bcast.big = qos->bcast.big; - bap_qos->bcast.bis = qos->bcast.bis; - bap_qos->bcast.sync_factor = qos->bcast.sync_factor; - bap_qos->bcast.packing = qos->bcast.packing; - bap_qos->bcast.framing = qos->bcast.framing; - bap_qos->bcast.encryption = qos->bcast.encryption; - bap_qos->bcast.options = qos->bcast.options; - bap_qos->bcast.skip = qos->bcast.skip; - bap_qos->bcast.sync_timeout = qos->bcast.sync_timeout; - bap_qos->bcast.sync_cte_type = qos->bcast.sync_cte_type; - bap_qos->bcast.mse = qos->bcast.mse; - bap_qos->bcast.timeout = qos->bcast.timeout; - bap_qos->bcast.io_qos.interval = qos->bcast.in.interval; - bap_qos->bcast.io_qos.latency = qos->bcast.in.latency; - bap_qos->bcast.io_qos.phy = qos->bcast.in.phy; - bap_qos->bcast.io_qos.sdu = qos->bcast.in.sdu; - bap_qos->bcast.io_qos.rtn = qos->bcast.in.rtn; + struct bap_bcast_pa_req *req = user_data; + struct bap_setup *setup = req->data.setup; + int fd; + struct bt_bap *bt_bap = bt_bap_stream_get_session(setup->stream); + struct btd_service *btd_service = bt_bap_get_user_data(bt_bap); + struct bap_data *bap_data = btd_service_get_user_data(btd_service); + + DBG("BIG Sync completed"); + + g_io_channel_unref(setup->io); + g_io_channel_shutdown(setup->io, TRUE, NULL); + setup->io = NULL; + + /* This device is no longer needed */ + btd_service_connecting_complete(bap_data->service, 0); + + fd = g_io_channel_unix_get_fd(io); + + queue_remove(bap_data->adapter->bcast_pa_requests, req); + free(req); - bap_qos->bcast.bcode = new0(struct iovec, 1); - util_iov_memcpy(bap_qos->bcast.bcode, qos->bcast.bcode, - sizeof(qos->bcast.bcode)); + if (bt_bap_stream_set_io(setup->stream, fd)) { + bt_bap_stream_start(setup->stream, NULL, NULL); + g_io_channel_set_close_on_unref(io, FALSE); + return; + } } -static bool match_ep_type(const void *data, const void *user_data) +static void print_ltv(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data) { - const struct bap_ep *ep = data; + util_debug(user_data, NULL, "CC #%zu: l:%u t:%u", i, l, t); + util_hexdump(' ', v, l, user_data, NULL); +} + +static void create_stream_for_bis(struct bap_data *bap_data, + struct bt_bap_pac *lpac, struct bt_iso_qos *qos, + struct iovec *caps, struct iovec *meta, char *path) +{ + struct bap_setup *setup; + + setup = setup_new(NULL); + + /* Create BAP QoS structure */ + setup->qos.bcast.big = qos->bcast.big; + setup->qos.bcast.bis = qos->bcast.bis; + setup->qos.bcast.sync_factor = qos->bcast.sync_factor; + setup->qos.bcast.packing = qos->bcast.packing; + setup->qos.bcast.framing = qos->bcast.framing; + setup->qos.bcast.encryption = qos->bcast.encryption; + if (setup->qos.bcast.encryption) + setup->qos.bcast.bcode = util_iov_new(qos->bcast.bcode, + sizeof(qos->bcast.bcode)); + setup->qos.bcast.options = qos->bcast.options; + setup->qos.bcast.skip = qos->bcast.skip; + setup->qos.bcast.sync_timeout = qos->bcast.sync_timeout; + setup->qos.bcast.sync_cte_type = + qos->bcast.sync_cte_type; + setup->qos.bcast.mse = qos->bcast.mse; + setup->qos.bcast.timeout = qos->bcast.timeout; + setup->qos.bcast.io_qos.interval = + qos->bcast.in.interval; + setup->qos.bcast.io_qos.latency = qos->bcast.in.latency; + setup->qos.bcast.io_qos.phy = qos->bcast.in.phy; + setup->qos.bcast.io_qos.rtn = qos->bcast.in.rtn; + setup->qos.bcast.io_qos.sdu = qos->bcast.in.sdu; + + queue_push_tail(bap_data->bcast_snks, setup); - return (bt_bap_pac_get_type(ep->lpac) == PTR_TO_INT(user_data)); + /* Create and configure stream */ + setup->stream = bt_bap_stream_new(bap_data->bap, + lpac, NULL, &setup->qos, caps); + + bt_bap_stream_set_user_data(setup->stream, path); + bt_bap_stream_config(setup->stream, &setup->qos, + caps, NULL, NULL); + bt_bap_stream_metadata(setup->stream, meta, + NULL, NULL); } -static void iso_bcast_confirm_cb(GIOChannel *io, GError *err, void *user_data) +static bool parse_base(struct bap_data *bap_data, struct bt_iso_base *base, + struct bt_iso_qos *qos, util_debug_func_t func) { - struct bap_data *data = user_data; - struct bt_iso_qos qos; - struct bt_iso_base base; - char address18; - struct bap_ep *ep; - int fd; - struct iovec *base_io; - uint32_t presDelay; - uint8_t numSubgroups; - uint8_t numBis; - struct bt_bap_codec codec; + struct iovec iov = { + .iov_base = base->base, + .iov_len = base->base_len, + }; + uint32_t pres_delay; + uint8_t num_subgroups; + bool ret = true; - bt_io_get(io, &err, - BT_IO_OPT_DEST, address, - BT_IO_OPT_QOS, &qos, - BT_IO_OPT_BASE, &base, - BT_IO_OPT_INVALID); - if (err) { - error("%s", err->message); - g_error_free(err); - goto drop; - } + util_debug(func, NULL, "BASE len: %ld", iov.iov_len); - g_io_channel_ref(io); - btd_service_connecting_complete(data->service, 0); - DBG("BCAST ISO: sync with %s (BIG 0x%02x BIS 0x%02x)", - address, qos.bcast.big, qos.bcast.bis); + if (!util_iov_pull_le24(&iov, &pres_delay)) + return false; + util_debug(func, NULL, "PresentationDelay: %d", pres_delay); - ep = queue_find(data->bcast, match_ep_type, - INT_TO_PTR(BT_BAP_BCAST_SINK)); - if (!ep) - return; + if (!util_iov_pull_u8(&iov, &num_subgroups)) + return false; + util_debug(func, NULL, "Number of Subgroups: %d", num_subgroups); - update_bcast_qos(&qos, &ep->qos); + /* Loop subgroups */ + for (int idx = 0; idx < num_subgroups; idx++) { + uint8_t num_bis; + struct bt_bap_codec codec; + struct iovec *l2_caps = NULL; + struct iovec *meta = NULL; + + util_debug(func, NULL, "Subgroup #%d", idx); - base_io = new0(struct iovec, 1); - util_iov_memcpy(base_io, base.base, base.base_len); + if (!util_iov_pull_u8(&iov, &num_bis)) { + ret = false; + goto fail; + } + util_debug(func, NULL, "Number of BISes: %d", num_bis); + + memcpy(&codec, + util_iov_pull_mem(&iov, + sizeof(struct bt_bap_codec)), + sizeof(struct bt_bap_codec)); + util_debug(func, NULL, "Codec: ID %d CID 0x%2.2x VID 0x%2.2x", + codec.id, codec.cid, codec.vid); + + /* Level 2 */ + /* Read Codec Specific Configuration */ + l2_caps = new0(struct iovec, 1); + if (!util_iov_pull_u8(&iov, (void *)&l2_caps->iov_len)) { + ret = false; + goto group_fail; + } - parse_base(base_io->iov_base, base_io->iov_len, bap_debug, - &presDelay, &numSubgroups, &numBis, - &codec, &ep->caps, &ep->metadata); + util_iov_memcpy(l2_caps, util_iov_pull_mem(&iov, + l2_caps->iov_len), + l2_caps->iov_len); - /* Update pac with BASE information */ - bt_bap_update_bcast_source(ep->rpac, &codec, ep->caps, ep->metadata); - ep->id = bt_bap_stream_config(ep->stream, &ep->qos, - ep->caps, NULL, NULL); - data->listen_io = io; + /* Print Codec Specific Configuration */ + util_debug(func, NULL, "CC len: %ld", l2_caps->iov_len); + util_ltv_foreach(l2_caps->iov_base, l2_caps->iov_len, NULL, + print_ltv, func); - bt_bap_stream_set_user_data(ep->stream, ep->path); + /* Read Metadata */ + meta = new0(struct iovec, 1); + if (!util_iov_pull_u8(&iov, (void *)&meta->iov_len)) { + ret = false; + goto group_fail; + } - fd = g_io_channel_unix_get_fd(io); + util_iov_memcpy(meta, + util_iov_pull_mem(&iov, meta->iov_len), + meta->iov_len); + + /* Print Metadata */ + util_debug(func, NULL, "Metadata len: %i", + (uint8_t)meta->iov_len); + util_hexdump(' ', meta->iov_base, meta->iov_len, func, NULL); + + /* Level 3 */ + for (; num_bis; num_bis--) { + uint8_t bis_index; + struct iovec *l3_caps; + struct iovec *merged_caps; + struct bt_bap_pac *matched_lpac; + char *path; + int err; + + if (!util_iov_pull_u8(&iov, &bis_index)) { + ret = false; + goto group_fail; + } - if (bt_bap_stream_set_io(ep->stream, fd)) { - bt_bap_stream_enable(ep->stream, true, NULL, NULL, NULL); - g_io_channel_set_close_on_unref(io, FALSE); - return; - } + util_debug(func, NULL, "BIS #%d", bis_index); + err = asprintf(&path, "%s/bis%d", + device_get_path(bap_data->device), + bis_index); + if (err < 0) + continue; + + /* Read Codec Specific Configuration */ + l3_caps = new0(struct iovec, 1); + if (!util_iov_pull_u8(&iov, + (void *)&l3_caps->iov_len)) { + free(l3_caps); + free(path); + ret = false; + goto group_fail; + } + util_iov_memcpy(l3_caps, + util_iov_pull_mem(&iov, + l3_caps->iov_len), + l3_caps->iov_len); + + /* Print Codec Specific Configuration */ + util_debug(func, NULL, "CC Len: %d", + (uint8_t)l3_caps->iov_len); + util_ltv_foreach(l3_caps->iov_base, + l3_caps->iov_len, NULL, print_ltv, + func); + + /* Check if this BIS matches any local PAC */ + bt_bap_verify_bis(bap_data->bap, bis_index, &codec, + l2_caps, l3_caps, &matched_lpac, + &merged_caps); + + if (matched_lpac == NULL || merged_caps == NULL) { + free(path); + continue; + } - return; + create_stream_for_bis(bap_data, matched_lpac, qos, + merged_caps, meta, path); + } -drop: - g_io_channel_shutdown(io, TRUE, NULL); +group_fail: + if (l2_caps != NULL) + free(l2_caps); + if (meta != NULL) + free(meta); + if (!ret) + break; + } + +fail: + if (!ret) + util_debug(func, NULL, "Unable to parse Base"); + return ret; } static void iso_pa_sync_confirm_cb(GIOChannel *io, void *user_data) { GError *err = NULL; + struct bap_bcast_pa_req *req = user_data; + struct bap_data *data = btd_service_get_user_data(req->data.service); + struct bt_iso_base base; + struct bt_iso_qos qos; - if (!bt_io_bcast_accept(io, iso_bcast_confirm_cb, - user_data, NULL, &err, BT_IO_OPT_INVALID)) { - error("bt_io_bcast_accept: %s", err->message); - g_error_free(err); - g_io_channel_shutdown(io, TRUE, NULL); - } + DBG("PA Sync done"); + bt_io_get(io, &err, + BT_IO_OPT_BASE, &base, + BT_IO_OPT_QOS, &qos, + BT_IO_OPT_INVALID); + if (err) { + error("%s", err->message); + g_error_free(err); + g_io_channel_shutdown(io, TRUE, NULL); + return; + } + + /* Close the io and remove the queue request for another PA Sync */ + g_io_channel_shutdown(data->listen_io, TRUE, NULL); + g_io_channel_unref(data->listen_io); + g_io_channel_shutdown(io, TRUE, NULL); + data->listen_io = NULL; + + /* Analyze received BASE data and create remote media endpoints for each + * BIS matching our capabilities + */ + parse_base(data, &base, &qos, bap_debug); + + service_set_connecting(req->data.service); + + queue_remove(data->adapter->bcast_pa_requests, req); + free(req); } static bool match_data_bap_data(const void *data, const void *match_data) @@ -1005,19 +1274,17 @@ { }, }; +static void ep_cancel_select(struct bap_ep *ep); + static void ep_free(void *data) { struct bap_ep *ep = data; + struct queue *setups = ep->setups; - if (ep->id) - bt_bap_stream_cancel(ep->stream, ep->id); - - bap_io_close(ep); + ep_cancel_select(ep); - util_iov_free(ep->caps, 1); - util_iov_free(ep->metadata, 1); - if (bt_bap_stream_get_type(ep->stream) == BT_BAP_STREAM_TYPE_BCAST) - util_iov_free(ep->qos.bcast.bcode, 1); + ep->setups = NULL; + queue_destroy(setups, setup_free); free(ep->path); free(ep); } @@ -1042,7 +1309,7 @@ struct bt_bap_pac *lpac, struct bt_bap_pac *rpac) { - struct btd_adapter *adapter = data->adapter; + struct btd_adapter *adapter = data->adapter->adapter; struct btd_device *device = data->device; struct bap_ep *ep; struct queue *queue; @@ -1077,12 +1344,10 @@ case BT_BAP_BCAST_SOURCE: err = asprintf(&ep->path, "%s/pac_%s%d", adapter_get_path(adapter), suffix, i); - ep->base = new0(struct iovec, 1); break; case BT_BAP_BCAST_SINK: err = asprintf(&ep->path, "%s/pac_%s%d", device_get_path(device), suffix, i); - ep->base = new0(struct iovec, 1); break; } @@ -1108,8 +1373,6 @@ */ if (rpac) bt_bap_pac_set_user_data(rpac, ep->path); - else - bt_bap_pac_set_user_data(lpac, ep->path); DBG("ep %p lpac %p rpac %p path %s", ep, ep->lpac, ep->rpac, ep->path); @@ -1118,6 +1381,31 @@ return ep; } +static void ep_update_properties(struct bap_ep *ep) +{ + if (!ep->rpac) + return; + + if (ep->locations != bt_bap_pac_get_locations(ep->rpac)) + g_dbus_emit_property_changed(btd_get_dbus_connection(), + ep->path, + MEDIA_ENDPOINT_INTERFACE, + "Locations"); + + if (ep->supported_context != + bt_bap_pac_get_supported_context(ep->rpac)) + g_dbus_emit_property_changed(btd_get_dbus_connection(), + ep->path, + MEDIA_ENDPOINT_INTERFACE, + "SupportedContext"); + + if (ep->context != bt_bap_pac_get_context(ep->rpac)) + g_dbus_emit_property_changed(btd_get_dbus_connection(), + ep->path, + MEDIA_ENDPOINT_INTERFACE, + "Context"); +} + static struct bap_ep *ep_register(struct btd_service *service, struct bt_bap_pac *lpac, struct bt_bap_pac *rpac) @@ -1146,8 +1434,10 @@ } ep = queue_find(queue, match_ep, &match); - if (ep) + if (ep) { + ep_update_properties(ep); return ep; + } ep = new0(struct bap_ep, 1); ep->data = data; @@ -1181,33 +1471,38 @@ return ep; } -static void bap_config(void *data, void *user_data) +static void setup_config(void *data, void *user_data) { - struct bap_ep *ep = data; + struct bap_setup *setup = data; + struct bap_ep *ep = setup->ep; - DBG("ep %p caps %p metadata %p", ep, ep->caps, ep->metadata); - - if (!ep->caps) - return; + DBG("setup %p caps %p metadata %p", setup, setup->caps, + setup->metadata); /* TODO: Check if stream capabilities match add support for Latency * and PHY. */ - if (!ep->stream) - ep->stream = bt_bap_stream_new(ep->data->bap, ep->lpac, - ep->rpac, &ep->qos, ep->caps); - - ep->id = bt_bap_stream_config(ep->stream, &ep->qos, ep->caps, - config_cb, ep); - if (!ep->id) { + if (!setup->stream) + setup->stream = bt_bap_stream_new(ep->data->bap, ep->lpac, + ep->rpac, &setup->qos, + setup->caps); + + setup->id = bt_bap_stream_config(setup->stream, &setup->qos, + setup->caps, config_cb, setup); + if (!setup->id) { DBG("Unable to config stream"); - util_iov_free(ep->caps, 1); - ep->caps = NULL; - util_iov_free(ep->metadata, 1); - ep->metadata = NULL; + setup_free(setup); + return; } - bt_bap_stream_set_user_data(ep->stream, ep->path); + bt_bap_stream_set_user_data(setup->stream, ep->path); +} + +static void bap_config(void *data, void *user_data) +{ + struct bap_ep *ep = data; + + queue_foreach(ep->setups, setup_config, NULL); } static void select_cb(struct bt_bap_pac *pac, int err, struct iovec *caps, @@ -1215,6 +1510,7 @@ void *user_data) { struct bap_ep *ep = user_data; + struct bap_setup *setup; if (err) { error("err %d", err); @@ -1222,15 +1518,10 @@ goto done; } - util_iov_free(ep->caps, 1); - ep->caps = util_iov_dup(caps, 1); - - if (metadata && metadata->iov_base && metadata->iov_len) { - ep->metadata = util_iov_dup(metadata, 1); - bt_bap_stream_metadata(ep->stream, ep->metadata, NULL, NULL); - } - - ep->qos = *qos; + setup = setup_new(ep); + setup->caps = util_iov_dup(caps, 1); + setup->metadata = util_iov_dup(metadata, 1); + setup->qos = *qos; DBG("selecting %d", ep->data->selecting); ep->data->selecting--; @@ -1244,7 +1535,7 @@ queue_foreach(ep->data->bcast, bap_config, NULL); } -static bool pac_found(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, +static bool pac_register(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, void *user_data) { struct btd_service *service = user_data; @@ -1253,23 +1544,67 @@ DBG("lpac %p rpac %p", lpac, rpac); ep = ep_register(service, lpac, rpac); - if (!ep) { + if (!ep) error("Unable to register endpoint for pac %p", rpac); + + return true; +} + +static bool pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, + void *user_data) +{ + struct btd_service *service = user_data; + struct bap_data *data = btd_service_get_user_data(service); + struct match_ep match = { lpac, rpac }; + struct queue *queue; + struct bap_ep *ep; + + switch (bt_bap_pac_get_type(rpac)) { + case BT_BAP_SINK: + queue = data->snks; + break; + case BT_BAP_SOURCE: + queue = data->srcs; + break; + default: return true; } - /* TODO: Cache LRU? */ - if (btd_service_is_initiator(service)) { - if (!bt_bap_select(lpac, rpac, select_cb, ep)) - ep->data->selecting++; + ep = queue_find(queue, match_ep, &match); + if (!ep) { + error("Unable to find endpoint for pac %p", rpac); + return true; } + /* TODO: Cache LRU? */ + if (btd_service_is_initiator(service)) + bt_bap_select(lpac, rpac, &ep->data->selecting, select_cb, ep); + return true; } +static bool pac_cancel_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, + void *user_data) +{ + struct bap_ep *ep = user_data; + + bt_bap_cancel_select(lpac, select_cb, ep); + + return true; +} + +static void ep_cancel_select(struct bap_ep *ep) +{ + struct bt_bap *bap = ep->data->bap; + + bt_bap_foreach_pac(bap, BT_BAP_SOURCE, pac_cancel_select, ep); + bt_bap_foreach_pac(bap, BT_BAP_SINK, pac_cancel_select, ep); +} + static bool pac_found_bcast(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, void *user_data) { + struct bap_data *data = user_data; struct bap_ep *ep; DBG("lpac %p rpac %p", lpac, rpac); @@ -1280,6 +1615,10 @@ return true; } + /* Mark the device as connetable if an Endpoint is registered */ + if (data->device) + btd_device_set_connectable(data->device, true); + return true; } @@ -1289,35 +1628,56 @@ DBG("bap %p", bap); - bt_bap_foreach_pac(bap, BT_BAP_SOURCE, pac_found, service); - bt_bap_foreach_pac(bap, BT_BAP_SINK, pac_found, service); + /* Register all ep before selecting, so that sound server + * knows all. + */ + bt_bap_foreach_pac(bap, BT_BAP_SOURCE, pac_register, service); + bt_bap_foreach_pac(bap, BT_BAP_SINK, pac_register, service); + + bt_bap_foreach_pac(bap, BT_BAP_SOURCE, pac_select, service); + bt_bap_foreach_pac(bap, BT_BAP_SINK, pac_select, service); } -static bool match_ep_by_stream(const void *data, const void *user_data) +static bool match_setup_stream(const void *data, const void *user_data) +{ + const struct bap_setup *setup = data; + const struct bt_bap_stream *stream = user_data; + + return setup->stream == stream; +} + +static bool match_ep_stream(const void *data, const void *user_data) { const struct bap_ep *ep = data; const struct bt_bap_stream *stream = user_data; - return ep->stream == stream; + return queue_find(ep->setups, match_setup_stream, stream); } -static struct bap_ep *bap_find_ep_by_stream(struct bap_data *data, +static struct bap_setup *bap_find_setup_by_stream(struct bap_data *data, struct bt_bap_stream *stream) { - struct bap_ep *ep; + struct bap_ep *ep = NULL; + struct queue *queue = NULL; switch (bt_bap_stream_get_type(stream)) { case BT_BAP_STREAM_TYPE_UCAST: - ep = queue_find(data->snks, match_ep_by_stream, stream); - if (ep) - return ep; + ep = queue_find(data->snks, match_ep_stream, stream); + if (!ep) + ep = queue_find(data->srcs, match_ep_stream, stream); - return queue_find(data->srcs, match_ep_by_stream, stream); + break; case BT_BAP_STREAM_TYPE_BCAST: - return queue_find(data->bcast, match_ep_by_stream, stream); + ep = queue_find(data->bcast, match_ep_stream, stream); + break; } - return NULL; + if (ep) + queue = ep->setups; + else + queue = data->bcast_snks; + + return queue_find(queue, match_setup_stream, stream); } static void iso_connect_bcast_cb(GIOChannel *chan, GError *err, @@ -1435,8 +1795,9 @@ g_io_channel_shutdown(io, TRUE, NULL); } -static void bap_accept_io(struct bap_ep *ep, struct bt_bap_stream *stream, - int fd, int defer) +static void setup_accept_io(struct bap_setup *setup, + struct bt_bap_stream *stream, + int fd, int defer) { char c; struct pollfd pfd; @@ -1472,7 +1833,7 @@ } } - ep->cig_active = true; + setup->cig_active = true; return; @@ -1485,12 +1846,20 @@ uint8_t cig; }; +static bool match_cig_active(const void *data, const void *match_data) +{ + const struct bap_setup *setup = data; + const struct cig_busy_data *info = match_data; + + return (setup->qos.ucast.cig_id == info->cig) && setup->cig_active; +} + static bool cig_busy_ep(const void *data, const void *match_data) { const struct bap_ep *ep = data; const struct cig_busy_data *info = match_data; - return (ep->qos.ucast.cig_id == info->cig) && ep->cig_active; + return queue_find(ep->setups, match_cig_active, info); } static bool cig_busy_session(const void *data, const void *match_data) @@ -1518,32 +1887,40 @@ return queue_find(sessions, cig_busy_session, &info); } -static void bap_create_io(struct bap_data *data, struct bap_ep *ep, +static void setup_create_io(struct bap_data *data, struct bap_setup *setup, struct bt_bap_stream *stream, int defer); -static gboolean bap_io_recreate(void *user_data) +static gboolean setup_io_recreate(void *user_data) { - struct bap_ep *ep = user_data; + struct bap_setup *setup = user_data; - DBG("ep %p", ep); + DBG("%p", setup); - ep->io_id = 0; + setup->io_id = 0; - bap_create_io(ep->data, ep, ep->stream, true); + setup_create_io(setup->ep->data, setup, setup->stream, true); return FALSE; } -static void recreate_cig_ep(void *data, void *match_data) +static void setup_recreate(void *data, void *match_data) { - struct bap_ep *ep = (struct bap_ep *)data; + struct bap_setup *setup = data; struct cig_busy_data *info = match_data; - if (ep->qos.ucast.cig_id != info->cig || !ep->recreate || ep->io_id) + if (setup->qos.ucast.cig_id != info->cig || !setup->recreate || + setup->io_id) return; - ep->recreate = false; - ep->io_id = g_idle_add(bap_io_recreate, ep); + setup->recreate = false; + setup->io_id = g_idle_add(setup_io_recreate, setup); +} + +static void recreate_cig_ep(void *data, void *match_data) +{ + struct bap_ep *ep = data; + + queue_foreach(ep->setups, setup_recreate, match_data); } static void recreate_cig_session(void *data, void *match_data) @@ -1558,38 +1935,39 @@ queue_foreach(session->srcs, recreate_cig_ep, match_data); } -static void recreate_cig(struct bap_ep *ep) +static void recreate_cig(struct bap_setup *setup) { - struct bap_data *data = ep->data; + struct bap_data *data = setup->ep->data; struct cig_busy_data info; info.adapter = device_get_adapter(data->device); - info.cig = ep->qos.ucast.cig_id; + info.cig = setup->qos.ucast.cig_id; - DBG("adapter %p ep %p recreate CIG %d", info.adapter, ep, info.cig); + DBG("adapter %p setup %p recreate CIG %d", info.adapter, setup, + info.cig); - if (ep->qos.ucast.cig_id == BT_ISO_QOS_CIG_UNSET) { - recreate_cig_ep(ep, &info); + if (setup->qos.ucast.cig_id == BT_ISO_QOS_CIG_UNSET) { + recreate_cig_ep(setup->ep, &info); return; } queue_foreach(sessions, recreate_cig_session, &info); } -static gboolean bap_io_disconnected(GIOChannel *io, GIOCondition cond, +static gboolean setup_io_disconnected(GIOChannel *io, GIOCondition cond, gpointer user_data) { - struct bap_ep *ep = user_data; + struct bap_setup *setup = user_data; - DBG("ep %p recreate %s", ep, ep->recreate ? "true" : "false"); + DBG("%p recreate %s", setup, setup->recreate ? "true" : "false"); - ep->io_id = 0; + setup->io_id = 0; - bap_io_close(ep); + setup_io_close(setup, NULL); /* Check if connecting recreate IO */ - if (!is_cig_busy(ep->data, ep->qos.ucast.cig_id)) - recreate_cig(ep); + if (!is_cig_busy(setup->ep->data, setup->qos.ucast.cig_id)) + recreate_cig(setup); return FALSE; } @@ -1597,25 +1975,25 @@ static void bap_connect_bcast_io_cb(GIOChannel *chan, GError *err, gpointer user_data) { - struct bap_ep *ep = user_data; + struct bap_setup *setup = user_data; - if (!ep->stream) + if (!setup->stream) return; - iso_connect_bcast_cb(chan, err, ep->stream); + iso_connect_bcast_cb(chan, err, setup->stream); } static void bap_connect_io_cb(GIOChannel *chan, GError *err, gpointer user_data) { - struct bap_ep *ep = user_data; + struct bap_setup *setup = user_data; - if (!ep->stream) + if (!setup->stream) return; - iso_connect_cb(chan, err, ep->stream); + iso_connect_cb(chan, err, setup->stream); } -static void bap_connect_io(struct bap_data *data, struct bap_ep *ep, +static void setup_connect_io(struct bap_data *data, struct bap_setup *setup, struct bt_bap_stream *stream, struct bt_iso_qos *qos, int defer) { @@ -1626,39 +2004,42 @@ /* If IO already set skip creating it again */ if (bt_bap_stream_get_io(stream)) { - DBG("ep %p stream %p has existing io", ep, stream); + DBG("setup %p stream %p has existing io", setup, stream); return; } if (bt_bap_stream_io_is_connecting(stream, &fd)) { - bap_accept_io(ep, stream, fd, defer); + setup_accept_io(setup, stream, fd, defer); return; } /* If IO channel still up or CIG is busy, wait for it to be * disconnected and then recreate. */ - if (ep->io || is_cig_busy(data, ep->qos.ucast.cig_id)) { - DBG("ep %p stream %p defer %s wait recreate", ep, stream, + if (setup->io || is_cig_busy(data, setup->qos.ucast.cig_id)) { + DBG("setup %p stream %p defer %s wait recreate", setup, stream, defer ? "true" : "false"); - ep->recreate = true; + setup->recreate = true; return; } - if (ep->io_id) { - g_source_remove(ep->io_id); - ep->io_id = 0; + if (setup->io_id) { + g_source_remove(setup->io_id); + setup->io_id = 0; } - DBG("ep %p stream %p defer %s", ep, stream, defer ? "true" : "false"); + DBG("setup %p stream %p defer %s", setup, stream, + defer ? "true" : "false"); - io = bt_io_connect(bap_connect_io_cb, ep, NULL, &err, + io = bt_io_connect(bap_connect_io_cb, setup, NULL, &err, BT_IO_OPT_SOURCE_BDADDR, btd_adapter_get_address(adapter), + BT_IO_OPT_SOURCE_TYPE, + btd_adapter_get_address_type(adapter), BT_IO_OPT_DEST_BDADDR, - device_get_address(ep->data->device), + device_get_address(data->device), BT_IO_OPT_DEST_TYPE, - device_get_le_address_type(ep->data->device), + device_get_le_address_type(data->device), BT_IO_OPT_MODE, BT_IO_MODE_ISO, BT_IO_OPT_QOS, qos, BT_IO_OPT_DEFER_TIMEOUT, defer, @@ -1669,18 +2050,19 @@ return; } - ep->io_id = g_io_add_watch(io, G_IO_HUP | G_IO_ERR | G_IO_NVAL, - bap_io_disconnected, ep); + setup->io_id = g_io_add_watch(io, G_IO_HUP | G_IO_ERR | G_IO_NVAL, + setup_io_disconnected, setup); - ep->io = io; - ep->cig_active = !defer; + setup->io = io; + setup->cig_active = !defer; bt_bap_stream_io_connecting(stream, g_io_channel_unix_get_fd(io)); } -static void bap_connect_io_broadcast(struct bap_data *data, struct bap_ep *ep, - struct bt_bap_stream *stream, - struct bt_iso_qos *qos) +static void setup_connect_io_broadcast(struct bap_data *data, + struct bap_setup *setup, + struct bt_bap_stream *stream, + struct bt_iso_qos *qos, int defer) { struct btd_adapter *adapter = data->user_data; GIOChannel *io = NULL; @@ -1695,20 +2077,23 @@ if (bt_bap_stream_get_io(stream)) return; - if (ep->io_id) { - g_source_remove(ep->io_id); - ep->io_id = 0; + if (setup->io_id) { + g_source_remove(setup->io_id); + setup->io_id = 0; } - base.base_len = ep->base->iov_len; + base.base_len = setup->base->iov_len; memset(base.base, 0, 248); - memcpy(base.base, ep->base->iov_base, ep->base->iov_len); - DBG("ep %p stream %p ", ep, stream); + memcpy(base.base, setup->base->iov_base, setup->base->iov_len); ba2str(btd_adapter_get_address(adapter), addr); - io = bt_io_connect(bap_connect_bcast_io_cb, ep, NULL, &err, + DBG("setup %p stream %p", setup, stream); + + io = bt_io_connect(bap_connect_bcast_io_cb, setup, NULL, &err, BT_IO_OPT_SOURCE_BDADDR, btd_adapter_get_address(adapter), + BT_IO_OPT_SOURCE_TYPE, + btd_adapter_get_address_type(adapter), BT_IO_OPT_DEST_BDADDR, &dst_addr, BT_IO_OPT_DEST_TYPE, @@ -1716,7 +2101,7 @@ BT_IO_OPT_MODE, BT_IO_MODE_ISO, BT_IO_OPT_QOS, qos, BT_IO_OPT_BASE, &base, - BT_IO_OPT_DEFER_TIMEOUT, false, + BT_IO_OPT_DEFER_TIMEOUT, defer, BT_IO_OPT_INVALID); if (!io) { @@ -1725,15 +2110,15 @@ return; } - ep->io_id = g_io_add_watch(io, G_IO_HUP | G_IO_ERR | G_IO_NVAL, - bap_io_disconnected, ep); + setup->io_id = g_io_add_watch(io, G_IO_HUP | G_IO_ERR | G_IO_NVAL, + setup_io_disconnected, setup); - ep->io = io; + setup->io = io; bt_bap_stream_io_connecting(stream, g_io_channel_unix_get_fd(io)); } -static void bap_listen_io(struct bap_data *data, struct bt_bap_stream *stream, +static void setup_listen_io(struct bap_data *data, struct bt_bap_stream *stream, struct bt_iso_qos *qos) { struct btd_adapter *adapter = device_get_adapter(data->device); @@ -1749,6 +2134,8 @@ io = bt_io_listen(NULL, iso_confirm_cb, data, NULL, &err, BT_IO_OPT_SOURCE_BDADDR, btd_adapter_get_address(adapter), + BT_IO_OPT_SOURCE_TYPE, + btd_adapter_get_address_type(adapter), BT_IO_OPT_DEST_BDADDR, BDADDR_ANY, BT_IO_OPT_DEST_TYPE, @@ -1765,47 +2152,81 @@ data->listen_io = io; } -static void bap_listen_io_broadcast(struct bap_data *data, struct bap_ep *ep, - struct bt_bap_stream *stream, struct bt_iso_qos *qos) +static void check_pa_req_in_progress(void *data, void *user_data) { - GIOChannel *io; - GError *err = NULL; - struct sockaddr_iso_bc iso_bc_addr; + struct bap_bcast_pa_req *req = data; - iso_bc_addr.bc_bdaddr_type = btd_device_get_bdaddr_type(data->device); - memcpy(&iso_bc_addr.bc_bdaddr, device_get_address(data->device), - sizeof(bdaddr_t)); - iso_bc_addr.bc_bis0 = 1; - iso_bc_addr.bc_num_bis = 1; + if (req->in_progress == TRUE) + *((bool *)user_data) = TRUE; +} - DBG("stream %p", stream); +static int short_lived_pa_sync(struct bap_bcast_pa_req *req); +static void pa_and_big_sync(struct bap_bcast_pa_req *req); - /* If IO already set skip creating it again */ - if (bt_bap_stream_get_io(stream) || data->listen_io) - return; +static gboolean pa_idle_timer(gpointer user_data) +{ + struct bap_adapter *adapter = user_data; + struct bap_bcast_pa_req *req; + bool in_progress = FALSE; - io = bt_io_listen(NULL, iso_pa_sync_confirm_cb, ep->data, NULL, &err, - BT_IO_OPT_SOURCE_BDADDR, - btd_adapter_get_address(ep->data->adapter), - BT_IO_OPT_DEST_BDADDR, - device_get_address(data->device), - BT_IO_OPT_DEST_TYPE, - btd_device_get_bdaddr_type(data->device), - BT_IO_OPT_MODE, BT_IO_MODE_ISO, - BT_IO_OPT_QOS, &qos->bcast, - BT_IO_OPT_ISO_BC_NUM_BIS, iso_bc_addr.bc_num_bis, - BT_IO_OPT_ISO_BC_BIS, iso_bc_addr.bc_bis, - BT_IO_OPT_INVALID); - if (!io) { - error("%s", err->message); - g_error_free(err); + /* Handle timer if no request is in progress */ + queue_foreach(adapter->bcast_pa_requests, check_pa_req_in_progress, + &in_progress); + if (in_progress == FALSE) { + req = queue_peek_head(adapter->bcast_pa_requests); + if (req != NULL) + switch (req->type) { + case BAP_PA_SHORT_REQ: + DBG("do short lived PA Sync"); + short_lived_pa_sync(req); + break; + case BAP_PA_BIG_SYNC_REQ: + DBG("do PA Sync and BIG Sync"); + pa_and_big_sync(req); + break; + } + else { + /* pa_req queue is empty, stop the timer by returning + * FALSE and set the pa_timer_id to 0. This will later + * be used to check if the timer is active. + */ + adapter->pa_timer_id = 0; + return FALSE; + } } - ep->io = io; - ep->data->listen_io = io; + return TRUE; } -static void bap_create_ucast_io(struct bap_data *data, struct bap_ep *ep, - struct bt_bap_stream *stream, int defer) + +static void setup_accept_io_broadcast(struct bap_data *data, + struct bap_setup *setup) +{ + struct bap_bcast_pa_req *req = new0(struct bap_bcast_pa_req, 1); + struct bap_adapter *adapter = data->adapter; + + /* Timer could be stopped if all the short lived requests were treated. + * Check the state of the timer and turn it on so that this requests + * can also be treated. + */ + if (adapter->pa_timer_id == 0) + adapter->pa_timer_id = g_timeout_add_seconds(PA_IDLE_TIMEOUT, + pa_idle_timer, + adapter); + + /* Add this request to the PA queue. + * We don't need to check the queue here, as we cannot have + * BAP_PA_BIG_SYNC_REQ before a short PA (BAP_PA_SHORT_REQ) + */ + req->type = BAP_PA_BIG_SYNC_REQ; + req->in_progress = FALSE; + req->data.setup = setup; + queue_push_tail(adapter->bcast_pa_requests, req); +} + +static void setup_create_ucast_io(struct bap_data *data, + struct bap_setup *setup, + struct bt_bap_stream *stream, + int defer) { struct bt_bap_qos *qos2 = {}; struct bt_iso_qos iso_qos; @@ -1825,49 +2246,51 @@ bap_iso_qos(qos0, &iso_qos.ucast.in); bap_iso_qos(qos1, &iso_qos.ucast.out); - if (ep) - bap_connect_io(data, ep, stream, &iso_qos, defer); + if (setup) + setup_connect_io(data, setup, stream, &iso_qos, defer); else - bap_listen_io(data, stream, &iso_qos); + setup_listen_io(data, stream, &iso_qos); } -static void bap_create_bcast_io(struct bap_data *data, struct bap_ep *ep, - struct bt_bap_stream *stream, int defer) +static void setup_create_bcast_io(struct bap_data *data, + struct bap_setup *setup, + struct bt_bap_stream *stream, int defer) { + struct bt_bap_qos *qos = &setup->qos; + struct iovec *bcode = qos->bcast.bcode; struct bt_iso_qos iso_qos; memset(&iso_qos, 0, sizeof(iso_qos)); - if (!defer) - goto done; - - iso_qos.bcast.big = ep->qos.bcast.big; - iso_qos.bcast.bis = ep->qos.bcast.bis; - iso_qos.bcast.sync_factor = ep->qos.bcast.sync_factor; - iso_qos.bcast.packing = ep->qos.bcast.packing; - iso_qos.bcast.framing = ep->qos.bcast.framing; - iso_qos.bcast.encryption = ep->qos.bcast.encryption; - if (ep->qos.bcast.bcode) - memcpy(iso_qos.bcast.bcode, ep->qos.bcast.bcode->iov_base, 16); - iso_qos.bcast.options = ep->qos.bcast.options; - iso_qos.bcast.skip = ep->qos.bcast.skip; - iso_qos.bcast.sync_timeout = ep->qos.bcast.sync_timeout; - iso_qos.bcast.sync_cte_type = ep->qos.bcast.sync_cte_type; - iso_qos.bcast.mse = ep->qos.bcast.mse; - iso_qos.bcast.timeout = ep->qos.bcast.timeout; - memcpy(&iso_qos.bcast.out, &ep->qos.bcast.io_qos, + iso_qos.bcast.big = setup->qos.bcast.big; + iso_qos.bcast.bis = setup->qos.bcast.bis; + iso_qos.bcast.sync_factor = setup->qos.bcast.sync_factor; + iso_qos.bcast.packing = setup->qos.bcast.packing; + iso_qos.bcast.framing = setup->qos.bcast.framing; + iso_qos.bcast.encryption = setup->qos.bcast.encryption; + if (bcode && bcode->iov_base) + memcpy(iso_qos.bcast.bcode, bcode->iov_base, bcode->iov_len); + iso_qos.bcast.options = setup->qos.bcast.options; + iso_qos.bcast.skip = setup->qos.bcast.skip; + iso_qos.bcast.sync_timeout = setup->qos.bcast.sync_timeout; + iso_qos.bcast.sync_cte_type = setup->qos.bcast.sync_cte_type; + iso_qos.bcast.mse = setup->qos.bcast.mse; + iso_qos.bcast.timeout = setup->qos.bcast.timeout; + memcpy(&iso_qos.bcast.out, &setup->qos.bcast.io_qos, sizeof(struct bt_iso_io_qos)); -done: - if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SOURCE) - bap_connect_io_broadcast(data, ep, stream, &iso_qos); + + if (bt_bap_stream_get_dir(stream) == BT_BAP_BCAST_SINK) + setup_connect_io_broadcast(data, setup, stream, &iso_qos, + defer); else - bap_listen_io_broadcast(data, ep, stream, &iso_qos); + setup_accept_io_broadcast(data, setup); } -static void bap_create_io(struct bap_data *data, struct bap_ep *ep, +static void setup_create_io(struct bap_data *data, struct bap_setup *setup, struct bt_bap_stream *stream, int defer) { - DBG("ep %p stream %p defer %s", ep, stream, defer ? "true" : "false"); + DBG("setup %p stream %p defer %s", setup, stream, + defer ? "true" : "false"); if (!data->streams) data->streams = queue_new(); @@ -1877,10 +2300,10 @@ switch (bt_bap_stream_get_type(stream)) { case BT_BAP_STREAM_TYPE_UCAST: - bap_create_ucast_io(data, ep, stream, defer); + setup_create_ucast_io(data, setup, stream, defer); break; case BT_BAP_STREAM_TYPE_BCAST: - bap_create_bcast_io(data, ep, stream, defer); + setup_create_bcast_io(data, setup, stream, defer); break; } } @@ -1889,7 +2312,7 @@ uint8_t new_state, void *user_data) { struct bap_data *data = user_data; - struct bap_ep *ep; + struct bap_setup *setup; DBG("stream %p: %s(%u) -> %s(%u)", stream, bt_bap_stream_statestr(old_state), old_state, @@ -1902,21 +2325,20 @@ if (new_state == old_state && new_state != BT_BAP_STREAM_STATE_CONFIG) return; - ep = bap_find_ep_by_stream(data, stream); + setup = bap_find_setup_by_stream(data, stream); switch (new_state) { case BT_BAP_STREAM_STATE_IDLE: /* Release stream if idle */ - if (ep) { - bap_io_close(ep); - ep->stream = NULL; - } else + if (setup) + setup_free(setup); + else queue_remove(data->streams, stream); break; case BT_BAP_STREAM_STATE_CONFIG: - if (ep && !ep->id) { - bap_create_io(data, ep, stream, true); - if (!ep->io) { + if (setup && !setup->id) { + setup_create_io(data, setup, stream, true); + if (!setup->io) { error("Unable to create io"); if (old_state != BT_BAP_STREAM_STATE_RELEASING) bt_bap_stream_release(stream, NULL, @@ -1924,34 +2346,283 @@ return; } - if (bt_bap_stream_get_type(stream) == - BT_BAP_STREAM_TYPE_UCAST) { - /* Wait QoS response to respond */ - ep->id = bt_bap_stream_qos(stream, &ep->qos, - qos_cb, ep); - if (!ep->id) { - error("Failed to Configure QoS"); - bt_bap_stream_release(stream, - NULL, NULL); - } + /* Wait QoS response to respond */ + setup->id = bt_bap_stream_qos(stream, + &setup->qos, + qos_cb, setup); + if (!setup->id) { + error("Failed to Configure QoS"); + bt_bap_stream_release(stream, + NULL, NULL); } } break; case BT_BAP_STREAM_STATE_QOS: - if (bt_bap_stream_get_type(stream) == - BT_BAP_STREAM_TYPE_UCAST) { - bap_create_io(data, ep, stream, true); - } + setup_create_io(data, setup, stream, true); break; case BT_BAP_STREAM_STATE_ENABLING: - if (ep) - bap_create_io(data, ep, stream, false); + if (setup) + setup_create_io(data, setup, stream, false); break; case BT_BAP_STREAM_STATE_STREAMING: break; } } +/* This function will call setup_create_io on all BISes from a BIG. + * The defer parameter will be set on true on all but the last one. + * This is done to inform the kernel when to when to start the BIG. + */ +static bool create_io_bises(struct bap_setup *setup, + uint8_t nb_bises, struct bap_data *data) +{ + const struct queue_entry *entry; + struct bap_setup *ent_setup; + bool defer = true; + uint8_t active_bis_cnt = 1; + + for (entry = queue_get_entries(setup->ep->setups); + entry; entry = entry->next) { + ent_setup = entry->data; + + if (bt_bap_stream_get_qos(ent_setup->stream)->bcast.big != + bt_bap_stream_get_qos(setup->stream)->bcast.big) + continue; + + if (active_bis_cnt == nb_bises) + defer = false; + + setup_create_io(data, ent_setup, ent_setup->stream, defer); + if (!ent_setup->io) { + error("Unable to create io"); + goto fail; + } + + active_bis_cnt++; + } + + return true; + +fail: + /* Clear the io of the created sockets if one + * socket creation fails. + */ + for (entry = queue_get_entries(setup->ep->setups); + entry; entry = entry->next) { + ent_setup = entry->data; + + if (bt_bap_stream_get_qos(ent_setup->stream)->bcast.big != + bt_bap_stream_get_qos(setup->stream)->bcast.big) + continue; + + if (setup->io) + g_io_channel_unref(setup->io); + } + return false; +} + +static void iterate_setup_update_base(void *data, void *user_data) +{ + struct bap_setup *setup = data; + struct bap_setup *data_setup = user_data; + + if ((setup->stream != data_setup->stream) && + (setup->qos.bcast.big == data_setup->qos.bcast.big)) { + + if (setup->base) + util_iov_free(setup->base, 1); + + setup->base = util_iov_dup(data_setup->base, 1); + } +} + +/* Function checks the state of all streams in the same BIG + * as the parameter stream, so it can decide if any sockets need + * to be created. Returns he number of streams that need a socket + * from that BIG. + */ +static uint8_t get_streams_nb_by_state(struct bap_setup *setup) +{ + const struct queue_entry *entry; + struct bap_setup *ent_setup; + uint8_t stream_cnt = 0; + + if (setup->qos.bcast.big == BT_ISO_QOS_BIG_UNSET) + /* If BIG ID is unset this is a single BIS BIG. + * return 1 as create one socket only for this BIS + */ + return 1; + + for (entry = queue_get_entries(setup->ep->setups); + entry; entry = entry->next) { + ent_setup = entry->data; + + /* Skip the curent stream form testing */ + if (ent_setup == setup) { + stream_cnt++; + continue; + } + + /* Test only BISes for the same BIG */ + if (bt_bap_stream_get_qos(ent_setup->stream)->bcast.big != + bt_bap_stream_get_qos(setup->stream)->bcast.big) + continue; + + if (bt_bap_stream_get_state(ent_setup->stream) == + BT_BAP_STREAM_STATE_STREAMING) + /* If one stream in a multiple BIS BIG is in + * streaming state this means that just the current + * stream must have is socket created so return 1. + */ + return 1; + else if (bt_bap_stream_get_state(ent_setup->stream) != + BT_BAP_STREAM_STATE_ENABLING) + /* Not all streams form a BIG have received transport + * acquire, so wait for the other streams to. + */ + return 0; + + stream_cnt++; + } + + /* Return the number of streams for the BIG + * as all are ready to create sockets + */ + return stream_cnt; +} + +static void bap_state_bcast_src(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + struct bap_data *data = user_data; + struct bap_setup *setup; + bool defer = false; + uint8_t nb_bises = 0; + + DBG("stream %p: %s(%u) -> %s(%u)", stream, + bt_bap_stream_statestr(old_state), old_state, + bt_bap_stream_statestr(new_state), new_state); + + /* Ignore transitions back to same state */ + if (new_state == old_state) + return; + + setup = bap_find_setup_by_stream(data, stream); + + switch (new_state) { + case BT_BAP_STREAM_STATE_IDLE: + /* Release stream if idle */ + if (setup) + setup_free(setup); + else + queue_remove(data->streams, stream); + break; + case BT_BAP_STREAM_STATE_CONFIG: + // TO DO Reconfiguration + break; + /* Use the ENABLING state to know when a transport + * linked to a stream has been acquired by a process + * and in the case of a BIG with one BIS stream goes + * in the ENABLING state waiting for the response + * from the kernel that the BIG has been created + * so it can go to the streaming state. + * For the case of a BIG with multiple BISes, + * the BIG is created when all BISes are acquired. + * So we use the ENABLING state to verify that all + * transports attached to that streams form BIG have + * been acquired so we can create the BIG. + */ + case BT_BAP_STREAM_STATE_ENABLING: + /* If the stream attached to a broadcast + * source endpoint generate the base. + */ + if (setup->base == NULL) { + setup->base = bt_bap_stream_get_base( + setup->stream); + /* Set the generated BASE on all setups + * from the same BIG. + */ + queue_foreach(setup->ep->setups, + iterate_setup_update_base, setup); + } + /* The kernel has 2 requirements when handling + * multiple BIS connections for the same BIG: + * 1 - setup_create_io for all but the last BIS + * must be with defer true so we can inform the + * kernel when to start the BIG. + * 2 - The order in which the setup_create_io + * are called must be in the order of BIS + * indexes in BASE from first to last. + * To address this requirement we will call + * setup_create_io on all BISes only when all + * transport acquire have been received and will + * send it in the order of the BIS index + * from BASE. + */ + nb_bises = get_streams_nb_by_state(setup); + + if (nb_bises == 1) { + setup_create_io(data, setup, + stream, defer); + if (!setup->io) { + error("Unable to create io"); + if (old_state != + BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, + NULL, NULL); + } + break; + } else if (nb_bises == 0) + break; + + if (!create_io_bises(setup, nb_bises, data)) { + if (old_state != + BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, + NULL, NULL); + } + break; + } +} + +static void bap_state_bcast_sink(struct bt_bap_stream *stream, + uint8_t old_state, uint8_t new_state, + void *user_data) +{ + struct bap_data *data = user_data; + struct bap_setup *setup; + bool defer = false; + + DBG("stream %p: %s(%u) -> %s(%u)", stream, + bt_bap_stream_statestr(old_state), old_state, + bt_bap_stream_statestr(new_state), new_state); + + if (new_state == old_state && new_state != BT_BAP_STREAM_STATE_CONFIG) + return; + + setup = bap_find_setup_by_stream(data, stream); + + switch (new_state) { + case BT_BAP_STREAM_STATE_IDLE: + /* Release stream if idle */ + if (setup) + setup_free(setup); + else + queue_remove(data->streams, stream); + break; + case BT_BAP_STREAM_STATE_CONFIG: + if (!setup) + break; + if (old_state == + BT_BAP_STREAM_STATE_CONFIG) + setup_create_io(data, setup, stream, defer); + if (old_state == + BT_BAP_STREAM_STATE_STREAMING) + setup_io_close(setup, NULL); + break; + } +} + static void pac_added(struct bt_bap_pac *pac, void *user_data) { struct btd_service *service = user_data; @@ -1964,8 +2635,11 @@ data = btd_service_get_user_data(service); - bt_bap_foreach_pac(data->bap, BT_BAP_SOURCE, pac_found, service); - bt_bap_foreach_pac(data->bap, BT_BAP_SINK, pac_found, service); + bt_bap_foreach_pac(data->bap, BT_BAP_SOURCE, pac_register, service); + bt_bap_foreach_pac(data->bap, BT_BAP_SINK, pac_register, service); + + bt_bap_foreach_pac(data->bap, BT_BAP_SOURCE, pac_select, service); + bt_bap_foreach_pac(data->bap, BT_BAP_SINK, pac_select, service); } static void pac_added_broadcast(struct bt_bap_pac *pac, void *user_data) @@ -2028,15 +2702,12 @@ static void pac_removed_broadcast(struct bt_bap_pac *pac, void *user_data) { - struct btd_service *service = user_data; - struct bap_data *data; + struct bap_data *data = user_data; struct queue *queue; struct bap_ep *ep; DBG("pac %p", pac); - data = btd_service_get_user_data(service); - switch (bt_bap_pac_get_type(pac)) { case BT_BAP_SINK: queue = data->srcs; @@ -2117,67 +2788,93 @@ void *user_data) { struct bap_data *data = user_data; - struct bap_ep *ep; + struct bap_setup *setup; + struct bt_bap_qos *qos; GIOChannel *io; if (!state) return; - ep = bap_find_ep_by_stream(data, stream); - if (!ep) + setup = bap_find_setup_by_stream(data, stream); + if (!setup) return; - ep->recreate = false; + setup->recreate = false; + qos = &setup->qos; - if (!ep->io) { + if (!setup->io) { io = g_io_channel_unix_new(fd); - ep->io_id = g_io_add_watch(io, G_IO_HUP | G_IO_ERR | G_IO_NVAL, - bap_io_disconnected, ep); - ep->io = io; + setup->io_id = g_io_add_watch(io, + G_IO_HUP | G_IO_ERR | G_IO_NVAL, + setup_io_disconnected, setup); + setup->io = io; } else - io = ep->io; + io = setup->io; g_io_channel_set_close_on_unref(io, FALSE); - switch (bt_bap_stream_get_type(ep->stream)) { - case BT_BAP_STREAM_TYPE_UCAST: - /* Attempt to get CIG/CIS if they have not been set */ - if (ep->qos.ucast.cig_id == BT_ISO_QOS_CIG_UNSET || - ep->qos.ucast.cis_id == BT_ISO_QOS_CIS_UNSET) { - struct bt_iso_qos qos; - - if (!io_get_qos(io, &qos)) { - g_io_channel_unref(io); - return; - } + /* Attempt to get CIG/CIS if they have not been set */ + if (qos->ucast.cig_id == BT_ISO_QOS_CIG_UNSET || + qos->ucast.cis_id == BT_ISO_QOS_CIS_UNSET) { + struct bt_iso_qos iso_qos; - ep->qos.ucast.cig_id = qos.ucast.cig; - ep->qos.ucast.cis_id = qos.ucast.cis; + if (!io_get_qos(io, &iso_qos)) { + g_io_channel_unref(io); + return; } - DBG("stream %p fd %d: CIG 0x%02x CIS 0x%02x", stream, fd, - ep->qos.ucast.cig_id, ep->qos.ucast.cis_id); - break; - case BT_BAP_STREAM_TYPE_BCAST: - /* Attempt to get BIG/BIS if they have not been set */ - if (ep->qos.bcast.big == BT_ISO_QOS_BIG_UNSET || - ep->qos.bcast.bis == BT_ISO_QOS_BIS_UNSET) { - struct bt_iso_qos qos; + qos->ucast.cig_id = iso_qos.ucast.cig; + qos->ucast.cis_id = iso_qos.ucast.cis; + } - if (!io_get_qos(io, &qos)) { - g_io_channel_unref(io); - return; - } + DBG("stream %p fd %d: CIG 0x%02x CIS 0x%02x", stream, fd, + qos->ucast.cig_id, qos->ucast.cis_id); +} + +static void bap_connecting_bcast(struct bt_bap_stream *stream, bool state, + int fd, void *user_data) +{ + struct bap_data *data = user_data; + struct bap_setup *setup; + GIOChannel *io; + + if (!state) + return; - ep->qos.bcast.big = qos.bcast.big; - ep->qos.bcast.bis = qos.bcast.bis; - bt_bap_stream_config(ep->stream, &ep->qos, - ep->caps, NULL, NULL); + setup = bap_find_setup_by_stream(data, stream); + if (!setup) + return; + + setup->recreate = false; + + if (!setup->io) { + io = g_io_channel_unix_new(fd); + setup->io_id = g_io_add_watch(io, + G_IO_HUP | G_IO_ERR | G_IO_NVAL, + setup_io_disconnected, setup); + setup->io = io; + } else + io = setup->io; + + g_io_channel_set_close_on_unref(io, FALSE); + + /* Attempt to get BIG/BIS if they have not been set */ + if (setup->qos.bcast.big == BT_ISO_QOS_BIG_UNSET || + setup->qos.bcast.bis == BT_ISO_QOS_BIS_UNSET) { + struct bt_iso_qos iso_qos; + + if (!io_get_qos(io, &iso_qos)) { + g_io_channel_unref(io); + return; } - DBG("stream %p fd %d: BIG 0x%02x BIS 0x%02x", stream, fd, - ep->qos.bcast.big, ep->qos.bcast.bis); + setup->qos.bcast.big = iso_qos.bcast.big; + setup->qos.bcast.bis = iso_qos.bcast.bis; + bt_bap_stream_qos(setup->stream, &setup->qos, NULL, NULL); } + + DBG("stream %p fd %d: BIG 0x%02x BIS 0x%02x", stream, fd, + setup->qos.bcast.big, setup->qos.bcast.bis); } static void bap_attached(struct bt_bap *bap, void *user_data) @@ -2232,32 +2929,182 @@ bap_data_remove(data); } +static int short_lived_pa_sync(struct bap_bcast_pa_req *req) +{ + struct btd_service *service = req->data.service; + struct bap_data *data = btd_service_get_user_data(service); + GError *err = NULL; + + if (data->listen_io) { + DBG("Already probed"); + return -1; + } + + DBG("Create PA sync with this source"); + req->in_progress = TRUE; + data->listen_io = bt_io_listen(NULL, iso_pa_sync_confirm_cb, req, + NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, + btd_adapter_get_address(data->adapter->adapter), + BT_IO_OPT_SOURCE_TYPE, + btd_adapter_get_address_type(data->adapter->adapter), + BT_IO_OPT_DEST_BDADDR, + device_get_address(data->device), + BT_IO_OPT_DEST_TYPE, + btd_device_get_bdaddr_type(data->device), + BT_IO_OPT_MODE, BT_IO_MODE_ISO, + BT_IO_OPT_QOS, &bap_sink_pa_qos, + BT_IO_OPT_INVALID); + if (!data->listen_io) { + error("%s", err->message); + g_error_free(err); + } + + return 0; +} + +static void iso_do_big_sync(GIOChannel *io, void *user_data) +{ + GError *err = NULL; + struct bap_bcast_pa_req *req = user_data; + struct bap_setup *setup = req->data.setup; + struct bt_bap *bt_bap = bt_bap_stream_get_session(setup->stream); + struct btd_service *btd_service = bt_bap_get_user_data(bt_bap); + struct bap_data *data = btd_service_get_user_data(btd_service); + struct sockaddr_iso_bc iso_bc_addr; + struct bt_iso_qos qos; + char *path; + int bis_index = 1; + int s_err; + const char *strbis = NULL; + + DBG("PA Sync done"); + g_io_channel_unref(setup->io); + g_io_channel_shutdown(setup->io, TRUE, NULL); + setup->io = io; + g_io_channel_ref(setup->io); + + /* TODO + * We can only synchronize with a single BIS to a BIG. + * In order to have multiple BISes targeting this BIG we need to have + * all the BISes before doing bt_io_bcast_accept. + * This request comes from a transport "Acquire" call. + * For multiple BISes in the same BIG we need to either wait for all + * transports in the same BIG to be acquired or tell when to do the + * bt_io_bcast_accept by other means + */ + path = bt_bap_stream_get_user_data(setup->stream); + + strbis = strstr(path, "/bis"); + if (strbis == NULL) { + DBG("bis index cannot be found"); + return; + } + + s_err = sscanf(strbis, "/bis%d", &bis_index); + if (s_err == -1) { + DBG("sscanf error"); + return; + } + + DBG("Do BIG Sync with BIS %d", bis_index); + + iso_bc_addr.bc_bdaddr_type = btd_device_get_bdaddr_type(data->device); + memcpy(&iso_bc_addr.bc_bdaddr, device_get_address(data->device), + sizeof(bdaddr_t)); + iso_bc_addr.bc_bis0 = bis_index; + iso_bc_addr.bc_num_bis = 1; + + /* Set the user requested QOS */ + memset(&qos, 0, sizeof(qos)); + qos.bcast.big = setup->qos.bcast.big; + qos.bcast.bis = setup->qos.bcast.bis; + qos.bcast.sync_factor = setup->qos.bcast.sync_factor; + qos.bcast.packing = setup->qos.bcast.packing; + qos.bcast.framing = setup->qos.bcast.framing; + qos.bcast.encryption = setup->qos.bcast.encryption; + if (setup->qos.bcast.bcode && setup->qos.bcast.bcode->iov_base) + memcpy(qos.bcast.bcode, setup->qos.bcast.bcode->iov_base, + setup->qos.bcast.bcode->iov_len); + qos.bcast.options = setup->qos.bcast.options; + qos.bcast.skip = setup->qos.bcast.skip; + qos.bcast.sync_timeout = setup->qos.bcast.sync_timeout; + qos.bcast.sync_cte_type = setup->qos.bcast.sync_cte_type; + qos.bcast.mse = setup->qos.bcast.mse; + qos.bcast.timeout = setup->qos.bcast.timeout; + memcpy(&qos.bcast.out, &setup->qos.bcast.io_qos, + sizeof(struct bt_iso_io_qos)); + + if (!bt_io_set(setup->io, &err, + BT_IO_OPT_QOS, &qos, + BT_IO_OPT_INVALID)) { + error("bt_io_set: %s", err->message); + g_error_free(err); + } + + if (!bt_io_bcast_accept(setup->io, + iso_bcast_confirm_cb, + req, NULL, &err, + BT_IO_OPT_ISO_BC_NUM_BIS, + iso_bc_addr.bc_num_bis, BT_IO_OPT_ISO_BC_BIS, + iso_bc_addr.bc_bis, BT_IO_OPT_INVALID)) { + error("bt_io_bcast_accept: %s", err->message); + g_error_free(err); + } +} + +static void pa_and_big_sync(struct bap_bcast_pa_req *req) +{ + GError *err = NULL; + struct bap_setup *setup = req->data.setup; + struct bt_bap *bt_bap = bt_bap_stream_get_session(setup->stream); + struct btd_service *btd_service = bt_bap_get_user_data(bt_bap); + struct bap_data *bap_data = btd_service_get_user_data(btd_service); + + req->in_progress = TRUE; + + DBG("Create PA sync with this source"); + setup->io = bt_io_listen(NULL, iso_do_big_sync, req, + NULL, &err, + BT_IO_OPT_SOURCE_BDADDR, + btd_adapter_get_address(bap_data->adapter->adapter), + BT_IO_OPT_DEST_BDADDR, + device_get_address(bap_data->device), + BT_IO_OPT_DEST_TYPE, + btd_device_get_bdaddr_type(bap_data->device), + BT_IO_OPT_MODE, BT_IO_MODE_ISO, + BT_IO_OPT_QOS, &bap_sink_pa_qos, + BT_IO_OPT_INVALID); + if (!setup->io) { + error("%s", err->message); + g_error_free(err); + } +} + +static bool match_bap_adapter(const void *data, const void *match_data) +{ + struct bap_adapter *adapter = (struct bap_adapter *)data; + + return adapter->adapter == match_data; +} + static int bap_bcast_probe(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); struct btd_adapter *adapter = device_get_adapter(device); struct btd_gatt_database *database = btd_adapter_get_database(adapter); - struct bap_data *data = btd_service_get_user_data(service); - char addr18; - - ba2str(device_get_address(device), addr); + struct bap_bcast_pa_req *req; + struct bap_data *data; if (!btd_adapter_has_exp_feature(adapter, EXP_FEAT_ISO_SOCKET)) { error("BAP requires ISO Socket which is not enabled"); return -ENOTSUP; } - /* Ignore, if we were probed for this device already */ - if (data) { - error("Profile probed twice for the same device!"); - return -EINVAL; - } - data = bap_data_new(device); data->service = service; - data->adapter = adapter; + data->adapter = queue_find(adapters, match_bap_adapter, adapter); data->device = device; - data->bap = bt_bap_new(btd_gatt_database_get_db(database), btd_gatt_database_get_db(database)); if (!data->bap) { @@ -2265,26 +3112,55 @@ free(data); return -EINVAL; } + data->bcast_snks = queue_new(); + + if (!bt_bap_attach(data->bap, NULL)) { + error("BAP unable to attach"); + return -EINVAL; + } bap_data_add(data); data->ready_id = bt_bap_ready_register(data->bap, bap_ready, service, NULL); - data->state_id = bt_bap_state_register(data->bap, bap_state, - bap_connecting, data, NULL); + data->state_id = bt_bap_state_register(data->bap, bap_state_bcast_sink, + bap_connecting_bcast, data, NULL); data->pac_id = bt_bap_pac_register(data->bap, pac_added_broadcast, - pac_removed_broadcast, data, NULL); + pac_removed_broadcast, data, NULL); bt_bap_set_user_data(data->bap, service); - bt_bap_new_bcast_source(data->bap, device_get_path(device)); + /* Start the PA timer if it hasn't been started yet */ + if (data->adapter->pa_timer_id == 0) + data->adapter->pa_timer_id = g_timeout_add_seconds( + PA_IDLE_TIMEOUT, + pa_idle_timer, + data->adapter); + + /* Enqueue this device advertisement so that we can do short-lived + */ + DBG("enqueue service: %p", service); + req = new0(struct bap_bcast_pa_req, 1); + req->type = BAP_PA_SHORT_REQ; + req->in_progress = FALSE; + req->data.service = service; + queue_push_tail(data->adapter->bcast_pa_requests, req); + return 0; } +static bool match_service(const void *data, const void *match_data) +{ + struct bap_bcast_pa_req *req = (struct bap_bcast_pa_req *)data; + + return req->data.service == match_data; +} + static void bap_bcast_remove(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); struct bap_data *data; + struct bap_bcast_pa_req *req; char addr18; ba2str(device_get_address(device), addr); @@ -2295,6 +3171,15 @@ error("BAP service not handled by profile"); return; } + /* Remove the corresponding entry from the pa_req queue. Any pa_req that + * are in progress will be stopped by bap_data_remove which calls + * bap_data_free. + */ + req = queue_remove_if(data->adapter->bcast_pa_requests, + match_service, service); + free(req); + + bap_data_remove(data); } static int bap_probe(struct btd_service *service) @@ -2390,8 +3275,7 @@ return 0; } -static int bap_adapter_probe(struct btd_profile *p, - struct btd_adapter *adapter) +static int bap_adapter_probe(struct btd_profile *p, struct btd_adapter *adapter) { struct btd_gatt_database *database = btd_adapter_get_database(adapter); struct bap_data *data; @@ -2406,7 +3290,6 @@ } data = bap_data_new(NULL); - data->adapter = adapter; data->bap = bt_bap_new(btd_gatt_database_get_db(database), btd_gatt_database_get_db(database)); @@ -2423,13 +3306,22 @@ return -EINVAL; } - data->state_id = bt_bap_state_register(data->bap, bap_state, - bap_connecting, data, NULL); + data->state_id = bt_bap_state_register(data->bap, bap_state_bcast_src, + bap_connecting_bcast, data, NULL); data->pac_id = bt_bap_pac_register(data->bap, pac_added_broadcast, pac_removed_broadcast, data, NULL); bt_bap_set_user_data(data->bap, adapter); bap_data_set_user_data(data, adapter); + + data->adapter = new0(struct bap_adapter, 1); + data->adapter->adapter = adapter; + + if (adapters == NULL) + adapters = queue_new(); + data->adapter->bcast_pa_requests = queue_new(); + queue_push_tail(adapters, data->adapter); + return 0; } @@ -2443,6 +3335,15 @@ ba2str(btd_adapter_get_address(adapter), addr); DBG("%s", addr); + queue_destroy(data->adapter->bcast_pa_requests, free); + queue_remove(adapters, data->adapter); + free(data->adapter); + + if (queue_isempty(adapters)) { + queue_destroy(adapters, NULL); + adapters = NULL; + } + if (!data) { error("BAP service not handled by profile"); return; @@ -2471,6 +3372,7 @@ .remote_uuid = BCAAS_UUID_STR, .device_probe = bap_bcast_probe, .device_remove = bap_bcast_remove, + .disconnect = bap_disconnect, .auto_connect = false, .experimental = true, };
View file
_service:tar_scm:bluez-5.77.tar.xz/profiles/audio/ccp.c
Added
@@ -0,0 +1,233 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2024 Intel Corporation. All rights reserved. + * + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#define _GNU_SOURCE + +#include <ctype.h> +#include <stdbool.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <errno.h> + +#include <glib.h> + +#include "gdbus/gdbus.h" + +#include "lib/bluetooth.h" +#include "lib/hci.h" +#include "lib/sdp.h" +#include "lib/uuid.h" + +#include "src/dbus-common.h" +#include "src/shared/util.h" +#include "src/shared/att.h" +#include "src/shared/queue.h" +#include "src/shared/gatt-db.h" +#include "src/shared/gatt-client.h" +#include "src/shared/gatt-server.h" +#include "src/shared/ccp.h" + +#include "btio/btio.h" +#include "src/plugin.h" +#include "src/adapter.h" +#include "src/gatt-database.h" +#include "src/device.h" +#include "src/profile.h" +#include "src/service.h" +#include "src/log.h" +#include "src/error.h" + +#define GTBS_UUID_STR "0000184C-0000-1000-8000-00805f9b34fb" + +struct ccp_data { + struct btd_device *device; + struct btd_service *service; + struct bt_ccp *ccp; + unsigned int state_id; +}; + +static void ccp_debug(const char *str, void *user_data) +{ + DBG_IDX(0xffff, "%s", str); +} + +static struct ccp_data *ccp_data_new(struct btd_device *device) +{ + struct ccp_data *data; + + data = new0(struct ccp_data, 1); + data->device = device; + + return data; +} + +static int ccp_probe(struct btd_service *service) +{ + struct btd_device *device = btd_service_get_device(service); + struct btd_adapter *adapter = device_get_adapter(device); + struct btd_gatt_database *database = btd_adapter_get_database(adapter); + struct ccp_data *data = btd_service_get_user_data(service); + char addr18; + + ba2str(device_get_address(device), addr); + DBG("%s", addr); + + if (data) { + error("Profile probed twice for the same device!"); + return -EINVAL; + } + + data = ccp_data_new(device); + data->service = service; + + data->ccp = bt_ccp_new(btd_gatt_database_get_db(database), + btd_device_get_gatt_db(device)); + + bt_ccp_set_debug(data->ccp, ccp_debug, NULL, NULL); + btd_service_set_user_data(service, data); + + return 0; +} + +static void ccp_data_free(struct ccp_data *data) +{ + if (data->service) { + btd_service_set_user_data(data->service, NULL); + bt_ccp_set_user_data(data->ccp, NULL); + } + + bt_ccp_unref(data->ccp); + free(data); +} + +static void ccp_data_remove(struct ccp_data *data) +{ + DBG("data %p", data); + + ccp_data_free(data); +} + +static void ccp_remove(struct btd_service *service) +{ + struct btd_device *device = btd_service_get_device(service); + struct ccp_data *data; + char addr18; + + ba2str(device_get_address(device), addr); + DBG("%s", addr); + + data = btd_service_get_user_data(service); + if (!data) { + error("CCP service not handled by profile"); + return; + } + + ccp_data_remove(data); +} + +static int ccp_accept(struct btd_service *service) +{ + struct btd_device *device = btd_service_get_device(service); + struct bt_gatt_client *client = btd_device_get_gatt_client(device); + struct ccp_data *data = btd_service_get_user_data(service); + char addr18; + + ba2str(device_get_address(device), addr); + DBG("%s", addr); + + if (!bt_ccp_attach(data->ccp, client)) { + error("CCP unable to attach"); + return -EINVAL; + } + + /* TODO: register telephony operations here */ + + btd_service_connecting_complete(service, 0); + + return 0; +} + +static int ccp_connect(struct btd_service *service) +{ + struct btd_device *device = btd_service_get_device(service); + char addr18; + + ba2str(device_get_address(device), addr); + DBG("%s", addr); + + return 0; +} + +static int ccp_disconnect(struct btd_service *service) +{ + struct btd_device *device = btd_service_get_device(service); + struct ccp_data *data = btd_service_get_user_data(service); + char addr18; + + ba2str(device_get_address(device), addr); + DBG("%s", addr); + + bt_ccp_detach(data->ccp); + + btd_service_disconnecting_complete(service, 0); + + return 0; +} + +static int ccp_server_probe(struct btd_profile *p, struct btd_adapter *adapter) +{ + struct btd_gatt_database *database = btd_adapter_get_database(adapter); + + bt_ccp_register(btd_gatt_database_get_db(database)); + + return 0; +} + +static void +ccp_server_remove(struct btd_profile *p, + struct btd_adapter *adapter) +{ + DBG("CCP remove adapter"); +} + +static struct btd_profile ccp_profile = { + .name = "ccp", + .priority = BTD_PROFILE_PRIORITY_MEDIUM, + .remote_uuid = GTBS_UUID_STR, + .device_probe = ccp_probe, + .device_remove = ccp_remove, + .accept = ccp_accept, + .connect = ccp_connect, + .disconnect = ccp_disconnect, + .adapter_probe = ccp_server_probe, + .adapter_remove = ccp_server_remove, + .testing = true, +}; + +static int ccp_init(void) +{ + return btd_profile_register(&ccp_profile); +} + +static void ccp_exit(void) +{ + btd_profile_unregister(&ccp_profile); +} + +BLUETOOTH_PLUGIN_DEFINE(ccp, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, + ccp_init, ccp_exit)
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/mcp.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/mcp.c
Changed
@@ -169,7 +169,7 @@ unsigned char buf10; /* MCP defines duration is int32 but api takes it as uint32 */ - sprintf((char *)buf, "%d", duration); + snprintf((char *)buf, 10, "%d", duration); media_player_set_metadata(mp, NULL, "Duration", buf, sizeof(buf)); media_player_metadata_changed(mp); } @@ -224,13 +224,27 @@ return bt_mcp_stop(mcp); } +static int ct_next(struct media_player *mp, void *user_data) +{ + struct bt_mcp *mcp = user_data; + + return bt_mcp_next_track(mcp); +} + +static int ct_previous(struct media_player *mp, void *user_data) +{ + struct bt_mcp *mcp = user_data; + + return bt_mcp_previous_track(mcp); +} + static const struct media_player_callback ct_cbs = { .set_setting = NULL, .play = &ct_play, .pause = &ct_pause, .stop = &ct_stop, - .next = NULL, - .previous = NULL, + .next = &ct_next, + .previous = &ct_previous, .fast_forward = NULL, .rewind = NULL, .press = NULL,
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/media.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/media.c
Changed
@@ -38,6 +38,7 @@ #include "src/log.h" #include "src/error.h" #include "src/gatt-database.h" +#include "src/shared/asha.h" #include "src/shared/util.h" #include "src/shared/queue.h" #include "src/shared/att.h" @@ -88,6 +89,7 @@ struct media_endpoint { struct a2dp_sep *sep; struct bt_bap_pac *pac; + struct bt_asha_device *asha; char *sender; /* Endpoint DBus bus id */ char *path; /* Endpoint object path */ char *uuid; /* Endpoint property UUID */ @@ -149,6 +151,11 @@ { struct media_endpoint *endpoint = request->endpoint; + DBG("Canceling %s: name = %s path = %s", + dbus_message_get_member(request->msg), + dbus_message_get_destination(request->msg), + dbus_message_get_path(request->msg)); + if (request->call) dbus_pending_call_cancel(request->call); @@ -921,7 +928,7 @@ } static int pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, - struct bt_bap_pac_qos *qos, + uint32_t location, struct bt_bap_pac_qos *qos, bt_bap_pac_select_t cb, void *cb_data, void *user_data) { struct media_endpoint *endpoint = user_data; @@ -969,6 +976,10 @@ g_dbus_dict_append_entry(&dict, "Locations", DBUS_TYPE_UINT32, &loc); + if (location) + g_dbus_dict_append_entry(&dict, "ChannelAllocation", + DBUS_TYPE_UINT32, &location); + if (metadata) { key = "Metadata"; g_dbus_dict_append_basic_array(&dict, DBUS_TYPE_STRING, &key, @@ -1024,6 +1035,33 @@ data, free); } +static void pac_cancel_select(struct bt_bap_pac *lpac, bt_bap_pac_select_t cb, + void *cb_data, void *user_data) +{ + struct media_endpoint *endpoint = user_data; + GSList *l = endpoint->requests; + + while (l) { + struct endpoint_request *req = l->data; + struct pac_select_data *data; + + if (req->cb != pac_select_cb) { + l = g_slist_next(l); + continue; + } + + data = req->user_data; + if (data->pac != lpac || data->cb != cb || + data->user_data != cb_data) { + l = g_slist_next(l); + continue; + } + + media_endpoint_cancel(req); + l = endpoint->requests; + } +} + struct pac_config_data { struct bt_bap_stream *stream; bt_bap_pac_config_t cb; @@ -1191,6 +1229,7 @@ static struct bt_bap_pac_ops pac_ops = { .select = pac_select, + .cancel_select = pac_cancel_select, .config = pac_config, .clear = pac_clear, }; @@ -1241,6 +1280,7 @@ if (asprintf(&name, "%s:%s", endpoint->sender, endpoint->path) < 0) { error("Could not allocate name for pac %s:%s", endpoint->sender, endpoint->path); + free(name); return false; } @@ -1256,6 +1296,7 @@ &data, metadata); if (!endpoint->pac) { error("Unable to create PAC"); + free(name); free(metadata); return false; } @@ -1292,6 +1333,12 @@ return endpoint_init_pac(endpoint, BT_BAP_BCAST_SINK, err); } +static bool endpoint_init_asha(struct media_endpoint *endpoint, + int *err) +{ + return true; +} + static bool endpoint_properties_exists(const char *uuid, struct btd_device *dev, void *user_data) @@ -1416,7 +1463,12 @@ return g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL; } -static struct media_endpoint_init { +static bool experimental_asha_supported(struct btd_adapter *adapter) +{ + return g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL; +} + +static const struct media_endpoint_init { const char *uuid; bool (*func)(struct media_endpoint *endpoint, int *err); bool (*supported)(struct btd_adapter *adapter); @@ -1433,6 +1485,8 @@ experimental_broadcaster_ep_supported }, { BAA_SERVICE_UUID, endpoint_init_broadcast_sink, experimental_bcast_sink_ep_supported }, + { ASHA_PROFILE_UUID, endpoint_init_asha, + experimental_asha_supported }, }; static struct media_endpoint * @@ -1452,7 +1506,7 @@ int *err) { struct media_endpoint *endpoint; - struct media_endpoint_init *init; + const struct media_endpoint_init *init; size_t i; bool succeeded = false; @@ -3240,7 +3294,7 @@ DBUS_TYPE_STRING_AS_STRING, &entry); for (i = 0; i < ARRAY_SIZE(init_table); i++) { - struct media_endpoint_init *init = &init_tablei; + const struct media_endpoint_init *init = &init_tablei; if (init->supported(adapter->btd_adapter)) dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, @@ -3355,3 +3409,18 @@ return false; } + +const struct media_endpoint *media_endpoint_get_asha(void) +{ + /* + * Because ASHA does not require the application to register an + * endpoint, we need a minimal media_endpoint for transport creation to + * work, so let's create one + */ + static struct media_endpoint asha_endpoint = { + .uuid = ASHA_PROFILE_UUID, + .codec = 0x2, /* Currently on G.722 is defined by the spec */ + }; + + return &asha_endpoint; +}
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/media.h -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/media.h
Changed
@@ -24,3 +24,5 @@ struct media_endpoint *endpoint); bool media_endpoint_is_broadcast(struct media_endpoint *endpoint); int8_t media_player_get_device_volume(struct btd_device *device); + +const struct media_endpoint *media_endpoint_get_asha(void);
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/sink.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/sink.c
Changed
@@ -62,7 +62,7 @@ static GSList *sink_callbacks = NULL; -static char *str_state = { +static const char *str_state = { "SINK_STATE_DISCONNECTED", "SINK_STATE_CONNECTING", "SINK_STATE_CONNECTED",
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/source.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/source.c
Changed
@@ -61,7 +61,7 @@ static GSList *source_callbacks = NULL; -static char *str_state = { +static const char *str_state = { "SOURCE_STATE_DISCONNECTED", "SOURCE_STATE_CONNECTING", "SOURCE_STATE_CONNECTED",
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/transport.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/transport.c
Changed
@@ -37,6 +37,7 @@ #include "src/shared/bap.h" #include "src/shared/io.h" +#include "asha.h" #include "avdtp.h" #include "media.h" #include "transport.h" @@ -55,7 +56,7 @@ TRANSPORT_STATE_SUSPENDING, /* Release in progress */ } transport_state_t; -static char *str_state = { +static const char *str_state = { "TRANSPORT_STATE_IDLE", "TRANSPORT_STATE_PENDING", "TRANSPORT_STATE_REQUESTING", @@ -79,6 +80,7 @@ struct avdtp *session; uint16_t delay; int8_t volume; + guint watch; }; struct bap_transport { @@ -89,11 +91,32 @@ guint resume_id; }; +struct media_transport_ops { + const char *uuid; + const GDBusPropertyTable *properties; + void (*set_owner)(struct media_transport *transport, + struct media_owner *owner); + void (*remove_owner)(struct media_transport *transport, + struct media_owner *owner); + void *(*init)(struct media_transport *transport, void *stream); + guint (*resume)(struct media_transport *transport, + struct media_owner *owner); + guint (*suspend)(struct media_transport *transport, + struct media_owner *owner); + void (*cancel)(struct media_transport *transport, guint id); + void (*set_state)(struct media_transport *transport, + transport_state_t state); + void *(*get_stream)(struct media_transport *transport); + int8_t (*get_volume)(struct media_transport *transport); + int (*set_volume)(struct media_transport *transport, int8_t level); + GDestroyNotify destroy; +}; + struct media_transport { char *path; /* Transport object path */ struct btd_device *device; /* Transport device */ struct btd_adapter *adapter; /* Transport adapter bcast*/ - const char *remote_endpoint; /* Transport remote SEP */ + char *remote_endpoint; /* Transport remote SEP */ struct media_endpoint *endpoint; /* Transport endpoint */ struct media_owner *owner; /* Transport owner */ uint8_t *configuration; /* Transport configuration */ @@ -102,20 +125,7 @@ uint16_t imtu; /* Transport input mtu */ uint16_t omtu; /* Transport output mtu */ transport_state_t state; - guint hs_watch; - guint source_watch; - guint sink_watch; - guint (*resume) (struct media_transport *transport, - struct media_owner *owner); - guint (*suspend) (struct media_transport *transport, - struct media_owner *owner); - void (*cancel) (struct media_transport *transport, - guint id); - void (*set_state) (struct media_transport *transport, - transport_state_t state); - void *(*get_stream) - (struct media_transport *transport); - GDestroyNotify destroy; + const struct media_transport_ops *ops; void *data; }; @@ -198,20 +208,14 @@ "State"); /* Update transport specific data */ - if (transport->set_state) - transport->set_state(transport, state); + if (transport->ops && transport->ops->set_state) + transport->ops->set_state(transport, state); } void media_transport_destroy(struct media_transport *transport) { char *path; - if (transport->sink_watch) - sink_remove_state_cb(transport->sink_watch); - - if (transport->source_watch) - source_remove_state_cb(transport->source_watch); - path = g_strdup(transport->path); g_dbus_unregister_interface(btd_get_dbus_connection(), path, MEDIA_TRANSPORT_INTERFACE); @@ -261,8 +265,8 @@ DBG("Owner %s Request %s", owner->name, dbus_message_get_member(req->msg)); - if (req->id) - transport->cancel(transport, req->id); + if (req->id && transport->ops && transport->ops->cancel) + transport->ops->cancel(transport, req->id); owner->pending = NULL; if (req->msg) @@ -297,10 +301,36 @@ transport->owner = NULL; } +static guint media_transport_suspend(struct media_transport *transport, + struct media_owner *owner) +{ + if (!state_in_use(transport->state)) + return 0; + + DBG("Transport %s Owner %s", transport->path, owner ? owner->name : ""); + + if (transport->ops && transport->ops->suspend) + return transport->ops->suspend(transport, owner); + + return 0; +} + +static void transport_bap_remove_owner(struct media_transport *transport, + struct media_owner *owner) +{ + struct bap_transport *bap = transport->data; + + if (bap && bap->linked) { + struct bt_bap_stream *link; + + link = bt_bap_stream_io_get_link(bap->stream); + linked_transport_remove_owner(link, owner); + } +} + static void media_transport_remove_owner(struct media_transport *transport) { struct media_owner *owner = transport->owner; - struct bap_transport *bap = transport->data; if (!transport->owner) return; @@ -312,17 +342,16 @@ media_request_reply(owner->pending, EIO); transport->owner = NULL; - if (bap->linked) - queue_foreach(bt_bap_stream_io_get_links(bap->stream), - linked_transport_remove_owner, owner); + + if (transport->ops && transport->ops->remove_owner) + transport->ops->remove_owner(transport, owner); if (owner->watch) g_dbus_remove_watch(btd_get_dbus_connection(), owner->watch); media_owner_free(owner); - if (state_in_use(transport->state)) - transport->suspend(transport, NULL); + media_transport_suspend(transport, NULL); } static gboolean media_transport_set_fd(struct media_transport *transport, @@ -385,7 +414,7 @@ media_transport_remove_owner(transport); } -static guint resume_a2dp(struct media_transport *transport, +static guint transport_a2dp_resume(struct media_transport *transport, struct media_owner *owner) { struct a2dp_transport *a2dp = transport->data; @@ -439,7 +468,7 @@ media_transport_remove_owner(transport); } -static guint suspend_a2dp(struct media_transport *transport, +static guint transport_a2dp_suspend(struct media_transport *transport, struct media_owner *owner) { struct a2dp_transport *a2dp = transport->data; @@ -456,15 +485,55 @@ return 0; } -static void cancel_a2dp(struct media_transport *transport, guint id) +static void transport_a2dp_cancel(struct media_transport *transport, guint id) { a2dp_cancel(id); } +static int8_t transport_a2dp_get_volume(struct media_transport *transport) +{ + struct a2dp_transport *a2dp = transport->data; + return a2dp->volume; +} + +static int transport_a2dp_src_set_volume(struct media_transport *transport, + int8_t level) +{ + struct a2dp_transport *a2dp = transport->data; + + if (a2dp->volume == level) + return 0; + + return avrcp_set_volume(transport->device, level, false); +} + +static int transport_a2dp_snk_set_volume(struct media_transport *transport, + int8_t level) +{ + struct a2dp_transport *a2dp = transport->data; + bool notify; + + if (a2dp->volume == level) + return 0; + + notify = a2dp->watch ? true : false; + if (notify) { + a2dp->volume = level; + g_dbus_emit_property_changed(btd_get_dbus_connection(), + transport->path, + MEDIA_TRANSPORT_INTERFACE, + "Volume"); + } + + return avrcp_set_volume(transport->device, level, notify); +} + static void media_owner_exit(DBusConnection *connection, void *user_data) { struct media_owner *owner = user_data; + DBG("Owner %s", owner->name); + owner->watch = 0; media_owner_remove(owner); @@ -488,17 +557,27 @@ transport->owner = owner; } -static void media_transport_set_owner(struct media_transport *transport, +static void transport_bap_set_owner(struct media_transport *transport, struct media_owner *owner) { struct bap_transport *bap = transport->data; + if (bap && bap->linked) { + struct bt_bap_stream *link; + + link = bt_bap_stream_io_get_link(bap->stream); + linked_transport_set_owner(link, owner); + } +} + +static void media_transport_set_owner(struct media_transport *transport, + struct media_owner *owner) +{ DBG("Transport %s Owner %s", transport->path, owner->name); transport->owner = owner; - if (bap->linked) - queue_foreach(bt_bap_stream_io_get_links(bap->stream), - linked_transport_set_owner, owner); + if (transport->ops && transport->ops->set_owner) + transport->ops->set_owner(transport, owner); owner->transport = transport; owner->watch = g_dbus_add_disconnect_watch(btd_get_dbus_connection(), @@ -528,13 +607,24 @@ owner->pending = req; } -static void *get_stream_bap(struct media_transport *transport) +static void *transport_bap_get_stream(struct media_transport *transport) { struct bap_transport *bap = transport->data; return bap->stream; } +static guint media_transport_resume(struct media_transport *transport, + struct media_owner *owner) +{ + DBG("Transport %s Owner %s", transport->path, owner ? owner->name : ""); + + if (transport->ops && transport->ops->resume) + return transport->ops->resume(transport, owner); + + return 0; +} + static DBusMessage *acquire(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -560,7 +650,7 @@ media_transport_set_owner(transport, owner); } - id = transport->resume(transport, owner); + id = media_transport_resume(transport, owner); if (id == 0) { media_owner_free(owner); return btd_error_not_authorized(msg); @@ -593,7 +683,7 @@ return btd_error_not_available(msg); owner = media_owner_create(msg); - id = transport->resume(transport, owner); + id = media_transport_resume(transport, owner); if (id == 0) { media_owner_free(owner); return btd_error_not_authorized(msg); @@ -611,8 +701,13 @@ void *user_data) { struct media_owner *owner = user_data; - struct media_request *req = owner->pending; - struct media_transport *transport = owner->transport; + struct media_request *req; + struct media_transport *transport; + + if (!owner) + return; + + req = owner->pending; /* Release always succeeds */ if (req) { @@ -621,8 +716,12 @@ media_owner_remove(owner); } - transport_set_state(transport, TRANSPORT_STATE_IDLE); - media_transport_remove_owner(transport); + transport = owner->transport; + + if (transport) { + transport_set_state(transport, TRANSPORT_STATE_IDLE); + media_transport_remove_owner(transport); + } } static void bap_disable_complete(struct bt_bap_stream *stream, @@ -637,7 +736,6 @@ { struct media_transport *transport = data; struct media_owner *owner = transport->owner; - struct bap_transport *bap = transport->data; const char *sender; struct media_request *req; guint id; @@ -647,6 +745,8 @@ if (owner == NULL || g_strcmp0(owner->name, sender) != 0) return btd_error_not_authorized(msg); + DBG("Owner %s", owner->name); + if (owner->pending) { const char *member; @@ -660,7 +760,7 @@ transport_set_state(transport, TRANSPORT_STATE_SUSPENDING); - id = transport->suspend(transport, owner); + id = media_transport_suspend(transport, owner); if (id == 0) { media_transport_remove_owner(transport); return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); @@ -669,11 +769,6 @@ req = media_request_create(msg, id); media_owner_add(owner, req); - if (bt_bap_stream_get_type(bap->stream) == - BT_BAP_STREAM_TYPE_BCAST) { - bap_disable_complete(bap->stream, 0x00, 0x00, owner); - } - return NULL; } @@ -767,32 +862,59 @@ static gboolean volume_exists(const GDBusPropertyTable *property, void *data) { struct media_transport *transport = data; - struct a2dp_transport *a2dp = transport->data; + int8_t volume; + + if (media_transport_get_volume(transport, &volume)) + return FALSE; - return a2dp->volume >= 0; + return volume >= 0; +} + +int media_transport_get_volume(struct media_transport *transport, + int8_t *volume) +{ + if (transport->ops && transport->ops->get_volume) { + *volume = transport->ops->get_volume(transport); + return 0; + } + + return -EINVAL; } static gboolean get_volume(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data) { struct media_transport *transport = data; - struct a2dp_transport *a2dp = transport->data; - uint16_t volume = (uint16_t)a2dp->volume; + int8_t level; + uint16_t volume; + + if (media_transport_get_volume(transport, &level)) + return FALSE; + + volume = level; dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &volume); return TRUE; } +static int media_transport_set_volume(struct media_transport *transport, + int8_t level) +{ + DBG("Transport %s level %d", transport->path, level); + + if (transport->ops && transport->ops->set_volume) + return transport->ops->set_volume(transport, level); + + return 0; +} + static void set_volume(const GDBusPropertyTable *property, DBusMessageIter *iter, GDBusPendingPropertySet id, void *data) { struct media_transport *transport = data; - struct a2dp_transport *a2dp = transport->data; uint16_t arg; - int8_t volume; - bool notify; int err; if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_UINT16) { @@ -810,26 +932,13 @@ return; } - volume = (int8_t)arg; - if (a2dp->volume == volume) - return; - - notify = transport->source_watch ? true : false; - if (notify) { - a2dp->volume = volume; - g_dbus_emit_property_changed(btd_get_dbus_connection(), - transport->path, - MEDIA_TRANSPORT_INTERFACE, - "Volume"); - } - - err = avrcp_set_volume(transport->device, volume, notify); + err = media_transport_set_volume(transport, arg); if (err) { - error("avrcp_set_volume returned %s (%d)", strerror(-err), err); + error("Unable to set volume: %s (%d)", strerror(-err), err); g_dbus_pending_property_error(id, - ERROR_INTERFACE ".Failed", - "Internal error %s (%d)", - strerror(-err), err); + ERROR_INTERFACE ".Failed", + "Internal error %s (%d)", + strerror(-err), err); return; } @@ -869,7 +978,7 @@ { }, }; -static const GDBusPropertyTable a2dp_properties = { +static const GDBusPropertyTable transport_a2dp_properties = { { "Device", "o", get_device }, { "UUID", "s", get_uuid }, { "Codec", "y", get_codec }, @@ -962,12 +1071,15 @@ return bap->linked; } -static void append_links(void *data, void *user_data) +static void append_link(void *data, void *user_data) { struct bt_bap_stream *stream = data; DBusMessageIter *array = user_data; struct media_transport *transport; + if (!stream) + return; + transport = find_transport_by_bap_stream(stream); if (!transport) { error("Unable to find transport"); @@ -983,14 +1095,14 @@ { struct media_transport *transport = data; struct bap_transport *bap = transport->data; - struct queue *links = bt_bap_stream_io_get_links(bap->stream); + struct bt_bap_stream *link = bt_bap_stream_io_get_link(bap->stream); DBusMessageIter array; dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &array); - queue_foreach(links, append_links, &array); + append_link(link, &array); dbus_message_iter_close_container(iter, &array); @@ -1005,7 +1117,7 @@ return bap->qos.ucast.io_qos.phy != 0x00; } -static const GDBusPropertyTable bap_ucast_properties = { +static const GDBusPropertyTable transport_bap_uc_properties = { { "Device", "o", get_device }, { "UUID", "s", get_uuid }, { "Codec", "y", get_codec }, @@ -1075,7 +1187,7 @@ return bap->qos.bcast.io_qos.phy != 0x00; } -static const GDBusPropertyTable bap_bcast_properties = { +static const GDBusPropertyTable transport_bap_bc_properties = { { "Device", "o", get_device }, { "UUID", "s", get_uuid }, { "Codec", "y", get_codec }, @@ -1088,14 +1200,60 @@ { } }; -static void destroy_a2dp(void *data) +static gboolean get_asha_delay(const GDBusPropertyTable *property, + DBusMessageIter *iter, void *data) +{ + struct media_transport *transport = data; + struct bt_asha_device *asha_dev = transport->data; + uint16_t delay; + + // Delay property is in 1/10ths of ms, while ASHA RenderDelay is in ms + delay = bt_asha_device_get_render_delay(asha_dev) * 10; + + dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT16, &delay); + + return TRUE; +} + +static const GDBusPropertyTable transport_asha_properties = { + { "Device", "o", get_device }, + { "Endpoint", "o", get_endpoint, NULL, endpoint_exists }, + { "UUID", "s", get_uuid }, + { "Codec", "y", get_codec }, + { "State", "s", get_state }, + { "Delay", "q", get_asha_delay }, + { "Volume", "q", get_volume, set_volume, volume_exists }, + { } +}; + +static void transport_a2dp_destroy(void *data) { struct a2dp_transport *a2dp = data; if (a2dp->session) avdtp_unref(a2dp->session); - g_free(a2dp); + free(a2dp); +} + +static void transport_a2dp_src_destroy(void *data) +{ + struct a2dp_transport *a2dp = data; + + if (a2dp->watch) + sink_remove_state_cb(a2dp->watch); + + transport_a2dp_destroy(data); +} + +static void transport_a2dp_snk_destroy(void *data) +{ + struct a2dp_transport *a2dp = data; + + if (a2dp->watch) + source_remove_state_cb(a2dp->watch); + + transport_a2dp_destroy(data); } static void media_transport_free(void *data) @@ -1107,9 +1265,10 @@ if (transport->owner) media_transport_remove_owner(transport); - if (transport->destroy != NULL) - transport->destroy(transport->data); + if (transport->ops && transport->ops->destroy) + transport->ops->destroy(transport->data); + g_free(transport->remote_endpoint); g_free(transport->configuration); g_free(transport->path); g_free(transport); @@ -1159,53 +1318,39 @@ transport_update_playing(transport, FALSE); } -static int media_transport_init_source(struct media_transport *transport) +static void *transport_a2dp_src_init(struct media_transport *transport, + void *stream) { struct btd_service *service; struct a2dp_transport *a2dp; service = btd_device_get_service(transport->device, A2DP_SINK_UUID); - if (service == NULL) - return -EINVAL; - - a2dp = g_new0(struct a2dp_transport, 1); - - transport->resume = resume_a2dp; - transport->suspend = suspend_a2dp; - transport->cancel = cancel_a2dp; - transport->data = a2dp; - transport->destroy = destroy_a2dp; + if (!service) + return NULL; + a2dp = new0(struct a2dp_transport, 1); a2dp->volume = -1; - transport->sink_watch = sink_add_state_cb(service, sink_state_changed, - transport); + a2dp->watch = sink_add_state_cb(service, sink_state_changed, transport); - return 0; + return a2dp; } -static int media_transport_init_sink(struct media_transport *transport) +static void *transport_a2dp_snk_init(struct media_transport *transport, + void *stream) { struct btd_service *service; struct a2dp_transport *a2dp; service = btd_device_get_service(transport->device, A2DP_SOURCE_UUID); - if (service == NULL) - return -EINVAL; - - a2dp = g_new0(struct a2dp_transport, 1); - - transport->resume = resume_a2dp; - transport->suspend = suspend_a2dp; - transport->cancel = cancel_a2dp; - transport->data = a2dp; - transport->destroy = destroy_a2dp; + if (!service) + return NULL; + a2dp = new0(struct a2dp_transport, 1); a2dp->volume = 127; - transport->source_watch = source_add_state_cb(service, - source_state_changed, - transport); + a2dp->watch = source_add_state_cb(service, source_state_changed, + transport); - return 0; + return a2dp; } static void bap_enable_complete(struct bt_bap_stream *stream, @@ -1280,15 +1425,15 @@ static void bap_update_links(const struct media_transport *transport) { struct bap_transport *bap = transport->data; - struct queue *links = bt_bap_stream_io_get_links(bap->stream); + struct bt_bap_stream *link = bt_bap_stream_io_get_link(bap->stream); - if (bap->linked == !queue_isempty(links)) + if (bap->linked == (!!link)) return; - bap->linked = !queue_isempty(links); + bap->linked = link ? true : false; /* Check if the links transport has been create yet */ - if (bap->linked && !queue_find(links, match_link_transport, NULL)) { + if (bap->linked && !match_link_transport(link, NULL)) { bap->linked = false; return; } @@ -1366,7 +1511,7 @@ "Configuration"); } -static guint resume_bap(struct media_transport *transport, +static guint transport_bap_resume(struct media_transport *transport, struct media_owner *owner) { struct bap_transport *bap = transport->data; @@ -1402,11 +1547,12 @@ return id; } -static guint suspend_bap(struct media_transport *transport, +static guint transport_bap_suspend(struct media_transport *transport, struct media_owner *owner) { struct bap_transport *bap = transport->data; bt_bap_stream_func_t func = NULL; + guint id; if (!bap->stream) return 0; @@ -1418,10 +1564,18 @@ bap_update_links(transport); - return bt_bap_stream_disable(bap->stream, bap->linked, func, owner); + id = bt_bap_stream_disable(bap->stream, bap->linked, func, owner); + + if (bt_bap_stream_get_type(bap->stream) == BT_BAP_STREAM_TYPE_BCAST) { + if (transport->owner == owner) + bap_disable_complete(bap->stream, 0x00, 0x00, owner); + return 0; + } + + return id; } -static void cancel_bap(struct media_transport *transport, guint id) +static void transport_bap_cancel(struct media_transport *transport, guint id) { struct bap_transport *bap = transport->data; @@ -1452,17 +1606,19 @@ transport_set_state(transport, state); } -static void set_state_bap(struct media_transport *transport, +static void transport_bap_set_state(struct media_transport *transport, transport_state_t state) { struct bap_transport *bap = transport->data; + struct bt_bap_stream *link; if (!bap->linked) return; - /* Update links */ - queue_foreach(bt_bap_stream_io_get_links(bap->stream), link_set_state, - UINT_TO_PTR(state)); + link = bt_bap_stream_io_get_link(bap->stream); + + /* Update link */ + link_set_state(link, UINT_TO_PTR(state)); } static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state, @@ -1496,7 +1652,10 @@ bap_update_qos(transport); else if (bt_bap_stream_io_dir(stream) != BT_BAP_BCAST_SOURCE) bap_update_bcast_qos(transport); - transport_update_playing(transport, FALSE); + if (bt_bap_stream_io_dir(stream) == BT_BAP_BCAST_SOURCE) + transport_update_playing(transport, TRUE); + else + transport_update_playing(transport, FALSE); return; case BT_BAP_STREAM_STATE_DISABLING: return; @@ -1558,7 +1717,7 @@ bap_update_links(transport); } -static void free_bap(void *data) +static void transport_bap_destroy(void *data) { struct bap_transport *bap = data; @@ -1567,8 +1726,7 @@ free(bap); } -static int media_transport_init_bap(struct media_transport *transport, - void *stream) +static void *transport_bap_init(struct media_transport *transport, void *stream) { struct bt_bap_qos *qos; struct bap_transport *bap; @@ -1583,15 +1741,243 @@ bap_connecting, transport, NULL); - transport->data = bap; - transport->resume = resume_bap; - transport->suspend = suspend_bap; - transport->cancel = cancel_bap; - transport->set_state = set_state_bap; - transport->get_stream = get_stream_bap; - transport->destroy = free_bap; + return bap; +} - return 0; +static void asha_transport_sync_state(struct media_transport *transport, + struct bt_asha_device *asha_dev) +{ + switch (bt_asha_device_get_state(asha_dev)) { + case ASHA_STOPPED: + transport_set_state(transport, TRANSPORT_STATE_IDLE); + break; + case ASHA_STARTING: + transport_set_state(transport, TRANSPORT_STATE_REQUESTING); + break; + case ASHA_STARTED: + transport_set_state(transport, TRANSPORT_STATE_ACTIVE); + break; + case ASHA_STOPPING: + transport_set_state(transport, TRANSPORT_STATE_SUSPENDING); + break; + } +} + +static void asha_transport_state_cb(int status, void *user_data) +{ + struct media_owner *owner = user_data; + struct media_transport *transport = owner->transport; + struct bt_asha_device *asha_dev; + enum bt_asha_state_t state; + + if (!transport) { + DBG("Lost owner while connecting, bailing"); + return; + } + + asha_dev = transport->data; + state = bt_asha_device_get_state(asha_dev); + + if (state == ASHA_STARTED) { + int fd; + uint16_t imtu, omtu; + gboolean ret; + + fd = bt_asha_device_get_fd(asha_dev); + imtu = bt_asha_device_get_imtu(asha_dev); + omtu = bt_asha_device_get_omtu(asha_dev); + + media_transport_set_fd(transport, fd, imtu, omtu); + + owner->pending->id = 0; + ret = g_dbus_send_reply(btd_get_dbus_connection(), + owner->pending->msg, + DBUS_TYPE_UNIX_FD, &fd, + DBUS_TYPE_UINT16, &imtu, + DBUS_TYPE_UINT16, &omtu, + DBUS_TYPE_INVALID); + if (!ret) { + media_transport_remove_owner(transport); + return; + } + + media_owner_remove(owner); + } else if (state == ASHA_STOPPED) { + if (owner->pending) { + owner->pending->id = 0; + media_request_reply(owner->pending, 0); + media_owner_remove(owner); + } + + media_transport_remove_owner(transport); + } + + asha_transport_sync_state(transport, asha_dev); +} + +static guint transport_asha_resume(struct media_transport *transport, + struct media_owner *owner) +{ + struct bt_asha_device *asha_dev = transport->data; + guint ret; + + ret = bt_asha_device_start(asha_dev, asha_transport_state_cb, owner); + asha_transport_sync_state(transport, asha_dev); + + return ret > 0 ? ret : 0; +} + +static guint transport_asha_suspend(struct media_transport *transport, + struct media_owner *owner) +{ + struct bt_asha_device *asha_dev = transport->data; + guint ret = 0; + + if (owner) { + ret = bt_asha_device_stop(asha_dev, asha_transport_state_cb, + owner); + asha_transport_sync_state(transport, asha_dev); + } else { + ret = bt_asha_device_stop(asha_dev, NULL, NULL); + /* We won't have a callback to set the final state */ + transport_set_state(transport, TRANSPORT_STATE_IDLE); + } + + return ret; +} + +static void transport_asha_cancel(struct media_transport *transport, guint id) +{ + struct bt_asha_device *asha_dev = transport->data; + enum bt_asha_state_t state = bt_asha_device_get_state(asha_dev); + + if (id != bt_asha_device_device_get_resume_id(asha_dev)) { + /* Not current, ignore */ + DBG("Ignoring cancel request for id %d", id); + return; + } + + if (state == ASHA_STARTING || state == ASHA_STARTED) { + DBG("Cancel requested, stopping"); + bt_asha_device_stop(asha_dev, NULL, NULL); + /* We won't have a callback to set the final state */ + transport_set_state(transport, TRANSPORT_STATE_IDLE); + } else if (state == ASHA_STOPPING) { + DBG("Cancel requested, resetting transport state"); + /* We already dispatched a stop, just reset our state */ + bt_asha_device_state_reset(asha_dev); + transport_set_state(transport, TRANSPORT_STATE_IDLE); + } +} + +static int8_t transport_asha_get_volume(struct media_transport *transport) +{ + struct bt_asha_device *asha_dev = transport->data; + int8_t volume; + int scaled_volume; + + volume = bt_asha_device_get_volume(asha_dev); + + /* Convert -128-0 to 0-127 */ + scaled_volume = ((((int) volume) + 128) * 127) / 128; + + return scaled_volume; +} + +static int transport_asha_set_volume(struct media_transport *transport, + int8_t volume) +{ + struct bt_asha_device *asha_dev = transport->data; + int scaled_volume; + + /* Convert 0-127 to -128-0 */ + scaled_volume = ((((int) volume) * 128) / 127) - 128; + + return bt_asha_device_set_volume(asha_dev, scaled_volume) ? 0 : -EIO; +} + +static void *transport_asha_init(struct media_transport *transport, void *data) +{ + /* We just store the struct asha_device on the transport */ + return data; +} + +#define TRANSPORT_OPS(_uuid, _props, _set_owner, _remove_owner, _init, \ + _resume, _suspend, _cancel, _set_state, _get_stream, \ + _get_volume, _set_volume, _destroy) \ +{ \ + .uuid = _uuid, \ + .properties = _props, \ + .set_owner = _set_owner, \ + .remove_owner = _remove_owner, \ + .init = _init, \ + .resume = _resume, \ + .suspend = _suspend, \ + .cancel = _cancel, \ + .set_state = _set_state, \ + .get_stream = _get_stream, \ + .get_volume = _get_volume, \ + .set_volume = _set_volume, \ + .destroy = _destroy \ +} + +#define A2DP_OPS(_uuid, _init, _set_volume, _destroy) \ + TRANSPORT_OPS(_uuid, transport_a2dp_properties, NULL, NULL, _init, \ + transport_a2dp_resume, transport_a2dp_suspend, \ + transport_a2dp_cancel, NULL, NULL, \ + transport_a2dp_get_volume, _set_volume, \ + _destroy) + +#define BAP_OPS(_uuid, _props, _set_owner, _remove_owner) \ + TRANSPORT_OPS(_uuid, _props, _set_owner, _remove_owner,\ + transport_bap_init, \ + transport_bap_resume, transport_bap_suspend, \ + transport_bap_cancel, transport_bap_set_state, \ + transport_bap_get_stream, NULL, NULL, \ + transport_bap_destroy) + +#define BAP_UC_OPS(_uuid) \ + BAP_OPS(_uuid, transport_bap_uc_properties, \ + transport_bap_set_owner, transport_bap_remove_owner) + +#define BAP_BC_OPS(_uuid) \ + BAP_OPS(_uuid, transport_bap_bc_properties, NULL, NULL) + +#define ASHA_OPS(_uuid) \ + TRANSPORT_OPS(_uuid, transport_asha_properties, NULL, NULL, \ + transport_asha_init, \ + transport_asha_resume, transport_asha_suspend, \ + transport_asha_cancel, NULL, NULL, \ + transport_asha_get_volume, transport_asha_set_volume, \ + NULL) + +static const struct media_transport_ops transport_ops = { + A2DP_OPS(A2DP_SOURCE_UUID, transport_a2dp_src_init, + transport_a2dp_src_set_volume, + transport_a2dp_src_destroy), + A2DP_OPS(A2DP_SINK_UUID, transport_a2dp_snk_init, + transport_a2dp_snk_set_volume, + transport_a2dp_snk_destroy), + BAP_UC_OPS(PAC_SOURCE_UUID), + BAP_UC_OPS(PAC_SINK_UUID), + BAP_BC_OPS(BCAA_SERVICE_UUID), + BAP_BC_OPS(BAA_SERVICE_UUID), + ASHA_OPS(ASHA_PROFILE_UUID), +}; + +static const struct media_transport_ops * +media_transport_find_ops(const char *uuid) +{ + size_t i; + + for (i = 0; i < ARRAY_SIZE(transport_ops); i++) { + const struct media_transport_ops *ops = &transport_opsi; + + if (!strcasecmp(uuid, ops->uuid)) + return ops; + } + + return NULL; } struct media_transport *media_transport_create(struct btd_device *device, @@ -1602,9 +1988,8 @@ { struct media_endpoint *endpoint = data; struct media_transport *transport; - const char *uuid; + const struct media_transport_ops *ops; static int fd = 0; - const GDBusPropertyTable *properties; transport = g_new0(struct media_transport, 1); if (device) @@ -1613,10 +1998,9 @@ transport->adapter = media_endpoint_get_btd_adapter(endpoint); transport->endpoint = endpoint; - transport->configuration = g_new(uint8_t, size); - memcpy(transport->configuration, configuration, size); + transport->configuration = util_memdup(configuration, size); transport->size = size; - transport->remote_endpoint = remote_endpoint; + transport->remote_endpoint = g_strdup(remote_endpoint); if (device) transport->path = g_strdup_printf("%s/fd%d", @@ -1629,31 +2013,21 @@ fd++); transport->fd = -1; - uuid = media_endpoint_get_uuid(endpoint); - if (strcasecmp(uuid, A2DP_SOURCE_UUID) == 0) { - if (media_transport_init_source(transport) < 0) - goto fail; - properties = a2dp_properties; - } else if (strcasecmp(uuid, A2DP_SINK_UUID) == 0) { - if (media_transport_init_sink(transport) < 0) - goto fail; - properties = a2dp_properties; - } else if (!strcasecmp(uuid, PAC_SINK_UUID) || - !strcasecmp(uuid, PAC_SOURCE_UUID)) { - if (media_transport_init_bap(transport, stream) < 0) - goto fail; - properties = bap_ucast_properties; - } else if (!strcasecmp(uuid, BCAA_SERVICE_UUID) || - !strcasecmp(uuid, BAA_SERVICE_UUID)) { - if (media_transport_init_bap(transport, stream) < 0) - goto fail; - properties = bap_bcast_properties; - } else + ops = media_transport_find_ops(media_endpoint_get_uuid(endpoint)); + if (!ops) goto fail; + transport->ops = ops; + + if (ops->init) { + transport->data = ops->init(transport, stream); + if (!transport->data) + goto fail; + } + if (g_dbus_register_interface(btd_get_dbus_connection(), transport->path, MEDIA_TRANSPORT_INTERFACE, - transport_methods, NULL, properties, + transport_methods, NULL, ops->properties, transport, media_transport_free) == FALSE) { error("Could not register transport %s", transport->path); goto fail; @@ -1675,8 +2049,8 @@ void *media_transport_get_stream(struct media_transport *transport) { - if (transport->get_stream) - return transport->get_stream(transport); + if (transport->ops && transport->ops->get_stream) + return transport->ops->get_stream(transport); return NULL; } @@ -1702,12 +2076,6 @@ return transport->device; } -int8_t media_transport_get_volume(struct media_transport *transport) -{ - struct a2dp_transport *a2dp = transport->data; - return a2dp->volume; -} - void media_transport_update_volume(struct media_transport *transport, int8_t volume) { @@ -1741,8 +2109,14 @@ continue; /* Volume is A2DP only */ - if (media_endpoint_get_sep(transport->endpoint)) - return media_transport_get_volume(transport); + if (media_endpoint_get_sep(transport->endpoint)) { + int8_t volume; + + if (!media_transport_get_volume(transport, &volume)) + return volume; + + return -1; + } } /* If transport volume doesn't exists use device_volume */
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/audio/transport.h -> _service:tar_scm:bluez-5.77.tar.xz/profiles/audio/transport.h
Changed
@@ -21,7 +21,8 @@ const char *media_transport_get_path(struct media_transport *transport); void *media_transport_get_stream(struct media_transport *transport); struct btd_device *media_transport_get_dev(struct media_transport *transport); -int8_t media_transport_get_volume(struct media_transport *transport); +int media_transport_get_volume(struct media_transport *transport, + int8_t *volume); void media_transport_update_delay(struct media_transport *transport, uint16_t delay); void media_transport_update_volume(struct media_transport *transport,
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/gap/gas.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/gap/gas.c
Changed
@@ -50,10 +50,18 @@ struct gatt_db_attribute *attr; }; -static void gas_free(struct gas *gas) +static void gas_reset(struct gas *gas) { + gas->attr = NULL; gatt_db_unref(gas->db); + gas->db = NULL; bt_gatt_client_unref(gas->client); + gas->client = NULL; +} + +static void gas_free(struct gas *gas) +{ + gas_reset(gas); btd_device_unref(gas->device); g_free(gas); } @@ -152,7 +160,76 @@ DBG("Failed to send request to read appearance"); } -static bool uuid_cmp(uint16_t u16, const bt_uuid_t *uuid) +static void read_ppcp_cb(bool success, uint8_t att_ecode, + const uint8_t *value, uint16_t length, + void *user_data) +{ + struct gas *gas = user_data; + uint16_t min_interval, max_interval, latency, timeout, max_latency; + + if (!success) { + DBG("Reading PPCP failed with ATT error: %u", att_ecode); + return; + } + + if (length != 8) { + DBG("Malformed PPCP value"); + return; + } + + min_interval = get_le16(&value0); + max_interval = get_le16(&value2); + latency = get_le16(&value4); + timeout = get_le16(&value6); + + /* 0xffff indicates no specific min/max */ + if (min_interval == 0xffff) + min_interval = 0x0018; /* 30.0ms */ + + if (max_interval == 0xffff) + max_interval = 0x0028; /* 50.0ms */ + + DBG("GAP Peripheral Preferred Connection Parameters:"); + DBG("\tMinimum connection interval: %u", min_interval); + DBG("\tMaximum connection interval: %u", max_interval); + DBG("\tSlave latency: %u", latency); + DBG("\tConnection Supervision timeout multiplier: %u", timeout); + + /* avoid persisting connection parameters that are not valid */ + if (min_interval > max_interval || + min_interval < 6 || max_interval > 3200) { + warn("GAS PPCP: Invalid Connection Parameters values"); + return; + } + + if (timeout < 10 || timeout > 3200) { + warn("GAS PPCP: Invalid Connection Parameters values"); + return; + } + + if (max_interval >= timeout * 8) { + warn("GAS PPCP: Invalid Connection Parameters values"); + return; + } + + max_latency = (timeout * 4 / max_interval) - 1; + if (latency > 499 || latency > max_latency) { + warn("GAS PPCP: Invalid Connection Parameters values"); + return; + } + + btd_device_set_conn_param(gas->device, min_interval, max_interval, + latency, timeout); +} + +static void handle_ppcp(struct gas *gas, uint16_t value_handle) +{ + if (!bt_gatt_client_read_value(gas->client, value_handle, + read_ppcp_cb, gas, NULL)) + DBG("Failed to send request to read PPCP"); +} + +static inline bool uuid_cmp(uint16_t u16, const bt_uuid_t *uuid) { bt_uuid_t lhs; @@ -178,6 +255,8 @@ handle_device_name(gas, value_handle); else if (uuid_cmp(GATT_CHARAC_APPEARANCE, &uuid)) handle_appearance(gas, value_handle); + else if (uuid_cmp(GATT_CHARAC_PERIPHERAL_PREF_CONN, &uuid)) + handle_ppcp(gas, value_handle); else { char uuid_strMAX_LEN_UUID_STR; @@ -188,11 +267,6 @@ } } -static void handle_gap_service(struct gas *gas) -{ - gatt_db_service_foreach_char(gas->attr, handle_characteristic, gas); -} - static int gap_probe(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); @@ -246,16 +320,7 @@ } gas->attr = attr; - handle_gap_service(gas); -} - -static void gas_reset(struct gas *gas) -{ - gas->attr = NULL; - gatt_db_unref(gas->db); - gas->db = NULL; - bt_gatt_client_unref(gas->client); - gas->client = NULL; + gatt_db_service_foreach_char(gas->attr, handle_characteristic, gas); } static int gap_accept(struct btd_service *service) @@ -266,15 +331,21 @@ struct gas *gas = btd_service_get_user_data(service); char addr18; bt_uuid_t gap_uuid; + int err = 0; ba2str(device_get_address(device), addr); DBG("GAP profile accept (%s)", addr); if (!gas) { error("GAP service not handled by profile"); - return -1; + err = -1; + goto _finish; } + /* Check if attribute already has been discovered */ + if (gas->attr) + goto _finish; + gas->db = gatt_db_ref(db); gas->client = bt_gatt_client_clone(client); @@ -285,20 +356,18 @@ if (!gas->attr) { error("GAP attribute not found"); gas_reset(gas); - return -1; + err = -1; } - btd_service_connecting_complete(service, 0); +_finish: - return 0; + btd_service_connecting_complete(service, err); + + return err; } static int gap_disconnect(struct btd_service *service) { - struct gas *gas = btd_service_get_user_data(service); - - gas_reset(gas); - btd_service_disconnecting_complete(service, 0); return 0;
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/health/hdp_util.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/health/hdp_util.c
Changed
@@ -42,7 +42,7 @@ GError **err); struct dict_entry_func { - char *key; + const char *key; parse_item_f func; }; @@ -67,7 +67,7 @@ GDestroyNotify destroy; }; -static gboolean parse_dict_entry(struct dict_entry_func dict_context, +static gboolean parse_dict_entry(const struct dict_entry_func dict_context, DBusMessageIter *iter, GError **err, gpointer user_data) @@ -75,7 +75,6 @@ DBusMessageIter entry; char *key; int ctype, i; - struct dict_entry_func df; dbus_message_iter_recurse(iter, &entry); ctype = dbus_message_iter_get_arg_type(&entry); @@ -88,9 +87,9 @@ dbus_message_iter_get_basic(&entry, &key); dbus_message_iter_next(&entry); /* Find function and call it */ - for (i = 0, df = dict_context0; df.key; i++, df = dict_contexti) { - if (g_ascii_strcasecmp(df.key, key) == 0) - return df.func(&entry, user_data, err); + for (i = 0; dict_contexti.key; i++) { + if (g_ascii_strcasecmp(dict_contexti.key, key) == 0) + return dict_contexti.func(&entry, user_data, err); } g_set_error(err, HDP_ERROR, HDP_DIC_ENTRY_PARSE_ERROR, @@ -98,7 +97,7 @@ return FALSE; } -static gboolean parse_dict(struct dict_entry_func dict_context, +static gboolean parse_dict(const struct dict_entry_func dict_context, DBusMessageIter *iter, GError **err, gpointer user_data) @@ -273,7 +272,7 @@ return TRUE; } -static struct dict_entry_func dict_parser = { +static const struct dict_entry_func dict_parser = { {"DataType", parse_data_type}, {"Role", parse_role}, {"Description", parse_desc},
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/health/mcap.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/health/mcap.c
Changed
@@ -1907,6 +1907,7 @@ set_default_cb(mcl); if (util_getrandom(&val, sizeof(val), 0) < 0) { mcap_instance_unref(mcl->mi); + g_free(mcl->cb); g_free(mcl); return FALSE; } @@ -2051,6 +2052,7 @@ set_default_cb(mcl); if (util_getrandom(&val, sizeof(val), 0) < 0) { mcap_instance_unref(mcl->mi); + g_free(mcl->cb); g_free(mcl); goto drop; }
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/iap/main.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/iap/main.c
Changed
@@ -398,7 +398,7 @@ static gboolean option_version = FALSE; -static GOptionEntry options = { +static const GOptionEntry options = { { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version, "Show version information and exit" }, { NULL },
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/input/device.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/input/device.c
Changed
@@ -42,6 +42,8 @@ #include "src/sdp-client.h" #include "src/shared/timeout.h" #include "src/shared/uhid.h" +#include "src/shared/util.h" +#include "src/shared/queue.h" #include "device.h" #include "hidp_defs.h" @@ -55,6 +57,11 @@ RECONNECT_ANY }; +struct hidp_msg { + uint8_t hdr; + struct iovec *iov; +}; + struct input_device { struct btd_service *service; struct btd_device *device; @@ -73,15 +80,16 @@ unsigned int reconnect_timer; uint32_t reconnect_attempt; struct bt_uhid *uhid; - bool uhid_created; uint8_t report_req_pending; unsigned int report_req_timer; uint32_t report_rsp_id; bool virtual_cable_unplug; + uint8_t type; + unsigned int idle_timer; }; static int idle_timeout = 0; -static bool uhid_enabled = false; +static bool uhid_enabled = true; static bool classic_bonded_only = true; void input_set_idle_timeout(int timeout) @@ -106,7 +114,6 @@ static void input_device_enter_reconnect_mode(struct input_device *idev); static int connection_disconnect(struct input_device *idev, uint32_t flags); -static int uhid_disconnect(struct input_device *idev); static bool input_device_bonded(struct input_device *idev) { @@ -141,6 +148,9 @@ g_free(idev->req); } + if (idev->idle_timer) + timeout_remove(idev->idle_timer); + if (idev->reconnect_timer > 0) timeout_remove(idev->reconnect_timer); @@ -158,8 +168,55 @@ idev->virtual_cable_unplug = false; } -static bool hidp_send_message(GIOChannel *chan, uint8_t hdr, - const uint8_t *data, size_t size) +static int uhid_disconnect(struct input_device *idev, bool force) +{ + int err; + + if (!bt_uhid_created(idev->uhid)) + return 0; + + /* Force destroy the node if virtual cable unplug flag has been set */ + if (idev->virtual_cable_unplug && !force) + force = true; + + err = bt_uhid_destroy(idev->uhid, force); + if (err < 0) { + error("bt_uhid_destroy: %s", strerror(-err)); + return err; + } + + if (!bt_uhid_created(idev->uhid)) + bt_uhid_unregister_all(idev->uhid); + + return err; +} + +static bool input_device_idle_timeout(gpointer user_data) +{ + struct input_device *idev = user_data; + + idev->idle_timer = 0; + + DBG("path=%s", idev->path); + + uhid_disconnect(idev, true); + connection_disconnect(idev, 0); + + return false; +} + +static void input_device_idle_reset(struct input_device *idev) +{ + timeout_remove(idev->idle_timer); + + if (idle_timeout) + idev->idle_timer = timeout_add_seconds(idle_timeout, + input_device_idle_timeout, idev, + NULL); +} + +static bool hidp_send_message(struct input_device *idev, GIOChannel *chan, + uint8_t hdr, const uint8_t *data, size_t size) { int fd; ssize_t len; @@ -193,6 +250,8 @@ return false; } + input_device_idle_reset(idev); + return true; } @@ -202,45 +261,33 @@ if (hdr == (HIDP_TRANS_HID_CONTROL | HIDP_CTRL_VIRTUAL_CABLE_UNPLUG)) idev->virtual_cable_unplug = true; - return hidp_send_message(idev->ctrl_io, hdr, data, size); + return hidp_send_message(idev, idev->ctrl_io, hdr, data, size); } static bool hidp_send_intr_message(struct input_device *idev, uint8_t hdr, const uint8_t *data, size_t size) { - return hidp_send_message(idev->intr_io, hdr, data, size); + return hidp_send_message(idev, idev->intr_io, hdr, data, size); } static bool uhid_send_get_report_reply(struct input_device *idev, const uint8_t *data, size_t size, uint32_t id, uint16_t err) { - struct uhid_event ev; int ret; if (data == NULL) size = 0; - if (size > sizeof(ev.u.get_report_reply.data)) - size = sizeof(ev.u.get_report_reply.data); - - if (!idev->uhid_created) { + if (!bt_uhid_created(idev->uhid)) { DBG("HID report (%zu bytes) dropped", size); return false; } - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_GET_REPORT_REPLY; - ev.u.get_report_reply.id = id; - ev.u.get_report_reply.err = err; - ev.u.get_report_reply.size = size; - - if (size > 0) - memcpy(ev.u.get_report_reply.data, data, size); - - ret = bt_uhid_send(idev->uhid, &ev); + ret = bt_uhid_get_report_reply(idev->uhid, id, 0, err, data, size); if (ret < 0) { - error("bt_uhid_send: %s (%d)", strerror(-ret), -ret); + error("bt_uhid_get_report_reply: %s (%d)", strerror(-ret), + -ret); return false; } @@ -252,20 +299,15 @@ static bool uhid_send_set_report_reply(struct input_device *idev, uint32_t id, uint16_t err) { - struct uhid_event ev; int ret; - if (!idev->uhid_created) + if (!bt_uhid_created(idev->uhid)) return false; - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_SET_REPORT_REPLY; - ev.u.set_report_reply.id = id; - ev.u.set_report_reply.err = err; - - ret = bt_uhid_send(idev->uhid, &ev); + ret = bt_uhid_set_report_reply(idev->uhid, id, err); if (ret < 0) { - error("bt_uhid_send: %s (%d)", strerror(-ret), -ret); + error("bt_uhid_set_report_reply: %s (%d)", strerror(-ret), + -ret); return false; } @@ -275,30 +317,19 @@ static bool uhid_send_input_report(struct input_device *idev, const uint8_t *data, size_t size) { - struct uhid_event ev; int err; if (data == NULL) size = 0; - if (size > sizeof(ev.u.input.data)) - size = sizeof(ev.u.input.data); - - if (!idev->uhid_created) { + if (!bt_uhid_created(idev->uhid)) { DBG("HID report (%zu bytes) dropped", size); return false; } - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_INPUT; - ev.u.input.size = size; - - if (size > 0) - memcpy(ev.u.input.data, data, size); - - err = bt_uhid_send(idev->uhid, &ev); + err = bt_uhid_input(idev->uhid, 0, data, size); if (err < 0) { - error("bt_uhid_send: %s (%d)", strerror(-err), -err); + error("bt_uhid_input: %s (%d)", strerror(-err), -err); return false; } @@ -327,6 +358,8 @@ return true; } + input_device_idle_reset(idev); + hdr = data0; if (hdr != (HIDP_TRANS_DATA | HIDP_DATA_RTYPE_INPUT)) { DBG("unsupported HIDP protocol header 0x%02x", hdr); @@ -385,8 +418,7 @@ virtual_cable_unplug(idev); /* If connection abruptly ended, uhid might be not yet disconnected */ - if (idev->uhid_created) - uhid_disconnect(idev); + uhid_disconnect(idev, false); return FALSE; } @@ -445,6 +477,7 @@ timeout_remove(idev->report_req_timer); idev->report_req_timer = 0; } + uhid_send_set_report_reply(idev, idev->report_rsp_id, 0); idev->report_rsp_id = 0; } } @@ -528,6 +561,8 @@ return true; } + input_device_idle_reset(idev); + hdr = data0; type = hdr & HIDP_HEADER_TRANS_MASK; param = hdr & HIDP_HEADER_PARAM_MASK; @@ -625,7 +660,7 @@ break; } - DBG("Device %s HIDP %s request timed out", address, req_type_str); + error("Device %s HIDP %s request timed out", address, req_type_str); idev->report_req_pending = 0; idev->report_req_timer = 0; @@ -638,11 +673,14 @@ { struct input_device *idev = user_data; uint8_t hdr = HIDP_TRANS_DATA | HIDP_DATA_RTYPE_OUTPUT; + bool sent; DBG(""); - hidp_send_intr_message(idev, hdr, ev->u.output.data, + sent = hidp_send_intr_message(idev, hdr, ev->u.output.data, ev->u.output.size); + if (!sent) + uhid_disconnect(idev, true); } static void hidp_send_set_report(struct uhid_event *ev, void *user_data) @@ -682,8 +720,11 @@ timeout_add_seconds(REPORT_REQ_TIMEOUT, hidp_report_req_timeout, idev, NULL); idev->report_rsp_id = ev->u.set_report.id; - } else + } else { uhid_send_set_report_reply(idev, ev->u.set_report.id, EIO); + /* Force UHID_DESTROY on error */ + uhid_disconnect(idev, true); + } } static void hidp_send_get_report(struct uhid_event *ev, void *user_data) @@ -726,9 +767,12 @@ hidp_report_req_timeout, idev, NULL); idev->report_rsp_id = ev->u.get_report.id; - } else + } else { uhid_send_get_report_reply(idev, NULL, 0, ev->u.get_report.id, EIO); + /* Force UHID_DESTROY on error */ + uhid_disconnect(idev, true); + } } static void epox_endian_quirk(unsigned char *data, int size) @@ -941,28 +985,16 @@ static int uhid_connadd(struct input_device *idev, struct hidp_connadd_req *req) { int err; - struct uhid_event ev; - if (idev->uhid_created) - return 0; + if (bt_uhid_created(idev->uhid)) + return bt_uhid_replay(idev->uhid); - /* create uHID device */ - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_CREATE; - strncpy((char *) ev.u.create.name, req->name, sizeof(ev.u.create.name)); - ba2strlc(&idev->src, (char *) ev.u.create.phys); - ba2strlc(&idev->dst, (char *) ev.u.create.uniq); - ev.u.create.vendor = req->vendor; - ev.u.create.product = req->product; - ev.u.create.version = req->version; - ev.u.create.country = req->country; - ev.u.create.bus = BUS_BLUETOOTH; - ev.u.create.rd_data = req->rd_data; - ev.u.create.rd_size = req->rd_size; - - err = bt_uhid_send(idev->uhid, &ev); + err = bt_uhid_create(idev->uhid, req->name, &idev->src, &idev->dst, + req->vendor, req->product, req->version, + req->country, idev->type, + req->rd_data, req->rd_size); if (err < 0) { - error("bt_uhid_send: %s", strerror(-err)); + error("bt_uhid_create: %s", strerror(-err)); return err; } @@ -972,32 +1004,6 @@ bt_uhid_register(idev->uhid, UHID_SET_REPORT, hidp_send_set_report, idev); - idev->uhid_created = true; - - return err; -} - -static int uhid_disconnect(struct input_device *idev) -{ - int err; - struct uhid_event ev; - - if (!idev->uhid_created) - return 0; - - bt_uhid_unregister_all(idev->uhid); - - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_DESTROY; - - err = bt_uhid_send(idev->uhid, &ev); - if (err < 0) { - error("bt_uhid_send: %s", strerror(-err)); - return err; - } - - idev->uhid_created = false; - return err; } @@ -1075,7 +1081,7 @@ /* Some platforms may choose to require encryption for all devices */ /* Note that this only matters for pre 2.1 devices as otherwise the */ /* device is encrypted by default by the lower layers */ - if (classic_bonded_only || req->subclass & 0x40) { + if (classic_bonded_only || idev->type == BT_UHID_KEYBOARD) { if (!bt_io_set(idev->intr_io, &gerr, BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM, BT_IO_OPT_INVALID)) { @@ -1132,7 +1138,7 @@ idev->virtual_cable_unplug = true; if (idev->uhid) - return uhid_disconnect(idev); + return uhid_disconnect(idev, false); else return ioctl_disconnect(idev, flags); } @@ -1465,6 +1471,7 @@ idev->service = btd_service_ref(service); idev->device = btd_device_ref(device); idev->path = g_strdup(path); + idev->type = bt_uhid_icon_to_type(btd_device_get_icon(device)); input_device_update_rec(idev);
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/input/hog-lib.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/input/hog-lib.c
Changed
@@ -73,14 +73,13 @@ uint16_t vendor; uint16_t product; uint16_t version; + uint8_t type; struct gatt_db_attribute *attr; struct gatt_primary *primary; GAttrib *attrib; GSList *reports; struct bt_uhid *uhid; int uhid_fd; - bool uhid_created; - bool uhid_start; uint64_t uhid_flags; uint16_t bcdhid; uint8_t bcountrycode; @@ -99,7 +98,6 @@ struct queue *gatt_op; struct gatt_db *gatt_db; struct gatt_db_attribute *report_map_attr; - struct queue *input; }; struct report { @@ -326,8 +324,6 @@ { struct report *report = user_data; struct bt_hog *hog = report->hog; - struct uhid_event ev; - uint8_t *buf; int err; if (len < ATT_NOTIFICATION_HEADER_SIZE) { @@ -338,40 +334,10 @@ pdu += ATT_NOTIFICATION_HEADER_SIZE; len -= ATT_NOTIFICATION_HEADER_SIZE; - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_INPUT; - buf = ev.u.input.data; - - /* BLUETOOTH SPECIFICATION Page 16 of 26 - * HID Service Specification - * - * Report ID shall be nonzero in a Report Reference characteristic - * descriptor where there is more than one instance of the Report - * characteristic for any given Report Type. - */ - if (report->numbered && report->id) { - buf0 = report->id; - len = MIN(len, sizeof(ev.u.input.data) - 1); - memcpy(buf + 1, pdu, len); - ev.u.input.size = ++len; - } else { - len = MIN(len, sizeof(ev.u.input.data)); - memcpy(buf, pdu, len); - ev.u.input.size = len; - } - - /* If uhid had not sent UHID_START yet queue up the input */ - if (!hog->uhid_created || !hog->uhid_start) { - if (!hog->input) - hog->input = queue_new(); - - queue_push_tail(hog->input, util_memdup(&ev, sizeof(ev))); - return; - } - - err = bt_uhid_send(hog->uhid, &ev); + err = bt_uhid_input(hog->uhid, report->numbered ? report->id : 0, pdu, + len); if (err < 0) - error("bt_uhid_send: %s (%d)", strerror(-err), -err); + error("bt_uhid_input: %s (%d)", strerror(-err), -err); } static void report_notify_destroy(void *user_data) @@ -832,56 +798,46 @@ } } -static bool input_dequeue(const void *data, const void *match_data) -{ - const struct uhid_event *ev = data; - const struct bt_hog *hog = match_data; - int err; - - err = bt_uhid_send(hog->uhid, ev); - if (err < 0) { - error("bt_uhid_send: %s (%d)", strerror(-err), -err); - return false; - } - - return true; -} - static void start_flags(struct uhid_event *ev, void *user_data) { struct bt_hog *hog = user_data; - hog->uhid_start = true; hog->uhid_flags = ev->u.start.dev_flags; DBG("uHID device flags: 0x%16" PRIx64, hog->uhid_flags); if (hog->uhid_flags) g_slist_foreach(hog->reports, set_numbered, hog); - - queue_remove_all(hog->input, input_dequeue, hog, free); } static void set_report_cb(guint8 status, const guint8 *pdu, guint16 plen, gpointer user_data) { struct bt_hog *hog = user_data; - struct uhid_event rsp; int err; hog->setrep_att = 0; - memset(&rsp, 0, sizeof(rsp)); - rsp.type = UHID_SET_REPORT_REPLY; - rsp.u.set_report_reply.id = hog->setrep_id; - rsp.u.set_report_reply.err = status; - if (status != 0) error("Error setting Report value: %s", att_ecode2str(status)); - err = bt_uhid_send(hog->uhid, &rsp); + err = bt_uhid_set_report_reply(hog->uhid, hog->setrep_id, status); if (err < 0) - error("bt_uhid_send: %s", strerror(-err)); + error("bt_uhid_set_report_reply: %s", strerror(-err)); +} + +static void uhid_destroy(struct bt_hog *hog, bool force) +{ + int err; + + err = bt_uhid_destroy(hog->uhid, force); + if (err < 0) { + error("bt_uhid_destroy: %s", strerror(-err)); + return; + } + + if (bt_uhid_created(hog->uhid)) + bt_uhid_unregister_all(hog->uhid); } static void set_report(struct uhid_event *ev, void *user_data) @@ -892,6 +848,14 @@ int size; int err; + /* Destroy input device if there is an attempt to communicate with it + * while disconnected. + */ + if (hog->attrib == NULL) { + uhid_destroy(hog, true); + return; + } + /* uhid never sends reqs in parallel; if there's a req, it timed out */ if (hog->setrep_att) { g_attrib_cancel(hog->attrib, hog->setrep_att); @@ -918,9 +882,6 @@ DBG("Sending report type %d ID %d to handle 0x%X", report->type, report->id, report->value_handle); - if (hog->attrib == NULL) - return; - hog->setrep_att = gatt_write_char(hog->attrib, report->value_handle, data, size, set_report_cb, @@ -937,34 +898,16 @@ } static void report_reply(struct bt_hog *hog, uint8_t status, uint8_t id, - bool numbered, uint16_t len, const uint8_t *data) + uint16_t len, const uint8_t *data) { - struct uhid_event rsp; int err; hog->getrep_att = 0; - memset(&rsp, 0, sizeof(rsp)); - rsp.type = UHID_GET_REPORT_REPLY; - rsp.u.get_report_reply.id = hog->getrep_id; - - if (status) - goto done; - - if (numbered && len > 0) { - rsp.u.get_report_reply.size = len + 1; - rsp.u.get_report_reply.data0 = id; - memcpy(&rsp.u.get_report_reply.data1, data, len); - } else { - rsp.u.get_report_reply.size = len; - memcpy(rsp.u.get_report_reply.data, data, len); - } - -done: - rsp.u.get_report_reply.err = status; - err = bt_uhid_send(hog->uhid, &rsp); + err = bt_uhid_get_report_reply(hog->uhid, hog->getrep_id, id, status, + data, len); if (err < 0) - error("bt_uhid_send: %s", strerror(-err)); + error("bt_uhid_get_report_reply: %s", strerror(-err)); } static void get_report_cb(guint8 status, const guint8 *pdu, guint16 len, @@ -994,7 +937,7 @@ ++pdu; exit: - report_reply(hog, status, report->id, report->numbered, len, pdu); + report_reply(hog, status, report->numbered ? report->id : 0, len, pdu); } static void get_report(struct uhid_event *ev, void *user_data) @@ -1003,6 +946,14 @@ struct report *report; guint8 err; + /* Destroy input device if there is an attempt to communicate with it + * while disconnected. + */ + if (hog->attrib == NULL) { + uhid_destroy(hog, true); + return; + } + /* uhid never sends reqs in parallel; if there's a req, it timed out */ if (hog->getrep_att) { g_attrib_cancel(hog->attrib, hog->getrep_att); @@ -1030,61 +981,33 @@ fail: /* reply with an error on failure */ - report_reply(hog, err, 0, false, 0, NULL); + report_reply(hog, err, 0, 0, NULL); } static void uhid_create(struct bt_hog *hog, uint8_t *report_map, size_t report_map_len) { uint8_t *value = report_map; - struct uhid_event ev; size_t vlen = report_map_len; - int i, err; + int err; GError *gerr = NULL; - - if (vlen > sizeof(ev.u.create2.rd_data)) { - error("Report MAP too big: %zu > %zu", vlen, - sizeof(ev.u.create2.rd_data)); - return; - } - - /* create uHID device */ - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_CREATE2; + bdaddr_t src, dst; bt_io_get(g_attrib_get_channel(hog->attrib), &gerr, - BT_IO_OPT_SOURCE, ev.u.create2.phys, - BT_IO_OPT_DEST, ev.u.create2.uniq, + BT_IO_OPT_SOURCE_BDADDR, &src, + BT_IO_OPT_DEST_BDADDR, &dst, BT_IO_OPT_INVALID); - if (gerr) { error("Failed to connection details: %s", gerr->message); g_error_free(gerr); return; } - /* Phys + uniq are the same size (hw address type) */ - for (i = 0; - i < (int)sizeof(ev.u.create2.phys) && ev.u.create2.physi != 0; - ++i) { - ev.u.create2.physi = tolower(ev.u.create2.physi); - ev.u.create2.uniqi = tolower(ev.u.create2.uniqi); - } - - strncpy((char *) ev.u.create2.name, hog->name, - sizeof(ev.u.create2.name) - 1); - ev.u.create2.vendor = hog->vendor; - ev.u.create2.product = hog->product; - ev.u.create2.version = hog->version; - ev.u.create2.country = hog->bcountrycode; - ev.u.create2.bus = BUS_BLUETOOTH; - ev.u.create2.rd_size = vlen; - - memcpy(ev.u.create2.rd_data, value, vlen); - - err = bt_uhid_send(hog->uhid, &ev); + err = bt_uhid_create(hog->uhid, hog->name, &src, &dst, + hog->vendor, hog->product, hog->version, + hog->bcountrycode, hog->type, value, vlen); if (err < 0) { - error("bt_uhid_send: %s", strerror(-err)); + error("bt_uhid_create: %s", strerror(-err)); return; } @@ -1093,9 +1016,6 @@ bt_uhid_register(hog->uhid, UHID_GET_REPORT, get_report, hog); bt_uhid_register(hog->uhid, UHID_SET_REPORT, set_report, hog); - hog->uhid_created = true; - hog->uhid_start = false; - DBG("HoG created uHID device"); } @@ -1146,7 +1066,8 @@ { uint16_t handle; - if (!hog->report_map_attr || hog->uhid_created || hog->report_map_id) + if (!hog->report_map_attr || bt_uhid_created(hog->uhid) || + hog->report_map_id) return; handle = gatt_db_attribute_get_handle(hog->report_map_attr); @@ -1313,9 +1234,9 @@ { struct bt_hog *hog = data; - bt_hog_detach(hog); + bt_hog_detach(hog, true); + uhid_destroy(hog, true); - queue_destroy(hog->input, free); queue_destroy(hog->bas, (void *) bt_bas_unref); g_slist_free_full(hog->instances, hog_free); @@ -1333,9 +1254,9 @@ struct bt_hog *bt_hog_new_default(const char *name, uint16_t vendor, uint16_t product, uint16_t version, - struct gatt_db *db) + uint8_t type, struct gatt_db *db) { - return bt_hog_new(-1, name, vendor, product, version, db); + return bt_hog_new(-1, name, vendor, product, version, type, db); } static void foreach_hog_report(struct gatt_db_attribute *attr, void *user_data) @@ -1495,6 +1416,7 @@ static struct bt_hog *hog_new(int fd, const char *name, uint16_t vendor, uint16_t product, uint16_t version, + uint8_t type, struct gatt_db_attribute *attr) { struct bt_hog *hog; @@ -1522,6 +1444,7 @@ hog->vendor = vendor; hog->product = product; hog->version = version; + hog->type = type; hog->attr = attr; return hog; @@ -1537,8 +1460,8 @@ return; } - instance = hog_new(hog->uhid_fd, hog->name, hog->vendor, - hog->product, hog->version, attr); + instance = hog_new(hog->uhid_fd, hog->name, hog->vendor, hog->product, + hog->version, hog->type, attr); if (!instance) return; @@ -1574,11 +1497,11 @@ struct bt_hog *bt_hog_new(int fd, const char *name, uint16_t vendor, uint16_t product, uint16_t version, - struct gatt_db *db) + uint8_t type, struct gatt_db *db) { struct bt_hog *hog; - hog = hog_new(fd, name, vendor, product, version, NULL); + hog = hog_new(fd, name, vendor, product, version, type, NULL); if (!hog) return NULL; @@ -1701,7 +1624,7 @@ instance = bt_hog_new(hog->uhid_fd, hog->name, hog->vendor, hog->product, hog->version, - hog->gatt_db); + hog->type, hog->gatt_db); if (!instance) return; @@ -1786,7 +1709,7 @@ bt_hog_attach(instance, gatt); } - if (!hog->uhid_created) { + if (!bt_uhid_created(hog->uhid)) { DBG("HoG discovering characteristics"); if (hog->attr) gatt_db_service_foreach_char(hog->attr, @@ -1798,7 +1721,7 @@ char_discovered_cb, hog); } - if (!hog->uhid_created) + if (!bt_uhid_created(hog->uhid)) return true; /* If UHID is already created, set up the report value handlers to @@ -1820,45 +1743,30 @@ "handle 0x%04x", r->value_handle); } + /* Attempt to replay get/set report messages since the driver might not + * be aware the device has been disconnected in the meantime. + */ + bt_uhid_replay(hog->uhid); + return true; } -static void uhid_destroy(struct bt_hog *hog) +void bt_hog_detach(struct bt_hog *hog, bool force) { - int err; - struct uhid_event ev; - - if (!hog->uhid_created) - return; - - bt_uhid_unregister_all(hog->uhid); - - memset(&ev, 0, sizeof(ev)); - ev.type = UHID_DESTROY; - - err = bt_uhid_send(hog->uhid, &ev); + GSList *l; - if (err < 0) { - error("bt_uhid_send: %s", strerror(-err)); + if (!hog) return; - } - - hog->uhid_created = false; -} - -void bt_hog_detach(struct bt_hog *hog) -{ - GSList *l; if (!hog->attrib) - return; + goto done; queue_foreach(hog->bas, (void *) bt_bas_detach, NULL); for (l = hog->instances; l; l = l->next) { struct bt_hog *instance = l->data; - bt_hog_detach(instance); + bt_hog_detach(instance, force); } for (l = hog->reports; l; l = l->next) { @@ -1879,7 +1787,9 @@ queue_remove_all(hog->gatt_op, cancel_gatt_req, hog, destroy_gatt_req); g_attrib_unref(hog->attrib); hog->attrib = NULL; - uhid_destroy(hog); + +done: + uhid_destroy(hog, force); } int bt_hog_set_control_point(struct bt_hog *hog, bool suspend)
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/input/hog-lib.h -> _service:tar_scm:bluez-5.77.tar.xz/profiles/input/hog-lib.h
Changed
@@ -12,17 +12,17 @@ struct bt_hog *bt_hog_new_default(const char *name, uint16_t vendor, uint16_t product, uint16_t version, - struct gatt_db *db); + uint8_t type, struct gatt_db *db); struct bt_hog *bt_hog_new(int fd, const char *name, uint16_t vendor, uint16_t product, uint16_t version, - struct gatt_db *db); + uint8_t type, struct gatt_db *db); struct bt_hog *bt_hog_ref(struct bt_hog *hog); void bt_hog_unref(struct bt_hog *hog); bool bt_hog_attach(struct bt_hog *hog, void *gatt); -void bt_hog_detach(struct bt_hog *hog); +void bt_hog_detach(struct bt_hog *hog, bool force); int bt_hog_set_control_point(struct bt_hog *hog, bool suspend); int bt_hog_send_report(struct bt_hog *hog, void *data, size_t size, int type);
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/input/hog.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/input/hog.c
Changed
@@ -50,6 +50,7 @@ struct hog_device { struct btd_device *device; struct bt_hog *hog; + uint8_t type; }; static gboolean suspend_supported = FALSE; @@ -64,7 +65,7 @@ static void hog_device_accept(struct hog_device *dev, struct gatt_db *db) { char name248; - uint16_t vendor, product, version; + uint16_t vendor, product, version, type; if (dev->hog) return; @@ -77,11 +78,12 @@ vendor = btd_device_get_vendor(dev->device); product = btd_device_get_product(dev->device); version = btd_device_get_version(dev->device); + type = bt_uhid_icon_to_type(btd_device_get_icon(dev->device)); DBG("name=%s vendor=0x%X, product=0x%X, version=0x%X", name, vendor, product, version); - dev->hog = bt_hog_new_default(name, vendor, product, version, db); + dev->hog = bt_hog_new_default(name, vendor, product, version, type, db); } static struct hog_device *hog_device_new(struct btd_device *device) @@ -206,7 +208,7 @@ { struct hog_device *dev = btd_service_get_user_data(service); - bt_hog_detach(dev->hog); + bt_hog_detach(dev->hog, false); btd_service_disconnecting_complete(service, 0);
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/input/input.conf -> _service:tar_scm:bluez-5.77.tar.xz/profiles/input/input.conf
Changed
@@ -4,12 +4,13 @@ # particular interface General -# Set idle timeout (in minutes) before the connection will -# be disconnect (defaults to 0 for no timeout) -#IdleTimeout=30 +# Set idle timeout (in seconds) before the connection will be disconnect and +# the input device is removed. +# Defaults: 0 (disabled) +#IdleTimeout=0 # Enable HID protocol handling in userspace input profile -# Defaults to false (HIDP handled in HIDP kernel module) +# Defaults to true (Use UHID instead of kernel HIDP) #UserspaceHID=true # Limit HID connections to bonded devices
View file
_service:tar_scm:bluez-5.71.tar.xz/profiles/input/manager.c -> _service:tar_scm:bluez-5.77.tar.xz/profiles/input/manager.c
Changed
@@ -89,7 +89,7 @@ "IdleTimeout", &err); if (!err) { DBG("input.conf: IdleTimeout=%d", idle_timeout); - input_set_idle_timeout(idle_timeout * 60); + input_set_idle_timeout(idle_timeout); } else g_clear_error(&err);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/adapter.c -> _service:tar_scm:bluez-5.77.tar.xz/src/adapter.c
Changed
@@ -311,6 +311,7 @@ bool pincode_requested; /* PIN requested during last bonding */ GSList *connections; /* Connected devices */ GSList *devices; /* Devices structure pointers */ + GSList *load_keys; /* Devices keys to be loaded */ GSList *connect_list; /* Devices to connect when found */ struct btd_device *connect_le; /* LE device waiting to be connected */ sdp_list_t *services; /* Services associated to adapter */ @@ -1348,6 +1349,10 @@ void adapter_service_remove(struct btd_adapter *adapter, uint32_t handle) { sdp_record_t *rec; + + if (!adapter) + return; + /* * If the controller does not support BR/EDR operation, * there is no point in trying to remote SDP records. @@ -1729,7 +1734,8 @@ next = g_slist_next(l); - if (device_is_temporary(dev) && !device_is_connectable(dev)) + if (device_is_temporary(dev) && !device_is_connectable(dev) + && !btd_device_is_connected(dev)) btd_adapter_remove_device(adapter, dev); } } @@ -2405,7 +2411,7 @@ * starting discovery. */ if (filters_equal(adapter->current_discovery_filter, sd_cp) && - adapter->discovering != 0) { + adapter->discovering != false) { DBG("filters were equal, deciding to not restart the scan."); g_free(sd_cp); return 0; @@ -3913,8 +3919,7 @@ { "Alias", "s", property_get_alias, property_set_alias }, { "Class", "u", property_get_class }, { "Powered", "b", property_get_powered, property_set_powered }, - { "PowerState", "s", property_get_power_state, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL }, + { "PowerState", "s", property_get_power_state }, { "Discoverable", "b", property_get_discoverable, property_set_discoverable }, { "DiscoverableTimeout", "u", property_get_discoverable_timeout, @@ -4284,6 +4289,9 @@ return -1; } +static void load_link_keys(struct btd_adapter *adapter, bool debug_keys, + bool retry); + static void load_link_keys_complete(uint8_t status, uint16_t length, const void *param, void *user_data) { @@ -4293,18 +4301,31 @@ btd_error(adapter->dev_id, "Failed to load link keys for hci%u: %s (0x%02x)", adapter->dev_id, mgmt_errstr(status), status); + + if (status == MGMT_STATUS_INVALID_PARAMS) { + load_link_keys(adapter, btd_opts.debug_keys, true); + /* Release keys after retry since we shall only retry + * once. + */ + goto done; + } + return; } DBG("link keys loaded for hci%u", adapter->dev_id); + +done: + g_slist_free_full(adapter->load_keys, g_free); + adapter->load_keys = NULL; } -static void load_link_keys(struct btd_adapter *adapter, GSList *keys, - bool debug_keys) +static void load_link_keys(struct btd_adapter *adapter, bool debug_keys, + bool retry) { struct mgmt_cp_load_link_keys *cp; struct mgmt_link_key_info *key; - size_t key_count, cp_size; + size_t count, cp_size; unsigned int id; GSList *l; @@ -4318,12 +4339,14 @@ if (!(adapter->supported_settings & MGMT_SETTING_BREDR)) return; - key_count = g_slist_length(keys); + count = g_slist_length(adapter->load_keys); + if (!count) + return; - DBG("hci%u keys %zu debug_keys %d", adapter->dev_id, key_count, - debug_keys); + DBG("hci%u keys %zu debug_keys %d retry %s", adapter->dev_id, count, + debug_keys, retry ? "true" : "false"); - cp_size = sizeof(*cp) + (key_count * sizeof(*key)); + cp_size = sizeof(*cp) + (count * sizeof(*key)); cp = g_try_malloc0(cp_size); if (cp == NULL) { @@ -4341,13 +4364,18 @@ * behavior for debug keys. */ cp->debug_keys = debug_keys; - cp->key_count = htobs(key_count); + cp->key_count = htobs(count); - for (l = keys, key = cp->keys; l != NULL; l = g_slist_next(l), key++) { + for (l = adapter->load_keys, key = cp->keys; l != NULL; + l = g_slist_next(l), key++) { struct link_key_info *info = l->data; bacpy(&key->addr.bdaddr, &info->bdaddr); - key->addr.type = info->bdaddr_type; + /* Old kernels might only support loading with type set to + * BDADDR_BREDR so on retry set that instead of using the stored + * info. + */ + key->addr.type = retry ? BDADDR_BREDR : info->bdaddr_type; key->type = info->type; memcpy(key->val, info->key, 16); key->pin_len = info->pin_len; @@ -4359,9 +4387,12 @@ g_free(cp); - if (id == 0) + if (id == 0) { btd_error(adapter->dev_id, "Failed to load link keys for hci%u", adapter->dev_id); + g_slist_free_full(adapter->load_keys, g_free); + adapter->load_keys = NULL; + } } static void load_ltks_complete(uint8_t status, uint16_t length, @@ -4602,6 +4633,30 @@ btd_error(adapter->dev_id, "Load connection parameters failed"); } +void btd_adapter_load_conn_param(struct btd_adapter *adapter, + const bdaddr_t *peer, uint8_t bdaddr_type, + uint16_t min_interval, uint16_t max_interval, + uint16_t latency, uint16_t timeout) +{ + GSList *params = NULL; + struct conn_param param; + + /* Only versions >= 1.23 support updating connection parameters */ + if (MGMT_VERSION(mgmt_version, mgmt_revision) < MGMT_VERSION(1, 23)) + return; + + bacpy(¶m.bdaddr, peer); + param.bdaddr_type = bdaddr_type; + param.max_interval = max_interval; + param.min_interval = min_interval; + param.latency = latency; + param.timeout = timeout; + + params = g_slist_append(params, ¶m); + load_conn_params(adapter, params); + g_slist_free(params); +} + static uint8_t get_addr_type(GKeyFile *keyfile) { uint8_t addr_type; @@ -4873,7 +4928,6 @@ static void load_devices(struct btd_adapter *adapter) { char dirnamePATH_MAX; - GSList *keys = NULL; GSList *ltks = NULL; GSList *irks = NULL; GSList *params = NULL; @@ -4964,7 +5018,8 @@ } if (key_info) - keys = g_slist_append(keys, key_info); + adapter->load_keys = g_slist_append(adapter->load_keys, + key_info); if (ltk_info) ltks = g_slist_append(ltks, ltk_info); @@ -5013,8 +5068,7 @@ closedir(dir); - load_link_keys(adapter, keys, btd_opts.debug_keys); - g_slist_free_full(keys, g_free); + load_link_keys(adapter, btd_opts.debug_keys, false); load_ltks(adapter, ltks); g_slist_free_full(ltks, g_free); @@ -6930,6 +6984,9 @@ g_slist_free(adapter->devices); adapter->devices = NULL; + g_slist_free(adapter->load_keys); + adapter->load_keys = NULL; + discovery_cleanup(adapter, 0); unload_drivers(adapter); @@ -7458,7 +7515,7 @@ device_cancel_authentication(device, TRUE); /* If another bearer is still connected */ - if (btd_device_is_connected(device)) + if (btd_device_bearer_is_connected(device)) return; adapter->connections = g_slist_remove(adapter->connections, device); @@ -8757,75 +8814,6 @@ bonding_complete(adapter, &addr->bdaddr, addr->type, 0); } -static void store_csrk(struct btd_adapter *adapter, const bdaddr_t *peer, - uint8_t bdaddr_type, const unsigned char *key, - uint32_t counter, uint8_t type) -{ - const char *group; - char device_addr18; - char filenamePATH_MAX; - GKeyFile *key_file; - GError *gerr = NULL; - char key_str33; - gsize length = 0; - gboolean auth; - char *str; - int i; - - switch (type) { - case 0x00: - group = "LocalSignatureKey"; - auth = FALSE; - break; - case 0x01: - group = "RemoteSignatureKey"; - auth = FALSE; - break; - case 0x02: - group = "LocalSignatureKey"; - auth = TRUE; - break; - case 0x03: - group = "RemoteSignatureKey"; - auth = TRUE; - break; - default: - warn("Unsupported CSRK type %u", type); - return; - } - - ba2str(peer, device_addr); - - create_filename(filename, PATH_MAX, "/%s/%s/info", - btd_adapter_get_storage_dir(adapter), device_addr); - - key_file = g_key_file_new(); - if (!g_key_file_load_from_file(key_file, filename, 0, &gerr)) { - error("Unable to load key file from %s: (%s)", filename, - gerr->message); - g_clear_error(&gerr); - } - - for (i = 0; i < 16; i++) - sprintf(key_str + (i * 2), "%2.2X", keyi); - - g_key_file_set_string(key_file, group, "Key", key_str); - g_key_file_set_integer(key_file, group, "Counter", counter); - g_key_file_set_boolean(key_file, group, "Authenticated", auth); - - create_file(filename, 0600); - - str = g_key_file_to_data(key_file, &length, NULL); - if (!g_file_set_contents(filename, str, length, &gerr)) { - error("Unable set contents for %s: (%s)", filename, - gerr->message); - g_error_free(gerr); - } - g_free(str); - - g_key_file_free(key_file); -} - static void new_csrk_callback(uint16_t index, uint16_t length, const void *param, void *user_data) { @@ -8853,13 +8841,7 @@ return; } - if (!ev->store_hint) - return; - - store_csrk(adapter, &key->addr.bdaddr, key->addr.type, key->val, 0, - key->type); - - btd_device_set_temporary(device, false); + device_set_csrk(device, key->val, 0, key->type, ev->store_hint); } static void store_irk(struct btd_adapter *adapter, const bdaddr_t *peer, @@ -8959,10 +8941,10 @@ btd_device_set_temporary(device, false); } -static void store_conn_param(struct btd_adapter *adapter, const bdaddr_t *peer, - uint8_t bdaddr_type, uint16_t min_interval, - uint16_t max_interval, uint16_t latency, - uint16_t timeout) +void btd_adapter_store_conn_param(struct btd_adapter *adapter, + const bdaddr_t *peer, uint8_t bdaddr_type, + uint16_t min_interval, uint16_t max_interval, + uint16_t latency, uint16_t timeout) { char device_addr18; char filenamePATH_MAX; @@ -9042,7 +9024,7 @@ if (!ev->store_hint) return; - store_conn_param(adapter, &ev->addr.bdaddr, ev->addr.type, + btd_adapter_store_conn_param(adapter, &ev->addr.bdaddr, ev->addr.type, ev->min_interval, ev->max_interval, ev->latency, ev->timeout); } @@ -10276,6 +10258,9 @@ set_mode(adapter, MGMT_OP_SET_SECURE_CONN, btd_opts.secure_conn); + if (missing_settings & MGMT_SETTING_WIDEBAND_SPEECH) + set_mode(adapter, MGMT_OP_SET_WIDEBAND_SPEECH, 0x01); + if (adapter->supported_settings & MGMT_SETTING_PRIVACY) set_privacy(adapter, btd_opts.privacy);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/adapter.h -> _service:tar_scm:bluez-5.77.tar.xz/src/adapter.h
Changed
@@ -288,3 +288,13 @@ struct queue *uuids); bool btd_adapter_is_uuid_allowed(struct btd_adapter *adapter, const char *uuid_str); + +void btd_adapter_load_conn_param(struct btd_adapter *adapter, + const bdaddr_t *peer, uint8_t bdaddr_type, + uint16_t min_interval, uint16_t max_interval, + uint16_t latency, uint16_t timeout); + +void btd_adapter_store_conn_param(struct btd_adapter *adapter, + const bdaddr_t *peer, uint8_t bdaddr_type, + uint16_t min_interval, uint16_t max_interval, + uint16_t latency, uint16_t timeout);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/advertising.c -> _service:tar_scm:bluez-5.77.tar.xz/src/advertising.c
Changed
@@ -734,8 +734,7 @@ /* Set BR/EDR Not Supported if adapter is not discoverable but the * instance is. */ - if ((flags & (BT_AD_FLAG_GENERAL | BT_AD_FLAG_LIMITED)) && - !btd_adapter_get_discoverable(client->manager->adapter)) + if (!btd_adapter_get_discoverable(client->manager->adapter)) flags |= BT_AD_FLAG_NO_BREDR; if (!bt_ad_add_flags(client->data, &flags, 1)) @@ -884,12 +883,18 @@ flags |= client->flags; + /* Detect if the length is bigger that legacy and secondary is not set + * then force it to be set to ensure the kernel uses EA. + */ + if (bt_ad_length(client->data) > BT_AD_MAX_DATA_LEN && + !(flags & MGMT_ADV_FLAG_SEC_MASK)) + flags |= MGMT_ADV_FLAG_SEC_1M; + return flags; } static int refresh_legacy_adv(struct btd_adv_client *client, - mgmt_request_func_t func, - unsigned int *mgmt_id) + mgmt_request_func_t func) { struct mgmt_cp_add_advertising *cp; uint8_t param_len; @@ -950,8 +955,8 @@ free(cp); return -EINVAL; } - if (mgmt_id) - *mgmt_id = mgmt_ret; + if (func) + client->add_adv_id = mgmt_ret; free(cp); @@ -962,7 +967,7 @@ const void *param, void *user_data); static int refresh_extended_adv(struct btd_adv_client *client, - mgmt_request_func_t func, unsigned int *mgmt_id) + mgmt_request_func_t func) { struct mgmt_cp_add_ext_adv_params cp; uint32_t flags = 0; @@ -1015,21 +1020,18 @@ /* Store callback, called after we set advertising data */ client->refresh_done_func = func; - - if (mgmt_id) - *mgmt_id = mgmt_ret; - + client->add_adv_id = mgmt_ret; return 0; } static int refresh_advertisement(struct btd_adv_client *client, - mgmt_request_func_t func, unsigned int *mgmt_id) + mgmt_request_func_t func) { if (client->manager->extended_add_cmds) - return refresh_extended_adv(client, func, mgmt_id); + return refresh_extended_adv(client, func); - return refresh_legacy_adv(client, func, mgmt_id); + return refresh_legacy_adv(client, func); } static bool client_discoverable_timeout(void *user_data) @@ -1042,7 +1044,7 @@ bt_ad_clear_flags(client->data); - refresh_advertisement(client, NULL, NULL); + refresh_advertisement(client, NULL); return FALSE; } @@ -1065,7 +1067,9 @@ if (client->disc_to_id) timeout_remove(client->disc_to_id); - client->disc_to_id = timeout_add_seconds(client->discoverable_to, + if (client->discoverable_to > 0) + client->disc_to_id = timeout_add_seconds( + client->discoverable_to, client_discoverable_timeout, client, NULL); @@ -1124,10 +1128,6 @@ { uint32_t min_interval_ms; - /* Only consider this property if experimental setting is applied */ - if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) - return true; - if (!iter) { client->min_interval = 0; return false; @@ -1157,10 +1157,6 @@ { uint32_t max_interval_ms; - /* Only consider this property if experimental setting is applied */ - if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) - return true; - if (!iter) { client->max_interval = 0; return false; @@ -1190,10 +1186,6 @@ { int16_t val; - /* Only consider this property if experimental setting is applied */ - if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) - return true; - if (!iter) { client->tx_power = ADV_TX_POWER_NO_PREFERENCE; return false; @@ -1250,7 +1242,7 @@ continue; if (parser->func(iter, client)) { - refresh_advertisement(client, NULL, NULL); + refresh_advertisement(client, NULL); break; } @@ -1261,9 +1253,18 @@ { DBusMessage *reply; - if (status) { + if (status) error("Failed to add advertisement: %s (0x%02x)", mgmt_errstr(status), status); + + /* If the advertising request was not started by a direct call from + * the client, but rather by a refresh due to properties update or + * our internal timer, there is nothing to reply to. + */ + if (!client->reg) + return; + + if (status) { reply = btd_error_failed(client->reg, "Failed to register advertisement"); queue_remove(client->manager->clients, client); @@ -1329,6 +1330,8 @@ unsigned int mgmt_ret; dbus_int16_t tx_power; + client->add_adv_id = 0; + if (status) goto fail; @@ -1391,6 +1394,9 @@ client->manager->mgmt_index, param_len, cp, client->refresh_done_func, client, NULL); + if (mgmt_ret && client->refresh_done_func) + client->add_adv_id = mgmt_ret; + /* Clear the callback */ client->refresh_done_func = NULL; @@ -1399,9 +1405,6 @@ goto fail; } - if (client->add_adv_id) - client->add_adv_id = mgmt_ret; - free(cp); cp = NULL; @@ -1483,8 +1486,7 @@ goto fail; } - err = refresh_advertisement(client, add_adv_callback, - &client->add_adv_id); + err = refresh_advertisement(client, add_adv_callback); if (!err) return NULL; @@ -1826,10 +1828,8 @@ { "SupportedIncludes", "as", get_supported_includes, NULL, NULL }, { "SupportedSecondaryChannels", "as", get_supported_secondary, NULL, secondary_exists }, - { "SupportedFeatures", "as", get_supported_features, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL}, - { "SupportedCapabilities", "a{sv}", get_supported_cap, NULL, NULL, - G_DBUS_PROPERTY_FLAG_EXPERIMENTAL}, + { "SupportedFeatures", "as", get_supported_features, NULL, NULL }, + { "SupportedCapabilities", "a{sv}", get_supported_cap, NULL, NULL }, { } }; @@ -1891,6 +1891,19 @@ /* Reset existing instances */ if (feat->num_instances) remove_advertising(manager, 0); + + /* Emit property update */ + g_dbus_emit_property_changed(btd_get_dbus_connection(), + adapter_get_path(manager->adapter), + LE_ADVERTISING_MGR_IFACE, "SupportedFeatures"); + + g_dbus_emit_property_changed(btd_get_dbus_connection(), + adapter_get_path(manager->adapter), + LE_ADVERTISING_MGR_IFACE, "SupportedIncludes"); + + g_dbus_emit_property_changed(btd_get_dbus_connection(), + adapter_get_path(manager->adapter), + LE_ADVERTISING_MGR_IFACE, "SupportedSecondaryChannels"); } static void read_controller_cap_complete(uint8_t status, uint16_t length, @@ -1970,8 +1983,7 @@ /* Query controller capabilities. This will be used to display valid * advertising tx power range to the client. */ - if (g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL && - btd_has_kernel_features(KERNEL_HAS_CONTROLLER_CAP_CMD)) + if (btd_has_kernel_features(KERNEL_HAS_CONTROLLER_CAP_CMD)) mgmt_send(manager->mgmt, MGMT_OP_READ_CONTROLLER_CAP, manager->mgmt_index, 0, NULL, read_controller_cap_complete, manager, NULL); @@ -2017,7 +2029,7 @@ { struct btd_adv_client *client = data; - refresh_advertisement(client, user_data, NULL); + refresh_advertisement(client, NULL); } void btd_adv_manager_refresh(struct btd_adv_manager *manager)
View file
_service:tar_scm:bluez-5.71.tar.xz/src/bluetooth.service.in -> _service:tar_scm:bluez-5.77.tar.xz/src/bluetooth.service.in
Changed
@@ -6,7 +6,7 @@ Service Type=dbus BusName=org.bluez -ExecStart=@pkglibexecdir@/bluetoothd +ExecStart=@PKGLIBEXECDIR@/bluetoothd NotifyAccess=main #WatchdogSec=10 #Restart=on-failure
View file
_service:tar_scm:bluez-5.71.tar.xz/src/bluetoothd.8 -> _service:tar_scm:bluez-5.77.tar.xz/src/bluetoothd.8
Changed
@@ -84,8 +84,14 @@ Provide deprecated command line interfaces. .TP .B \-E\fP,\fB \-\-experimental -Enable experimental interfaces. Those interfaces are not -guaranteed to be compatible or present in future releases. +Enable D\-Bus experimental interfaces. +These interfaces are not guaranteed to be compatible or present in future +releases. +.TP +.B \-T\fP,\fB \-\-testing +Enable D\-Bus testing interfaces. +These interfaces are only meant for test validation of the internals of +bluetoothd and shall not never be used by anything other than that. .UNINDENT .INDENT 0.0 .TP
View file
_service:tar_scm:bluez-5.71.tar.xz/src/bluetoothd.rst -> _service:tar_scm:bluez-5.77.tar.xz/src/bluetoothd.rst
Changed
@@ -64,8 +64,13 @@ -C, --compat Provide deprecated command line interfaces. --E, --experimental Enable experimental interfaces. Those interfaces are not - guaranteed to be compatible or present in future releases. +-E, --experimental Enable D-Bus experimental interfaces. + These interfaces are not guaranteed to be compatible or present in future + releases. + +-T, --testing Enable D-Bus testing interfaces. + These interfaces are only meant for test validation of the internals of + bluetoothd and shall not never be used by anything other than that. -K, --kernel=<uuid1>,<uuid2>,... Enable Kernel experimental features. Kernel experimental features are
View file
_service:tar_scm:bluez-5.71.tar.xz/src/bluetoothd.rst.in -> _service:tar_scm:bluez-5.77.tar.xz/src/bluetoothd.rst.in
Changed
@@ -64,8 +64,13 @@ -C, --compat Provide deprecated command line interfaces. --E, --experimental Enable experimental interfaces. Those interfaces are not - guaranteed to be compatible or present in future releases. +-E, --experimental Enable D-Bus experimental interfaces. + These interfaces are not guaranteed to be compatible or present in future + releases. + +-T, --testing Enable D-Bus testing interfaces. + These interfaces are only meant for test validation of the internals of + bluetoothd and shall not never be used by anything other than that. -K, --kernel=<uuid1>,<uuid2>,... Enable Kernel experimental features. Kernel experimental features are
View file
_service:tar_scm:bluez-5.71.tar.xz/src/btd.h -> _service:tar_scm:bluez-5.77.tar.xz/src/btd.h
Changed
@@ -128,6 +128,7 @@ bool fast_conn; bool refresh_discovery; bool experimental; + bool testing; struct queue *kernel; uint16_t did_source; @@ -140,6 +141,7 @@ bt_gatt_cache_t gatt_cache; uint16_t gatt_mtu; uint8_t gatt_channels; + bool gatt_client; enum mps_mode_t mps; struct btd_avdtp_opts avdtp; @@ -155,7 +157,7 @@ extern struct btd_opts btd_opts; -gboolean plugin_init(const char *enable, const char *disable); +void plugin_init(const char *enable, const char *disable); void plugin_cleanup(void); void rfkill_init(void);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/device.c -> _service:tar_scm:bluez-5.77.tar.xz/src/device.c
Changed
@@ -169,6 +169,7 @@ struct csrk_info { uint8_t key16; uint32_t counter; + bool auth; }; struct sirk_info { @@ -400,6 +401,7 @@ g_key_file_set_string(key_file, group, "Key", key); g_key_file_set_integer(key_file, group, "Counter", csrk->counter); + g_key_file_set_boolean(key_file, group, "Authenticated", csrk->auth); } static void store_sirk(struct sirk_info *sirk, GKeyFile *key_file, @@ -1050,16 +1052,14 @@ return TRUE; } -static const char *get_icon(const GDBusPropertyTable *property, void *data) +const char *btd_device_get_icon(struct btd_device *device) { - struct btd_device *device = data; const char *icon = NULL; - uint16_t appearance; if (device->class != 0) icon = class_to_icon(device->class); - else if (get_appearance(property, data, &appearance)) - icon = gap_appearance_to_icon(appearance); + else if (device->appearance != 0) + icon = gap_appearance_to_icon(device->appearance); return icon; } @@ -1067,7 +1067,7 @@ static gboolean dev_property_exists_icon( const GDBusPropertyTable *property, void *data) { - return get_icon(property, data) != NULL; + return btd_device_get_icon(data) != NULL; } static gboolean dev_property_get_icon(const GDBusPropertyTable *property, @@ -1075,7 +1075,7 @@ { const char *icon; - icon = get_icon(property, data); + icon = btd_device_get_icon(data); if (icon == NULL) return FALSE; @@ -1955,6 +1955,52 @@ return true; } +void device_set_csrk(struct btd_device *device, const uint8_t val16, + uint32_t counter, uint8_t type, + bool store_hint) +{ + struct csrk_info **handle; + struct csrk_info *csrk; + bool auth; + + switch (type) { + case 0x00: + handle = &device->local_csrk; + auth = FALSE; + break; + case 0x01: + handle = &device->remote_csrk; + auth = FALSE; + break; + case 0x02: + handle = &device->local_csrk; + auth = TRUE; + break; + case 0x03: + handle = &device->remote_csrk; + auth = TRUE; + break; + default: + warn("Unsupported CSRK type %u", type); + return; + } + + if (!*handle) + *handle = g_new0(struct csrk_info, 1); + + csrk = *handle; + memcpy(csrk->key, val, sizeof(csrk->key)); + csrk->counter = counter; + csrk->auth = auth; + + if (!store_hint) + return; + + store_device_info(device); + + btd_device_set_temporary(device, false); +} + static bool match_sirk(const void *data, const void *match_data) { const struct sirk_info *sirk = data; @@ -2489,13 +2535,13 @@ if (dev->bdaddr_type == BDADDR_LE_RANDOM) return dev->bdaddr_type; - if (dev->bredr_state.last_seen) { + if (dev->bredr_state.connectable && dev->bredr_state.last_seen) { bredr_last = current - dev->bredr_state.last_seen; if (bredr_last > SEEN_TRESHHOLD) bredr_last = NVAL_TIME; } - if (dev->le_state.last_seen) { + if (dev->le_state.connectable && dev->le_state.last_seen) { le_last = current - dev->le_state.last_seen; if (le_last > SEEN_TRESHHOLD) le_last = NVAL_TIME; @@ -3225,6 +3271,15 @@ bool btd_device_is_connected(struct btd_device *dev) { + if (btd_device_bearer_is_connected(dev)) + return true; + + return find_service_with_state(dev->services, + BTD_SERVICE_STATE_CONNECTED); +} + +bool btd_device_bearer_is_connected(struct btd_device *dev) +{ return dev->bredr_state.connected || dev->le_state.connected; } @@ -3272,10 +3327,26 @@ "Connected"); } +static bool device_service_connected(struct btd_device *dev) +{ + if (find_service_with_state(dev->services, + BTD_SERVICE_STATE_CONNECTING)) + return true; + + return find_service_with_state(dev->services, + BTD_SERVICE_STATE_CONNECTED); +} + static bool device_disappeared(gpointer user_data) { struct btd_device *dev = user_data; + /* If there are services connected restart the timer to give more time + * for the service to either complete the connection or disconnect. + */ + if (device_service_connected(dev)) + return TRUE; + dev->temporary_timer = 0; btd_adapter_remove_device(dev->adapter, dev); @@ -4495,6 +4566,11 @@ set_temporary_timer(device, btd_opts.tmpto); } +void btd_device_set_connectable(struct btd_device *device, bool connectable) +{ + device_update_last_seen(device, device->bdaddr_type, connectable); +} + /* It is possible that we have two device objects for the same device in * case it has first been discovered over BR/EDR and has a private * address when discovered over LE for the first time. In such a case we @@ -5440,6 +5516,10 @@ DBG("Reverse service discovery disabled: skipping GATT client"); return; } + if (!device->connect && !btd_opts.gatt_client) { + DBG("GATT client disabled: skipping GATT client"); + return; + } device->client = bt_gatt_client_new(device->db, device->att, device->att_mtu, 0); @@ -6348,7 +6428,8 @@ /* Put the device back to the temporary state so that it will be * treated as a newly discovered device. */ - if (!device_is_paired(device, bdaddr_type) && + if (!btd_device_bearer_is_connected(device) && + !device_is_paired(device, bdaddr_type) && !btd_device_is_trusted(device)) btd_device_set_temporary(device, true); @@ -6914,6 +6995,27 @@ return device->db; } +bool btd_device_set_gatt_db(struct btd_device *device, struct gatt_db *db) +{ + struct gatt_db *clone; + + if (!device) + return false; + + clone = gatt_db_clone(db); + if (clone) + return false; + + gatt_db_unregister(device->db, device->db_id); + gatt_db_unref(device->db); + + device->db = clone; + device->db_id = gatt_db_register(device->db, gatt_service_added, + gatt_service_removed, device, NULL); + + return true; +} + struct bt_gatt_client *btd_device_get_gatt_client(struct btd_device *device) { if (!device) @@ -7157,7 +7259,7 @@ if (!changed_flags) return; - if (changed_flags & DEVICE_FLAG_REMOTE_WAKEUP) { + if (changed_flags & DEVICE_FLAG_REMOTE_WAKEUP && dev->wake_support) { flag_value = !!(current_flags & DEVICE_FLAG_REMOTE_WAKEUP); dev->pending_wake_allowed = flag_value; @@ -7240,3 +7342,17 @@ { bt_ad_foreach_data(dev->ad, func, data); } + +void btd_device_set_conn_param(struct btd_device *device, uint16_t min_interval, + uint16_t max_interval, uint16_t latency, + uint16_t timeout) +{ + /* Attempt to load the new connection parameters, in case it is + * successful the MGMT_EV_NEW_CONN_PARAM will be generated which will + * then trigger btd_adapter_store_conn_param. + */ + btd_adapter_load_conn_param(device->adapter, &device->bdaddr, + device->bdaddr_type, min_interval, + max_interval, latency, + timeout); +}
View file
_service:tar_scm:bluez-5.71.tar.xz/src/device.h -> _service:tar_scm:bluez-5.77.tar.xz/src/device.h
Changed
@@ -41,6 +41,7 @@ uint16_t btd_device_get_vendor_src(struct btd_device *device); uint16_t btd_device_get_product(struct btd_device *device); uint16_t btd_device_get_version(struct btd_device *device); +const char *btd_device_get_icon(struct btd_device *device); void device_remove_bonding(struct btd_device *device, uint8_t bdaddr_type); void device_remove(struct btd_device *device, gboolean remove_stored); int device_address_cmp(gconstpointer a, gconstpointer b); @@ -65,6 +66,7 @@ const char *uuid); GSList *btd_device_get_primaries(struct btd_device *device); struct gatt_db *btd_device_get_gatt_db(struct btd_device *device); +bool btd_device_set_gatt_db(struct btd_device *device, struct gatt_db *db); struct bt_gatt_client *btd_device_get_gatt_client(struct btd_device *device); struct bt_gatt_server *btd_device_get_gatt_server(struct btd_device *device); bool btd_device_is_initiator(struct btd_device *device); @@ -95,6 +97,7 @@ void device_set_unpaired(struct btd_device *dev, uint8_t bdaddr_type); void btd_device_set_temporary(struct btd_device *device, bool temporary); void btd_device_set_trusted(struct btd_device *device, gboolean trusted); +void btd_device_set_connectable(struct btd_device *device, bool connectable); void device_set_bonded(struct btd_device *device, uint8_t bdaddr_type); void device_set_legacy(struct btd_device *device, bool legacy); void device_set_rssi_with_delta(struct btd_device *device, int8_t rssi, @@ -103,6 +106,7 @@ void device_set_tx_power(struct btd_device *device, int8_t tx_power); void device_set_flags(struct btd_device *device, uint8_t flags); bool btd_device_is_connected(struct btd_device *dev); +bool btd_device_bearer_is_connected(struct btd_device *dev); uint8_t btd_device_get_bdaddr_type(struct btd_device *dev); bool device_is_retrying(struct btd_device *device); void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type, @@ -134,6 +138,9 @@ bool central, uint8_t enc_size); bool btd_device_get_ltk(struct btd_device *device, uint8_t val16, bool *central, uint8_t *enc_size); +void device_set_csrk(struct btd_device *device, const uint8_t val16, + uint32_t counter, uint8_t type, + bool store_hint); bool btd_device_add_set(struct btd_device *device, bool encrypted, uint8_t sirk16, uint8_t size, uint8_t rank); void device_store_svc_chng_ccc(struct btd_device *device, uint8_t bdaddr_type, @@ -199,3 +206,6 @@ void btd_device_foreach_ad(struct btd_device *dev, bt_device_ad_func_t func, void *data); +void btd_device_set_conn_param(struct btd_device *device, uint16_t min_interval, + uint16_t max_interval, uint16_t latency, + uint16_t timeout);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/gatt-client.c -> _service:tar_scm:bluez-5.77.tar.xz/src/gatt-client.c
Changed
@@ -1127,6 +1127,11 @@ msg.msg_iov = &iov; msg.msg_iovlen = 1; + if (fd < 0) { + error("io_get_fd() returned %d\n", fd); + return false; + } + bytes_read = recvmsg(fd, &msg, MSG_DONTWAIT); if (bytes_read < 0) { error("recvmsg: %s", strerror(errno));
View file
_service:tar_scm:bluez-5.71.tar.xz/src/gatt-database.c -> _service:tar_scm:bluez-5.77.tar.xz/src/gatt-database.c
Changed
@@ -112,6 +112,7 @@ struct client_io { struct bt_att *att; + struct external_chrc *chrc; unsigned int disconn_id; struct io *io; }; @@ -2247,6 +2248,9 @@ if (strcmp(name, ERROR_INTERFACE ".InProgress") == 0) return BT_ERROR_ALREADY_IN_PROGRESS; + if (!strcmp(name, ERROR_INTERFACE ".ImproperlyConfigured")) + return BT_ERROR_CCC_IMPROPERLY_CONFIGURED; + if (strcmp(name, ERROR_INTERFACE ".NotPermitted") == 0) return perm_err; @@ -2588,21 +2592,23 @@ static bool sock_io_read(struct io *io, void *user_data) { - struct external_chrc *chrc = user_data; + struct client_io *client = user_data; + struct external_chrc *chrc = client->chrc; uint8_t buf512; int fd = io_get_fd(io); ssize_t bytes_read; + if (fd < 0) { + error("io_get_fd() returned %d\n", fd); + return false; + } + bytes_read = read(fd, buf, sizeof(buf)); if (bytes_read <= 0) return false; - send_notification_to_devices(chrc->service->app->database, - gatt_db_attribute_get_handle(chrc->attrib), - buf, bytes_read, - gatt_db_attribute_get_handle(chrc->ccc), - conf_cb, - chrc->proxy); + gatt_notify_cb(chrc->attrib, chrc->ccc, buf, bytes_read, client->att, + client->chrc->service->app->database); return true; } @@ -2652,6 +2658,7 @@ client = new0(struct client_io, 1); client->att = bt_att_ref(att); + client->chrc = chrc; client->disconn_id = bt_att_register_disconnect(att, att_disconnect_cb, client, NULL); client->io = sock_io_new(fd, chrc); @@ -2721,6 +2728,7 @@ if (ecode != BT_ATT_ERROR_UNLIKELY) { gatt_db_attribute_write_result(op->attrib, op->id, ecode); + pending_op_free(op); return; } @@ -2809,7 +2817,7 @@ client = client_io_new(chrc, fd, att); - io_set_read_handler(client->io, sock_io_read, chrc, NULL); + io_set_read_handler(client->io, sock_io_read, client, NULL); if (!chrc->notify_ios) chrc->notify_ios = queue_new(); @@ -3331,12 +3339,12 @@ static bool database_add_chrc(struct external_service *service, struct external_chrc *chrc) { - uint16_t handle; + uint16_t handle = 0, value_handle; bt_uuid_t uuid; char strMAX_LEN_UUID_STR; const struct queue_entry *entry; - if (!parse_handle(chrc->proxy, &handle)) { + if (!parse_handle(chrc->proxy, &value_handle)) { error("Failed to read \"Handle\" property of characteristic"); return false; } @@ -3351,10 +3359,14 @@ return false; } + if (value_handle) + handle = value_handle - 1; + chrc->attrib = gatt_db_service_insert_characteristic(service->attrib, - handle, &uuid, chrc->perm, - chrc->props, chrc_read_cb, - chrc_write_cb, chrc); + handle, value_handle, &uuid, + chrc->perm, chrc->props, + chrc_read_cb, chrc_write_cb, + chrc); if (!chrc->attrib) { error("Failed to create characteristic entry in database"); return false;
View file
_service:tar_scm:bluez-5.71.tar.xz/src/genbuiltin -> _service:tar_scm:bluez-5.77.tar.xz/src/genbuiltin
Changed
@@ -2,11 +2,11 @@ for i in $* do - echo "extern struct bluetooth_plugin_desc __bluetooth_builtin_$i;" + echo "extern const struct bluetooth_plugin_desc __bluetooth_builtin_$i;" done echo -echo "static struct bluetooth_plugin_desc *__bluetooth_builtin = {" +echo "static const struct bluetooth_plugin_desc *__bluetooth_builtin = {" for i in $* do
View file
_service:tar_scm:bluez-5.71.tar.xz/src/log.c -> _service:tar_scm:bluez-5.77.tar.xz/src/log.c
Changed
@@ -123,7 +123,7 @@ static char **enabled = NULL; -static gboolean is_enabled(struct btd_debug_desc *desc) +static gboolean is_enabled(const struct btd_debug_desc *desc) { int i;
View file
_service:tar_scm:bluez-5.71.tar.xz/src/main.c -> _service:tar_scm:bluez-5.77.tar.xz/src/main.c
Changed
@@ -87,6 +87,7 @@ "TemporaryTimeout", "RefreshDiscovery", "Experimental", + "Testing", "KernelExperimental", "RemoteNameRequestRetryDelay", NULL @@ -145,6 +146,7 @@ "KeySize", "ExchangeMTU", "Channels", + "Client", NULL }; @@ -452,21 +454,25 @@ tmp = strtol(str, &endptr, 0); if (!endptr || *endptr != '\0') { error("%s.%s = %s is not integer", group, key, str); + g_free(str); return false; } if (tmp < min) { + g_free(str); warn("%s.%s = %zu is out of range (< %zu)", group, key, tmp, min); return false; } if (tmp > max) { + g_free(str); warn("%s.%s = %zu is out of range (> %zu)", group, key, tmp, max); return false; } + g_free(str); if (val) *val = tmp; @@ -1032,6 +1038,8 @@ parse_secure_conns(config); parse_config_bool(config, "General", "Experimental", &btd_opts.experimental); + parse_config_bool(config, "General", "Testing", + &btd_opts.testing); parse_kernel_exp(config); parse_config_u32(config, "General", "RemoteNameRequestRetryDelay", &btd_opts.name_request_retry_delay, @@ -1058,6 +1066,7 @@ BT_ATT_DEFAULT_LE_MTU, BT_ATT_MAX_LE_MTU); parse_config_u8(config, "GATT", "Channels", &btd_opts.gatt_channels, 1, 5); + parse_config_bool(config, "GATT", "Client", &btd_opts.gatt_client); } static void parse_csis_sirk(GKeyFile *config) @@ -1190,6 +1199,7 @@ btd_opts.gatt_cache = BT_GATT_CACHE_ALWAYS; btd_opts.gatt_mtu = BT_ATT_MAX_LE_MTU; btd_opts.gatt_channels = 1; + btd_opts.gatt_client = true; btd_opts.avdtp.session_mode = BT_IO_MODE_BASIC; btd_opts.avdtp.stream_mode = BT_IO_MODE_BASIC; @@ -1340,6 +1350,8 @@ "Provide deprecated command line interfaces" }, { "experimental", 'E', 0, G_OPTION_ARG_NONE, &btd_opts.experimental, "Enable experimental D-Bus interfaces" }, + { "testing", 'T', 0, G_OPTION_ARG_NONE, &btd_opts.testing, + "Enable testing D-Bus interfaces" }, { "kernel", 'K', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, parse_kernel_experimental, "Enable kernel experimental features" }, @@ -1406,6 +1418,9 @@ if (btd_opts.experimental) gdbus_flags = G_DBUS_FLAG_ENABLE_EXPERIMENTAL; + if (btd_opts.testing) + gdbus_flags |= G_DBUS_FLAG_ENABLE_TESTING; + g_dbus_set_flags(gdbus_flags); if (adapter_init() < 0) {
View file
_service:tar_scm:bluez-5.71.tar.xz/src/main.conf -> _service:tar_scm:bluez-5.77.tar.xz/src/main.conf
Changed
@@ -33,7 +33,7 @@ # us. For BR/EDR this option is really only needed for qualification since the # BITE tester doesn't like us doing reverse SDP for some test cases, for LE # this disables the GATT client functionally so it can be used in system which -# can only operate as peripheral. +# can only operate as peripheral (see also GATT Client option). # Defaults to 'true'. #ReverseServiceDiscovery = true @@ -126,6 +126,10 @@ # Possible values: true or false #Experimental = false +# Enables D-Bus testing interfaces +# Possible values: true or false +#Testing = false + # Enables kernel experimental features, alternatively a list of UUIDs # can be given. # Possible values: true,false,<UUID List> @@ -283,6 +287,11 @@ # Defaults to 0 #Rank = 0 +# This enables the GATT client functionally, so it can be disabled in system +# which can only operate as a peripheral. +# Defaults to 'true'. +#Client = true + AVDTP # AVDTP L2CAP Signalling Channel Mode. # Possible values:
View file
_service:tar_scm:bluez-5.71.tar.xz/src/oui.c -> _service:tar_scm:bluez-5.77.tar.xz/src/oui.c
Changed
@@ -16,7 +16,7 @@ #include "lib/bluetooth.h" #include "oui.h" -#ifdef HAVE_UDEV_HWDB_NEW +#ifdef HAVE_UDEV #include <libudev.h> char *batocomp(const bdaddr_t *ba)
View file
_service:tar_scm:bluez-5.71.tar.xz/src/plugin.c -> _service:tar_scm:bluez-5.77.tar.xz/src/plugin.c
Changed
@@ -26,12 +26,13 @@ #include "src/log.h" #include "src/btd.h" +#define IS_ENABLED(x) (x) + static GSList *plugins = NULL; struct bluetooth_plugin { void *handle; - gboolean active; - struct bluetooth_plugin_desc *desc; + const struct bluetooth_plugin_desc *desc; }; static int compare_priority(gconstpointer a, gconstpointer b) @@ -42,7 +43,24 @@ return plugin2->desc->priority - plugin1->desc->priority; } -static gboolean add_plugin(void *handle, struct bluetooth_plugin_desc *desc) +static int init_plugin(const struct bluetooth_plugin_desc *desc) +{ + int err; + + err = desc->init(); + if (err < 0) { + if (err == -ENOSYS || err == -ENOTSUP) + warn("System does not support %s plugin", + desc->name); + else + error("Failed to init %s plugin", + desc->name); + } + return err; +} + +static gboolean add_external_plugin(void *handle, + const struct bluetooth_plugin_desc *desc) { struct bluetooth_plugin *plugin; @@ -54,23 +72,47 @@ return FALSE; } - DBG("Loading %s plugin", desc->name); - plugin = g_try_new0(struct bluetooth_plugin, 1); if (plugin == NULL) return FALSE; plugin->handle = handle; - plugin->active = FALSE; plugin->desc = desc; + if (init_plugin(desc) < 0) { + g_free(plugin); + return FALSE; + } + __btd_enable_debug(desc->debug_start, desc->debug_stop); plugins = g_slist_insert_sorted(plugins, plugin, compare_priority); + DBG("Plugin %s loaded", desc->name); return TRUE; } +static void add_plugin(const struct bluetooth_plugin_desc *desc) +{ + struct bluetooth_plugin *plugin; + + DBG("Loading %s plugin", desc->name); + + plugin = g_try_new0(struct bluetooth_plugin, 1); + if (plugin == NULL) + return; + + plugin->desc = desc; + + if (init_plugin(desc) < 0) { + g_free(plugin); + return; + } + + plugins = g_slist_insert_sorted(plugins, plugin, compare_priority); + DBG("Plugin %s loaded", desc->name); +} + static gboolean enable_plugin(const char *name, char **cli_enable, char **cli_disable) { @@ -97,51 +139,26 @@ return TRUE; } -#include "src/builtin.h" -gboolean plugin_init(const char *enable, const char *disable) +static void external_plugin_init(char **cli_disabled, char **cli_enabled) { - GSList *list; GDir *dir; const char *file; - char **cli_disabled, **cli_enabled; - unsigned int i; - /* Make a call to BtIO API so its symbols got resolved before the - * plugins are loaded. */ - bt_io_error_quark(); - - if (enable) - cli_enabled = g_strsplit_set(enable, ", ", -1); - else - cli_enabled = NULL; - - if (disable) - cli_disabled = g_strsplit_set(disable, ", ", -1); - else - cli_disabled = NULL; - - DBG("Loading builtin plugins"); - - for (i = 0; __bluetooth_builtini; i++) { - if (!enable_plugin(__bluetooth_builtini->name, cli_enabled, - cli_disabled)) - continue; - - add_plugin(NULL, __bluetooth_builtini); - } + info("Using external plugins is not officially supported.\n"); + info("Consider upstreaming your plugins into the BlueZ project."); if (strlen(PLUGINDIR) == 0) - goto start; + return; DBG("Loading plugins %s", PLUGINDIR); dir = g_dir_open(PLUGINDIR, 0, NULL); if (!dir) - goto start; + return; while ((file = g_dir_read_name(dir)) != NULL) { - struct bluetooth_plugin_desc *desc; + const struct bluetooth_plugin_desc *desc; void *handle; char *filename; @@ -173,35 +190,46 @@ continue; } - if (add_plugin(handle, desc) == FALSE) + if (add_external_plugin(handle, desc) == FALSE) dlclose(handle); } g_dir_close(dir); +} -start: - for (list = plugins; list; list = list->next) { - struct bluetooth_plugin *plugin = list->data; - int err; - - err = plugin->desc->init(); - if (err < 0) { - if (err == -ENOSYS || err == -ENOTSUP) - warn("System does not support %s plugin", - plugin->desc->name); - else - error("Failed to init %s plugin", - plugin->desc->name); +#include "src/builtin.h" + +void plugin_init(const char *enable, const char *disable) +{ + char **cli_disabled = NULL; + char **cli_enabled = NULL; + unsigned int i; + + /* Make a call to BtIO API so its symbols got resolved before the + * plugins are loaded. */ + bt_io_error_quark(); + + if (enable) + cli_enabled = g_strsplit_set(enable, ", ", -1); + + if (disable) + cli_disabled = g_strsplit_set(disable, ", ", -1); + + DBG("Loading builtin plugins"); + + for (i = 0; __bluetooth_builtini; i++) { + if (!enable_plugin(__bluetooth_builtini->name, cli_enabled, + cli_disabled)) continue; - } - plugin->active = TRUE; + add_plugin(__bluetooth_builtini); } + if IS_ENABLED(EXTERNAL_PLUGINS) + external_plugin_init(cli_enabled, cli_disabled); + g_strfreev(cli_enabled); g_strfreev(cli_disabled); - - return TRUE; } void plugin_cleanup(void) @@ -213,7 +241,7 @@ for (list = plugins; list; list = list->next) { struct bluetooth_plugin *plugin = list->data; - if (plugin->active == TRUE && plugin->desc->exit) + if (plugin->desc->exit) plugin->desc->exit(); if (plugin->handle != NULL)
View file
_service:tar_scm:bluez-5.71.tar.xz/src/plugin.h -> _service:tar_scm:bluez-5.77.tar.xz/src/plugin.h
Changed
@@ -23,19 +23,25 @@ #ifdef BLUETOOTH_PLUGIN_BUILTIN #define BLUETOOTH_PLUGIN_DEFINE(name, version, priority, init, exit) \ - struct bluetooth_plugin_desc __bluetooth_builtin_ ## name = { \ + const struct bluetooth_plugin_desc \ + __bluetooth_builtin_ ## name = { \ #name, version, priority, init, exit \ }; #else +#if EXTERNAL_PLUGINS #define BLUETOOTH_PLUGIN_DEFINE(name, version, priority, init, exit) \ extern struct btd_debug_desc __start___debug \ __attribute__ ((weak, visibility("hidden"))); \ extern struct btd_debug_desc __stop___debug \ __attribute__ ((weak, visibility("hidden"))); \ - extern struct bluetooth_plugin_desc bluetooth_plugin_desc \ + extern const struct bluetooth_plugin_desc \ + bluetooth_plugin_desc \ __attribute__ ((visibility("default"))); \ - struct bluetooth_plugin_desc bluetooth_plugin_desc = { \ + const struct bluetooth_plugin_desc bluetooth_plugin_desc = { \ #name, version, priority, init, exit, \ __start___debug, __stop___debug \ }; +#else +#error "Requested non built-in plugin, while external plugins is disabled" +#endif #endif
View file
_service:tar_scm:bluez-5.71.tar.xz/src/profile.c -> _service:tar_scm:bluez-5.77.tar.xz/src/profile.c
Changed
@@ -781,6 +781,12 @@ return -ENOTSUP; } + if (profile->testing && !(g_dbus_get_flags() & + G_DBUS_FLAG_ENABLE_TESTING)) { + DBG("D-Bus testing not enabled"); + return -ENOTSUP; + } + profiles = g_slist_append(profiles, profile); return 0; }
View file
_service:tar_scm:bluez-5.71.tar.xz/src/profile.h -> _service:tar_scm:bluez-5.77.tar.xz/src/profile.h
Changed
@@ -33,6 +33,11 @@ */ bool experimental; + /* Indicates the profile for testing only and shall only be registered + * when testing has been enabled (see: main.conf:Testing). + */ + bool testing; + int (*device_probe) (struct btd_service *service); void (*device_remove) (struct btd_service *service);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/rfkill.c -> _service:tar_scm:bluez-5.77.tar.xz/src/rfkill.c
Changed
@@ -55,7 +55,7 @@ }; #define RFKILL_EVENT_SIZE_V1 8 -static int get_adapter_id_for_rfkill(int rfkill_id) +static int get_adapter_id_for_rfkill(uint32_t rfkill_id) { char sysnamePATH_MAX; int namefd;
View file
_service:tar_scm:bluez-5.71.tar.xz/src/set.c -> _service:tar_scm:bluez-5.77.tar.xz/src/set.c
Changed
@@ -28,6 +28,8 @@ #include "src/shared/queue.h" #include "src/shared/ad.h" #include "src/shared/crypto.h" +#include "src/shared/att.h" +#include "src/shared/gatt-db.h" #include "log.h" #include "error.h" @@ -171,7 +173,7 @@ } static struct btd_device_set *set_new(struct btd_device *device, - uint8_t sirk16, uint8_t size) + const uint8_t sirk16, uint8_t size) { struct btd_device_set *set; @@ -206,7 +208,7 @@ } static struct btd_device_set *set_find(struct btd_device *device, - uint8_t sirk16) + const uint8_t sirk16) { struct btd_adapter *adapter = device_get_adapter(device); const struct queue_entry *entry; @@ -277,8 +279,24 @@ bt_crypto_unref(crypto); - if (!memcmp(ad->data, res, sizeof(res))) - device_connect_le(set->device); + if (memcmp(ad->data, res, sizeof(res))) + return; + + /* Attempt to use existing gatt_db from set if device has never been + * connected before. + * + * If dbs don't really match bt_gatt_client will attempt to rediscover + * the ranges that don't match. + */ + if (gatt_db_isempty(btd_device_get_gatt_db(set->device))) { + struct btd_device *device; + + device = queue_get_entries(set->devices)->data; + btd_device_set_gatt_db(set->device, + btd_device_get_gatt_db(device)); + } + + device_connect_le(set->device); } static void foreach_device(struct btd_device *device, void *data) @@ -295,10 +313,14 @@ } struct btd_device_set *btd_set_add_device(struct btd_device *device, - uint8_t *key, uint8_t sirk16, + const uint8_t *key, + const uint8_t sirk_value16, uint8_t size) { struct btd_device_set *set; + uint8_t sirk16; + + memcpy(sirk, sirk_value, sizeof(sirk)); /* In case key has been set it means SIRK is encrypted */ if (key) {
View file
_service:tar_scm:bluez-5.71.tar.xz/src/set.h -> _service:tar_scm:bluez-5.77.tar.xz/src/set.h
Changed
@@ -13,7 +13,8 @@ struct btd_device_set; struct btd_device_set *btd_set_add_device(struct btd_device *device, - uint8_t *ltk, uint8_t sirk16, + const uint8_t *ltk, + const uint8_t sirk16, uint8_t size); bool btd_set_remove_device(struct btd_device_set *set, struct btd_device *device);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/settings.c -> _service:tar_scm:bluez-5.77.tar.xz/src/settings.c
Changed
@@ -58,13 +58,17 @@ uint16_t val; bt_uuid_t uuid, ext_uuid; - if (sscanf(handle, "%04hx", &handle_int) != 1) + if (sscanf(handle, "%04hx", &handle_int) != 1) { + DBG("Failed to parse handle: %s", handle); return -EIO; + } /* Check if there is any value stored, otherwise it is just the UUID */ if (sscanf(value, "%04hx:%36s", &val, uuid_str) != 2) { - if (sscanf(value, "%36s", uuid_str) != 1) + if (sscanf(value, "%36s", uuid_str) != 1) { + DBG("Failed to parse value: %s", value); return -EIO; + } val = 0; } @@ -104,8 +108,10 @@ size_t val_len; bt_uuid_t uuid; - if (sscanf(handle, "%04hx", &handle_int) != 1) + if (sscanf(handle, "%04hx", &handle_int) != 1) { + DBG("Failed to parse handle: %s", handle); return -EIO; + } /* Check if there is any value stored */ if (sscanf(value, GATT_CHARAC_UUID_STR ":%04hx:%02hx:%32s:%36s", @@ -125,7 +131,8 @@ handle_int, value_handle, properties, val_len ? val_str : "", uuid_str); - att = gatt_db_service_insert_characteristic(service, value_handle, + att = gatt_db_service_insert_characteristic(service, handle_int, + value_handle, &uuid, 0, properties, NULL, NULL, NULL); if (!att || gatt_db_attribute_get_handle(att) != value_handle) @@ -147,12 +154,16 @@ struct gatt_db_attribute *att; uint16_t start, end; - if (sscanf(handle, "%04hx", &start) != 1) + if (sscanf(handle, "%04hx", &start) != 1) { + DBG("Failed to parse handle: %s", handle); return -EIO; + } if (sscanf(value, GATT_INCLUDE_UUID_STR ":%04hx:%04hx:%36s", &start, - &end, uuid_str) != 3) + &end, uuid_str) != 3) { + DBG("Failed to parse value: %s", value); return -EIO; + } /* Log debug message. */ DBG("loading included service: 0x%04x, end: 0x%04x, uuid: %s", @@ -177,11 +188,15 @@ bt_uuid_t uuid; bool primary; - if (sscanf(handle, "%04hx", &start) != 1) + if (sscanf(handle, "%04hx", &start) != 1) { + DBG("Failed to parse handle: %s", handle); return -EIO; + } - if (sscanf(value, "%^::%04hx:%36s", type, &end, uuid_str) != 3) + if (sscanf(value, "%^::%04hx:%36s", type, &end, uuid_str) != 3) { + DBG("Failed to parse value: %s", value); return -EIO; + } if (g_str_equal(type, GATT_PRIM_SVC_UUID_STR)) primary = true; @@ -217,7 +232,7 @@ value = g_key_file_get_string(key_file, "Attributes", *handle, NULL); - if (sscanf(value, "%^::", type) != 1) { + if (!value || sscanf(value, "%^::", type) != 1) { g_free(value); return -EIO; } @@ -240,7 +255,7 @@ value = g_key_file_get_string(key_file, "Attributes", *handle, NULL); - if (sscanf(value, "%^::", type) != 1) { + if (!value || sscanf(value, "%^::", type) != 1) { g_free(value); return -EIO; }
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/ad.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/ad.c
Changed
@@ -48,7 +48,7 @@ struct bt_ad *ad; ad = new0(struct bt_ad, 1); - ad->max_len = BT_AD_MAX_DATA_LEN; + ad->max_len = BT_EA_MAX_DATA_LEN; ad->service_uuids = queue_new(); ad->manufacturer_data = queue_new(); ad->solicit_uuids = queue_new(); @@ -520,9 +520,14 @@ return length; } -static size_t calculate_length(struct bt_ad *ad) +size_t bt_ad_length(struct bt_ad *ad) { - size_t length = 0; + size_t length; + + if (!ad) + return 0; + + length = 0; length += uuid_list_length(ad->service_uuids); @@ -698,7 +703,7 @@ if (!ad) return NULL; - *length = calculate_length(ad); + *length = bt_ad_length(ad); if (*length > ad->max_len) return NULL;
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/ad.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/ad.h
Changed
@@ -15,6 +15,8 @@ #include "lib/uuid.h" #define BT_AD_MAX_DATA_LEN 31 +#define BT_EA_MAX_DATA_LEN 251 +#define BT_PA_MAX_DATA_LEN 252 #define BT_AD_FLAGS 0x01 #define BT_AD_UUID16_SOME 0x02 @@ -106,6 +108,8 @@ void bt_ad_unref(struct bt_ad *ad); +size_t bt_ad_length(struct bt_ad *ad); + uint8_t *bt_ad_generate(struct bt_ad *ad, size_t *length); bool bt_ad_is_empty(struct bt_ad *ad);
View file
_service:tar_scm:bluez-5.77.tar.xz/src/shared/asha.c
Added
@@ -0,0 +1,359 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2024 Asymptotic Inc. + * + * Author: Arun Raghavan <arun@asymptotic.io> + * + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +#include "lib/bluetooth.h" +#include "lib/uuid.h" + +#include "src/shared/util.h" +#include "src/shared/att.h" +#include "src/log.h" + +#include "src/shared/queue.h" +#include "src/shared/gatt-db.h" +#include "src/shared/gatt-client.h" + +#include "asha.h" + +/* We use strings instead of uint128_t to maintain readability */ +#define ASHA_CHRC_READ_ONLY_PROPERTIES_UUID "6333651e-c481-4a3e-9169-7c902aad37bb" +#define ASHA_CHRC_AUDIO_CONTROL_POINT_UUID "f0d4de7e-4a88-476c-9d9f-1937b0996cc0" +#define ASHA_CHRC_AUDIO_STATUS_UUID "38663f1a-e711-4cac-b641-326b56404837" +#define ASHA_CHRC_VOLUME_UUID "00e4ca9e-ab14-41e4-8823-f9e70c7e91df" +#define ASHA_CHRC_LE_PSM_OUT_UUID "2d410339-82b6-42aa-b34e-e2e01df8cc1a" + +struct bt_asha *bt_asha_new(void) +{ + struct bt_asha *asha; + + asha = new0(struct bt_asha, 1); + + return asha; +} + +void bt_asha_reset(struct bt_asha *asha) +{ + if (asha->status_notify_id) { + bt_gatt_client_unregister_notify(asha->client, + asha->status_notify_id); + } + + gatt_db_unref(asha->db); + asha->db = NULL; + + bt_gatt_client_unref(asha->client); + asha->client = NULL; + + asha->psm = 0; +} + +void bt_asha_state_reset(struct bt_asha *asha) +{ + asha->state = ASHA_STOPPED; + + asha->cb = NULL; + asha->cb_user_data = NULL; +} + +void bt_asha_free(struct bt_asha *asha) +{ + gatt_db_unref(asha->db); + bt_gatt_client_unref(asha->client); + free(asha); +} + +static void asha_acp_sent(bool success, uint8_t err, void *user_data) +{ + struct bt_asha *asha = user_data; + + if (success) { + DBG("AudioControlPoint command successfully sent"); + } else { + error("Failed to send AudioControlPoint command: %d", err); + + if (asha->cb) + asha->cb(-1, asha->cb_user_data); + + bt_asha_state_reset(asha); + } +} + +static int asha_send_acp(struct bt_asha *asha, uint8_t *cmd, + unsigned int len, bt_asha_cb_t cb, void *user_data) +{ + if (!bt_gatt_client_write_value(asha->client, asha->acp_handle, cmd, + len, asha_acp_sent, asha, NULL)) { + error("Error writing ACP command"); + return -1; + } + + asha->cb = cb; + asha->cb_user_data = user_data; + + return 0; +} + +unsigned int bt_asha_start(struct bt_asha *asha, bt_asha_cb_t cb, + void *user_data) +{ + uint8_t acp_start_cmd = { + 0x01, /* START */ + 0x01, /* G.722, 16 kHz */ + 0, /* Unknown media type */ + asha->volume, /* Volume */ + 0, /* Other disconnected */ + }; + int ret; + + if (asha->state != ASHA_STOPPED) { + error("ASHA device start failed. Bad state %d", asha->state); + return 0; + } + + ret = asha_send_acp(asha, acp_start_cmd, sizeof(acp_start_cmd), cb, + user_data); + if (ret < 0) + return ret; + + asha->state = ASHA_STARTING; + + return 0; +} + +unsigned int bt_asha_stop(struct bt_asha *asha, bt_asha_cb_t cb, + void *user_data) +{ + uint8_t acp_stop_cmd = { + 0x02, /* STOP */ + }; + + if (asha->state != ASHA_STARTED) + return 0; + + asha->state = ASHA_STOPPING; + + return asha_send_acp(asha, acp_stop_cmd, sizeof(acp_stop_cmd), + cb, user_data); +} + +bool bt_asha_set_volume(struct bt_asha *asha, int8_t volume) +{ + if (!bt_gatt_client_write_without_response(asha->client, + asha->volume_handle, false, + (const uint8_t *)&volume, 1)) { + error("Error writing volume"); + return false; + } + + asha->volume = volume; + return true; +} + +static bool uuid_cmp(const char *uuid1, const bt_uuid_t *uuid2) +{ + bt_uuid_t lhs; + + bt_string_to_uuid(&lhs, uuid1); + + return bt_uuid_cmp(&lhs, uuid2) == 0; +} + +static void read_psm(bool success, + uint8_t att_ecode, + const uint8_t *value, + uint16_t length, + void *user_data) +{ + struct bt_asha *asha = user_data; + + if (!success) { + DBG("Reading PSM failed with ATT error: %u", att_ecode); + return; + } + + if (length != 2) { + DBG("Reading PSM failed: unexpected length %u", length); + return; + } + + asha->psm = get_le16(value); + + DBG("Got PSM: %u", asha->psm); +} + +static void read_rops(bool success, + uint8_t att_ecode, + const uint8_t *value, + uint16_t length, + void *user_data) +{ + struct bt_asha *asha = user_data; + + if (!success) { + DBG("Reading ROPs failed with ATT error: %u", att_ecode); + return; + } + + if (length != 17) { + DBG("Reading ROPs failed: unexpected length %u", length); + return; + } + + if (value0 != 0x01) { + DBG("Unexpected ASHA version: %u", value0); + return; + } + + /* Device Capabilities */ + asha->right_side = (value1 & 0x1) != 0; + asha->binaural = (value1 & 0x2) != 0; + asha->csis_supported = (value1 & 0x4) != 0; + /* HiSyncId: 2 byte company id, 6 byte ID shared by left and right */ + memcpy(asha->hisyncid, &value2, 8); + /* FeatureMap */ + asha->coc_streaming_supported = (value10 & 0x1) != 0; + /* RenderDelay */ + asha->render_delay = get_le16(&value11); + /* byte 13 & 14 are reserved */ + /* Codec IDs */ + asha->codec_ids = get_le16(&value15); + + DBG("Got ROPS: side %u, binaural %u, csis: %u, delay %u, codecs: %u", + asha->right_side, asha->binaural, asha->csis_supported, + asha->render_delay, asha->codec_ids); +} + +static void audio_status_register(uint16_t att_ecode, void *user_data) +{ + if (att_ecode) + DBG("AudioStatusPoint register failed 0x%04x", att_ecode); + else + DBG("AudioStatusPoint register succeeded"); +} + +static void audio_status_notify(uint16_t value_handle, const uint8_t *value, + uint16_t length, void *user_data) +{ + struct bt_asha *asha = user_data; + uint8_t status = *value; + /* Back these up to survive the reset paths */ + bt_asha_cb_t cb = asha->cb; + bt_asha_cb_t cb_user_data = asha->cb_user_data; + + if (asha->state == ASHA_STARTING) { + if (status == 0) { + asha->state = ASHA_STARTED; + DBG("ASHA start complete"); + } else { + bt_asha_state_reset(asha); + DBG("ASHA start failed"); + } + } else if (asha->state == ASHA_STOPPING) { + /* We reset our state, regardless */ + bt_asha_state_reset(asha); + DBG("ASHA stop %s", status == 0 ? "complete" : "failed"); + } + + if (cb) { + cb(status, cb_user_data); + asha->cb = NULL; + asha->cb_user_data = NULL; + } +} + +static void handle_characteristic(struct gatt_db_attribute *attr, + void *user_data) +{ + struct bt_asha *asha = user_data; + uint16_t value_handle; + bt_uuid_t uuid; + char uuid_strMAX_LEN_UUID_STR; + + if (!gatt_db_attribute_get_char_data(attr, NULL, &value_handle, NULL, + NULL, &uuid)) { + error("Failed to obtain characteristic data"); + return; + } + + bt_uuid_to_string(&uuid, uuid_str, sizeof(uuid_str)); + if (uuid_cmp(ASHA_CHRC_LE_PSM_OUT_UUID, &uuid)) { + DBG("Got chrc %s/0x%x: LE_PSM_ID", uuid_str, value_handle); + if (!bt_gatt_client_read_value(asha->client, value_handle, + read_psm, asha, NULL)) + DBG("Failed to send request to read battery level"); + } else if (uuid_cmp(ASHA_CHRC_READ_ONLY_PROPERTIES_UUID, &uuid)) { + DBG("Got chrc %s/0x%x: READ_ONLY_PROPERTIES", uuid_str, + value_handle); + if (!bt_gatt_client_read_value(asha->client, value_handle, + read_rops, asha, NULL)) + DBG("Failed to send request for readonly properties"); + } else if (uuid_cmp(ASHA_CHRC_AUDIO_CONTROL_POINT_UUID, &uuid)) { + DBG("Got chrc %s/0x%x: AUDIO_CONTROL_POINT", uuid_str, + value_handle); + /* Store this for later writes */ + asha->acp_handle = value_handle; + } else if (uuid_cmp(ASHA_CHRC_VOLUME_UUID, &uuid)) { + DBG("Got chrc %s/0x%x: VOLUME", uuid_str, value_handle); + /* Store this for later writes */ + asha->volume_handle = value_handle; + } else if (uuid_cmp(ASHA_CHRC_AUDIO_STATUS_UUID, &uuid)) { + DBG("Got chrc %s/0x%x: AUDIO_STATUS", uuid_str, value_handle); + asha->status_notify_id = + bt_gatt_client_register_notify(asha->client, + value_handle, audio_status_register, + audio_status_notify, asha, NULL); + if (!asha->status_notify_id) + DBG("Failed to send request to notify AudioStatus"); + } else { + DBG("Unsupported characteristic: %s", uuid_str); + } +} + +static void foreach_asha_service(struct gatt_db_attribute *attr, + void *user_data) +{ + struct bt_asha *asha = user_data; + + DBG("Found ASHA GATT service"); + + asha->attr = attr; + gatt_db_service_set_claimed(attr, true); + gatt_db_service_foreach_char(asha->attr, handle_characteristic, asha); +} + +bool bt_asha_probe(struct bt_asha *asha, struct gatt_db *db, + struct bt_gatt_client *client) +{ + bt_uuid_t asha_uuid; + + asha->db = gatt_db_ref(db); + asha->client = bt_gatt_client_clone(client); + + bt_uuid16_create(&asha_uuid, ASHA_SERVICE); + gatt_db_foreach_service(db, &asha_uuid, foreach_asha_service, asha); + + if (!asha->attr) { + error("ASHA attribute not found"); + bt_asha_reset(asha); + return false; + } + + return true; +}
View file
_service:tar_scm:bluez-5.77.tar.xz/src/shared/asha.h
Added
@@ -0,0 +1,63 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2024 Asymptotic Inc. + * + * Author: Arun Raghavan <arun@asymptotic.io> + * + * + */ + +# + +#include <stdbool.h> +#include <stdint.h> + +enum bt_asha_state_t { + ASHA_STOPPED = 0, + ASHA_STARTING, + ASHA_STARTED, + ASHA_STOPPING, +}; + +typedef void (*bt_asha_cb_t)(int status, void *data); + +struct bt_asha { + struct bt_gatt_client *client; + struct gatt_db *db; + struct gatt_db_attribute *attr; + uint16_t acp_handle; + uint16_t volume_handle; + unsigned int status_notify_id; + + uint16_t psm; + bool right_side; + bool binaural; + bool csis_supported; + bool coc_streaming_supported; + uint8_t hisyncid8; + uint16_t render_delay; + uint16_t codec_ids; + int8_t volume; + + enum bt_asha_state_t state; + bt_asha_cb_t cb; + void *cb_user_data; +}; + +struct bt_asha *bt_asha_new(void); +void bt_asha_reset(struct bt_asha *asha); +void bt_asha_state_reset(struct bt_asha *asha); +void bt_asha_free(struct bt_asha *asha); + +unsigned int bt_asha_start(struct bt_asha *asha, bt_asha_cb_t cb, + void *user_data); +unsigned int bt_asha_stop(struct bt_asha *asha, bt_asha_cb_t cb, + void *user_data); + +bool bt_asha_set_volume(struct bt_asha *asha, int8_t volume); + +bool bt_asha_probe(struct bt_asha *asha, struct gatt_db *db, + struct bt_gatt_client *client);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/att.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/att.c
Changed
@@ -1009,8 +1009,9 @@ found = true; if (notify->callback) - notify->callback(chan, opcode, pdu + 1, pdu_len - 1, - notify->user_data); + notify->callback(chan, chan->mtu, opcode, + pdu + 1, pdu_len - 1, + notify->user_data); /* callback could remove all entries from notify list */ if (queue_isempty(att->notify_list)) @@ -2042,3 +2043,29 @@ return att->crypto ? true : false; } + +bool bt_att_set_retry(struct bt_att *att, unsigned int id, bool retry) +{ + struct att_send_op *op; + + if (!id) + return false; + + op = queue_find(att->req_queue, match_op_id, UINT_TO_PTR(id)); + if (op) + goto done; + + op = queue_find(att->ind_queue, match_op_id, UINT_TO_PTR(id)); + if (op) + goto done; + + op = queue_find(att->write_queue, match_op_id, UINT_TO_PTR(id)); + +done: + if (!op) + return false; + + op->retry = !retry; + + return true; +}
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/att.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/att.h
Changed
@@ -35,7 +35,7 @@ typedef void (*bt_att_response_func_t)(uint8_t opcode, const void *pdu, uint16_t length, void *user_data); -typedef void (*bt_att_notify_func_t)(struct bt_att_chan *chan, +typedef void (*bt_att_notify_func_t)(struct bt_att_chan *chan, uint16_t mtu, uint8_t opcode, const void *pdu, uint16_t length, void *user_data); typedef void (*bt_att_destroy_func_t)(void *user_data); @@ -110,3 +110,4 @@ bool bt_att_set_remote_key(struct bt_att *att, uint8_t sign_key16, bt_att_counter_func_t func, void *user_data); bool bt_att_has_crypto(struct bt_att *att); +bool bt_att_set_retry(struct bt_att *att, unsigned int id, bool retry);
View file
_service:tar_scm:bluez-5.77.tar.xz/src/shared/bap-defs.h
Added
@@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2022 Intel Corporation. All rights reserved. + * Copyright 2023-2024 NXP + * + */ + +#ifndef SRC_SHARED_BAP_DEFS_H_ +#define SRC_SHARED_BAP_DEFS_H_ + +#ifndef __packed +#define __packed __attribute__((packed)) +#endif + +#define BT_BAP_SINK BIT(0) +#define BT_BAP_SOURCE BIT(1) +#define BT_BAP_BCAST_SOURCE BIT(2) +#define BT_BAP_BCAST_SINK BIT(3) + +#define BT_BAP_STREAM_TYPE_UCAST 0x01 +#define BT_BAP_STREAM_TYPE_BCAST 0x02 + +#define BT_BAP_STREAM_STATE_IDLE 0x00 +#define BT_BAP_STREAM_STATE_CONFIG 0x01 +#define BT_BAP_STREAM_STATE_QOS 0x02 +#define BT_BAP_STREAM_STATE_ENABLING 0x03 +#define BT_BAP_STREAM_STATE_STREAMING 0x04 +#define BT_BAP_STREAM_STATE_DISABLING 0x05 +#define BT_BAP_STREAM_STATE_RELEASING 0x06 + +#define BT_BAP_CONFIG_LATENCY_LOW 0x01 +#define BT_BAP_CONFIG_LATENCY_BALANCED 0x02 +#define BT_BAP_CONFIG_LATENCY_HIGH 0x03 + +#define BT_BAP_CONFIG_PHY_1M 0x01 +#define BT_BAP_CONFIG_PHY_2M 0x02 +#define BT_BAP_CONFIG_PHY_CODEC 0x03 + +struct bt_bap_codec { + uint8_t id; + uint16_t cid; + uint16_t vid; +} __packed; + +struct bt_ltv { + uint8_t len; + uint8_t type; + uint8_t value; +} __packed; + +struct bt_bap_io_qos { + uint32_t interval; /* Frame interval */ + uint16_t latency; /* Transport Latency */ + uint16_t sdu; /* Maximum SDU Size */ + uint8_t phy; /* PHY */ + uint8_t rtn; /* Retransmission Effort */ +}; + +struct bt_bap_ucast_qos { + uint8_t cig_id; + uint8_t cis_id; + uint8_t framing; /* Frame framing */ + uint32_t delay; /* Presentation Delay */ + uint8_t target_latency; /* Target Latency */ + struct bt_bap_io_qos io_qos; +}; + +struct bt_bap_bcast_qos { + uint8_t big; + uint8_t bis; + uint8_t sync_factor; + uint8_t packing; + uint8_t framing; + uint8_t encryption; + struct iovec *bcode; + uint8_t options; + uint16_t skip; + uint16_t sync_timeout; + uint8_t sync_cte_type; + uint8_t mse; + uint16_t timeout; + uint8_t pa_sync; + struct bt_bap_io_qos io_qos; + uint32_t delay; /* Presentation Delay */ +}; + +struct bt_bap_qos { + union { + struct bt_bap_ucast_qos ucast; + struct bt_bap_bcast_qos bcast; + }; +}; + +#endif /* SRC_SHARED_BAP_DEFS_H_ */
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/bap.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/bap.c
Changed
@@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. All rights reserved. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * */ @@ -48,6 +48,15 @@ #define BAP_PROCESS_TIMEOUT 10 +#define BAP_FREQ_LTV_TYPE 1 +#define BAP_DURATION_LTV_TYPE 2 +#define BAP_CHANNEL_ALLOCATION_LTV_TYPE 3 +#define BAP_FRAME_LEN_LTV_TYPE 4 +#define CODEC_SPECIFIC_CONFIGURATION_MASK (\ + (1<<BAP_FREQ_LTV_TYPE)|\ + (1<<BAP_DURATION_LTV_TYPE)|\ + (1<<BAP_FRAME_LEN_LTV_TYPE)) + struct bt_bap_pac_changed { unsigned int id; bt_bap_pac_func_t added; @@ -177,6 +186,11 @@ void *user_data; }; +struct bt_bap_chan { + uint8_t count; + uint32_t location; +}; + struct bt_bap_pac { struct bt_bap_db *bdb; char *name; @@ -185,6 +199,7 @@ struct bt_bap_pac_qos qos; struct iovec *data; struct iovec *metadata; + struct queue *channels; struct bt_bap_pac_ops *ops; void *user_data; }; @@ -208,6 +223,36 @@ bool connecting; }; +struct bt_bap_stream_ops { + uint8_t type; + void (*set_state)(struct bt_bap_stream *stream, uint8_t state); + unsigned int (*get_state)(struct bt_bap_stream *stream); + unsigned int (*config)(struct bt_bap_stream *stream, + struct bt_bap_qos *qos, struct iovec *data, + bt_bap_stream_func_t func, void *user_data); + unsigned int (*qos)(struct bt_bap_stream *stream, + struct bt_bap_qos *qos, + bt_bap_stream_func_t func, void *user_data); + unsigned int (*enable)(struct bt_bap_stream *stream, bool enable_links, + struct iovec *metadata, + bt_bap_stream_func_t func, void *user_data); + unsigned int (*start)(struct bt_bap_stream *stream, + bt_bap_stream_func_t func, void *user_data); + unsigned int (*disable)(struct bt_bap_stream *stream, + bool disable_links, bt_bap_stream_func_t func, + void *user_data); + unsigned int (*stop)(struct bt_bap_stream *stream, + bt_bap_stream_func_t func, void *user_data); + unsigned int (*metadata)(struct bt_bap_stream *stream, + struct iovec *data, bt_bap_stream_func_t func, + void *user_data); + unsigned int (*get_dir)(struct bt_bap_stream *stream); + unsigned int (*get_loc)(struct bt_bap_stream *stream); + unsigned int (*release)(struct bt_bap_stream *stream, + bt_bap_stream_func_t func, void *user_data); + void (*detach)(struct bt_bap_stream *stream); +}; + struct bt_bap_stream { struct bt_bap *bap; struct bt_bap_endpoint *ep; @@ -216,8 +261,11 @@ struct iovec *cc; struct iovec *meta; struct bt_bap_qos qos; - struct queue *links; + struct bt_bap_stream *link; struct bt_bap_stream_io *io; + const struct bt_bap_stream_ops *ops; + uint8_t old_state; + uint8_t state; bool client; void *user_data; }; @@ -249,6 +297,26 @@ uint16_t src; } __packed; +struct bt_base { + uint8_t big_id; + uint32_t pres_delay; + uint8_t next_bis_index; + struct queue *subgroups; +}; + +struct bt_subgroup { + uint8_t index; + struct bt_bap_codec codec; + struct iovec *caps; + struct iovec *meta; + struct queue *bises; +}; + +struct bt_bis { + uint8_t index; + struct iovec *caps; +}; + /* Contains local bt_bap_db */ static struct queue *bap_db; static struct queue *bap_cbs; @@ -262,12 +330,6 @@ return (bdb->db == db); } -static void *iov_append(struct iovec *iov, size_t len, const void *d) -{ - iov->iov_base = realloc(iov->iov_base, iov->iov_len + len); - return util_iov_push_mem(iov, len, d); -} - unsigned int bt_bap_pac_register(struct bt_bap *bap, bt_bap_pac_func_t added, bt_bap_pac_func_t removed, void *user_data, bt_bap_destroy_func_t destroy) @@ -629,7 +691,7 @@ if (type == BT_BAP_BCAST_SINK) ep->dir = BT_BAP_BCAST_SOURCE; else - ep->dir = 0; + ep->dir = BT_BAP_BCAST_SINK; return ep; } @@ -743,12 +805,17 @@ void *user_data) { struct bt_ase *ase = user_data; - struct bt_bap *bap = bap_get_session(att, ase->ascs->bdb->db); - struct bt_bap_endpoint *ep = bap_get_endpoint(bap->local_eps, - bap->ldb, attrib); + struct bt_bap *bap = NULL; + struct bt_bap_endpoint *ep = NULL; struct bt_ascs_ase_status rsp; - if (!ase || !bap || !ep) { + if (ase) + bap = bap_get_session(att, ase->ascs->bdb->db); + + if (bap) + ep = bap_get_endpoint(bap->local_eps, bap->ldb, attrib); + + if (!ep) { gatt_db_attribute_read_result(attrib, id, BT_ATT_ERROR_UNLIKELY, NULL, 0); return; @@ -803,27 +870,46 @@ return c1->id == c2->id; } -static struct bt_bap_stream *bap_stream_new(struct bt_bap *bap, - struct bt_bap_endpoint *ep, - struct bt_bap_pac *lpac, - struct bt_bap_pac *rpac, - struct iovec *data, - bool client) +static void ascs_ase_rsp_add(struct iovec *iov, uint8_t id, + uint8_t code, uint8_t reason) { - struct bt_bap_stream *stream; + struct bt_ascs_cp_rsp *cp; + struct bt_ascs_ase_rsp *rsp; - stream = new0(struct bt_bap_stream, 1); - stream->bap = bap; - stream->ep = ep; - ep->stream = stream; - stream->lpac = lpac; - stream->rpac = rpac; - stream->cc = util_iov_dup(data, 1); - stream->client = client; + if (!iov) + return; - queue_push_tail(bap->streams, stream); + cp = iov->iov_base; - return stream; + if (cp->num_ase == 0xff) + return; + + switch (code) { + /* If the Response_Code value is 0x01 or 0x02, Number_of_ASEs shall be + * set to 0xFF. + */ + case BT_ASCS_RSP_NOT_SUPPORTED: + case BT_ASCS_RSP_TRUNCATED: + cp->num_ase = 0xff; + break; + default: + cp->num_ase++; + break; + } + + iov->iov_len += sizeof(*rsp); + iov->iov_base = realloc(iov->iov_base, iov->iov_len); + + rsp = iov->iov_base + (iov->iov_len - sizeof(*rsp)); + rsp->ase = id; + rsp->code = code; + rsp->reason = reason; +} + +static void ascs_ase_rsp_success(struct iovec *iov, uint8_t id) +{ + return ascs_ase_rsp_add(iov, id, BT_ASCS_RSP_SUCCESS, + BT_ASCS_REASON_NONE); } static void stream_notify_config(struct bt_bap_stream *stream) @@ -959,6 +1045,14 @@ free(status); } +static struct bt_bap *bt_bap_ref_safe(struct bt_bap *bap) +{ + if (!bap || !bap->ref_count || !queue_find(sessions, NULL, bap)) + return NULL; + + return bt_bap_ref(bap); +} + static void bap_stream_clear_cfm(struct bt_bap_stream *stream) { if (!stream->lpac->ops || !stream->lpac->ops->clear) @@ -1004,14 +1098,6 @@ stream_io_free(io); } -static void bap_stream_unlink(void *data, void *user_data) -{ - struct bt_bap_stream *link = data; - struct bt_bap_stream *stream = user_data; - - queue_remove(link->links, stream); -} - static void bap_stream_free(void *data) { struct bt_bap_stream *stream = data; @@ -1019,147 +1105,140 @@ if (stream->ep) stream->ep->stream = NULL; - queue_foreach(stream->links, bap_stream_unlink, stream); - queue_destroy(stream->links, NULL); + if (stream->link) + stream->link->link = NULL; + stream_io_unref(stream->io); util_iov_free(stream->cc, 1); util_iov_free(stream->meta, 1); free(stream); } -static void bap_stream_detach(struct bt_bap_stream *stream) +static void bap_req_free(void *data) { - struct bt_bap_endpoint *ep = stream->ep; - - if (!ep) - return; + struct bt_bap_req *req = data; + size_t i; - DBG(stream->bap, "stream %p ep %p", stream, ep); + queue_destroy(req->group, bap_req_free); - queue_remove(stream->bap->streams, stream); - bap_stream_clear_cfm(stream); + for (i = 0; i < req->len; i++) + free(req->iovi.iov_base); - stream->ep = NULL; - ep->stream = NULL; - bap_stream_free(stream); + free(req->iov); + free(req); } -static void bap_stream_io_link(void *data, void *user_data) +static void bap_req_complete(struct bt_bap_req *req, + const struct bt_ascs_ase_rsp *rsp) { - struct bt_bap_stream *stream = data; - struct bt_bap_stream *link = user_data; - - bt_bap_stream_io_link(stream, link); -} + struct queue *group; -static void bap_stream_update_io_links(struct bt_bap_stream *stream) -{ - struct bt_bap *bap = stream->bap; + if (!req->func) + goto done; - DBG(bap, "stream %p", stream); + if (rsp) + req->func(req->stream, rsp->code, rsp->reason, req->user_data); + else + req->func(req->stream, BT_ASCS_RSP_UNSPECIFIED, 0x00, + req->user_data); - queue_foreach(bap->streams, bap_stream_io_link, stream); -} +done: + /* Detach from request so it can be freed separately */ + group = req->group; + req->group = NULL; -static struct bt_bap_stream_io *stream_io_ref(struct bt_bap_stream_io *io) -{ - if (!io) - return NULL; + queue_foreach(group, (queue_foreach_func_t)bap_req_complete, + (void *)rsp); - __sync_fetch_and_add(&io->ref_count, 1); + queue_destroy(group, NULL); - return io; + bap_req_free(req); } -static struct bt_bap_stream_io *stream_io_new(struct bt_bap *bap, int fd) +static bool match_req_stream(const void *data, const void *match_data) { - struct io *io; - struct bt_bap_stream_io *sio; + const struct bt_bap_req *req = data; - io = io_new(fd); - if (!io) - return NULL; + return req->stream == match_data; +} - DBG(bap, "fd %d", fd); +static void bap_req_abort(void *data) +{ + struct bt_bap_req *req = data; + struct bt_bap *bap = req->stream->bap; - sio = new0(struct bt_bap_stream_io, 1); - sio->bap = bap; - sio->io = io; + DBG(bap, "req %p", req); + bap_req_complete(req, NULL); +} - return stream_io_ref(sio); +static void bap_abort_stream_req(struct bt_bap *bap, + struct bt_bap_stream *stream) +{ + queue_remove_all(bap->reqs, match_req_stream, stream, bap_req_abort); } -static void stream_find_io(void *data, void *user_data) +static void bap_ucast_detach(struct bt_bap_stream *stream) { - struct bt_bap_stream *stream = data; - struct bt_bap_stream_io **io = user_data; + struct bt_bap_endpoint *ep = stream->ep; - if (*io) + if (!ep) return; - *io = stream->io; -} + DBG(stream->bap, "stream %p ep %p", stream, ep); -static struct bt_bap_stream_io *stream_get_io(struct bt_bap_stream *stream) -{ - struct bt_bap_stream_io *io; + bap_abort_stream_req(stream->bap, stream); - if (!stream) - return NULL; + queue_remove(stream->bap->streams, stream); + bap_stream_clear_cfm(stream); - if (stream->io) - return stream->io; + stream->ep = NULL; + ep->stream = NULL; + bap_stream_free(stream); +} - io = NULL; - queue_foreach(stream->links, stream_find_io, &io); +static void bap_bcast_src_detach(struct bt_bap_stream *stream) +{ + struct bt_bap_endpoint *ep = stream->ep; - return io; -} + if (!ep) + return; -static bool stream_io_disconnected(struct io *io, void *user_data); + DBG(stream->bap, "stream %p ep %p", stream, ep); -static bool bap_stream_io_attach(struct bt_bap_stream *stream, int fd, - bool connecting) -{ - struct bt_bap_stream_io *io; + queue_remove(stream->bap->streams, stream); + bap_stream_clear_cfm(stream); - io = stream_get_io(stream); - if (io) { - if (fd == stream_io_get_fd(io)) { - if (!stream->io) - stream->io = stream_io_ref(io); + stream->ep = NULL; + ep->stream = NULL; - io->connecting = connecting; - return true; - } + bap_stream_free(stream); +} - DBG(stream->bap, "stream %p io already set", stream); - return false; - } +static void bap_bcast_sink_detach(struct bt_bap_stream *stream) +{ + DBG(stream->bap, "stream %p", stream); - DBG(stream->bap, "stream %p connecting %s", stream, - connecting ? "true" : "false"); + queue_remove(stream->bap->streams, stream); + bap_stream_clear_cfm(stream); - io = stream_io_new(stream->bap, fd); - if (!io) - return false; + bap_stream_free(stream); +} - io->connecting = connecting; - stream->io = io; - io_set_disconnect_handler(io->io, stream_io_disconnected, stream, NULL); +static bool bap_stream_io_link(const void *data, const void *user_data) +{ + struct bt_bap_stream *stream = (void *)data; + struct bt_bap_stream *link = (void *)user_data; - return true; + return !bt_bap_stream_io_link(stream, link); } -static bool match_stream_io(const void *data, const void *user_data) +static void bap_stream_update_io_links(struct bt_bap_stream *stream) { - const struct bt_bap_stream *stream = data; - const struct bt_bap_stream_io *io = user_data; + struct bt_bap *bap = stream->bap; - if (!stream->io) - return false; + DBG(bap, "stream %p", stream); - return stream->io == io; + queue_find(bap->streams, bap_stream_io_link, stream); } static bool bap_stream_io_detach(struct bt_bap_stream *stream) @@ -1175,7 +1254,7 @@ io = stream->io; stream->io = NULL; - link = queue_find(stream->links, match_stream_io, io); + link = stream->link; if (link) { /* Detach link if in QoS state */ if (link->ep->state == BT_ASCS_ASE_STATE_QOS) @@ -1187,42 +1266,6 @@ return true; } -static void bap_stream_set_io(void *data, void *user_data) -{ - struct bt_bap_stream *stream = data; - int fd = PTR_TO_INT(user_data); - bool ret; - - if (fd >= 0) - ret = bap_stream_io_attach(stream, fd, false); - else - ret = bap_stream_io_detach(stream); - - if (!ret) - return; - - switch (stream->ep->state) { - case BT_BAP_STREAM_STATE_ENABLING: - if (fd < 0) - bt_bap_stream_disable(stream, false, NULL, NULL); - else - bt_bap_stream_start(stream, NULL, NULL); - break; - case BT_BAP_STREAM_STATE_DISABLING: - if (fd < 0) - bt_bap_stream_stop(stream, NULL, NULL); - break; - } -} - -static struct bt_bap *bt_bap_ref_safe(struct bt_bap *bap) -{ - if (!bap || !bap->ref_count) - return NULL; - - return bt_bap_ref(bap); -} - static void stream_stop_complete(struct bt_bap_stream *stream, uint8_t code, uint8_t reason, void *user_data) { @@ -1232,66 +1275,11 @@ bap_stream_io_detach(stream); } -static void bap_req_free(void *data) -{ - struct bt_bap_req *req = data; - size_t i; - - queue_destroy(req->group, bap_req_free); - - for (i = 0; i < req->len; i++) - free(req->iovi.iov_base); - - free(req->iov); - free(req); -} - -static void bap_req_complete(struct bt_bap_req *req, - const struct bt_ascs_ase_rsp *rsp) -{ - struct queue *group; - - if (!req->func) - goto done; - - if (rsp) - req->func(req->stream, rsp->code, rsp->reason, req->user_data); - else - req->func(req->stream, BT_ASCS_RSP_UNSPECIFIED, 0x00, - req->user_data); - -done: - /* Detach from request so it can be freed separately */ - group = req->group; - req->group = NULL; - - queue_foreach(group, (queue_foreach_func_t)bap_req_complete, - (void *)rsp); - - queue_destroy(group, NULL); - - bap_req_free(req); -} - static void bap_stream_state_changed(struct bt_bap_stream *stream) { struct bt_bap *bap = stream->bap; const struct queue_entry *entry; - DBG(bap, "stream %p dir 0x%02x: %s -> %s", stream, - bt_bap_stream_get_dir(stream), - bt_bap_stream_statestr(stream->ep->old_state), - bt_bap_stream_statestr(stream->ep->state)); - - /* Check if ref_count is already 0 which means detaching is in - * progress. - */ - bap = bt_bap_ref_safe(bap); - if (!bap) { - bap_stream_detach(stream); - return; - } - /* Pre notification updates */ switch (stream->ep->state) { case BT_ASCS_ASE_STATE_IDLE: @@ -1331,7 +1319,10 @@ bap_req_complete(bap->req, NULL); bap->req = NULL; } - bap_stream_detach(stream); + + if (stream->ops && stream->ops->detach) + stream->ops->detach(stream); + break; case BT_ASCS_ASE_STATE_QOS: break; @@ -1345,62 +1336,262 @@ bt_bap_stream_stop(stream, stream_stop_complete, NULL); break; } - - bt_bap_unref(bap); } -static void stream_set_state_broadcast(struct bt_bap_stream *stream, - uint8_t state) +/* Return false if the stream is being detached */ +static bool stream_set_state(struct bt_bap_stream *stream, uint8_t state) { - struct bt_bap_endpoint *ep = stream->ep; struct bt_bap *bap = stream->bap; - const struct queue_entry *entry; - if (ep->old_state == state) + /* Check if ref_count is already 0 which means detaching is in + * progress. + */ + bap = bt_bap_ref_safe(bap); + if (!bap) { + if (stream->ops && stream->ops->detach) + stream->ops->detach(stream); + + return false; + } + + if (stream->ops && stream->ops->set_state) + stream->ops->set_state(stream, state); + + bt_bap_unref(bap); + return true; +} + +static void ep_config_cb(struct bt_bap_stream *stream, int err) +{ + if (err) return; - ep->old_state = ep->state; - ep->state = state; - DBG(bap, "stream %p dir 0x%02x: %s -> %s", stream, - bt_bap_stream_get_dir(stream), - bt_bap_stream_statestr(stream->ep->old_state), - bt_bap_stream_statestr(stream->ep->state)); + stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG); +} - bt_bap_ref(bap); +static uint8_t stream_config(struct bt_bap_stream *stream, struct iovec *cc, + struct iovec *rsp) +{ + struct bt_bap_pac *pac = stream->lpac; - for (entry = queue_get_entries(bap->state_cbs); entry; - entry = entry->next) { - struct bt_bap_state *state = entry->data; + DBG(stream->bap, "stream %p", stream); - if (state->func) - state->func(stream, stream->ep->old_state, - stream->ep->state, state->data); + /* TODO: Wait for pac->ops response */ + ascs_ase_rsp_success(rsp, stream->ep->id); + + if (!util_iov_memcmp(stream->cc, cc)) { + stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG); + return 0; } - /* Post notification updates */ - switch (stream->ep->state) { - case BT_ASCS_ASE_STATE_IDLE: - bap_stream_detach(stream); - break; - case BT_ASCS_ASE_STATE_RELEASING: - bap_stream_io_detach(stream); - break; + util_iov_free(stream->cc, 1); + stream->cc = util_iov_dup(cc, 1); + + if (pac->ops && pac->ops->config) + pac->ops->config(stream, cc, NULL, ep_config_cb, + pac->user_data); + + return 0; +} + +static struct bt_bap_req *bap_req_new(struct bt_bap_stream *stream, + uint8_t op, struct iovec *iov, + size_t len, + bt_bap_stream_func_t func, + void *user_data) +{ + struct bt_bap_req *req; + static unsigned int id; + + req = new0(struct bt_bap_req, 1); + req->id = ++id ? id : ++id; + req->stream = stream; + req->op = op; + req->iov = util_iov_dup(iov, len); + req->len = len; + req->func = func; + req->user_data = user_data; + + return req; +} + +static uint16_t bap_req_len(struct bt_bap_req *req) +{ + uint16_t len = 0; + size_t i; + const struct queue_entry *e; + + for (i = 0; i < req->len; i++) + len += req->iovi.iov_len; + + e = queue_get_entries(req->group); + for (; e; e = e->next) + len += bap_req_len(e->data); + + return len; +} + +static bool match_req(const void *data, const void *match_data) +{ + const struct bt_bap_req *pend = data; + const struct bt_bap_req *req = match_data; + + return pend->op == req->op; +} + +static struct bt_ascs *bap_get_ascs(struct bt_bap *bap) +{ + if (!bap || !bap->rdb) + return NULL; + + if (bap->rdb->ascs) + return bap->rdb->ascs; + + bap->rdb->ascs = new0(struct bt_ascs, 1); + bap->rdb->ascs->bdb = bap->rdb; + + return bap->rdb->ascs; +} + +static void append_group(void *data, void *user_data) +{ + struct bt_bap_req *req = data; + struct iovec *iov = user_data; + size_t i; + + for (i = 0; i < req->len; i++) + util_iov_push_mem(iov, req->iovi.iov_len, + req->iovi.iov_base); +} + +static bool bap_send(struct bt_bap *bap, struct bt_bap_req *req) +{ + struct bt_ascs *ascs = bap_get_ascs(bap); + int ret; + uint16_t handle; + struct bt_ascs_ase_hdr hdr; + struct iovec iov; + size_t i; + + iov.iov_len = sizeof(hdr) + bap_req_len(req); + + DBG(bap, "req %p len %u", req, iov.iov_len); + + if (req->stream && !queue_find(bap->streams, NULL, req->stream)) { + DBG(bap, "stream %p detached, aborting op 0x%02x", req->op); + return false; } - bt_bap_unref(bap); + if (!gatt_db_attribute_get_char_data(ascs->ase_cp, NULL, &handle, + NULL, NULL, NULL)) { + DBG(bap, "Unable to find Control Point"); + return false; + } + + iov.iov_base = alloca(iov.iov_len); + iov.iov_len = 0; + + hdr.op = req->op; + hdr.num = 1 + queue_length(req->group); + + util_iov_push_mem(&iov, sizeof(hdr), &hdr); + + for (i = 0; i < req->len; i++) + util_iov_push_mem(&iov, req->iovi.iov_len, + req->iovi.iov_base); + + /* Append the request group with the same opcode */ + queue_foreach(req->group, append_group, &iov); + + ret = bt_gatt_client_write_without_response(bap->client, handle, + false, iov.iov_base, + iov.iov_len); + if (!ret) { + DBG(bap, "Unable to Write to Control Point"); + return false; + } + + bap->req = req; + + return true; +} + +static bool bap_process_queue(void *data) +{ + struct bt_bap *bap = data; + struct bt_bap_req *req; + + DBG(bap, ""); + + if (bap->process_id) { + timeout_remove(bap->process_id); + bap->process_id = 0; + } + + while ((req = queue_pop_head(bap->reqs))) { + if (bap_send(bap, req)) + break; + bap_req_complete(req, NULL); + } + + return false; +} + +static bool bap_queue_req(struct bt_bap *bap, struct bt_bap_req *req) +{ + struct bt_bap_req *pend; + struct queue *queue; + struct bt_att *att = bt_bap_get_att(bap); + uint16_t mtu = bt_att_get_mtu(att); + uint16_t len = 2 + bap_req_len(req); + + if (len > mtu) { + DBG(bap, "Unable to queue request: req len %u > %u mtu", len, + mtu); + return false; + } + + pend = queue_find(bap->reqs, match_req, req); + /* Check if req can be grouped together and it fits in the MTU */ + if (pend && (bap_req_len(pend) + len < mtu)) { + if (!pend->group) + pend->group = queue_new(); + /* Group requests with the same opcode */ + queue = pend->group; + } else { + queue = bap->reqs; + } + + DBG(bap, "req %p (op 0x%2.2x) queue %p", req, req->op, queue); + + if (!queue_push_tail(queue, req)) { + DBG(bap, "Unable to queue request"); + return false; + } + + /* Only attempot to process queue if there is no outstanding request + * and it has not been scheduled. + */ + if (!bap->req && !bap->process_id) + bap->process_id = timeout_add(BAP_PROCESS_TIMEOUT, + bap_process_queue, bap, NULL); + + return true; } -static void stream_set_state(struct bt_bap_stream *stream, uint8_t state) +static void bap_ucast_set_state(struct bt_bap_stream *stream, uint8_t state) { struct bt_bap_endpoint *ep = stream->ep; ep->old_state = ep->state; ep->state = state; - if (stream->lpac->type == BT_BAP_BCAST_SINK) - goto done; + DBG(stream->bap, "stream %p dir 0x%02x: %s -> %s", stream, + bt_bap_stream_get_dir(stream), + bt_bap_stream_statestr(stream->ep->old_state), + bt_bap_stream_statestr(stream->ep->state)); - if (stream->client) + if (stream->lpac->type == BT_BAP_BCAST_SINK || stream->client) goto done; switch (ep->state) { @@ -1423,40 +1614,764 @@ bap_stream_state_changed(stream); } -static void ascs_ase_rsp_add(struct iovec *iov, uint8_t id, - uint8_t code, uint8_t reason) +static unsigned int bap_ucast_get_state(struct bt_bap_stream *stream) { - struct bt_ascs_cp_rsp *cp; - struct bt_ascs_ase_rsp *rsp; + return stream->ep->state; +} - if (!iov) - return; +static unsigned int bap_ucast_config(struct bt_bap_stream *stream, + struct bt_bap_qos *qos, + struct iovec *data, + bt_bap_stream_func_t func, + void *user_data) +{ + struct iovec iov2; + struct bt_ascs_config config; + uint8_t iovlen = 1; + struct bt_bap_req *req; - cp = iov->iov_base; + if (!stream->client) { + stream_config(stream, data, NULL); + return -EINVAL; + } - if (cp->num_ase == 0xff) - return; + memset(&config, 0, sizeof(config)); - switch (code) { - /* If the Response_Code value is 0x01 or 0x02, Number_of_ASEs shall be - * set to 0xFF. + config.ase = stream->ep->id; + config.latency = qos->ucast.target_latency; + config.phy = qos->ucast.io_qos.phy; + config.codec = stream->rpac->codec; + + if (config.codec.id == 0xff) { + config.codec.cid = cpu_to_le16(config.codec.cid); + config.codec.vid = cpu_to_le16(config.codec.vid); + } + + iov0.iov_base = &config; + iov0.iov_len = sizeof(config); + + if (data) { + if (!bt_bap_debug_config(data->iov_base, data->iov_len, + stream->bap->debug_func, + stream->bap->debug_data)) + return 0; + + config.cc_len = data->iov_len; + iov1 = *data; + iovlen++; + } + + req = bap_req_new(stream, BT_ASCS_CONFIG, iov, iovlen, func, user_data); + if (!bap_queue_req(stream->bap, req)) { + bap_req_free(req); + return 0; + } + + stream->qos = *qos; + + return req->id; +} + +static unsigned int bap_ucast_qos(struct bt_bap_stream *stream, + struct bt_bap_qos *data, + bt_bap_stream_func_t func, + void *user_data) +{ + struct iovec iov; + struct bt_ascs_qos qos; + struct bt_bap_req *req; + + /* Table 3.2: ASE state machine transition + * Initiating device - client Only */ - case BT_ASCS_RSP_NOT_SUPPORTED: - case BT_ASCS_RSP_TRUNCATED: - cp->num_ase = 0xff; + if (!stream->client) + return 0; + + memset(&qos, 0, sizeof(qos)); + + /* TODO: Figure out how to pass these values around */ + qos.ase = stream->ep->id; + qos.cig = data->ucast.cig_id; + qos.cis = data->ucast.cis_id; + put_le24(data->ucast.io_qos.interval, qos.interval); + qos.framing = data->ucast.framing; + qos.phy = data->ucast.io_qos.phy; + qos.sdu = cpu_to_le16(data->ucast.io_qos.sdu); + qos.rtn = data->ucast.io_qos.rtn; + qos.latency = cpu_to_le16(data->ucast.io_qos.latency); + put_le24(data->ucast.delay, qos.pd); + + iov.iov_base = &qos; + iov.iov_len = sizeof(qos); + + req = bap_req_new(stream, BT_ASCS_QOS, &iov, 1, func, user_data); + + if (!bap_queue_req(stream->bap, req)) { + bap_req_free(req); + return 0; + } + + stream->qos = *data; + + return req->id; +} + +static unsigned int bap_stream_metadata(struct bt_bap_stream *stream, + uint8_t op, struct iovec *data, + bt_bap_stream_func_t func, + void *user_data) +{ + struct iovec iov2; + struct bt_ascs_metadata meta; + struct bt_bap_req *req; + struct metadata { + uint8_t len; + uint8_t type; + uint8_t data2; + } ctx = LTV(0x02, 0x01, 0x00); /* Context = Unspecified */ + + memset(&meta, 0, sizeof(meta)); + + meta.ase = stream->ep->id; + + iov0.iov_base = &meta; + iov0.iov_len = sizeof(meta); + + if (data) + iov1 = *data; + else { + iov1.iov_base = &ctx; + iov1.iov_len = sizeof(ctx); + } + + meta.len = iov1.iov_len; + + req = bap_req_new(stream, op, iov, 2, func, user_data); + + if (!bap_queue_req(stream->bap, req)) { + bap_req_free(req); + return 0; + } + + return req->id; +} + +static unsigned int bap_bcast_qos(struct bt_bap_stream *stream, + struct bt_bap_qos *data, + bt_bap_stream_func_t func, + void *user_data) +{ + stream->qos = *data; + return 1; +} + +static unsigned int bap_bcast_config(struct bt_bap_stream *stream, + struct bt_bap_qos *qos, struct iovec *data, + bt_bap_stream_func_t func, void *user_data) +{ + stream->qos = *qos; + stream->lpac->ops->config(stream, stream->cc, &stream->qos, + ep_config_cb, stream->lpac->user_data); + + return 1; +} + +static unsigned int bap_ucast_enable(struct bt_bap_stream *stream, + bool enable_links, struct iovec *data, + bt_bap_stream_func_t func, + void *user_data) +{ + int ret; + + /* Table 3.2: ASE state machine transition + * Initiating device - client Only + */ + if (!stream->client) + return 0; + + ret = bap_stream_metadata(stream, BT_ASCS_ENABLE, data, func, + user_data); + if (!ret || !enable_links) + return ret; + + if (stream->link) + bap_stream_metadata(stream->link, BT_ASCS_ENABLE, data, + NULL, NULL); + + return ret; +} + +static uint8_t stream_start(struct bt_bap_stream *stream, struct iovec *rsp) +{ + DBG(stream->bap, "stream %p", stream); + + ascs_ase_rsp_success(rsp, stream->ep->id); + + stream_set_state(stream, BT_BAP_STREAM_STATE_STREAMING); + + return 0; +} + +static unsigned int bap_ucast_start(struct bt_bap_stream *stream, + bt_bap_stream_func_t func, + void *user_data) +{ + struct iovec iov; + struct bt_ascs_start start; + struct bt_bap_req *req; + + if (!stream->client) { + if (stream->ep->dir == BT_BAP_SINK) + stream_start(stream, NULL); + return 0; + } + + if (stream->ep->dir == BT_BAP_SINK) + return 0; + + memset(&start, 0, sizeof(start)); + + start.ase = stream->ep->id; + + iov.iov_base = &start; + iov.iov_len = sizeof(start); + + req = bap_req_new(stream, BT_ASCS_START, &iov, 1, func, user_data); + if (!bap_queue_req(stream->bap, req)) { + bap_req_free(req); + return 0; + } + + return req->id; +} + +static unsigned int bap_ucast_disable(struct bt_bap_stream *stream, + bool disable_links, + bt_bap_stream_func_t func, + void *user_data) +{ + struct iovec iov; + struct bt_ascs_disable disable; + struct bt_bap_req *req; + + memset(&disable, 0, sizeof(disable)); + + disable.ase = stream->ep->id; + + iov.iov_base = &disable; + iov.iov_len = sizeof(disable); + + req = bap_req_new(stream, BT_ASCS_DISABLE, &iov, 1, func, user_data); + if (!bap_queue_req(stream->bap, req)) { + bap_req_free(req); + return 0; + } + + if (disable_links) + bt_bap_stream_disable(stream->link, false, NULL, NULL); + + return req->id; +} + +static uint8_t stream_stop(struct bt_bap_stream *stream, struct iovec *rsp) +{ + if (!stream) + return 0; + + DBG(stream->bap, "stream %p", stream); + + ascs_ase_rsp_success(rsp, stream->ep->id); + + stream_set_state(stream, BT_BAP_STREAM_STATE_QOS); + + return 0; +} + +static unsigned int bap_ucast_stop(struct bt_bap_stream *stream, + bt_bap_stream_func_t func, + void *user_data) +{ + struct iovec iov; + struct bt_ascs_stop stop; + struct bt_bap_req *req; + + if (!stream->client) { + if (stream->ep->dir == BT_BAP_SINK) + stream_stop(stream, NULL); + return 0; + } + + if (stream->ep->dir == BT_BAP_SINK) + return 0; + + memset(&stop, 0, sizeof(stop)); + + stop.ase = stream->ep->id; + + iov.iov_base = &stop; + iov.iov_len = sizeof(stop); + + req = bap_req_new(stream, BT_ASCS_STOP, &iov, 1, func, user_data); + + if (!bap_queue_req(stream->bap, req)) { + bap_req_free(req); + return 0; + } + + return req->id; +} + +static uint8_t stream_metadata(struct bt_bap_stream *stream, struct iovec *meta, + struct iovec *rsp) +{ + DBG(stream->bap, "stream %p", stream); + + ascs_ase_rsp_success(rsp, stream->ep->id); + + util_iov_free(stream->meta, 1); + stream->meta = util_iov_dup(meta, 1); + + return 0; +} + +static unsigned int bap_ucast_metadata(struct bt_bap_stream *stream, + struct iovec *data, + bt_bap_stream_func_t func, + void *user_data) +{ + if (!stream->client) { + stream_metadata(stream, data, NULL); + return 0; + } + + return bap_stream_metadata(stream, BT_ASCS_METADATA, data, func, + user_data); +} + +static uint8_t stream_release(struct bt_bap_stream *stream, struct iovec *rsp) +{ + struct bt_bap_pac *pac; + + DBG(stream->bap, "stream %p", stream); + + ascs_ase_rsp_success(rsp, stream->ep->id); + + pac = stream->lpac; + if (pac->ops && pac->ops->clear) + pac->ops->clear(stream, pac->user_data); + + stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE); + + return 0; +} + +static bool bap_stream_valid(struct bt_bap_stream *stream) +{ + if (!stream || !stream->bap) + return false; + + return queue_find(stream->bap->streams, NULL, stream); +} + +static unsigned int bap_ucast_get_dir(struct bt_bap_stream *stream) +{ + return stream->ep->dir; +} + +static unsigned int bap_ucast_get_location(struct bt_bap_stream *stream) +{ + struct bt_pacs *pacs; + + if (!stream) + return 0x00000000; + + pacs = stream->client ? stream->bap->rdb->pacs : stream->bap->ldb->pacs; + + if (stream->ep->dir == BT_BAP_SOURCE) + return pacs->source_loc_value; + else if (stream->ep->dir == BT_BAP_SINK) + return pacs->sink_loc_value; + return 0x00000000; +} + +static unsigned int bap_ucast_release(struct bt_bap_stream *stream, + bt_bap_stream_func_t func, + void *user_data) +{ + struct iovec iov; + struct bt_ascs_release rel; + struct bt_bap_req *req; + struct bt_bap *bap; + + if (!stream->client) { + stream_release(stream, NULL); + return 0; + } + + memset(&req, 0, sizeof(req)); + + rel.ase = stream->ep->id; + + iov.iov_base = &rel; + iov.iov_len = sizeof(rel); + + bap = stream->bap; + + /* If stream does not belong to a client session, clean it up now */ + if (!bap_stream_valid(stream)) { + stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE); + stream = NULL; + return 0; + } + + req = bap_req_new(stream, BT_ASCS_RELEASE, &iov, 1, func, user_data); + if (!bap_queue_req(bap, req)) { + bap_req_free(req); + return 0; + } + + return req->id; +} + +static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) +{ + struct bt_bap *bap = stream->bap; + const struct queue_entry *entry; + + stream->old_state = stream->state; + stream->state = state; + + DBG(bap, "stream %p dir 0x%02x: %s -> %s", stream, + bt_bap_stream_get_dir(stream), + bt_bap_stream_statestr(stream->old_state), + bt_bap_stream_statestr(stream->state)); + + for (entry = queue_get_entries(bap->state_cbs); entry; + entry = entry->next) { + struct bt_bap_state *state = entry->data; + + if (state->func) + state->func(stream, stream->old_state, + stream->state, state->data); + } + + /* Post notification updates */ + switch (state) { + case BT_ASCS_ASE_STATE_IDLE: + if (stream->ops && stream->ops->detach) + stream->ops->detach(stream); break; - default: - cp->num_ase++; + case BT_ASCS_ASE_STATE_RELEASING: + bap_stream_io_detach(stream); + stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE); break; } +} - iov->iov_len += sizeof(*rsp); - iov->iov_base = realloc(iov->iov_base, iov->iov_len); +static unsigned int bap_bcast_get_state(struct bt_bap_stream *stream) +{ + return stream->state; +} - rsp = iov->iov_base + (iov->iov_len - sizeof(*rsp)); - rsp->ase = id; - rsp->code = code; - rsp->reason = reason; +static unsigned int bap_bcast_sink_enable(struct bt_bap_stream *stream, + bool enable_links, struct iovec *data, + bt_bap_stream_func_t func, + void *user_data) +{ + stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG); + + return 1; +} + +static unsigned int bap_bcast_src_enable(struct bt_bap_stream *stream, + bool enable_links, struct iovec *data, + bt_bap_stream_func_t func, + void *user_data) +{ + stream_set_state(stream, BT_BAP_STREAM_STATE_ENABLING); + + return 1; +} + +static unsigned int bap_bcast_start(struct bt_bap_stream *stream, + bt_bap_stream_func_t func, + void *user_data) +{ + stream_set_state(stream, BT_BAP_STREAM_STATE_STREAMING); + + return 1; +} + +static unsigned int bap_bcast_disable(struct bt_bap_stream *stream, + bool disable_links, + bt_bap_stream_func_t func, + void *user_data) +{ + bap_stream_io_detach(stream); + stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG); + + return 1; +} + +static unsigned int bap_bcast_metadata(struct bt_bap_stream *stream, + struct iovec *data, + bt_bap_stream_func_t func, + void *user_data) +{ + util_iov_free(stream->meta, 1); + stream->meta = util_iov_dup(data, 1); + + return 1; +} + +static unsigned int bap_bcast_src_get_dir(struct bt_bap_stream *stream) +{ + return BT_BAP_BCAST_SINK; +} + +static unsigned int bap_bcast_sink_get_dir(struct bt_bap_stream *stream) +{ + return BT_BAP_BCAST_SOURCE; +} + +static void bap_sink_get_allocation(size_t i, uint8_t l, uint8_t t, + uint8_t *v, void *user_data) +{ + uint32_t location32; + + if (!v) + return; + + memcpy(&location32, v, l); + *((uint32_t *)user_data) = le32_to_cpu(location32); +} + +static unsigned int bap_bcast_get_location(struct bt_bap_stream *stream) +{ + uint8_t type = BAP_CHANNEL_ALLOCATION_LTV_TYPE; + uint32_t allocation = 0; + struct iovec *caps; + + caps = bt_bap_stream_get_config(stream); + + /* Get stream allocation from capabilities */ + util_ltv_foreach(caps->iov_base, caps->iov_len, &type, + bap_sink_get_allocation, &allocation); + + return allocation; +} + +static unsigned int bap_bcast_release(struct bt_bap_stream *stream, + bt_bap_stream_func_t func, + void *user_data) +{ + stream_set_state(stream, BT_BAP_STREAM_STATE_RELEASING); + + return 1; +} + +#define STREAM_OPS(_type, _set_state, _get_state, _config, _qos, _enable, \ + _start, _disable, _stop, _metadata, _get_dir, _get_loc, _release, \ + _detach) \ +{ \ + .type = _type, \ + .set_state = _set_state, \ + .get_state = _get_state, \ + .config = _config, \ + .qos = _qos, \ + .enable = _enable, \ + .start = _start, \ + .disable = _disable, \ + .stop = _stop, \ + .metadata = _metadata, \ + .get_dir = _get_dir,\ + .get_loc = _get_loc, \ + .release = _release, \ + .detach = _detach, \ +} + +static const struct bt_bap_stream_ops stream_ops = { + STREAM_OPS(BT_BAP_SINK, bap_ucast_set_state, + bap_ucast_get_state, + bap_ucast_config, bap_ucast_qos, bap_ucast_enable, + bap_ucast_start, bap_ucast_disable, bap_ucast_stop, + bap_ucast_metadata, bap_ucast_get_dir, + bap_ucast_get_location, + bap_ucast_release, bap_ucast_detach), + STREAM_OPS(BT_BAP_SOURCE, bap_ucast_set_state, + bap_ucast_get_state, + bap_ucast_config, bap_ucast_qos, bap_ucast_enable, + bap_ucast_start, bap_ucast_disable, bap_ucast_stop, + bap_ucast_metadata, bap_ucast_get_dir, + bap_ucast_get_location, + bap_ucast_release, bap_ucast_detach), + STREAM_OPS(BT_BAP_BCAST_SINK, bap_bcast_set_state, + bap_bcast_get_state, + bap_bcast_config, NULL, bap_bcast_sink_enable, + bap_bcast_start, bap_bcast_disable, NULL, + bap_bcast_metadata, bap_bcast_sink_get_dir, + bap_bcast_get_location, + bap_bcast_release, bap_bcast_sink_detach), + STREAM_OPS(BT_BAP_BCAST_SOURCE, bap_bcast_set_state, + bap_bcast_get_state, + bap_bcast_config, bap_bcast_qos, bap_bcast_src_enable, + bap_bcast_start, bap_bcast_disable, NULL, + bap_bcast_metadata, bap_bcast_src_get_dir, + bap_bcast_get_location, + bap_bcast_release, bap_bcast_src_detach), +}; + +static const struct bt_bap_stream_ops * +bap_stream_new_ops(struct bt_bap_stream *stream) +{ + const struct bt_bap_stream_ops *ops; + uint8_t type = bt_bap_pac_get_type(stream->lpac); + size_t i; + + for (i = 0; i < ARRAY_SIZE(stream_ops); i++) { + ops = &stream_opsi; + + if (ops->type == type) + return ops; + } + + return NULL; +} + +static struct bt_bap_stream *bap_stream_new(struct bt_bap *bap, + struct bt_bap_endpoint *ep, + struct bt_bap_pac *lpac, + struct bt_bap_pac *rpac, + struct iovec *data, + bool client) +{ + struct bt_bap_stream *stream; + + stream = new0(struct bt_bap_stream, 1); + stream->bap = bap; + stream->ep = ep; + if (ep != NULL) + ep->stream = stream; + stream->lpac = lpac; + stream->rpac = rpac; + stream->cc = util_iov_dup(data, 1); + stream->client = client; + stream->ops = bap_stream_new_ops(stream); + + queue_push_tail(bap->streams, stream); + + return stream; +} + +static struct bt_bap_stream_io *stream_io_ref(struct bt_bap_stream_io *io) +{ + if (!io) + return NULL; + + __sync_fetch_and_add(&io->ref_count, 1); + + return io; +} + +static struct bt_bap_stream_io *stream_io_new(struct bt_bap *bap, int fd) +{ + struct io *io; + struct bt_bap_stream_io *sio; + + io = io_new(fd); + if (!io) + return NULL; + + DBG(bap, "fd %d", fd); + + sio = new0(struct bt_bap_stream_io, 1); + sio->bap = bap; + sio->io = io; + + return stream_io_ref(sio); +} + +static struct bt_bap_stream_io *stream_get_io(struct bt_bap_stream *stream) +{ + if (!stream) + return NULL; + + if (stream->io) + return stream->io; + + if (stream->link) + return stream->link->io; + + return NULL; +} + +static bool stream_io_disconnected(struct io *io, void *user_data); + +static bool bap_stream_io_attach(struct bt_bap_stream *stream, int fd, + bool connecting) +{ + struct bt_bap_stream_io *io; + + io = stream_get_io(stream); + if (io) { + if (fd == stream_io_get_fd(io)) { + if (!stream->io) + stream->io = stream_io_ref(io); + + io->connecting = connecting; + return true; + } + + DBG(stream->bap, "stream %p io already set", stream); + return false; + } + + DBG(stream->bap, "stream %p connecting %s", stream, + connecting ? "true" : "false"); + + io = stream_io_new(stream->bap, fd); + if (!io) + return false; + + io->connecting = connecting; + stream->io = io; + io_set_disconnect_handler(io->io, stream_io_disconnected, stream, NULL); + + return true; +} + +static void bap_stream_set_io(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + int fd = PTR_TO_INT(user_data); + bool ret; + uint8_t state; + + if (fd >= 0) + ret = bap_stream_io_attach(stream, fd, false); + else + ret = bap_stream_io_detach(stream); + + if (!ret) + return; + + if (bt_bap_stream_get_type(stream) == BT_BAP_STREAM_TYPE_BCAST) + state = stream->state; + else + state = stream->ep->state; + + switch (state) { + case BT_BAP_STREAM_STATE_ENABLING: + if (fd < 0) + bt_bap_stream_disable(stream, false, NULL, NULL); + else + bt_bap_stream_start(stream, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_DISABLING: + if (fd < 0) + bt_bap_stream_stop(stream, NULL, NULL); + break; + } } static void ascs_ase_rsp_add_errno(struct iovec *iov, uint8_t id, int err) @@ -1518,55 +2433,6 @@ } } -static void ascs_ase_rsp_success(struct iovec *iov, uint8_t id) -{ - return ascs_ase_rsp_add(iov, id, BT_ASCS_RSP_SUCCESS, - BT_ASCS_REASON_NONE); -} - -static void ep_config_cb(struct bt_bap_stream *stream, int err) -{ - if (err) - return; - - if (bt_bap_stream_get_type(stream) == BT_BAP_STREAM_TYPE_BCAST) { - if (!bt_bap_stream_io_dir(stream)) - stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_QOS); - else if (bt_bap_stream_io_dir(stream) == BT_BAP_BCAST_SOURCE) - stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_CONFIG); - return; - } - - stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG); -} - -static uint8_t stream_config(struct bt_bap_stream *stream, struct iovec *cc, - struct iovec *rsp) -{ - struct bt_bap_pac *pac = stream->lpac; - - DBG(stream->bap, "stream %p", stream); - - /* TODO: Wait for pac->ops response */ - ascs_ase_rsp_success(rsp, stream->ep->id); - - if (!util_iov_memcmp(stream->cc, cc)) { - stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG); - return 0; - } - - util_iov_free(stream->cc, 1); - stream->cc = util_iov_dup(cc, 1); - - if (pac->ops && pac->ops->config) - pac->ops->config(stream, cc, NULL, ep_config_cb, - pac->user_data); - - return 0; -} - static uint8_t ep_config(struct bt_bap_endpoint *ep, struct bt_bap *bap, struct bt_ascs_config *req, struct iovec *iov, struct iovec *rsp) @@ -1756,7 +2622,8 @@ util_iov_free(stream->meta, 1); stream->meta = util_iov_dup(meta, 1); - stream_set_state(stream, BT_BAP_STREAM_STATE_ENABLING); + if (!stream_set_state(stream, BT_BAP_STREAM_STATE_ENABLING)) + return 1; /* Sink can autonomously for to Streaming state if io already exits */ if (stream->io && stream->ep->dir == BT_BAP_SINK) @@ -1826,17 +2693,6 @@ return ep_enable(ep, bap, req, iov, rsp); } -static uint8_t stream_start(struct bt_bap_stream *stream, struct iovec *rsp) -{ - DBG(stream->bap, "stream %p", stream); - - ascs_ase_rsp_success(rsp, stream->ep->id); - - stream_set_state(stream, BT_BAP_STREAM_STATE_STREAMING); - - return 0; -} - static uint8_t ep_start(struct bt_bap_endpoint *ep, struct iovec *rsp) { struct bt_bap_stream *stream = ep->stream; @@ -1900,12 +2756,12 @@ static uint8_t stream_disable(struct bt_bap_stream *stream, struct iovec *rsp) { - DBG(stream->bap, "stream %p", stream); - if (!stream || stream->ep->state == BT_BAP_STREAM_STATE_QOS || stream->ep->state == BT_BAP_STREAM_STATE_IDLE) return 0; + DBG(stream->bap, "stream %p", stream); + ascs_ase_rsp_success(rsp, stream->ep->id); /* Sink can autonomously transit to QOS while source needs to go to @@ -1970,20 +2826,6 @@ return ep_disable(ep, rsp); } -static uint8_t stream_stop(struct bt_bap_stream *stream, struct iovec *rsp) -{ - DBG(stream->bap, "stream %p", stream); - - if (!stream) - return 0; - - ascs_ase_rsp_success(rsp, stream->ep->id); - - stream_set_state(stream, BT_BAP_STREAM_STATE_QOS); - - return 0; -} - static uint8_t ep_stop(struct bt_bap_endpoint *ep, struct iovec *rsp) { struct bt_bap_stream *stream = ep->stream; @@ -2045,19 +2887,6 @@ return ep_stop(ep, rsp); } -static uint8_t stream_metadata(struct bt_bap_stream *stream, struct iovec *meta, - struct iovec *rsp) -{ - DBG(stream->bap, "stream %p", stream); - - ascs_ase_rsp_success(rsp, stream->ep->id); - - util_iov_free(stream->meta, 1); - stream->meta = util_iov_dup(meta, 1); - - return 0; -} - static uint8_t ep_metadata(struct bt_bap_endpoint *ep, struct iovec *meta, struct iovec *rsp) { @@ -2110,23 +2939,6 @@ return ep_metadata(ep, iov, rsp); } -static uint8_t stream_release(struct bt_bap_stream *stream, struct iovec *rsp) -{ - struct bt_bap_pac *pac; - - DBG(stream->bap, "stream %p", stream); - - ascs_ase_rsp_success(rsp, stream->ep->id); - - pac = stream->lpac; - if (pac->ops && pac->ops->clear) - pac->ops->clear(stream, pac->user_data); - - stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE); - - return 0; -} - static uint8_t ascs_release(struct bt_ascs *ascs, struct bt_bap *bap, struct iovec *iov, struct iovec *rsp) { @@ -2363,20 +3175,6 @@ return bap->rdb->pacs; } -static struct bt_ascs *bap_get_ascs(struct bt_bap *bap) -{ - if (!bap) - return NULL; - - if (bap->rdb->ascs) - return bap->rdb->ascs; - - bap->rdb->ascs = new0(struct bt_ascs, 1); - bap->rdb->ascs->bdb = bap->rdb; - - return bap->rdb->ascs; -} - static bool match_codec(const void *data, const void *user_data) { const struct bt_bap_pac *pac = data; @@ -2412,9 +3210,39 @@ if (!cont || !cont->iov_len || !cont->iov_base) return data->iov_base; - iov_append(data, sizeof(delimiter), &delimiter); + util_iov_append(data, &delimiter, sizeof(delimiter)); + + return util_iov_append(data, cont->iov_base, cont->iov_len); +} + +static void bap_pac_foreach_channel(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data) +{ + struct bt_bap_pac *pac = user_data; + struct bt_bap_chan *chan; + + if (!v) + return; + + if (!pac->channels) + pac->channels = queue_new(); + + chan = new0(struct bt_bap_chan, 1); + chan->count = *v; + chan->location = bt_bap_pac_get_locations(pac) ? : pac->qos.location; + + queue_push_tail(pac->channels, chan); +} + +static void bap_pac_update_channels(struct bt_bap_pac *pac, struct iovec *data) +{ + uint8_t type = 0x03; - return iov_append(data, cont->iov_len, cont->iov_base); + if (!data) + return; + + util_ltv_foreach(data->iov_base, data->iov_len, &type, + bap_pac_foreach_channel, pac); } static void bap_pac_merge(struct bt_bap_pac *pac, struct iovec *data, @@ -2426,6 +3254,9 @@ else pac->data = util_iov_dup(data, 1); + /* Update channels */ + bap_pac_update_channels(pac, data); + /* Merge metadata into existing record */ if (pac->metadata) ltv_merge(pac->metadata, metadata); @@ -2446,15 +3277,15 @@ pac->bdb = bdb; pac->name = name ? strdup(name) : NULL; pac->type = type; + if (codec) pac->codec = *codec; - if (data) - pac->data = util_iov_dup(data, 1); - if (metadata) - pac->metadata = util_iov_dup(metadata, 1); + if (qos) pac->qos = *qos; + bap_pac_merge(pac, data, metadata); + return pac; } @@ -2465,6 +3296,7 @@ free(pac->name); util_iov_free(pac->metadata, 1); util_iov_free(pac->data, 1); + queue_destroy(pac->channels, free); free(pac); } @@ -2599,7 +3431,7 @@ static void pacs_add_source_context(struct bt_pacs *pacs, uint16_t context) { - context |= pacs->supported_source_context_value; + context |= pacs->source_context_value; /* Check if context value needs updating */ if (context == pacs->source_context_value) @@ -2641,6 +3473,13 @@ static void bap_add_broadcast_sink(struct bt_bap_pac *pac) { queue_push_tail(pac->bdb->broadcast_sinks, pac); + + /* Update local PACS for broadcast sink also, when registering an + * endpoint + */ + pacs_add_sink_location(pac->bdb->pacs, pac->qos.location); + pacs_add_sink_supported_context(pac->bdb->pacs, + pac->qos.supported_context); } static void notify_pac_added(void *data, void *user_data) @@ -2792,6 +3631,16 @@ return &pac->qos; } +struct iovec *bt_bap_pac_get_data(struct bt_bap_pac *pac) +{ + return pac->data; +} + +struct iovec *bt_bap_pac_get_metadata(struct bt_bap_pac *pac) +{ + return pac->metadata; +} + uint8_t bt_bap_stream_get_type(struct bt_bap_stream *stream) { if (!stream) @@ -2950,6 +3799,16 @@ free(state); } +static void bap_ep_free(void *data) +{ + struct bt_bap_endpoint *ep = data; + + if (ep && ep->stream) + ep->stream->ep = NULL; + + free(ep); +} + static void bap_detached(void *data, void *user_data) { struct bt_bap_cb *cb = data; @@ -2972,7 +3831,7 @@ queue_destroy(bap->ready_cbs, bap_ready_free); queue_destroy(bap->state_cbs, bap_state_free); queue_destroy(bap->local_eps, free); - queue_destroy(bap->remote_eps, free); + queue_destroy(bap->remote_eps, bap_ep_free); queue_destroy(bap->reqs, bap_req_free); queue_destroy(bap->notify, NULL); @@ -3800,156 +4659,6 @@ bap_endpoint_notify, ep); } -static void append_group(void *data, void *user_data) -{ - struct bt_bap_req *req = data; - struct iovec *iov = user_data; - size_t i; - - for (i = 0; i < req->len; i++) - util_iov_push_mem(iov, req->iovi.iov_len, - req->iovi.iov_base); -} - -static uint16_t bap_req_len(struct bt_bap_req *req) -{ - uint16_t len = 0; - size_t i; - const struct queue_entry *e; - - for (i = 0; i < req->len; i++) - len += req->iovi.iov_len; - - e = queue_get_entries(req->group); - for (; e; e = e->next) - len += bap_req_len(e->data); - - return len; -} - -static bool bap_send(struct bt_bap *bap, struct bt_bap_req *req) -{ - struct bt_ascs *ascs = bap_get_ascs(bap); - int ret; - uint16_t handle; - struct bt_ascs_ase_hdr hdr; - struct iovec iov; - size_t i; - - iov.iov_len = sizeof(hdr) + bap_req_len(req); - - DBG(bap, "req %p len %u", req, iov.iov_len); - - if (req->stream && !queue_find(bap->streams, NULL, req->stream)) { - DBG(bap, "stream %p detached, aborting op 0x%02x", req->op); - return false; - } - - if (!gatt_db_attribute_get_char_data(ascs->ase_cp, NULL, &handle, - NULL, NULL, NULL)) { - DBG(bap, "Unable to find Control Point"); - return false; - } - - iov.iov_base = alloca(iov.iov_len); - iov.iov_len = 0; - - hdr.op = req->op; - hdr.num = 1 + queue_length(req->group); - - util_iov_push_mem(&iov, sizeof(hdr), &hdr); - - for (i = 0; i < req->len; i++) - util_iov_push_mem(&iov, req->iovi.iov_len, - req->iovi.iov_base); - - /* Append the request group with the same opcode */ - queue_foreach(req->group, append_group, &iov); - - ret = bt_gatt_client_write_without_response(bap->client, handle, - false, iov.iov_base, - iov.iov_len); - if (!ret) { - DBG(bap, "Unable to Write to Control Point"); - return false; - } - - bap->req = req; - - return true; -} - -static bool bap_process_queue(void *data) -{ - struct bt_bap *bap = data; - struct bt_bap_req *req; - - DBG(bap, ""); - - if (bap->process_id) { - timeout_remove(bap->process_id); - bap->process_id = 0; - } - - while ((req = queue_pop_head(bap->reqs))) { - if (bap_send(bap, req)) - break; - bap_req_complete(req, NULL); - } - - return false; -} - -static bool match_req(const void *data, const void *match_data) -{ - const struct bt_bap_req *pend = data; - const struct bt_bap_req *req = match_data; - - return pend->op == req->op; -} - -static bool bap_queue_req(struct bt_bap *bap, struct bt_bap_req *req) -{ - struct bt_bap_req *pend; - struct queue *queue; - struct bt_att *att = bt_bap_get_att(bap); - uint16_t mtu = bt_att_get_mtu(att); - uint16_t len = 2 + bap_req_len(req); - - if (len > mtu) { - DBG(bap, "Unable to queue request: req len %u > %u mtu", len, - mtu); - return false; - } - - pend = queue_find(bap->reqs, match_req, req); - /* Check if req can be grouped together and it fits in the MTU */ - if (pend && (bap_req_len(pend) + len < mtu)) { - if (!pend->group) - pend->group = queue_new(); - /* Group requests with the same opcode */ - queue = pend->group; - } else { - queue = bap->reqs; - } - - DBG(bap, "req %p (op 0x%2.2x) queue %p", req, req->op, queue); - - if (!queue_push_tail(queue, req)) { - DBG(bap, "Unable to queue request"); - return false; - } - - /* Only attempot to process queue if there is no outstanding request - * and it has not been scheduled. - */ - if (!bap->req && !bap->process_id) - bap->process_id = timeout_add(BAP_PROCESS_TIMEOUT, - bap_process_queue, bap, NULL); - - return true; -} - static void bap_cp_notify(struct bt_bap *bap, uint16_t value_handle, const uint8_t *value, uint16_t length, void *user_data) @@ -4127,7 +4836,8 @@ queue_foreach(bap_cbs, bap_attached, bap); if (!client) { - bap_attach_att(bap, bap->att); + if (bap->att) + bap_attach_att(bap, bap->att); return true; } @@ -4160,6 +4870,18 @@ } } + /* Resume reading sink locations if supported */ + if (pacs->sink && pacs->sink_loc && !pacs->sink_loc_value) { + if (gatt_db_attribute_get_char_data(pacs->sink_loc, + NULL, &value_handle, + NULL, NULL, NULL)) { + bt_gatt_client_read_value(bap->client, + value_handle, + read_sink_pac_loc, + bap, NULL); + } + } + /* Resume reading sources if supported */ if (pacs->source && queue_isempty(bap->rdb->sources)) { if (gatt_db_attribute_get_char_data(pacs->source, @@ -4172,6 +4894,48 @@ } } + /* Resume reading source locations if supported */ + if (pacs->source && pacs->source_loc && + !pacs->source_loc_value) { + if (gatt_db_attribute_get_char_data(pacs->source_loc, + NULL, &value_handle, + NULL, NULL, NULL)) { + bt_gatt_client_read_value(bap->client, + value_handle, + read_source_pac_loc, + bap, NULL); + } + } + + /* Resume reading supported contexts if supported */ + if (pacs->sink && pacs->supported_context && + !pacs->supported_sink_context_value && + !pacs->supported_source_context_value) { + if (gatt_db_attribute_get_char_data( + pacs->supported_context, + NULL, &value_handle, + NULL, NULL, NULL)) { + bt_gatt_client_read_value(bap->client, + value_handle, + read_pac_supported_context, + bap, NULL); + } + } + + /* Resume reading contexts if supported */ + if (pacs->sink && pacs->context && + !pacs->sink_context_value && + !pacs->source_context_value) { + if (gatt_db_attribute_get_char_data(pacs->context, + NULL, &value_handle, + NULL, NULL, NULL)) { + bt_gatt_client_read_value(bap->client, + value_handle, + read_pac_context, + bap, NULL); + } + } + queue_foreach(bap->remote_eps, bap_endpoint_foreach, bap); bap_cp_attach(bap); @@ -4505,36 +5269,26 @@ if (ep->stream->lpac != match->lpac) return false; - return ep->stream->rpac == match->rpac; -} - -static struct bt_bap_req *bap_req_new(struct bt_bap_stream *stream, - uint8_t op, struct iovec *iov, - size_t len, - bt_bap_stream_func_t func, - void *user_data) -{ - struct bt_bap_req *req; - static unsigned int id; + if (ep->stream->rpac != match->rpac) + return false; - req = new0(struct bt_bap_req, 1); - req->id = ++id ? id : ++id; - req->stream = stream; - req->op = op; - req->iov = util_iov_dup(iov, len); - req->len = len; - req->func = func; - req->user_data = user_data; + switch (ep->state) { + case BT_BAP_STREAM_STATE_CONFIG: + case BT_BAP_STREAM_STATE_QOS: + return true; + } - return req; + return false; } -static bool bap_stream_valid(struct bt_bap_stream *stream) +static bool find_ep_source(const void *data, const void *user_data) { - if (!stream || !stream->bap) - return false; + const struct bt_bap_endpoint *ep = data; - return queue_find(stream->bap->streams, NULL, stream); + if (ep->dir == BT_BAP_BCAST_SINK) + return true; + else + return false; } unsigned int bt_bap_stream_config(struct bt_bap_stream *stream, @@ -4543,69 +5297,25 @@ bt_bap_stream_func_t func, void *user_data) { - struct iovec iov2; - struct bt_ascs_config config; - uint8_t iovlen = 1; - struct bt_bap_req *req; + unsigned int id; + struct bt_bap *bap; if (!bap_stream_valid(stream)) return 0; - switch (bt_bap_stream_get_type(stream)) { - case BT_BAP_STREAM_TYPE_UCAST: - if (!stream->client) { - stream_config(stream, data, NULL); - return 0; - } - - memset(&config, 0, sizeof(config)); - - config.ase = stream->ep->id; - config.latency = qos->ucast.target_latency; - config.phy = qos->ucast.io_qos.phy; - config.codec = stream->rpac->codec; - - if (config.codec.id == 0xff) { - config.codec.cid = cpu_to_le16(config.codec.cid); - config.codec.vid = cpu_to_le16(config.codec.vid); - } - - iov0.iov_base = &config; - iov0.iov_len = sizeof(config); - - if (data) { - if (!bt_bap_debug_config(data->iov_base, data->iov_len, - stream->bap->debug_func, - stream->bap->debug_data)) - return 0; - - config.cc_len = data->iov_len; - iov1 = *data; - iovlen++; - } + if (!stream->ops || !stream->ops->config) + return 0; - req = bap_req_new(stream, BT_ASCS_CONFIG, iov, iovlen, - func, user_data); + if (!bt_bap_ref_safe(stream->bap)) + return 0; - if (!bap_queue_req(stream->bap, req)) { - bap_req_free(req); - return 0; - } + bap = stream->bap; - stream->qos = *qos; + id = stream->ops->config(stream, qos, data, func, user_data); - return req->id; - case BT_BAP_STREAM_TYPE_BCAST: - stream->qos = *qos; - if (stream->lpac->type == BT_BAP_BCAST_SINK) { - if (data) - stream_config(stream, data, NULL); - stream_set_state(stream, BT_BAP_STREAM_STATE_CONFIG); - } - return 1; - } + bt_bap_unref(bap); - return 0; + return id; } static bool match_pac(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, @@ -4626,80 +5336,142 @@ } int bt_bap_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, - bt_bap_pac_select_t func, void *user_data) + int *count, bt_bap_pac_select_t func, + void *user_data) { + const struct queue_entry *lchan, *rchan; + int selected = 0; + if (!lpac || !rpac || !func) return -EINVAL; if (!lpac->ops || !lpac->ops->select) return -EOPNOTSUPP; - lpac->ops->select(lpac, rpac, &rpac->qos, - func, user_data, lpac->user_data); + for (lchan = queue_get_entries(lpac->channels); lchan; + lchan = lchan->next) { + struct bt_bap_chan *lc = lchan->data; + struct bt_bap_chan map = *lc; + int i; + + for (i = 0, rchan = queue_get_entries(rpac->channels); rchan; + rchan = rchan->next, i++) { + struct bt_bap_chan *rc = rchan->data; + + /* Try matching the channel count */ + if (!(map.count & rc->count)) + break; + + /* Check if location was set otherwise attempt to + * assign one based on the number of channels it + * supports. + */ + if (!rc->location) { + rc->location = bt_bap_pac_get_locations(rpac); + /* If channel count is 1 use a single + * location + */ + if (rc->count == 0x01) + rc->location &= BIT(i); + } + + /* Try matching the channel location */ + if (!(map.location & rc->location)) + break; + + lpac->ops->select(lpac, rpac, map.location & + rc->location, &rpac->qos, + func, user_data, + lpac->user_data); + selected++; + + /* Check if there are any channels left to select */ + map.count &= ~(map.count & rc->count); + /* Check if there are any locations left to select */ + map.location &= ~(map.location & rc->location); + + if (!map.count || !map.location) + break; + + /* Check if device require AC*(i) settings */ + if (rc->count == 0x01) + map.count = map.count >> 1; + } + } + + /* Fallback to no channel allocation since none could be matched. */ + if (!selected) { + lpac->ops->select(lpac, rpac, 0, &rpac->qos, func, user_data, + lpac->user_data); + selected++; + } + + if (count) + *count += selected; return 0; } -struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, +void bt_bap_cancel_select(struct bt_bap_pac *lpac, bt_bap_pac_select_t func, + void *user_data) +{ + if (!lpac || !func) + return; + + if (!lpac->ops || !lpac->ops->cancel_select) + return; + + lpac->ops->cancel_select(lpac, func, user_data, lpac->user_data); +} + +static struct bt_bap_stream *bap_bcast_stream_new(struct bt_bap *bap, struct bt_bap_pac *lpac, - struct bt_bap_pac *rpac, struct bt_bap_qos *pqos, struct iovec *data) { - struct bt_bap_stream *stream; - struct bt_bap_endpoint *ep; + struct bt_bap_stream *stream = NULL; + struct bt_bap_endpoint *ep = NULL; struct match_pac match; if (!bap) return NULL; - if (!rpac && (lpac->type != BT_BAP_BCAST_SOURCE) - && queue_isempty(bap->remote_eps)) - return NULL; - - if (lpac && rpac) { - if ((rpac->type != BT_BAP_BCAST_SOURCE) - && (!bap_codec_equal(&lpac->codec, &rpac->codec))) - return NULL; - } else { - uint8_t type; - + if (lpac->type == BT_BAP_BCAST_SOURCE) { match.lpac = lpac; - match.rpac = rpac; + match.rpac = NULL; memset(&match.codec, 0, sizeof(match.codec)); - if (rpac) - type = rpac->type; - else if (lpac) { - switch (lpac->type) { - case BT_BAP_SINK: - type = BT_BAP_SOURCE; - break; - case BT_BAP_SOURCE: - type = BT_BAP_SINK; - break; - case BT_BAP_BCAST_SOURCE: - type = BT_BAP_BCAST_SINK; - break; - case BT_BAP_BCAST_SINK: - type = BT_BAP_BCAST_SOURCE; - break; - default: - return NULL; - } - } else - return NULL; - - bt_bap_foreach_pac(bap, type, match_pac, &match); - if (!match.lpac) - return NULL; - if (!match.rpac && (lpac->type != BT_BAP_BCAST_SOURCE)) + bt_bap_foreach_pac(bap, BT_BAP_BCAST_SINK, match_pac, &match); + if ((!match.lpac) || (!lpac)) return NULL; lpac = match.lpac; - rpac = match.rpac; + + ep = queue_find(bap->remote_eps, find_ep_source, NULL); + if (!ep) + return NULL; } + if (!stream) + stream = bap_stream_new(bap, ep, lpac, NULL, data, true); + + return stream; +} + +static struct bt_bap_stream *bap_ucast_stream_new(struct bt_bap *bap, + struct bt_bap_pac *lpac, + struct bt_bap_pac *rpac, + struct bt_bap_qos *pqos, + struct iovec *data) +{ + struct bt_bap_stream *stream = NULL; + struct bt_bap_endpoint *ep = NULL; + struct match_pac match; + + if (!lpac || !rpac || !bap_codec_equal(&lpac->codec, &rpac->codec)) + return NULL; + + memset(&match, 0, sizeof(match)); match.lpac = lpac; match.rpac = rpac; @@ -4721,6 +5493,22 @@ return stream; } +struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, + struct bt_bap_pac *lpac, + struct bt_bap_pac *rpac, + struct bt_bap_qos *pqos, + struct iovec *data) +{ + if (!bap) + return NULL; + + /* Check if ATT is attached then it must be a unicast stream */ + if (bt_bap_get_att(bap)) + return bap_ucast_stream_new(bap, lpac, rpac, pqos, data); + + return bap_bcast_stream_new(bap, lpac, pqos, data); +} + struct bt_bap *bt_bap_stream_get_session(struct bt_bap_stream *stream) { if (!stream) @@ -4734,7 +5522,7 @@ if (!stream) return BT_BAP_STREAM_STATE_IDLE; - return stream->ep->state; + return stream->ops->get_state(stream); } bool bt_bap_stream_set_user_data(struct bt_bap_stream *stream, void *user_data) @@ -4744,10 +5532,6 @@ stream->user_data = user_data; - if (bt_bap_stream_get_type(stream) == BT_BAP_STREAM_TYPE_BCAST) - stream->lpac->ops->config(stream, stream->cc, &stream->qos, - ep_config_cb, stream->lpac->user_data); - return true; } @@ -4764,91 +5548,22 @@ bt_bap_stream_func_t func, void *user_data) { - struct iovec iov; - struct bt_ascs_qos qos; - struct bt_bap_req *req; + unsigned int id; - /* Table 3.2: ASE state machine transition - * Initiating device - client Only - */ - if (!bap_stream_valid(stream) || !stream->client) + if (!bap_stream_valid(stream)) return 0; - memset(&qos, 0, sizeof(qos)); - - /* TODO: Figure out how to pass these values around */ - qos.ase = stream->ep->id; - qos.cig = data->ucast.cig_id; - qos.cis = data->ucast.cis_id; - put_le24(data->ucast.io_qos.interval, qos.interval); - qos.framing = data->ucast.framing; - qos.phy = data->ucast.io_qos.phy; - qos.sdu = cpu_to_le16(data->ucast.io_qos.sdu); - qos.rtn = data->ucast.io_qos.rtn; - qos.latency = cpu_to_le16(data->ucast.io_qos.latency); - put_le24(data->ucast.delay, qos.pd); - - iov.iov_base = &qos; - iov.iov_len = sizeof(qos); - - req = bap_req_new(stream, BT_ASCS_QOS, &iov, 1, func, user_data); - - if (!bap_queue_req(stream->bap, req)) { - bap_req_free(req); + if (!stream->ops || !stream->ops->qos) return 0; - } - - stream->qos = *data; - - return req->id; -} - -static int bap_stream_metadata(struct bt_bap_stream *stream, uint8_t op, - struct iovec *data, - bt_bap_stream_func_t func, - void *user_data) -{ - struct iovec iov2; - struct bt_ascs_metadata meta; - struct bt_bap_req *req; - struct metadata { - uint8_t len; - uint8_t type; - uint8_t data2; - } ctx = LTV(0x02, 0x01, 0x00); /* Context = Unspecified */ - - memset(&meta, 0, sizeof(meta)); - - meta.ase = stream->ep->id; - - iov0.iov_base = &meta; - iov0.iov_len = sizeof(meta); - - if (data) - iov1 = *data; - else { - iov1.iov_base = &ctx; - iov1.iov_len = sizeof(ctx); - } - meta.len = iov1.iov_len; - - req = bap_req_new(stream, op, iov, 2, func, user_data); - - if (!bap_queue_req(stream->bap, req)) { - bap_req_free(req); + if (!bt_bap_ref_safe(stream->bap)) return 0; - } - return req->id; -} + id = stream->ops->qos(stream, data, func, user_data); -static void bap_stream_enable_link(void *data, void *user_data) -{ - struct bt_bap_stream *stream = data; - struct iovec *metadata = user_data; + bt_bap_unref(stream->bap); - bap_stream_metadata(stream, BT_ASCS_ENABLE, metadata, NULL, NULL); + return id; } unsigned int bt_bap_stream_enable(struct bt_bap_stream *stream, @@ -4857,102 +5572,51 @@ bt_bap_stream_func_t func, void *user_data) { - int ret = 0; + unsigned int id; + struct bt_bap *bap; - /* Table 3.2: ASE state machine transition - * Initiating device - client Only - */ - if (!bap_stream_valid(stream) || !stream->client) + if (!bap_stream_valid(stream)) return 0; - switch (bt_bap_stream_get_type(stream)) { - case BT_BAP_STREAM_TYPE_UCAST: - ret = bap_stream_metadata(stream, BT_ASCS_ENABLE, metadata, - func, user_data); - if (!ret || !enable_links) - return ret; + if (!stream->ops || !stream->ops->enable) + return 0; - queue_foreach(stream->links, bap_stream_enable_link, metadata); - break; - case BT_BAP_STREAM_TYPE_BCAST: - if (!bt_bap_stream_io_dir(stream)) - stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_CONFIG); - else if (bt_bap_stream_io_dir(stream) == BT_BAP_BCAST_SOURCE) - stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_STREAMING); + if (!bt_bap_ref_safe(stream->bap)) + return 0; - return 1; - } + bap = stream->bap; - return ret; + id = stream->ops->enable(stream, enable_links, metadata, func, + user_data); + + bt_bap_unref(bap); + + return id; } unsigned int bt_bap_stream_start(struct bt_bap_stream *stream, bt_bap_stream_func_t func, void *user_data) { - struct iovec iov; - struct bt_ascs_start start; - struct bt_bap_req *req; + unsigned int id; + struct bt_bap *bap; if (!bap_stream_valid(stream)) return 0; - switch (bt_bap_stream_get_type(stream)) { - case BT_BAP_STREAM_TYPE_UCAST: - if (!stream->client) { - if (stream->ep->dir == BT_BAP_SINK) - stream_start(stream, NULL); - return 0; - } - - if (stream->ep->dir == BT_BAP_SINK) - return 0; - - memset(&start, 0, sizeof(start)); - - start.ase = stream->ep->id; - - iov.iov_base = &start; - iov.iov_len = sizeof(start); - - req = bap_req_new(stream, BT_ASCS_START, - &iov, 1, func, user_data); - - if (!bap_queue_req(stream->bap, req)) { - bap_req_free(req); - return 0; - } - - return req->id; - case BT_BAP_STREAM_TYPE_BCAST: - stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_STREAMING); - return 1; - } - - return 0; -} - -static void bap_stream_disable_link(void *data, void *user_data) -{ - struct bt_bap_stream *stream = data; - struct bt_bap_req *req; - struct iovec iov; - struct bt_ascs_disable disable; + if (!stream->ops || !stream->ops->start) + return 0; - memset(&disable, 0, sizeof(disable)); + if (!bt_bap_ref_safe(stream->bap)) + return 0; - disable.ase = stream->ep->id; + bap = stream->bap; - iov.iov_base = &disable; - iov.iov_len = sizeof(disable); + id = stream->ops->start(stream, func, user_data); - req = bap_req_new(stream, BT_ASCS_DISABLE, &iov, 1, NULL, NULL); + bt_bap_unref(bap); - if (!bap_queue_req(stream->bap, req)) - bap_req_free(req); + return id; } unsigned int bt_bap_stream_disable(struct bt_bap_stream *stream, @@ -4960,85 +5624,47 @@ bt_bap_stream_func_t func, void *user_data) { - struct iovec iov; - struct bt_ascs_disable disable; - struct bt_bap_req *req; + unsigned int id; + struct bt_bap *bap; if (!bap_stream_valid(stream)) return 0; - if (!stream->client) { - stream_disable(stream, NULL); + if (!stream->ops || !stream->ops->disable) return 0; - } - - switch (bt_bap_stream_get_type(stream)) { - case BT_BAP_STREAM_TYPE_UCAST: - memset(&disable, 0, sizeof(disable)); - disable.ase = stream->ep->id; - - iov.iov_base = &disable; - iov.iov_len = sizeof(disable); - - req = bap_req_new(stream, BT_ASCS_DISABLE, &iov, 1, func, - user_data); - - if (!bap_queue_req(stream->bap, req)) { - bap_req_free(req); - return 0; - } + if (!bt_bap_ref_safe(stream->bap)) + return 0; - if (disable_links) - queue_foreach(stream->links, bap_stream_disable_link, - NULL); + bap = stream->bap; - return req->id; + id = stream->ops->disable(stream, disable_links, func, user_data); - case BT_BAP_STREAM_TYPE_BCAST: - stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_RELEASING); - return 1; - } + bt_bap_unref(bap); - return 0; + return id; } unsigned int bt_bap_stream_stop(struct bt_bap_stream *stream, bt_bap_stream_func_t func, void *user_data) { - struct iovec iov; - struct bt_ascs_stop stop; - struct bt_bap_req *req; + unsigned int id; if (!bap_stream_valid(stream)) return 0; - if (!stream->client) { - if (stream->ep->dir == BT_BAP_SINK) - stream_stop(stream, NULL); + if (!stream->ops || !stream->ops->stop) return 0; - } - if (stream->ep->dir == BT_BAP_SINK) + if (!bt_bap_ref_safe(stream->bap)) return 0; - memset(&stop, 0, sizeof(stop)); + id = stream->ops->stop(stream, func, user_data); - stop.ase = stream->ep->id; + bt_bap_unref(stream->bap); - iov.iov_base = &stop; - iov.iov_len = sizeof(stop); - - req = bap_req_new(stream, BT_ASCS_STOP, &iov, 1, func, user_data); - - if (!bap_queue_req(stream->bap, req)) { - bap_req_free(req); - return 0; - } - - return req->id; + return id; } unsigned int bt_bap_stream_metadata(struct bt_bap_stream *stream, @@ -5046,68 +5672,42 @@ bt_bap_stream_func_t func, void *user_data) { - if (!stream) + unsigned int id; + + if (!bap_stream_valid(stream)) return 0; - if (!stream->client) { - stream_metadata(stream, metadata, NULL); + if (!stream->ops || !stream->ops->metadata) return 0; - } - return bap_stream_metadata(stream, BT_ASCS_METADATA, metadata, func, - user_data); + if (!bt_bap_ref_safe(stream->bap)) + return 0; + + id = stream->ops->metadata(stream, metadata, func, user_data); + + bt_bap_unref(stream->bap); + + return id; } unsigned int bt_bap_stream_release(struct bt_bap_stream *stream, bt_bap_stream_func_t func, void *user_data) { - struct iovec iov; - struct bt_ascs_release rel; - struct bt_bap_req *req; - struct bt_bap *bap; - - if (!stream) - return 0; + unsigned int id; + struct bt_bap *bap = stream->bap; - if (!stream->client) { - stream_release(stream, NULL); + if (!stream || !stream->ops || !stream->ops->release) return 0; - } - - memset(&req, 0, sizeof(req)); - rel.ase = stream->ep->id; - - iov.iov_base = &rel; - iov.iov_len = sizeof(rel); - - bap = stream->bap; - - /* If stream is broadcast, no BT_ASCS_RELEASE is required */ - if (bt_bap_stream_get_type(stream) == BT_BAP_STREAM_TYPE_BCAST) { - if (!bap_stream_valid(stream)) { - stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_IDLE); - stream = NULL; - } + if (!bt_bap_ref_safe(bap)) return 0; - } - - /* If stream does not belong to a client session, clean it up now */ - if (!bap_stream_valid(stream)) { - stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE); - stream = NULL; - } - req = bap_req_new(stream, BT_ASCS_RELEASE, &iov, 1, func, user_data); + id = stream->ops->release(stream, func, user_data); - if (!bap_queue_req(bap, req)) { - bap_req_free(req); - return 0; - } + bt_bap_unref(bap); - return req->id; + return id; } uint8_t bt_bap_stream_get_dir(struct bt_bap_stream *stream) @@ -5115,27 +5715,15 @@ if (!stream) return 0x00; - return stream->ep->dir; + return stream->ops->get_dir(stream); } uint32_t bt_bap_stream_get_location(struct bt_bap_stream *stream) { - struct bt_pacs *pacs; - if (!stream) return 0x00000000; - pacs = stream->client ? stream->bap->rdb->pacs : stream->bap->ldb->pacs; - - if (stream->ep->dir == BT_BAP_SOURCE) - return pacs->source_loc_value; - else if (stream->ep->dir == BT_BAP_SINK) - return pacs->sink_loc_value; - else - /* TO DO get the location values from metadata - * for brodcast source and sink - */ - return stream->bap->ldb->pacs->source_loc_value; + return stream->ops->get_loc(stream); } struct iovec *bt_bap_stream_get_config(struct bt_bap_stream *stream) @@ -5198,7 +5786,8 @@ bap_stream_set_io(stream, INT_TO_PTR(fd)); - queue_foreach(stream->links, bap_stream_set_io, INT_TO_PTR(fd)); + if (stream->link) + bap_stream_set_io(stream->link, INT_TO_PTR(fd)); return true; } @@ -5246,27 +5835,24 @@ int bt_bap_stream_io_link(struct bt_bap_stream *stream, struct bt_bap_stream *link) { - struct bt_bap *bap = stream->bap; + struct bt_bap *bap; if (!stream || !link || stream == link) return -EINVAL; - if (queue_find(stream->links, NULL, link)) + bap = stream->bap; + + if (stream->link || link->link) return -EALREADY; if (stream->client != link->client || stream->qos.ucast.cig_id != link->qos.ucast.cig_id || - stream->qos.ucast.cis_id != link->qos.ucast.cis_id) + stream->qos.ucast.cis_id != link->qos.ucast.cis_id || + stream->ep->dir == link->ep->dir) return -EINVAL; - if (!stream->links) - stream->links = queue_new(); - - if (!link->links) - link->links = queue_new(); - - queue_push_tail(stream->links, link); - queue_push_tail(link->links, stream); + stream->link = link; + link->link = stream; /* Link IOs if already set on stream/link */ if (stream->io && !link->io) @@ -5279,12 +5865,12 @@ return 0; } -struct queue *bt_bap_stream_io_get_links(struct bt_bap_stream *stream) +struct bt_bap_stream *bt_bap_stream_io_get_link(struct bt_bap_stream *stream) { if (!stream) return NULL; - return stream->links; + return stream->link; } static void bap_stream_get_in_qos(void *data, void *user_data) @@ -5292,6 +5878,9 @@ struct bt_bap_stream *stream = data; struct bt_bap_qos **qos = user_data; + if (!stream) + return; + if (!qos || *qos || stream->ep->dir != BT_BAP_SOURCE || !stream->qos.ucast.io_qos.sdu) return; @@ -5304,6 +5893,9 @@ struct bt_bap_stream *stream = data; struct bt_bap_qos **qos = user_data; + if (!stream) + return; + if (!qos || *qos || stream->ep->dir != BT_BAP_SINK || !stream->qos.ucast.io_qos.sdu) return; @@ -5321,11 +5913,11 @@ switch (stream->ep->dir) { case BT_BAP_SOURCE: bap_stream_get_in_qos(stream, in); - queue_foreach(stream->links, bap_stream_get_out_qos, out); + bap_stream_get_out_qos(stream->link, out); break; case BT_BAP_SINK: bap_stream_get_out_qos(stream, out); - queue_foreach(stream->links, bap_stream_get_in_qos, in); + bap_stream_get_in_qos(stream->link, in); break; default: return false; @@ -5336,14 +5928,6 @@ return in && out; } -static void bap_stream_get_dir(void *data, void *user_data) -{ - struct bt_bap_stream *stream = data; - uint8_t *dir = user_data; - - *dir |= stream->ep->dir; -} - uint8_t bt_bap_stream_io_dir(struct bt_bap_stream *stream) { uint8_t dir; @@ -5351,9 +5935,20 @@ if (!stream) return 0x00; - dir = stream->ep->dir; + if (stream->ep) + dir = stream->ep->dir; + else { + uint8_t pac_type = bt_bap_pac_get_type(stream->lpac); - queue_foreach(stream->links, bap_stream_get_dir, &dir); + if (pac_type == BT_BAP_BCAST_SINK) + dir = BT_BAP_BCAST_SOURCE; + else + dir = BT_BAP_BCAST_SINK; + + } + + if (stream->link) + dir |= stream->link->ep->dir; return dir; } @@ -5364,6 +5959,9 @@ int fd = PTR_TO_INT(user_data); const struct queue_entry *entry; + if (!stream) + return; + if (fd >= 0) bap_stream_io_attach(stream, fd, true); else @@ -5385,8 +5983,7 @@ return -EINVAL; bap_stream_io_connecting(stream, INT_TO_PTR(fd)); - - queue_foreach(stream->links, bap_stream_io_connecting, INT_TO_PTR(fd)); + bap_stream_io_connecting(stream->link, INT_TO_PTR(fd)); return 0; } @@ -5450,3 +6047,581 @@ bap_pac_merge(pac, data, metadata); pac->codec = *codec; } + +static void destroy_base_bis(void *data) +{ + struct bt_bis *bis = data; + + if (!bis) + return; + + if (bis->caps) + util_iov_free(bis->caps, 1); + + free(bis); +} + +static void generate_bis_base(void *data, void *user_data) +{ + struct bt_bis *bis = data; + struct iovec *base_iov = user_data; + uint8_t cc_length = bis->caps->iov_len; + + if (!util_iov_push_u8(base_iov, bis->index)) + return; + + if (!util_iov_push_u8(base_iov, cc_length)) + return; + + if (cc_length) + util_iov_push_mem(base_iov, bis->caps->iov_len, + bis->caps->iov_base); +} + +static void generate_subgroup_base(void *data, void *user_data) +{ + struct bt_subgroup *sgrp = data; + struct iovec *base_iov = user_data; + + if (!util_iov_push_u8(base_iov, queue_length(sgrp->bises))) + return; + + if (!util_iov_push_u8(base_iov, sgrp->codec.id)) + return; + + if (!util_iov_push_le16(base_iov, sgrp->codec.cid)) + return; + + if (!util_iov_push_le16(base_iov, sgrp->codec.vid)) + return; + + if (sgrp->caps) { + if (!util_iov_push_u8(base_iov, sgrp->caps->iov_len)) + return; + + if (sgrp->caps->iov_len) + util_iov_push_mem(base_iov, sgrp->caps->iov_len, + sgrp->caps->iov_base); + } else if (!util_iov_push_u8(base_iov, 0)) + return; + + if (sgrp->meta) { + if (!util_iov_push_u8(base_iov, sgrp->meta->iov_len)) + return; + + if (sgrp->meta->iov_len) + util_iov_push_mem(base_iov, sgrp->meta->iov_len, + sgrp->meta->iov_base); + } else if (!util_iov_push_u8(base_iov, 0)) + return; + + queue_foreach(sgrp->bises, generate_bis_base, base_iov); +} + +static struct iovec *generate_base(struct bt_base *base) +{ + struct iovec *base_iov = new0(struct iovec, 0x1); + + base_iov->iov_base = util_malloc(BASE_MAX_LENGTH); + + if (!util_iov_push_le24(base_iov, base->pres_delay)) { + free(base_iov->iov_base); + free(base_iov); + return NULL; + } + + if (!util_iov_push_u8(base_iov, + queue_length(base->subgroups))) { + free(base_iov->iov_base); + free(base_iov); + return NULL; + } + + queue_foreach(base->subgroups, generate_subgroup_base, + base_iov); + + return base_iov; +} + +static void add_new_bis(struct bt_subgroup *subgroup, + uint8_t bis_index, struct iovec *caps) +{ + struct bt_bis *bis = new0(struct bt_bis, 1); + + bis->index = bis_index; + + if (caps) + bis->caps = caps; + else + bis->caps = new0(struct iovec, 1); + + queue_push_tail(subgroup->bises, bis); +} + +static void add_new_subgroup(struct bt_base *base, + struct bt_bap_stream *stream) +{ + struct bt_bap_pac *lpac = stream->lpac; + struct bt_subgroup *sgrp = new0( + struct bt_subgroup, 1); + uint16_t cid = 0; + uint16_t vid = 0; + + bt_bap_pac_get_vendor_codec(lpac, &sgrp->codec.id, &cid, + &vid, NULL, NULL); + sgrp->codec.cid = cid; + sgrp->codec.vid = vid; + sgrp->caps = util_iov_dup(stream->cc, 1); + sgrp->meta = util_iov_dup(stream->meta, 1); + sgrp->bises = queue_new(); + + stream->qos.bcast.bis = base->next_bis_index++; + add_new_bis(sgrp, stream->qos.bcast.bis, + NULL); + queue_push_tail(base->subgroups, sgrp); +} + +struct bt_ltv_match { + uint8_t l; + void *data; + bool found; + uint32_t data32; +}; + +struct bt_ltv_search { + struct iovec *iov; + bool found; +}; + +static void match_ltv(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data) +{ + struct bt_ltv_match *ltv_match = user_data; + + if (ltv_match->found == true) + return; + + if (ltv_match->l != l) + return; + + if (!memcmp(v, ltv_match->data, l)) + ltv_match->found = true; +} + +static void search_ltv(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data) +{ + struct bt_ltv_search *ltv_search = user_data; + struct bt_ltv_match ltv_match; + + ltv_match.found = false; + ltv_match.l = l; + ltv_match.data = v; + + util_ltv_foreach(ltv_search->iov->iov_base, + ltv_search->iov->iov_len, &t, + match_ltv, <v_match); + + /* Once "found" has been updated to "false", + * do not overwrite it anymore. + * It means that an ltv was not found in the search list, + * and this should be detected back in the parent function. + */ + if (ltv_search->found) + ltv_search->found = ltv_match.found; +} + +static bool compare_ltv(struct iovec *iov1, + struct iovec *iov2) +{ + struct bt_ltv_search ltv_search; + + if ((!iov1) && (!iov2)) + return true; + + if ((!iov1) || (!iov2)) + return false; + + /* Compare metadata length */ + if (iov1->iov_len != iov2->iov_len) + return false; + + ltv_search.found = true; + ltv_search.iov = iov2; + + util_ltv_foreach(iov1->iov_base, + iov1->iov_len, NULL, + search_ltv, <v_search); + + return ltv_search.found; +} + +struct bt_ltv_extract { + struct iovec *src; + void *value; + uint8_t len; + struct iovec *result; +}; + +static void extract_ltv(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data) +{ + struct bt_ltv_extract *ext_data = user_data; + struct bt_ltv_match ltv_match; + uint8_t ltv_len = 0; + + ltv_match.found = false; + ltv_match.l = l; + ltv_match.data = v; + + /* Search each BIS caps ltv in subgroup caps + * to extract the one that are BIS specific + */ + util_ltv_foreach(ext_data->src->iov_base, + ext_data->src->iov_len, &t, + match_ltv, <v_match); + + if (!ltv_match.found) { + ltv_len = l + 1; + util_iov_append(ext_data->result, <v_len, 1); + util_iov_append(ext_data->result, &t, 1); + util_iov_append(ext_data->result, v, l); + } +} + +static struct iovec *extract_diff_caps( + struct iovec *subgroup_caps, struct iovec *bis_caps) +{ + struct bt_ltv_extract ext_data; + + ext_data.src = subgroup_caps; + ext_data.result = new0(struct iovec, 1); + + util_ltv_foreach(bis_caps->iov_base, + bis_caps->iov_len, NULL, + extract_ltv, &ext_data); + + return ext_data.result; +} + +static void set_base_subgroup(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + struct bt_base *base = user_data; + /* BIS specific codec capabilities */ + struct iovec *bis_caps; + + if (bt_bap_pac_get_type(stream->lpac) != BT_BAP_BCAST_SOURCE) + return; + + if (stream->qos.bcast.big != base->big_id) + return; + + if (base->pres_delay < stream->qos.bcast.delay) + base->pres_delay = stream->qos.bcast.delay; + + if (queue_isempty(base->subgroups)) { + add_new_subgroup(base, stream); + } else { + /* Verify if a subgroup has the same metadata */ + const struct queue_entry *entry; + struct bt_subgroup *subgroup = NULL; + bool same_meta = false; + + for (entry = queue_get_entries(base->subgroups); + entry; entry = entry->next) { + subgroup = entry->data; + same_meta = compare_ltv(subgroup->meta, stream->meta); + if (same_meta) + break; + } + + if (!same_meta) { + /* No subgroup with the same metadata found. + * Create a new one. + */ + add_new_subgroup(base, stream); + } else { + /* Subgroup found with the same metadata. + * Extract different codec capabilities. + */ + bis_caps = extract_diff_caps( + subgroup->caps, + stream->cc); + + stream->qos.bcast.bis = base->next_bis_index++; + add_new_bis(subgroup, + stream->qos.bcast.bis, + bis_caps); + } + } +} + +static void destroy_base_subgroup(void *data) +{ + struct bt_subgroup *subgroup = data; + + if (!subgroup) + return; + + if (subgroup->caps) + util_iov_free(subgroup->caps, 1); + + if (subgroup->meta) + util_iov_free(subgroup->meta, 1); + + queue_destroy(subgroup->bises, destroy_base_bis); + + free(subgroup); +} + +/* + * Function to update the BASE using configuration data + * from each BIS belonging to the same BIG + */ +struct iovec *bt_bap_stream_get_base(struct bt_bap_stream *stream) +{ + struct bt_base base; + struct iovec *base_iov; + + base.subgroups = queue_new(); + base.next_bis_index = 1; + base.big_id = stream->qos.bcast.big; + base.pres_delay = stream->qos.bcast.delay; + + /* If the BIG ID was explicitly set, create a BASE with information + * from all streams belonging to this BIG. Otherwise, create a BASE + * with only this BIS. + */ + if (stream->qos.bcast.big != 0xFF) + queue_foreach(stream->bap->streams, set_base_subgroup, &base); + else { + base.pres_delay = stream->qos.bcast.delay; + set_base_subgroup(stream, &base); + } + + base_iov = generate_base(&base); + + queue_destroy(base.subgroups, destroy_base_subgroup); + + return base_iov; +} + +/* + * This function compares PAC Codec Specific Capabilities, with the Codec + * Specific Configuration LTVs received in the BASE of the BAP Source. The + * result is accumulated in data32 which is a bitmask of types. + */ +static void check_pac_caps_ltv(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data) +{ + struct bt_ltv_match *compare_data = user_data; + uint8_t *bis_v = compare_data->data; + uint16_t mask; + uint16_t min; + uint16_t max; + uint16_t frame_len; + + switch (t) { + case BAP_FREQ_LTV_TYPE: + mask = *((uint16_t *)v); + mask = le16_to_cpu(mask); + if (mask & (1 << (bis_v0 - 1))) + compare_data->data32 |= 1<<t; + break; + case BAP_DURATION_LTV_TYPE: + if ((v0) & (1 << bis_v0)) + compare_data->data32 |= 1<<t; + break; + case BAP_FRAME_LEN_LTV_TYPE: + min = *((uint16_t *)v); + max = *((uint16_t *)(&v2)); + frame_len = *((uint16_t *)bis_v); + min = le16_to_cpu(min); + max = le16_to_cpu(max); + frame_len = le16_to_cpu(frame_len); + if ((frame_len >= min) && + (frame_len <= max)) + compare_data->data32 |= 1<<t; + break; + } +} + +static void check_source_ltv(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data) +{ + struct bt_ltv_match *local_data = user_data; + struct iovec *pac_caps = local_data->data; + struct bt_ltv_match compare_data; + + compare_data.data = v; + + /* Search inside local PAC's caps for LTV of type t */ + util_ltv_foreach(pac_caps->iov_base, pac_caps->iov_len, &t, + check_pac_caps_ltv, &compare_data); + + local_data->data32 |= compare_data.data32; +} + +static void bap_sink_check_level3_ltv(size_t i, uint8_t l, uint8_t t, + uint8_t *v, void *user_data) +{ + struct bt_ltv_extract *merge_data = user_data; + + merge_data->value = v; + merge_data->len = l; +} + +static void bap_sink_check_level2_ltv(size_t i, uint8_t l, uint8_t t, + uint8_t *v, void *user_data) +{ + struct bt_ltv_extract *merge_data = user_data; + + merge_data->value = NULL; + util_ltv_foreach(merge_data->src->iov_base, + merge_data->src->iov_len, + &t, + bap_sink_check_level3_ltv, merge_data); + + /* If the LTV at level 2 was found at level 3 add the one from level 3, + * otherwise add the one at level 2 + */ + if (merge_data->value) + util_ltv_push(merge_data->result, merge_data->len, + t, merge_data->value); + else + util_ltv_push(merge_data->result, l, t, v); +} + +static void check_local_pac(void *data, void *user_data) +{ + struct bt_ltv_match *compare_data = user_data; + struct iovec *bis_data = (struct iovec *)compare_data->data; + const struct bt_bap_pac *pac = data; + + /* Keep searching for a matching PAC if one wasn't found + * in previous PAC element + */ + if (compare_data->found == false) { + struct bt_ltv_match bis_compare_data = { + .data = pac->data, + .data32 = 0, /* LTVs bitmask result */ + .found = false + }; + + /* loop each BIS LTV */ + util_ltv_foreach(bis_data->iov_base, bis_data->iov_len, NULL, + check_source_ltv, &bis_compare_data); + + /* We have a match if all selected LTVs have a match */ + if ((bis_compare_data.data32 & + CODEC_SPECIFIC_CONFIGURATION_MASK) == + CODEC_SPECIFIC_CONFIGURATION_MASK) { + compare_data->found = true; + compare_data->data = data; + } + } +} + +static void bap_sink_match_allocation(size_t i, uint8_t l, uint8_t t, + uint8_t *v, void *user_data) +{ + struct bt_ltv_match *data = user_data; + uint32_t location32; + + if (!v) + return; + + memcpy(&location32, v, l); + location32 = le32_to_cpu(location32); + + /* If all the bits in the received bitmask are found in + * the local bitmask then we have a match + */ + if ((location32 & data->data32) == location32) + data->found = true; + else + data->found = false; +} + +static struct bt_ltv_match bap_check_bis(struct bt_bap_db *ldb, + struct iovec *bis_data) +{ + struct bt_ltv_match compare_data = {}; + + /* Check channel allocation against the PACS location. + * If we don't have a location set we can accept any BIS location. + * If the BIS doesn't have a location set we also accept it + */ + compare_data.found = true; + + if (ldb->pacs->sink_loc_value) { + uint8_t type = BAP_CHANNEL_ALLOCATION_LTV_TYPE; + + compare_data.data32 = ldb->pacs->sink_loc_value; + util_ltv_foreach(bis_data->iov_base, bis_data->iov_len, &type, + bap_sink_match_allocation, &compare_data); + } + + /* Check remaining LTVs against the PACs list */ + if (compare_data.found) { + compare_data.data = bis_data; + compare_data.found = false; + queue_foreach(ldb->broadcast_sinks, check_local_pac, + &compare_data); + } + + return compare_data; +} + +void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index, + struct bt_bap_codec *codec, + struct iovec *l2_caps, + struct iovec *l3_caps, + struct bt_bap_pac **lpac, + struct iovec **caps) +{ + struct bt_ltv_extract merge_data = {0}; + struct bt_ltv_match match_data; + + if (!l2_caps) + /* Codec_Specific_Configuration parameters shall + * be present at Level 2. + */ + return; + + if (!l3_caps) { + /* Codec_Specific_Configuration parameters may + * be present at Level 3. + */ + merge_data.result = util_iov_dup(l2_caps, 1); + goto done; + } + + merge_data.src = l3_caps; + merge_data.result = new0(struct iovec, 1); + + /* Create a Codec Specific Configuration with LTVs at level 2 (subgroup) + * overwritten by LTVs at level 3 (BIS) + */ + util_ltv_foreach(l2_caps->iov_base, + l2_caps->iov_len, + NULL, + bap_sink_check_level2_ltv, &merge_data); + +done: + /* Check each BIS Codec Specific Configuration LTVs against our Codec + * Specific Capabilities and if the BIS matches create a PAC with it + */ + match_data = bap_check_bis(bap->ldb, merge_data.result); + if (match_data.found == true) { + *caps = merge_data.result; + *lpac = match_data.data; + DBG(bap, "Matching BIS %i", bis_index); + } else { + util_iov_free(merge_data.result, 1); + *caps = NULL; + *lpac = NULL; + } + +}
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/bap.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/bap.h
Changed
@@ -4,99 +4,18 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. All rights reserved. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * */ #include <stdbool.h> #include <inttypes.h> - -#ifndef __packed -#define __packed __attribute__((packed)) -#endif - -#define BT_BAP_SINK 0x01 -#define BT_BAP_SOURCE 0x02 -#define BT_BAP_BCAST_SOURCE 0x03 -#define BT_BAP_BCAST_SINK 0x04 - -#define BT_BAP_STREAM_TYPE_UCAST 0x01 -#define BT_BAP_STREAM_TYPE_BCAST 0x02 - -#define BT_BAP_STREAM_STATE_IDLE 0x00 -#define BT_BAP_STREAM_STATE_CONFIG 0x01 -#define BT_BAP_STREAM_STATE_QOS 0x02 -#define BT_BAP_STREAM_STATE_ENABLING 0x03 -#define BT_BAP_STREAM_STATE_STREAMING 0x04 -#define BT_BAP_STREAM_STATE_DISABLING 0x05 -#define BT_BAP_STREAM_STATE_RELEASING 0x06 - -#define BT_BAP_CONFIG_LATENCY_LOW 0x01 -#define BT_BAP_CONFIG_LATENCY_BALANCED 0x02 -#define BT_BAP_CONFIG_LATENCY_HIGH 0x03 - -#define BT_BAP_CONFIG_PHY_1M 0x01 -#define BT_BAP_CONFIG_PHY_2M 0x02 -#define BT_BAP_CONFIG_PHY_CODEC 0x03 +#include "src/shared/bap-defs.h" struct bt_bap; struct bt_bap_pac; struct bt_bap_stream; -struct bt_bap_codec { - uint8_t id; - uint16_t cid; - uint16_t vid; -} __packed; - -struct bt_ltv { - uint8_t len; - uint8_t type; - uint8_t value0; -} __packed; - -struct bt_bap_io_qos { - uint32_t interval; /* Frame interval */ - uint16_t latency; /* Transport Latency */ - uint16_t sdu; /* Maximum SDU Size */ - uint8_t phy; /* PHY */ - uint8_t rtn; /* Retransmission Effort */ -}; - -struct bt_bap_ucast_qos { - uint8_t cig_id; - uint8_t cis_id; - uint8_t framing; /* Frame framing */ - uint32_t delay; /* Presentation Delay */ - uint8_t target_latency; /* Target Latency */ - struct bt_bap_io_qos io_qos; -}; - -struct bt_bap_bcast_qos { - uint8_t big; - uint8_t bis; - uint8_t sync_factor; - uint8_t packing; - uint8_t framing; - uint8_t encryption; - struct iovec *bcode; - uint8_t options; - uint16_t skip; - uint16_t sync_timeout; - uint8_t sync_cte_type; - uint8_t mse; - uint16_t timeout; - uint8_t pa_sync; - struct bt_bap_io_qos io_qos; -}; - -struct bt_bap_qos { - union { - struct bt_bap_ucast_qos ucast; - struct bt_bap_bcast_qos bcast; - }; -}; - typedef void (*bt_bap_ready_func_t)(struct bt_bap *bap, void *user_data); typedef void (*bt_bap_destroy_func_t)(void *user_data); typedef void (*bt_bap_debug_func_t)(const char *str, void *user_data); @@ -151,7 +70,9 @@ struct bt_bap_pac_ops { int (*select)(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, - struct bt_bap_pac_qos *qos, + uint32_t chan_alloc, struct bt_bap_pac_qos *qos, + bt_bap_pac_select_t cb, void *cb_data, void *user_data); + void (*cancel_select)(struct bt_bap_pac *lpac, bt_bap_pac_select_t cb, void *cb_data, void *user_data); int (*config)(struct bt_bap_stream *stream, struct iovec *cfg, struct bt_bap_qos *qos, bt_bap_pac_config_t cb, @@ -174,6 +95,10 @@ struct bt_bap_pac_qos *bt_bap_pac_get_qos(struct bt_bap_pac *pac); +struct iovec *bt_bap_pac_get_data(struct bt_bap_pac *pac); + +struct iovec *bt_bap_pac_get_metadata(struct bt_bap_pac *pac); + uint8_t bt_bap_stream_get_type(struct bt_bap_stream *stream); struct bt_bap_stream *bt_bap_pac_get_stream(struct bt_bap_pac *pac); @@ -234,7 +159,11 @@ /* Stream related functions */ int bt_bap_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac, - bt_bap_pac_select_t func, void *user_data); + int *count, bt_bap_pac_select_t func, + void *user_data); + +void bt_bap_cancel_select(struct bt_bap_pac *lpac, bt_bap_pac_select_t func, + void *user_data); struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, struct bt_bap_pac *lpac, @@ -302,7 +231,7 @@ int bt_bap_stream_io_link(struct bt_bap_stream *stream, struct bt_bap_stream *link); -struct queue *bt_bap_stream_io_get_links(struct bt_bap_stream *stream); +struct bt_bap_stream *bt_bap_stream_io_get_link(struct bt_bap_stream *stream); bool bt_bap_stream_io_get_qos(struct bt_bap_stream *stream, struct bt_bap_qos **in, struct bt_bap_qos **out); @@ -320,3 +249,12 @@ bool bt_bap_pac_bcast_is_local(struct bt_bap *bap, struct bt_bap_pac *pac); +struct iovec *bt_bap_stream_get_base(struct bt_bap_stream *stream); + +void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index, + struct bt_bap_codec *codec, + struct iovec *l2_caps, + struct iovec *l3_caps, + struct bt_bap_pac **lpac, + struct iovec **caps); +
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/bass.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/bass.c
Changed
@@ -111,10 +111,10 @@ .bcode = {0x00}, .options = 0x00, .skip = 0x0000, - .sync_timeout = 0x4000, + .sync_timeout = BT_ISO_SYNC_TIMEOUT, .sync_cte_type = 0x00, .mse = 0x00, - .timeout = 0x4000, + .timeout = BT_ISO_SYNC_TIMEOUT, } }; @@ -1272,6 +1272,9 @@ { struct bt_bcast_src *bcast_src = data; + if (!bcast_src) + return; + for (int i = 0; i < bcast_src->num_subgroups; i++) free(bcast_src->subgroup_datai.meta);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/btsnoop.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/btsnoop.c
Changed
@@ -305,6 +305,9 @@ case BTSNOOP_OPCODE_SCO_TX_PKT: case BTSNOOP_OPCODE_SCO_RX_PKT: break; + case BTSNOOP_OPCODE_ISO_TX_PKT: + case BTSNOOP_OPCODE_ISO_RX_PKT: + break; case BTSNOOP_OPCODE_OPEN_INDEX: case BTSNOOP_OPCODE_CLOSE_INDEX: break; @@ -428,6 +431,14 @@ *index = 0x0000; *opcode = BTSNOOP_OPCODE_SCO_RX_PKT; break; + case 0x12: + *index = 0x0000; + *opcode = BTSNOOP_OPCODE_ISO_TX_PKT; + break; + case 0x13: + *index = 0x0000; + *opcode = BTSNOOP_OPCODE_ISO_RX_PKT; + break; case 0x0b: *index = 0x0000; *opcode = BTSNOOP_OPCODE_VENDOR_DIAG; @@ -470,6 +481,11 @@ return BTSNOOP_OPCODE_SCO_TX_PKT; case 0x04: return BTSNOOP_OPCODE_EVENT_PKT; + case 0x05: + if (flags & 0x01) + return BTSNOOP_OPCODE_ISO_RX_PKT; + else + return BTSNOOP_OPCODE_ISO_TX_PKT; case 0xff: if (flags & 0x02) { if (flags & 0x01)
View file
_service:tar_scm:bluez-5.77.tar.xz/src/shared/ccp.c
Added
@@ -0,0 +1,1226 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2022 Intel Corporation. All rights reserved. + * + */ + +#define _GNU_SOURCE +#include <inttypes.h> +#include <string.h> +#include <stdlib.h> +#include <stdbool.h> +#include <unistd.h> +#include <errno.h> + +#include "lib/bluetooth.h" +#include "lib/uuid.h" +#include "lib/hci.h" + +#include "src/shared/queue.h" +#include "src/shared/util.h" +#include "src/shared/timeout.h" +#include "src/shared/att.h" +#include "src/shared/gatt-db.h" +#include "src/shared/gatt-server.h" +#include "src/shared/gatt-client.h" +#include "src/shared/ccp.h" + +#define DBG(_ccp, fmt, arg...) \ + ccp_debug(_ccp, "%s:%s() " fmt, __FILE__, __func__, ## arg) + +struct bt_ccp_db { + struct gatt_db *db; + struct bt_ccs *ccs; +}; + +struct bt_ccp_pending { + unsigned int id; + struct bt_ccp *ccp; + bt_gatt_client_read_callback_t func; + void *user_data; +}; + +struct event_callback { + const struct bt_ccp_event_callback *cbs; + void *user_data; +}; + +struct bt_ccp { + int ref_count; + struct bt_gatt_client *client; + struct bt_ccp_db *ldb; + struct bt_ccp_db *rdb; + + unsigned int bearer_name_id; + unsigned int bearer_uci_id; + unsigned int bearer_technology_id; + unsigned int bearer_uri_schemes_list_id; + unsigned int signal_strength_id; + unsigned int signal_reporting_intrvl_id; + unsigned int current_call_list_id; + unsigned int ccid_id; + unsigned int status_flag_id; + unsigned int target_bearer_uri_id; + unsigned int call_state_id; + unsigned int call_control_pt_id; + unsigned int call_control_opt_opcode_id; + unsigned int termination_reason_id; + unsigned int incoming_call_id; + unsigned int friendly_name_id; + + struct event_callback *cb; + struct queue *pending; + + bt_ccp_debug_func_t debug_func; + bt_ccp_destroy_func_t debug_destroy; + void *debug_data; + void *user_data; +}; + +struct bt_ccs { + struct bt_ccp_db *mdb; + struct gatt_db_attribute *service; + struct gatt_db_attribute *bearer_name; + struct gatt_db_attribute *bearer_name_ccc; + struct gatt_db_attribute *bearer_uci; + struct gatt_db_attribute *bearer_technology; + struct gatt_db_attribute *bearer_technology_ccc; + struct gatt_db_attribute *bearer_uri_schemes_list; + struct gatt_db_attribute *signal_strength; + struct gatt_db_attribute *signal_strength_ccc; + struct gatt_db_attribute *signal_reporting_intrvl; + struct gatt_db_attribute *current_call_list; + struct gatt_db_attribute *current_call_list_ccc; + struct gatt_db_attribute *ccid; + struct gatt_db_attribute *status_flag; + struct gatt_db_attribute *status_flag_ccc; + struct gatt_db_attribute *target_bearer_uri; + struct gatt_db_attribute *call_state; + struct gatt_db_attribute *call_state_ccc; + struct gatt_db_attribute *call_ctrl_point; + struct gatt_db_attribute *call_ctrl_point_ccc; + struct gatt_db_attribute *call_ctrl_opt_opcode; + struct gatt_db_attribute *termination_reason; + struct gatt_db_attribute *termination_reason_ccc; + struct gatt_db_attribute *incoming_call; + struct gatt_db_attribute *incoming_call_ccc; + struct gatt_db_attribute *friendly_name; + struct gatt_db_attribute *friendly_name_ccc; +}; + +static struct queue *ccp_db; + +static void ccp_debug(struct bt_ccp *ccp, const char *format, ...) +{ + va_list ap; + + if (!ccp || !format || !ccp->debug_func) + return; + + va_start(ap, format); + util_debug_va(ccp->debug_func, ccp->debug_data, format, ap); + va_end(ap); +} + +static bool ccp_db_match(const void *data, const void *match_data) +{ + const struct bt_ccp_db *mdb = data; + const struct gatt_db *db = match_data; + + return (mdb->db == db); +} + +static void ccp_db_free(void *data) +{ + struct bt_ccp_db *bdb = data; + + if (!bdb) + return; + + gatt_db_unref(bdb->db); + + free(bdb->ccs); + free(bdb); +} + +static void ccp_free(void *data) +{ + struct bt_ccp *ccp = data; + + DBG(ccp, ""); + + bt_ccp_detach(ccp); + ccp_db_free(ccp->rdb); + queue_destroy(ccp->pending, NULL); + + free(ccp); +} + +struct bt_ccp *bt_ccp_ref(struct bt_ccp *ccp) +{ + if (!ccp) + return NULL; + + __sync_fetch_and_add(&ccp->ref_count, 1); + + return ccp; +} + +void bt_ccp_unref(struct bt_ccp *ccp) +{ + if (!ccp) + return; + + if (__sync_sub_and_fetch(&ccp->ref_count, 1)) + return; + + ccp_free(ccp); +} + +bool bt_ccp_set_user_data(struct bt_ccp *ccp, void *user_data) +{ + if (!ccp) + return false; + + ccp->user_data = user_data; + + return true; +} + +void *bt_ccp_get_user_data(struct bt_ccp *ccp) +{ + if (!ccp) + return NULL; + + return ccp->user_data; +} + +bool bt_ccp_set_debug(struct bt_ccp *ccp, bt_ccp_debug_func_t func, + void *user_data, + bt_ccp_destroy_func_t destroy) +{ + if (!ccp) + return false; + + if (ccp->debug_destroy) + ccp->debug_destroy(ccp->debug_data); + + ccp->debug_func = func; + ccp->debug_destroy = destroy; + ccp->debug_data = user_data; + + return true; +} + +static void ccs_call_state_read(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offset, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + int call_state = 0; + struct iovec iov; + + iov.iov_base = &call_state; + iov.iov_len = sizeof(int); + + gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base, iov.iov_len); +} + +static void ccs_call_state_write(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offset, + const uint8_t *value, size_t len, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + gatt_db_attribute_write_result(attrib, id, + BT_ATT_ERROR_INSUFFICIENT_RESOURCES); +} + +static struct bt_ccs *ccs_new(struct gatt_db *db) +{ + struct bt_ccs *ccs; + bt_uuid_t uuid; + + if (!db) + return NULL; + + ccs = new0(struct bt_ccs, 1); + + /* Populate DB with ccs attributes */ + bt_uuid16_create(&uuid, GTBS_UUID); + ccs->service = gatt_db_add_service(db, &uuid, true, 42); + + bt_uuid16_create(&uuid, BEARER_PROVIDER_NAME_CHRC_UUID); + ccs->bearer_name = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + ccs_call_state_read, NULL, + ccs); + + ccs->bearer_name_ccc = gatt_db_service_add_ccc(ccs->service, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE); + + bt_uuid16_create(&uuid, BEARER_UCI_CHRC_UUID); + ccs->bearer_uci = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ, + ccs_call_state_read, + NULL, ccs); + + bt_uuid16_create(&uuid, BEARER_TECH_CHRC_UUID); + ccs->bearer_technology = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + ccs_call_state_read, NULL, + ccs); + + ccs->bearer_technology_ccc = gatt_db_service_add_ccc(ccs->service, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE); + + bt_uuid16_create(&uuid, BEARER_URI_SCHEME_CHRC_UUID); + ccs->bearer_uri_schemes_list = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ, + ccs_call_state_read, NULL, + ccs); + + bt_uuid16_create(&uuid, BEARER_SIGNAL_STR_CHRC_UUID); + ccs->signal_strength = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + ccs_call_state_read, NULL, + ccs); + + ccs->signal_strength_ccc = gatt_db_service_add_ccc(ccs->service, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE); + + bt_uuid16_create(&uuid, BEARER_SIGNAL_INTRVL_CHRC_UUID); + ccs->signal_reporting_intrvl = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_WRITE | + BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP, + ccs_call_state_read, + ccs_call_state_write, ccs); + + bt_uuid16_create(&uuid, CURR_CALL_LIST_CHRC_UUID); + ccs->current_call_list = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + ccs_call_state_read, NULL, + ccs); + + ccs->current_call_list_ccc = gatt_db_service_add_ccc(ccs->service, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE); + + bt_uuid16_create(&uuid, BEARER_CCID_CHRC_UUID); + ccs->ccid = gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ, + ccs_call_state_read, + NULL, ccs); + + bt_uuid16_create(&uuid, CALL_STATUS_FLAG_CHRC_UUID); + ccs->status_flag = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + ccs_call_state_read, NULL, + ccs); + + ccs->status_flag_ccc = gatt_db_service_add_ccc(ccs->service, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE); + + bt_uuid16_create(&uuid, INCOM_CALL_TARGET_URI_CHRC_UUID); + ccs->target_bearer_uri = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ, + ccs_call_state_read, NULL, + ccs); + + bt_uuid16_create(&uuid, CALL_STATE_CHRC_UUID); + ccs->call_ctrl_point = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + ccs_call_state_read, NULL, + ccs); + + ccs->call_ctrl_point_ccc = gatt_db_service_add_ccc(ccs->service, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE); + + bt_uuid16_create(&uuid, CALL_CTRL_POINT_CHRC_UUID); + ccs->call_ctrl_opt_opcode = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_WRITE, + BT_GATT_CHRC_PROP_WRITE | + BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP + | BT_GATT_CHRC_PROP_NOTIFY, + NULL, ccs_call_state_write, + ccs); + + bt_uuid16_create(&uuid, CALL_CTRL_POINT_OPT_OPCODE_CHRC_UUID); + ccs->call_ctrl_opt_opcode = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ, + ccs_call_state_read, NULL, + ccs); + + bt_uuid16_create(&uuid, TERMINATION_REASON_CHRC_UUID); + ccs->termination_reason = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + ccs_call_state_read, NULL, + ccs); + + bt_uuid16_create(&uuid, INCOMING_CALL_CHRC_UUID); + ccs->incoming_call = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_NONE, + BT_GATT_CHRC_PROP_NOTIFY, + NULL, NULL, ccs); + + ccs->incoming_call_ccc = gatt_db_service_add_ccc(ccs->service, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE); + + bt_uuid16_create(&uuid, CALL_FRIENDLY_NAME_CHRC_UUID); + ccs->friendly_name = + gatt_db_service_add_characteristic(ccs->service, + &uuid, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + ccs_call_state_read, NULL, + ccs); + + ccs->friendly_name_ccc = gatt_db_service_add_ccc(ccs->service, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE); + + gatt_db_service_set_active(ccs->service, false); + + return ccs; +} + +static struct bt_ccs *ccp_get_ccs(struct bt_ccp *ccp) +{ + if (!ccp) + return NULL; + + if (ccp->rdb->ccs) + return ccp->rdb->ccs; + + ccp->rdb->ccs = new0(struct bt_ccs, 1); + ccp->rdb->ccs->mdb = ccp->rdb; + + return ccp->rdb->ccs; +} + +static void ccp_pending_destroy(void *data) +{ + struct bt_ccp_pending *pending = data; + struct bt_ccp *ccp = pending->ccp; + + queue_remove_if(ccp->pending, NULL, pending); +} + +static void ccp_pending_complete(bool success, uint8_t att_ecode, + const uint8_t *value, uint16_t length, + void *user_data) +{ + struct bt_ccp_pending *pending = user_data; + + if (pending->func) + pending->func(success, att_ecode, value, length, + pending->user_data); +} + +static void ccp_read_value(struct bt_ccp *ccp, uint16_t value_handle, + bt_gatt_client_read_callback_t func, + void *user_data) +{ + struct bt_ccp_pending *pending; + + pending = new0(struct bt_ccp_pending, 1); + pending->ccp = ccp; + pending->func = func; + pending->user_data = user_data; + + pending->id = bt_gatt_client_read_value(ccp->client, value_handle, + ccp_pending_complete, pending, + ccp_pending_destroy); + if (!pending->id) { + DBG(ccp, "Unable to send Read request"); + free(pending); + return; + } + + queue_push_tail(ccp->pending, pending); +} + +static void read_call_back(bool success, uint8_t att_ecode, + const uint8_t *value, uint16_t length, + void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (!success) { + DBG(ccp, "Unable to read call state: error 0x%02x", att_ecode); + return; + } +} + +static void ccp_cb_register(uint16_t att_ecode, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + if (att_ecode) + DBG(ccp, "ccp cb notification failed: 0x%04x", att_ecode); + + /* TODO: generic handler for non-mandatory CCP call backs */ +} + +static void ccp_cb_notify(uint16_t value_handle, const uint8_t *value, + uint16_t length, void *user_data) +{ + /* TODO: generic handler for non-mandatory CCP notifications */ +} + +static void ccp_cb_status_flag_register(uint16_t att_ecode, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + if (att_ecode) + DBG(ccp, "ccp cb notification failed: 0x%04x", att_ecode); +} + +static void ccp_cb_status_flag_notify(uint16_t value_handle, + const uint8_t *value, + uint16_t length, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (!length) + return; +} + +static void ccp_cb_terminate_register(uint16_t att_ecode, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + if (att_ecode) + DBG(ccp, "ccp cb notification failed: 0x%04x", att_ecode); +} + +static void ccp_cb_terminate_notify(uint16_t value_handle, const uint8_t *value, + uint16_t length, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (!length) + return; + + /* TODO: update call state in Local context */ +} + +static void ccp_cb_bearer_name_register(uint16_t att_ecode, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (att_ecode) + DBG(ccp, "ccp cb notification failed: 0x%04x", att_ecode); +} + +static void ccp_cb_bearer_name_notify(uint16_t value_handle, + const uint8_t *value, + uint16_t length, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (!length) + return; + + /* TODO: update call details in Local context */ +} + +static void ccp_cb_call_list_register(uint16_t att_ecode, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (att_ecode) + DBG(ccp, "ccp cb notification failed: 0x%04x", att_ecode); +} + +static void ccp_cb_call_list_notify(uint16_t value_handle, const uint8_t *value, + uint16_t length, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (!length) + return; + + /* TODO: update call list in Local context */ +} + +static void ccp_cb_call_state_register(uint16_t att_ecode, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (att_ecode) + DBG(ccp, "ccp cb notification failed: 0x%04x", att_ecode); +} + +static void ccp_cb_call_state_notify(uint16_t value_handle, + const uint8_t *value, + uint16_t length, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (!length) + return; + + /* TODO: update call state in Local context */ +} + +static void ccp_cb_incom_call_register(uint16_t att_ecode, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (att_ecode) + DBG(ccp, "ccp cb notification failed: 0x%04x", att_ecode); +} + +static void ccp_cb_incom_call_notify(uint16_t value_handle, + const uint8_t *value, + uint16_t length, void *user_data) +{ + struct bt_ccp *ccp = user_data; + + DBG(ccp, ""); + + if (!length) + return; + + /* TODO: Handle incoming call notofiation, Answer/reject etc */ +} + +static void bt_ccp_incom_call_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->incoming_call, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->incoming_call_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, + ccp_cb_incom_call_register, + ccp_cb_incom_call_notify, ccp, + NULL); +} + +static void bt_ccp_call_state_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->call_state, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->call_state_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, + ccp_cb_call_state_register, + ccp_cb_call_state_notify, ccp, + NULL); +} + +static void bt_ccp_call_list_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->current_call_list, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->current_call_list_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, + ccp_cb_call_list_register, + ccp_cb_call_list_notify, ccp, + NULL); +} + +static void bt_ccp_name_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->bearer_name, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->bearer_name_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, + ccp_cb_bearer_name_register, + ccp_cb_bearer_name_notify, ccp, + NULL); +} + +static void bt_ccp_term_reason_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->termination_reason, NULL, + &value_handle, NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->termination_reason_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, + ccp_cb_terminate_register, + ccp_cb_terminate_notify, ccp, + NULL); +} + +static void bt_ccp_status_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->status_flag, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->status_flag_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, + ccp_cb_status_flag_register, + ccp_cb_status_flag_notify, ccp, + NULL); +} + +static void bt_ccp_uci_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->bearer_uci, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->bearer_uci_id = bt_gatt_client_register_notify(ccp->client, + value_handle, + ccp_cb_register, + ccp_cb_notify, ccp, + NULL); +} + +static void bt_ccp_technology_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->bearer_technology, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->bearer_technology_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, ccp_cb_register, + ccp_cb_notify, ccp, NULL); +} + +static void bt_ccp_strength_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->signal_strength, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->signal_strength_id = + bt_gatt_client_register_notify(ccp->client, value_handle, + ccp_cb_register, ccp_cb_notify, + ccp, NULL); +} + +static void bt_ccp_ccid_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->ccid, NULL, &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->ccid_id = bt_gatt_client_register_notify(ccp->client, + value_handle, + ccp_cb_register, + ccp_cb_notify, ccp, NULL); +} + +static void bt_ccp_tar_uri_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->target_bearer_uri, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->target_bearer_uri_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, ccp_cb_register, + ccp_cb_notify, ccp, + NULL); +} + +static void bt_ccp_ctrl_point_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->call_ctrl_point, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->call_control_pt_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, ccp_cb_register, + ccp_cb_notify, ccp, NULL); +} + +static void bt_ccp_ctrl_opcode_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->call_ctrl_opt_opcode, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->call_control_opt_opcode_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, ccp_cb_register, + ccp_cb_notify, ccp, NULL); +} + +static void bt_ccp_friendly_name_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->friendly_name, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->friendly_name_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, ccp_cb_register, + ccp_cb_notify, ccp, NULL); +} + +static void bt_ccp_signal_intrvl_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->signal_reporting_intrvl, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->signal_reporting_intrvl_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, ccp_cb_register, + ccp_cb_notify, ccp, NULL); +} + +static void bt_ccp_uri_list_attach(struct bt_ccp *ccp) +{ + uint16_t value_handle; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + DBG(ccp, ""); + + if (!gatt_db_attribute_get_char_data(ccs->bearer_uri_schemes_list, NULL, + &value_handle, + NULL, NULL, NULL)) + return; + + ccp_read_value(ccp, value_handle, read_call_back, ccp); + + ccp->bearer_uri_schemes_list_id = + bt_gatt_client_register_notify(ccp->client, + value_handle, ccp_cb_register, + ccp_cb_notify, ccp, NULL); +} + +static void foreach_ccs_char(struct gatt_db_attribute *attr, void *user_data) +{ + struct bt_ccp *ccp = user_data; + struct bt_ccs *ccs; + uint16_t value_handle; + bt_uuid_t uuid; + + if (!gatt_db_attribute_get_char_data(attr, NULL, &value_handle, + NULL, NULL, &uuid)) + return; + + ccs = ccp_get_ccs(ccp); + if (!ccs || ccs->call_state) + return; + + if (bt_uuid16_cmp(&uuid, BEARER_PROVIDER_NAME_CHRC_UUID)) { + DBG(ccp, "Found Bearer Name, handle 0x%04x", value_handle); + + ccs->bearer_name = attr; + bt_ccp_name_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, BEARER_UCI_CHRC_UUID)) { + DBG(ccp, "Found Bearer Uci, handle 0x%04x", value_handle); + + ccs->bearer_uci = attr; + bt_ccp_uci_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, BEARER_TECH_CHRC_UUID)) { + DBG(ccp, "Found Bearer Technology, handle %x", value_handle); + + ccs->bearer_technology = attr; + bt_ccp_technology_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, BEARER_SIGNAL_STR_CHRC_UUID)) { + DBG(ccp, "Found Signal Strength, handle 0x%04x", value_handle); + + ccs->signal_strength = attr; + bt_ccp_strength_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, BEARER_SIGNAL_INTRVL_CHRC_UUID)) { + DBG(ccp, "Found Signal Interval, handle 0x%04x", value_handle); + + ccs->signal_reporting_intrvl = attr; + bt_ccp_signal_intrvl_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, CALL_STATUS_FLAG_CHRC_UUID)) { + DBG(ccp, "Found Status Flag, handle 0x%04x", value_handle); + + ccs->status_flag = attr; + bt_ccp_status_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, BEARER_URI_SCHEME_CHRC_UUID)) { + DBG(ccp, "Found URI Scheme, handle 0x%04x", value_handle); + + ccs->bearer_uri_schemes_list = attr; + bt_ccp_uri_list_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, CURR_CALL_LIST_CHRC_UUID)) { + DBG(ccp, "Found Call List, handle 0x%04x", value_handle); + + ccs->current_call_list = attr; + bt_ccp_call_list_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, BEARER_CCID_CHRC_UUID)) { + DBG(ccp, "Found CCID, handle 0x%04x", value_handle); + + ccs->ccid = attr; + bt_ccp_ccid_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, INCOM_CALL_TARGET_URI_CHRC_UUID)) { + DBG(ccp, "Found Bearer Uri, handle 0x%04x", value_handle); + + ccs->target_bearer_uri = attr; + bt_ccp_tar_uri_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, CALL_CTRL_POINT_CHRC_UUID)) { + DBG(ccp, "Found Control Point, handle 0x%04x", value_handle); + + ccs->call_ctrl_point = attr; + bt_ccp_ctrl_point_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, CALL_CTRL_POINT_OPT_OPCODE_CHRC_UUID)) { + DBG(ccp, "Found Control opcode, handle 0x%04x", value_handle); + + ccs->call_ctrl_opt_opcode = attr; + bt_ccp_ctrl_opcode_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, TERMINATION_REASON_CHRC_UUID)) { + DBG(ccp, "Found Termination Reason, handle %x", value_handle); + + ccs->termination_reason = attr; + bt_ccp_term_reason_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, INCOMING_CALL_CHRC_UUID)) { + DBG(ccp, "Found Incoming call, handle 0x%04x", value_handle); + + ccs->incoming_call = attr; + bt_ccp_incom_call_attach(ccp); + } + + if (bt_uuid16_cmp(&uuid, CALL_FRIENDLY_NAME_CHRC_UUID)) { + DBG(ccp, "Found Friendly name, handle 0x%04x", value_handle); + + ccs->friendly_name = attr; + bt_ccp_friendly_name_attach(ccp); + } +} + +void bt_ccp_set_event_callbacks(struct bt_ccp *ccp, + const struct bt_ccp_event_callback *cbs, + void *user_data) +{ + struct event_callback *cb; + + if (ccp->cb) + free(ccp->cb); + + cb = new0(struct event_callback, 1); + cb->cbs = cbs; + cb->user_data = user_data; + + ccp->cb = cb; +} + +static void foreach_ccs_service(struct gatt_db_attribute *attr, + void *user_data) +{ + struct bt_ccp *ccp = user_data; + struct bt_ccs *ccs = ccp_get_ccs(ccp); + + ccs->service = attr; + + gatt_db_service_foreach_char(attr, foreach_ccs_char, ccp); +} + +static struct bt_ccp_db *ccp_db_new(struct gatt_db *db) +{ + struct bt_ccp_db *mdb; + + if (!db) + return NULL; + + mdb = new0(struct bt_ccp_db, 1); + mdb->db = gatt_db_ref(db); + + if (!ccp_db) + ccp_db = queue_new(); + + queue_push_tail(ccp_db, mdb); + + mdb->ccs = ccs_new(db); + return mdb; +} + +static struct bt_ccp_db *ccp_get_db(struct gatt_db *db) +{ + struct bt_ccp_db *mdb; + + mdb = queue_find(ccp_db, ccp_db_match, db); + if (mdb) + return mdb; + + return ccp_db_new(db); +} + +struct bt_ccp *bt_ccp_new(struct gatt_db *ldb, struct gatt_db *rdb) +{ + struct bt_ccp *ccp; + struct bt_ccp_db *mdb; + + if (!ldb) + return NULL; + + mdb = ccp_get_db(ldb); + if (!mdb) + return NULL; + + ccp = new0(struct bt_ccp, 1); + ccp->ldb = mdb; + ccp->pending = queue_new(); + + if (!rdb) + goto done; + + mdb = new0(struct bt_ccp_db, 1); + mdb->db = gatt_db_ref(rdb); + + ccp->rdb = mdb; + +done: + bt_ccp_ref(ccp); + + return ccp; +} + +void bt_ccp_register(struct gatt_db *db) +{ + ccp_db_new(db); +} + +bool bt_ccp_attach(struct bt_ccp *ccp, struct bt_gatt_client *client) +{ + bt_uuid_t uuid; + + DBG(ccp, "ccp %p", ccp); + + ccp->client = bt_gatt_client_clone(client); + if (!ccp->client) + return false; + + if (ccp->rdb->ccs) { + bt_ccp_call_state_attach(ccp); + return true; + } + + bt_uuid16_create(&uuid, GTBS_UUID); + gatt_db_foreach_service(ccp->rdb->db, &uuid, foreach_ccs_service, ccp); + + return true; +} + +void bt_ccp_detach(struct bt_ccp *ccp) +{ + DBG(ccp, "%p", ccp); + + bt_gatt_client_unref(ccp->client); + ccp->client = NULL; +}
View file
_service:tar_scm:bluez-5.77.tar.xz/src/shared/ccp.h
Added
@@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2020 Intel Corporation. All rights reserved. + * + */ + +#include <stdbool.h> +#include <inttypes.h> + +#ifndef __packed +#define __packed __attribute__((packed)) +#endif + +struct bt_ccp; +struct bt_ccp_db; +struct bt_ccp_session_info; + +typedef void (*bt_ccp_debug_func_t)(const char *str, void *user_data); +typedef void (*bt_ccp_destroy_func_t)(void *user_data); + +struct bt_ccp_event_callback { + void (*call_state)(struct bt_ccp *ccp, const uint8_t *value, + uint16_t length); +}; + +void bt_ccp_set_event_callbacks(struct bt_ccp *ccp, + const struct bt_ccp_event_callback *cbs, + void *user_data); + +bool bt_ccp_set_debug(struct bt_ccp *ccp, bt_ccp_debug_func_t cb, + void *user_data, bt_ccp_destroy_func_t destroy); + +void bt_ccp_register(struct gatt_db *db); +bool bt_ccp_attach(struct bt_ccp *ccp, struct bt_gatt_client *client); +void bt_ccp_detach(struct bt_ccp *ccp); + +struct bt_ccp *bt_ccp_new(struct gatt_db *ldb, struct gatt_db *rdb); +struct bt_ccp *bt_ccp_ref(struct bt_ccp *ccp); +void bt_ccp_unref(struct bt_ccp *ccp); + +bool bt_ccp_set_user_data(struct bt_ccp *ccp, void *user_data); +void *bt_ccp_get_user_data(struct bt_ccp *ccp);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/csip.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/csip.c
Changed
@@ -128,6 +128,15 @@ queue_foreach(csip_cbs, csip_detached, csip); } +static void csis_free(struct bt_csis *csis) +{ + if (!csis) + return; + + free(csis->sirk_val); + free(csis); +} + static void csip_db_free(void *data) { struct bt_csip_db *cdb = data; @@ -137,7 +146,7 @@ gatt_db_unref(cdb->db); - free(cdb->csis); + csis_free(cdb->csis); free(cdb); } @@ -602,6 +611,9 @@ struct bt_csip *csip = user_data; struct bt_csis *csis = csip_get_csis(csip); + if (!csis) + return; + csis->service = attr; gatt_db_service_set_claimed(attr, true);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/ecc.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/ecc.c
Changed
@@ -870,6 +870,8 @@ uint64_t privNUM_ECC_DIGITS; unsigned int tries = 0; + memset(&pk, 0, sizeof(pk)); + do { if (!get_random_number(priv) || (tries++ >= MAX_TRIES)) return false;
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/gatt-client.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/gatt-client.c
Changed
@@ -735,6 +735,7 @@ } attr = gatt_db_insert_characteristic(client->db, + chrc_data->start_handle, chrc_data->value_handle, &chrc_data->uuid, 0, chrc_data->properties, @@ -829,6 +830,8 @@ return true; failed: + DBG(client, "Failed to discover descriptors"); + free(chrc_data); return false; } @@ -1663,7 +1666,7 @@ bt_gatt_client_callback_t callback) { unsigned int att_id; - uint16_t value; + uint16_t value = 0x0000; uint16_t properties = notify_data->chrc->properties; assert(notify_data->chrc->ccc_handle); @@ -2225,7 +2228,7 @@ value_data->len, notify_data->user_data); } -static void notify_cb(struct bt_att_chan *chan, uint8_t opcode, +static void notify_cb(struct bt_att_chan *chan, uint16_t mtu, uint8_t opcode, const void *pdu, uint16_t length, void *user_data) { @@ -3818,3 +3821,22 @@ return false; } + +bool bt_gatt_client_set_retry(struct bt_gatt_client *client, + unsigned int id, + bool retry) +{ + struct request *req; + + if (!client || !id) + return false; + + req = queue_find(client->pending_requests, match_req_id, + UINT_TO_PTR(id)); + if (!req) + return false; + + bt_att_set_retry(client->att, req->att_id, retry); + + return true; +}
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/gatt-client.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/gatt-client.h
Changed
@@ -134,3 +134,6 @@ bt_gatt_client_destroy_func_t destroy); bool bt_gatt_client_idle_unregister(struct bt_gatt_client *client, unsigned int id); +bool bt_gatt_client_set_retry(struct bt_gatt_client *client, + unsigned int id, + bool retry);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/gatt-db.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/gatt-db.c
Changed
@@ -58,7 +58,7 @@ struct bt_crypto *crypto; uint8_t hash16; unsigned int hash_id; - uint16_t next_handle; + uint16_t last_handle; struct queue *services; struct queue *notify_list; @@ -255,11 +255,82 @@ db->crypto = bt_crypto_new(); db->services = queue_new(); db->notify_list = queue_new(); - db->next_handle = 0x0001; + db->last_handle = 0x0000; return gatt_db_ref(db); } +static void service_clone(void *data, void *user_data) +{ + struct gatt_db_service *service = data; + struct gatt_db *db = user_data; + struct gatt_db_service *clone; + int i; + + clone = new0(struct gatt_db_service, 1); + clone->db = db; + clone->active = service->active; + clone->num_handles = service->num_handles; + clone->attributes = new0(struct gatt_db_attribute *, + service->num_handles); + + /* Clone attributes */ + for (i = 0; i < service->num_handles; i++) { + struct gatt_db_attribute *attr = service->attributesi; + + /* Only clone values for characteristics declaration since that + * is considered when calculating the db hash. + */ + if (bt_uuid_len(&attr->uuid) != 2) { + clone->attributesi = new_attribute(clone, + attr->handle, + &attr->uuid, + NULL, 0); + continue; + } + + /* Attribute values that are used for generating the hash needs + * to be cloned as well. + */ + switch (attr->uuid.value.u16) { + case GATT_PRIM_SVC_UUID: + case GATT_SND_SVC_UUID: + case GATT_INCLUDE_UUID: + case GATT_CHARAC_UUID: + clone->attributesi = new_attribute(clone, + attr->handle, + &attr->uuid, + attr->value, + attr->value_len); + break; + default: + clone->attributesi = new_attribute(clone, + attr->handle, + &attr->uuid, + NULL, 0); + break; + } + } + + queue_push_tail(db->services, clone); +} + +struct gatt_db *gatt_db_clone(struct gatt_db *db) +{ + struct gatt_db *clone; + + if (!db) + return NULL; + + clone = gatt_db_new(); + if (!clone) + return NULL; + + queue_foreach(db->services, service_clone, clone); + + return clone; +} + static void notify_destroy(void *data) { struct notify *notify = data; @@ -356,14 +427,15 @@ db->hash_id = 0; - if (!db->next_handle) + if (gatt_db_isempty(db)) return false; - hash.iov = new0(struct iovec, db->next_handle); + hash.iov = new0(struct iovec, db->last_handle + 1); hash.i = 0; gatt_db_foreach_service(db, NULL, service_gen_hash_m, &hash); - bt_crypto_gatt_hash(db->crypto, hash.iov, db->next_handle, db->hash); + bt_crypto_gatt_hash(db->crypto, hash.iov, db->last_handle + 1, + db->hash); for (i = 0; i < hash.i; i++) free(hash.iovi.iov_base); @@ -624,7 +696,7 @@ done: if (gatt_db_isempty(db)) - db->next_handle = 0; + db->last_handle = 0; return true; } @@ -700,7 +772,7 @@ return NULL; if (!handle) - handle = db->next_handle; + handle = db->last_handle + 1; if (num_handles < 1 || (handle + num_handles - 1) > UINT16_MAX) return NULL; @@ -747,8 +819,8 @@ service->attributes0->handle = handle; service->num_handles = num_handles; - /* Fast-forward next_handle if the new service was added to the end */ - db->next_handle = MAX(handle + num_handles, db->next_handle); + /* Fast-forward last_handle if the new service was added to the end */ + db->last_handle = MAX(handle + num_handles - 1, db->last_handle); return service->attributes0; @@ -824,28 +896,45 @@ return true; } -static uint16_t get_attribute_index(struct gatt_db_service *service, +static uint16_t service_get_attribute_index(struct gatt_db_service *service, + uint16_t *handle, int end_offset) { int i = 0; - /* Here we look for first free attribute index with given offset */ - while (i < (service->num_handles - end_offset) && + if (!service || !service->attributes0 || !handle) + return 0; + + if (*handle) { + /* Check if handle is in within service range */ + if (*handle < service->attributes0->handle) + return 0; + + /* Return index based on given handle */ + i = *handle - service->attributes0->handle; + } else { + /* Here we look for first free attribute index with given + * offset. + */ + while (i < (service->num_handles - end_offset) && service->attributesi) - i++; + i++; + } - return i == (service->num_handles - end_offset) ? 0 : i; -} + if (i >= (service->num_handles - end_offset)) + return 0; -static uint16_t get_handle_at_index(struct gatt_db_service *service, - int index) -{ - return service->attributesindex->handle; + /* Set handle based on the index */ + if (!(*handle)) + *handle = service->attributes0->handle + i; + + return i; } static struct gatt_db_attribute * service_insert_characteristic(struct gatt_db_service *service, uint16_t handle, + uint16_t value_handle, const bt_uuid_t *uuid, uint32_t permissions, uint8_t properties, @@ -853,6 +942,7 @@ gatt_db_write_t write_func, void *user_data) { + struct gatt_db_attribute **chrc; uint8_t valueMAX_CHAR_DECL_VALUE_LEN; uint16_t len = 0; int i; @@ -873,37 +963,48 @@ if (handle == UINT16_MAX) return NULL; - i = get_attribute_index(service, 1); + i = service_get_attribute_index(service, &handle, 1); if (!i) return NULL; - if (!handle) - handle = get_handle_at_index(service, i - 1) + 2; - value0 = properties; len += sizeof(properties); /* We set handle of characteristic value, which will be added next */ - put_le16(handle, &value1); + put_le16(value_handle, &value1); len += sizeof(uint16_t); len += uuid_to_le(uuid, &value3); - service->attributesi = new_attribute(service, handle - 1, + service->attributesi = new_attribute(service, handle, &characteristic_uuid, value, len); if (!service->attributesi) return NULL; - set_attribute_data(service->attributesi, NULL, NULL, BT_ATT_PERM_READ, NULL); + chrc = &service->attributesi; + set_attribute_data(service->attributesi, NULL, NULL, BT_ATT_PERM_READ, + NULL); - i++; + i = service_get_attribute_index(service, &value_handle, 0); + if (!i) { + free(*chrc); + *chrc = NULL; + return NULL; + } - service->attributesi = new_attribute(service, handle, uuid, NULL, 0); + service->attributesi = new_attribute(service, value_handle, uuid, + NULL, 0); if (!service->attributesi) { - free(service->attributesi - 1); + free(*chrc); + *chrc = NULL; return NULL; } + /* Update handle of characteristic value_handle if it has changed */ + put_le16(value_handle, &value1); + if (memcmp((*chrc)->value, value, len)) + memcpy((*chrc)->value, value, len); + set_attribute_data(service->attributesi, read_func, write_func, permissions, user_data); @@ -913,6 +1014,7 @@ struct gatt_db_attribute * gatt_db_insert_characteristic(struct gatt_db *db, uint16_t handle, + uint16_t value_handle, const bt_uuid_t *uuid, uint32_t permissions, uint8_t properties, @@ -926,7 +1028,8 @@ if (!attrib) return NULL; - return service_insert_characteristic(attrib->service, handle, uuid, + return service_insert_characteristic(attrib->service, handle, + value_handle, uuid, permissions, properties, read_func, write_func, user_data); @@ -935,6 +1038,7 @@ struct gatt_db_attribute * gatt_db_service_insert_characteristic(struct gatt_db_attribute *attrib, uint16_t handle, + uint16_t value_handle, const bt_uuid_t *uuid, uint32_t permissions, uint8_t properties, @@ -945,7 +1049,8 @@ if (!attrib) return NULL; - return service_insert_characteristic(attrib->service, handle, uuid, + return service_insert_characteristic(attrib->service, handle, + value_handle, uuid, permissions, properties, read_func, write_func, user_data); @@ -963,7 +1068,7 @@ if (!attrib) return NULL; - return service_insert_characteristic(attrib->service, 0, uuid, + return service_insert_characteristic(attrib->service, 0, 0, uuid, permissions, properties, read_func, write_func, user_data); @@ -980,17 +1085,10 @@ { int i; - i = get_attribute_index(service, 0); + i = service_get_attribute_index(service, &handle, 0); if (!i) return NULL; - /* Check if handle is in within service range */ - if (handle && handle <= service->attributes0->handle) - return NULL; - - if (!handle) - handle = get_handle_at_index(service, i - 1) + 1; - service->attributesi = new_attribute(service, handle, uuid, NULL, 0); if (!service->attributesi) return NULL; @@ -1150,17 +1248,10 @@ len += include->value_len; } - index = get_attribute_index(service, 0); + index = service_get_attribute_index(service, &handle, 0); if (!index) return NULL; - /* Check if handle is in within service range */ - if (handle && handle <= service->attributes0->handle) - return NULL; - - if (!handle) - handle = get_handle_at_index(service, index - 1) + 1; - service->attributesindex = new_attribute(service, handle, &included_service_uuid, value, len);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/gatt-db.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/gatt-db.h
Changed
@@ -12,6 +12,7 @@ struct gatt_db_attribute; struct gatt_db *gatt_db_new(void); +struct gatt_db *gatt_db_clone(struct gatt_db *db); struct gatt_db *gatt_db_ref(struct gatt_db *db); void gatt_db_unref(struct gatt_db *db); @@ -63,6 +64,7 @@ struct gatt_db_attribute * gatt_db_service_insert_characteristic(struct gatt_db_attribute *attrib, uint16_t handle, + uint16_t value_handle, const bt_uuid_t *uuid, uint32_t permissions, uint8_t properties, @@ -73,6 +75,7 @@ struct gatt_db_attribute * gatt_db_insert_characteristic(struct gatt_db *db, uint16_t handle, + uint16_t value_handle, const bt_uuid_t *uuid, uint32_t permissions, uint8_t properties,
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/gatt-server.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/gatt-server.c
Changed
@@ -50,6 +50,7 @@ struct bt_gatt_server *server; uint8_t opcode; bool done; + uint16_t mtu; uint8_t *pdu; size_t pdu_len; size_t value_len; @@ -106,6 +107,7 @@ unsigned int read_multiple_vl_id; unsigned int prep_write_id; unsigned int exec_write_id; + unsigned int signed_write_cmd_id; uint8_t min_enc_size; @@ -155,6 +157,7 @@ bt_att_unregister(server->att, server->read_multiple_vl_id); bt_att_unregister(server->att, server->prep_write_id); bt_att_unregister(server->att, server->exec_write_id); + bt_att_unregister(server->att, server->signed_write_cmd_id); queue_destroy(server->prep_queue, prep_write_data_destroy); @@ -226,7 +229,7 @@ * value is seen. */ if (iter == 0) { - data_val_len = MIN(MIN((unsigned)mtu - 6, 251), + data_val_len = MIN(MIN((unsigned int)mtu - 6, 251), value.iov_len); pdu0 = data_val_len + 4; iter++; @@ -264,15 +267,14 @@ va_end(ap); } -static void read_by_grp_type_cb(struct bt_att_chan *chan, uint8_t opcode, - const void *pdu, uint16_t length, - void *user_data) +static void read_by_grp_type_cb(struct bt_att_chan *chan, uint16_t mtu, + uint8_t opcode, const void *pdu, + uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; uint16_t start, end; bt_uuid_t type; bt_uuid_t prim, snd; - uint16_t mtu = bt_att_get_mtu(server->att); uint8_t rsp_pdumtu; uint16_t rsp_len; uint8_t ecode = 0; @@ -357,11 +359,8 @@ size_t len, void *user_data) { struct async_read_op *op = user_data; - struct bt_gatt_server *server = op->server; - uint16_t mtu; uint16_t handle; - mtu = bt_att_get_mtu(server->att); handle = gatt_db_attribute_get_handle(attr); /* Terminate the operation if there was an error */ @@ -373,7 +372,7 @@ } if (op->pdu_len == 0) { - op->value_len = MIN(MIN((unsigned) mtu - 4, 253), len); + op->value_len = MIN(MIN((unsigned int)op->mtu - 4, 253), len); op->pdu0 = op->value_len + 2; op->pdu_len++; } else if (len != op->value_len) { @@ -382,7 +381,7 @@ } /* Stop if this would surpass the MTU */ - if (op->pdu_len + op->value_len + 2 > (unsigned) mtu - 1) { + if (op->pdu_len + op->value_len + 2 > (unsigned int) op->mtu - 1) { op->done = true; goto done; } @@ -393,7 +392,7 @@ op->pdu_len += op->value_len + 2; - if (op->pdu_len == (unsigned) mtu - 1) + if (op->pdu_len == (unsigned int) op->mtu - 1) op->done = true; done: @@ -489,9 +488,9 @@ async_read_op_destroy(op); } -static void read_by_type_cb(struct bt_att_chan *chan, uint8_t opcode, - const void *pdu, uint16_t length, - void *user_data) +static void read_by_type_cb(struct bt_att_chan *chan, uint16_t mtu, + uint8_t opcode, const void *pdu, + uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; uint16_t start, end; @@ -534,7 +533,8 @@ } op = new0(struct async_read_op, 1); - op->pdu = malloc(bt_att_get_mtu(server->att)); + op->mtu = mtu; + op->pdu = malloc(mtu); if (!op->pdu) { free(op); ecode = BT_ATT_ERROR_INSUFFICIENT_RESOURCES; @@ -609,13 +609,12 @@ return true; } -static void find_info_cb(struct bt_att_chan *chan, uint8_t opcode, +static void find_info_cb(struct bt_att_chan *chan, uint16_t mtu, uint8_t opcode, const void *pdu, uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; uint16_t start, end; - uint16_t mtu = bt_att_get_mtu(server->att); uint8_t rsp_pdumtu; uint16_t rsp_len; uint8_t ecode = 0; @@ -707,14 +706,13 @@ data->len += 4; } -static void find_by_type_val_cb(struct bt_att_chan *chan, uint8_t opcode, - const void *pdu, uint16_t length, - void *user_data) +static void find_by_type_val_cb(struct bt_att_chan *chan, uint16_t mtu, + uint8_t opcode, const void *pdu, + uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; uint16_t start, end, uuid16; struct find_by_type_val_data data; - uint16_t mtu = bt_att_get_mtu(server->att); uint8_t rsp_pdumtu; uint16_t ehandle = 0; bt_uuid_t uuid; @@ -777,7 +775,8 @@ struct bt_gatt_server *server = op->server; uint16_t handle; - if (op->opcode == BT_ATT_OP_WRITE_CMD) { + if (op->opcode == BT_ATT_OP_WRITE_CMD || + op->opcode == BT_ATT_OP_SIGNED_WRITE_CMD) { async_write_op_destroy(op); return; } @@ -818,8 +817,8 @@ return 0; } -static void write_cb(struct bt_att_chan *chan, uint8_t opcode, const void *pdu, - uint16_t length, void *user_data) +static void write_cb(struct bt_att_chan *chan, uint16_t mtu, uint8_t opcode, + const void *pdu, uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; struct gatt_db_attribute *attr; @@ -905,12 +904,10 @@ struct async_read_op *op = user_data; struct bt_gatt_server *server = op->server; uint8_t rsp_opcode; - uint16_t mtu; uint16_t handle; DBG(server, "Read Complete: err %d", err); - mtu = bt_att_get_mtu(server->att); handle = gatt_db_attribute_get_handle(attr); if (err) { @@ -922,13 +919,14 @@ rsp_opcode = get_read_rsp_opcode(op->opcode); bt_att_chan_send_rsp(op->chan, rsp_opcode, len ? value : NULL, - MIN((unsigned int) mtu - 1, len)); + MIN((unsigned int) op->mtu - 1, len)); async_read_op_destroy(op); } static void handle_read_req(struct bt_att_chan *chan, - struct bt_gatt_server *server, uint8_t opcode, - uint16_t handle, uint16_t offset) + struct bt_gatt_server *server, uint16_t mtu, + uint8_t opcode, uint16_t handle, + uint16_t offset) { struct gatt_db_attribute *attr; uint8_t ecode; @@ -955,6 +953,7 @@ op->chan = chan; op->opcode = opcode; op->server = bt_gatt_server_ref(server); + op->mtu = mtu; if (gatt_db_attribute_read(attr, offset, opcode, server->att, read_complete_cb, op)) @@ -969,8 +968,8 @@ bt_att_chan_send_error_rsp(chan, opcode, handle, ecode); } -static void read_cb(struct bt_att_chan *chan, uint8_t opcode, const void *pdu, - uint16_t length, void *user_data) +static void read_cb(struct bt_att_chan *chan, uint16_t mtu, uint8_t opcode, + const void *pdu, uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; uint16_t handle; @@ -983,10 +982,10 @@ handle = get_le16(pdu); - handle_read_req(chan, server, opcode, handle, 0); + handle_read_req(chan, server, mtu, opcode, handle, 0); } -static void read_blob_cb(struct bt_att_chan *chan, uint8_t opcode, +static void read_blob_cb(struct bt_att_chan *chan, uint16_t mtu, uint8_t opcode, const void *pdu, uint16_t length, void *user_data) { @@ -1002,7 +1001,7 @@ handle = get_le16(pdu); offset = get_le16(pdu + 2); - handle_read_req(chan, server, opcode, handle, offset); + handle_read_req(chan, server, mtu, opcode, handle, offset); } struct read_mult_data { @@ -1102,6 +1101,7 @@ static struct read_mult_data *read_mult_data_new(struct bt_gatt_server *server, struct bt_att_chan *chan, + uint16_t mtu, uint8_t opcode, uint16_t num_handles) { @@ -1115,16 +1115,16 @@ data->server = server; data->num_handles = num_handles; data->cur_handle = 0; - data->mtu = bt_att_get_mtu(server->att); + data->mtu = mtu; data->length = 0; data->rsp_data = new0(uint8_t, data->mtu - 1); return data; } -static void read_multiple_cb(struct bt_att_chan *chan, uint8_t opcode, - const void *pdu, uint16_t length, - void *user_data) +static void read_multiple_cb(struct bt_att_chan *chan, uint16_t mtu, + uint8_t opcode, const void *pdu, + uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; struct gatt_db_attribute *attr; @@ -1138,7 +1138,7 @@ goto error; } - data = read_mult_data_new(server, chan, opcode, length / 2); + data = read_mult_data_new(server, chan, mtu, opcode, length / 2); for (i = 0; i < data->num_handles; i++) data->handlesi = get_le16(pdu + i * 2); @@ -1301,9 +1301,9 @@ free(pwcd); } -static void prep_write_cb(struct bt_att_chan *chan, uint8_t opcode, - const void *pdu, uint16_t length, - void *user_data) +static void prep_write_cb(struct bt_att_chan *chan, uint16_t mtu, + uint8_t opcode, const void *pdu, + uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; uint16_t handle = 0; @@ -1433,9 +1433,9 @@ return !prep_data->reliable_supported; } -static void exec_write_cb(struct bt_att_chan *chan, uint8_t opcode, - const void *pdu, uint16_t length, - void *user_data) +static void exec_write_cb(struct bt_att_chan *chan, uint16_t mtu, + uint8_t opcode, const void *pdu, + uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; struct exec_data *data; @@ -1496,9 +1496,9 @@ bt_att_chan_send_error_rsp(chan, opcode, ehandle, ecode); } -static void exchange_mtu_cb(struct bt_att_chan *chan, uint8_t opcode, - const void *pdu, uint16_t length, - void *user_data) +static void exchange_mtu_cb(struct bt_att_chan *chan, uint16_t mtu, + uint8_t opcode, const void *pdu, + uint16_t length, void *user_data) { struct bt_gatt_server *server = user_data; uint16_t client_rx_mtu; @@ -1628,6 +1628,14 @@ if (!server->exec_write_id) return NULL; + /* Signed Write Command */ + server->signed_write_cmd_id = bt_att_register(server->att, + BT_ATT_OP_SIGNED_WRITE_CMD, + write_cb, + server, NULL); + if (!server->signed_write_cmd_id) + return false; + return true; } @@ -1811,8 +1819,10 @@ return result; error: - if (data) + if (data) { + free(data->pdu); free(data); + } return false; }
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/lc3.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/lc3.h
Changed
@@ -4,22 +4,17 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. All rights reserved. + * Copyright 2024 NXP * */ -#define data(args...) ((const unsigned char) { args }) - -#define LC3_IOV(args...) \ - { \ - .iov_base = (void *)data(args), \ - .iov_len = sizeof(data(args)), \ - } +#include "src/shared/bap-defs.h" #define LC3_ID 0x06 -#define LC3_BASE 0x01 +#define LC3_TYPE_BASE 0x01 -#define LC3_FREQ (LC3_BASE) +#define LC3_FREQ LC3_TYPE_BASE #define LC3_FREQ_8KHZ BIT(0) #define LC3_FREQ_11KHZ BIT(1) #define LC3_FREQ_16KHZ BIT(2) @@ -37,7 +32,7 @@ LC3_FREQ_44KHZ | \ LC3_FREQ_48KHZ) -#define LC3_DURATION (LC3_BASE + 1) +#define LC3_DURATION (LC3_TYPE_BASE + 1) #define LC3_DURATION_7_5 BIT(0) #define LC3_DURATION_10 BIT(1) #define LC3_DURATION_ANY (LC3_DURATION_7_5 | LC3_DURATION_10) @@ -45,19 +40,19 @@ #define LC3_DURATION_PREFER_10 BIT(5) -#define LC3_CHAN_COUNT (LC3_BASE + 2) +#define LC3_CHAN_COUNT (LC3_TYPE_BASE + 2) #define LC3_CHAN_COUNT_SUPPORT BIT(0) -#define LC3_FRAME_LEN (LC3_BASE + 3) +#define LC3_FRAME_LEN (LC3_TYPE_BASE + 3) -#define LC3_FRAME_COUNT (LC3_BASE + 4) +#define LC3_FRAME_COUNT (LC3_TYPE_BASE + 4) #define LC3_CAPABILITIES(_freq, _duration, _chan_count, _len_min, _len_max) \ - LC3_IOV(0x02, LC3_FREQ, _freq, _freq >> 8, \ - 0x02, LC3_DURATION, _duration, \ - 0x02, LC3_CHAN_COUNT, _chan_count, \ - 0x05, LC3_FRAME_LEN, _len_min, _len_min >> 8, \ - _len_max, _len_max >> 8) + UTIL_IOV_INIT(0x02, LC3_FREQ, _freq, _freq >> 8, \ + 0x02, LC3_DURATION, _duration, \ + 0x02, LC3_CHAN_COUNT, _chan_count, \ + 0x05, LC3_FRAME_LEN, _len_min, _len_min >> 8, \ + _len_max, _len_max >> 8) #define LC3_CONFIG_BASE 0x01 @@ -75,86 +70,413 @@ #define LC3_CONFIG_DURATION_7_5 0x00 #define LC3_CONFIG_DURATION_10 0x01 -#define LC3_CONFIG_CHAN_ALLOC (LC3_CONFIG_BASE + 2) +#define LC3_CONFIG_CHAN_ALLOC (LC3_CONFIG_BASE + 2) +#define LC3_CONFIG_CHAN_ALLOC_LEN 0x05 #define LC3_CONFIG_FRAME_LEN (LC3_CONFIG_BASE + 3) #define LC3_CONFIG(_freq, _duration, _len) \ - LC3_IOV(0x02, LC3_CONFIG_FREQ, _freq, \ - 0x02, LC3_CONFIG_DURATION, _duration, \ - 0x03, LC3_CONFIG_FRAME_LEN, _len, _len >> 8) + UTIL_IOV_INIT(0x02, LC3_CONFIG_FREQ, _freq, \ + 0x02, LC3_CONFIG_DURATION, _duration, \ + 0x03, LC3_CONFIG_FRAME_LEN, _len, _len >> 8) + +#define LC3_AC_BITS(_ac) (BIT(_ac) - 1) + +#define LC3_CONFIG_AC(_freq, _duration, _len, _ac) \ + UTIL_IOV_INIT(0x02, LC3_CONFIG_FREQ, _freq, \ + 0x02, LC3_CONFIG_DURATION, _duration, \ + 0x03, LC3_CONFIG_FRAME_LEN, _len, _len >> 8, \ + 0x05, LC3_CONFIG_CHAN_ALLOC, LC3_AC_BITS(_ac), \ + LC3_AC_BITS(_ac) >> 8 & 0xff, \ + LC3_AC_BITS(_ac) >> 16 & 0xff, \ + LC3_AC_BITS(_ac) >> 24 & 0xff) #define LC3_CONFIG_8(_duration, _len) \ LC3_CONFIG(LC3_CONFIG_FREQ_8KHZ, _duration, _len) +#define LC3_CONFIG_8_AC(_duration, _len, _ac) \ + LC3_CONFIG_AC(LC3_CONFIG_FREQ_8KHZ, _duration, _len, _ac) + #define LC3_CONFIG_11(_duration, _len) \ LC3_CONFIG(LC3_CONFIG_FREQ_11KHZ, _duration, _len) +#define LC3_CONFIG_11_AC(_duration, _len, _ac) \ + LC3_CONFIG_AC(LC3_CONFIG_FREQ_11KHZ, _duration, _len, _ac) + #define LC3_CONFIG_16(_duration, _len) \ LC3_CONFIG(LC3_CONFIG_FREQ_16KHZ, _duration, _len) +#define LC3_CONFIG_16_AC(_duration, _len, _ac) \ + LC3_CONFIG_AC(LC3_CONFIG_FREQ_16KHZ, _duration, _len, _ac) + #define LC3_CONFIG_22(_duration, _len) \ LC3_CONFIG(LC3_CONFIG_FREQ_22KHZ, _duration, _len) +#define LC3_CONFIG_22_AC(_duration, _len) \ + LC3_CONFIG(LC3_CONFIG_FREQ_22KHZ, _duration, _len, _ac) + #define LC3_CONFIG_24(_duration, _len) \ LC3_CONFIG(LC3_CONFIG_FREQ_24KHZ, _duration, _len) +#define LC3_CONFIG_24_AC(_duration, _len, _ac) \ + LC3_CONFIG_AC(LC3_CONFIG_FREQ_24KHZ, _duration, _len, _ac) + #define LC3_CONFIG_32(_duration, _len) \ LC3_CONFIG(LC3_CONFIG_FREQ_32KHZ, _duration, _len) +#define LC3_CONFIG_32_AC(_duration, _len, _ac) \ + LC3_CONFIG_AC(LC3_CONFIG_FREQ_32KHZ, _duration, _len, _ac) + #define LC3_CONFIG_44(_duration, _len) \ LC3_CONFIG(LC3_CONFIG_FREQ_44KHZ, _duration, _len) +#define LC3_CONFIG_44_AC(_duration, _len, _ac) \ + LC3_CONFIG_AC(LC3_CONFIG_FREQ_44KHZ, _duration, _len, _ac) + #define LC3_CONFIG_48(_duration, _len) \ LC3_CONFIG(LC3_CONFIG_FREQ_48KHZ, _duration, _len) +#define LC3_CONFIG_48_AC(_duration, _len, _ac) \ + LC3_CONFIG_AC(LC3_CONFIG_FREQ_48KHZ, _duration, _len, _ac) + +#define LC3_CONFIG_FRAME_LEN_8_1 26u + #define LC3_CONFIG_8_1 \ - LC3_CONFIG_8(LC3_CONFIG_DURATION_7_5, 26u) + LC3_CONFIG_8(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_8_1) + +#define LC3_CONFIG_8_1_AC(_ac) \ + LC3_CONFIG_8_AC(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_8_1, _ac) + +#define LC3_CONFIG_FRAME_LEN_8_2 30u #define LC3_CONFIG_8_2 \ - LC3_CONFIG_8(LC3_CONFIG_DURATION_10, 30u) + LC3_CONFIG_8(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_8_2 ) + +#define LC3_CONFIG_8_2_AC(_ac) \ + LC3_CONFIG_8_AC(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_8_2, _ac) + +#define LC3_CONFIG_FRAME_LEN_16_1 30u #define LC3_CONFIG_16_1 \ - LC3_CONFIG_16(LC3_CONFIG_DURATION_7_5, 30u) + LC3_CONFIG_16(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_16_1) + +#define LC3_CONFIG_16_1_AC(_ac) \ + LC3_CONFIG_16_AC(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_16_1, \ + _ac) + +#define LC3_CONFIG_FRAME_LEN_16_2 40u #define LC3_CONFIG_16_2 \ - LC3_CONFIG_16(LC3_CONFIG_DURATION_10, 40u) + LC3_CONFIG_16(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_16_2) + +#define LC3_CONFIG_16_2_AC(_ac) \ + LC3_CONFIG_16_AC(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_16_2, _ac) + +#define LC3_CONFIG_FRAME_LEN_24_1 45u #define LC3_CONFIG_24_1 \ - LC3_CONFIG_24(LC3_CONFIG_DURATION_7_5, 45u) + LC3_CONFIG_24(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_24_1) + +#define LC3_CONFIG_24_1_AC(_ac) \ + LC3_CONFIG_24_AC(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_24_1, \ + _ac) + +#define LC3_CONFIG_FRAME_LEN_24_2 60u #define LC3_CONFIG_24_2 \ - LC3_CONFIG_24(LC3_CONFIG_DURATION_10, 60u) + LC3_CONFIG_24(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_24_2) + +#define LC3_CONFIG_24_2_AC(_ac) \ + LC3_CONFIG_24_AC(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_24_2, _ac) + +#define LC3_CONFIG_FRAME_LEN_32_1 60u #define LC3_CONFIG_32_1 \ - LC3_CONFIG_32(LC3_CONFIG_DURATION_7_5, 60u) + LC3_CONFIG_32(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_32_1) + +#define LC3_CONFIG_32_1_AC(_ac) \ + LC3_CONFIG_32_AC(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_32_1, \ + _ac) + +#define LC3_CONFIG_FRAME_LEN_32_2 80u #define LC3_CONFIG_32_2 \ - LC3_CONFIG_32(LC3_CONFIG_DURATION_10, 80u) + LC3_CONFIG_32(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_32_2) + +#define LC3_CONFIG_32_2_AC(_ac) \ + LC3_CONFIG_32_AC(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_32_2, _ac) + +#define LC3_CONFIG_FRAME_LEN_44_1 98u #define LC3_CONFIG_44_1 \ - LC3_CONFIG_44(LC3_CONFIG_DURATION_7_5, 98u) + LC3_CONFIG_44(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_44_1) + +#define LC3_CONFIG_44_1_AC(_ac) \ + LC3_CONFIG_44_AC(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_44_1, \ + _ac) + +#define LC3_CONFIG_FRAME_LEN_44_2 130u #define LC3_CONFIG_44_2 \ - LC3_CONFIG_44(LC3_CONFIG_DURATION_10, 130u) + LC3_CONFIG_44(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_44_2) + +#define LC3_CONFIG_44_2_AC(_ac) \ + LC3_CONFIG_44_AC(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_44_2, _ac) + +#define LC3_CONFIG_FRAME_LEN_48_1 75u #define LC3_CONFIG_48_1 \ - LC3_CONFIG_48(LC3_CONFIG_DURATION_7_5, 75u) + LC3_CONFIG_48(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_1) + +#define LC3_CONFIG_48_1_AC(_ac) \ + LC3_CONFIG_48_AC(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_1, \ + _ac) + +#define LC3_CONFIG_FRAME_LEN_48_2 100u #define LC3_CONFIG_48_2 \ - LC3_CONFIG_48(LC3_CONFIG_DURATION_10, 100u) + LC3_CONFIG_48(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_2) + +#define LC3_CONFIG_48_2_AC(_ac) \ + LC3_CONFIG_48_AC(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_2, _ac) + +#define LC3_CONFIG_FRAME_LEN_48_3 90u #define LC3_CONFIG_48_3 \ - LC3_CONFIG_48(LC3_CONFIG_DURATION_7_5, 90u) + LC3_CONFIG_48(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_3) + +#define LC3_CONFIG_48_3_AC(_ac) \ + LC3_CONFIG_48_AC(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_3, \ + _ac) + +#define LC3_CONFIG_FRAME_LEN_48_4 120u #define LC3_CONFIG_48_4 \ - LC3_CONFIG_48(LC3_CONFIG_DURATION_10, 120u) + LC3_CONFIG_48(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_4) + +#define LC3_CONFIG_48_4_AC(_ac) \ + LC3_CONFIG_48_AC(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_4, _ac) + +#define LC3_CONFIG_FRAME_LEN_48_5 117u #define LC3_CONFIG_48_5 \ - LC3_CONFIG_48(LC3_CONFIG_DURATION_7_5, 117u) + LC3_CONFIG_48(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_5) + +#define LC3_CONFIG_48_5_AC(_ac) \ + LC3_CONFIG_48_AC(LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_5, \ + _ac) + +#define LC3_CONFIG_FRAME_LEN_48_6 155u #define LC3_CONFIG_48_6 \ - LC3_CONFIG_48(LC3_CONFIG_DURATION_10, 155u) + LC3_CONFIG_48(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_6) + +#define LC3_CONFIG_48_6_AC(_ac) \ + LC3_CONFIG_48_AC(LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_6, \ + _ac) + +#define BASE(_pd, _sgrp, _nbis, _cfg...) \ + _pd & 0xff, _pd >> 8, _pd >> 16, \ + _sgrp, \ + _nbis, \ + _cfg + +#define BASE_LC3(_pd, _sgrp, _nbis, _cc...) \ + BASE(_pd, _sgrp, _nbis, \ + 0x06, 0x00, 0x00, 0x00, 0x00, \ + _cc) + +#define LC3_CFG(_freq, _dur, _len) \ + 0x0a, \ + 0x02, LC3_CONFIG_FREQ, _freq, \ + 0x02, LC3_CONFIG_DURATION, _dur, \ + 0x03, LC3_CONFIG_FRAME_LEN, _len, _len >> 8 + +#define LC3_CFG_8_1 \ + LC3_CFG(LC3_CONFIG_FREQ_8KHZ, \ + LC3_CONFIG_DURATION_7_5, \ + LC3_CONFIG_FRAME_LEN_8_1) + +#define BASE_LC3_8_1 \ + BASE_LC3(40000, 1, 1, LC3_CFG_8_1, 0x00, 0x01, 0x00) + +#define LC3_CFG_8_2 \ + LC3_CFG(LC3_CONFIG_FREQ_8KHZ, \ + LC3_CONFIG_DURATION_10, \ + LC3_CONFIG_FRAME_LEN_8_2) + +#define BASE_LC3_8_2 \ + BASE_LC3(40000, 1, 1, LC3_CFG_8_2, 0x00, 0x01, 0x00) + +#define LC3_CFG_16_1 \ + LC3_CFG(LC3_CONFIG_FREQ_16KHZ, \ + LC3_CONFIG_DURATION_7_5, \ + LC3_CONFIG_FRAME_LEN_16_1) + +#define BASE_LC3_16_1 \ + BASE_LC3(40000, 1, 1, LC3_CFG_16_1, 0x00, 0x01, 0x00) + +#define LC3_CFG_16_2 \ + LC3_CFG(LC3_CONFIG_FREQ_16KHZ, \ + LC3_CONFIG_DURATION_10, \ + LC3_CONFIG_FRAME_LEN_16_2) + +#define BASE_LC3_16_2 \ + BASE_LC3(40000, 1, 1, LC3_CFG_16_2, 0x00, 0x01, 0x00) + +#define LC3_CFG_24_1 \ + LC3_CFG(LC3_CONFIG_FREQ_24KHZ, \ + LC3_CONFIG_DURATION_7_5, \ + LC3_CONFIG_FRAME_LEN_24_1) + +#define BASE_LC3_24_1 \ + BASE_LC3(40000, 1, 1, LC3_CFG_24_1, 0x00, 0x01, 0x00) + +#define LC3_CFG_24_2 \ + LC3_CFG(LC3_CONFIG_FREQ_24KHZ, \ + LC3_CONFIG_DURATION_10, \ + LC3_CONFIG_FRAME_LEN_24_2) + +#define BASE_LC3_24_2 \ + BASE_LC3(40000, 1, 1, LC3_CFG_24_2, 0x00, 0x01, 0x00) + +#define LC3_CFG_32_1 \ + LC3_CFG(LC3_CONFIG_FREQ_32KHZ, \ + LC3_CONFIG_DURATION_7_5, \ + LC3_CONFIG_FRAME_LEN_32_1) + +#define BASE_LC3_32_1 \ + BASE_LC3(40000, 1, 1, LC3_CFG_32_1, 0x00, 0x01, 0x00) + +#define LC3_CFG_32_2 \ + LC3_CFG(LC3_CONFIG_FREQ_32KHZ, \ + LC3_CONFIG_DURATION_10, \ + LC3_CONFIG_FRAME_LEN_32_2) + +#define BASE_LC3_32_2 \ + BASE_LC3(40000, 1, 1, LC3_CFG_32_2, 0x00, 0x01, 0x00) + +#define LC3_CFG_44_1 \ + LC3_CFG(LC3_CONFIG_FREQ_44KHZ, \ + LC3_CONFIG_DURATION_7_5, \ + LC3_CONFIG_FRAME_LEN_44_1) + +#define BASE_LC3_44_1 \ + BASE_LC3(40000, 1, 1, LC3_CFG_44_1, 0x00, 0x01, 0x00) + +#define LC3_CFG_44_2 \ + LC3_CFG(LC3_CONFIG_FREQ_44KHZ, \ + LC3_CONFIG_DURATION_10, \ + LC3_CONFIG_FRAME_LEN_44_2) + +#define BASE_LC3_44_2 \ + BASE_LC3(40000, 1, 1, LC3_CFG_44_2, 0x00, 0x01, 0x00) + +#define LC3_CFG_48_1 \ + LC3_CFG(LC3_CONFIG_FREQ_48KHZ, \ + LC3_CONFIG_DURATION_7_5, \ + LC3_CONFIG_FRAME_LEN_48_1) + +#define BASE_LC3_48_1 \ + BASE_LC3(40000, 1, 1, LC3_CFG_48_1, 0x00, 0x01, 0x00) + +#define LC3_CFG_48_2 \ + LC3_CFG(LC3_CONFIG_FREQ_48KHZ, \ + LC3_CONFIG_DURATION_10, \ + LC3_CONFIG_FRAME_LEN_48_2) + +#define BASE_LC3_48_2 \ + BASE_LC3(40000, 1, 1, LC3_CFG_48_2, 0x00, 0x01, 0x00) + +#define LC3_CFG_48_3 \ + LC3_CFG(LC3_CONFIG_FREQ_48KHZ, \ + LC3_CONFIG_DURATION_7_5, \ + LC3_CONFIG_FRAME_LEN_48_3) + +#define BASE_LC3_48_3 \ + BASE_LC3(40000, 1, 1, LC3_CFG_48_3, 0x00, 0x01, 0x00) + +#define LC3_CFG_48_4 \ + LC3_CFG(LC3_CONFIG_FREQ_48KHZ, \ + LC3_CONFIG_DURATION_10, \ + LC3_CONFIG_FRAME_LEN_48_4) + +#define BASE_LC3_48_4 \ + BASE_LC3(40000, 1, 1, LC3_CFG_48_4, 0x00, 0x01, 0x00) + +#define LC3_CFG_48_5 \ + LC3_CFG(LC3_CONFIG_FREQ_48KHZ, \ + LC3_CONFIG_DURATION_7_5, \ + LC3_CONFIG_FRAME_LEN_48_5) + +#define BASE_LC3_48_5 \ + BASE_LC3(40000, 1, 1, LC3_CFG_48_5, 0x00, 0x01, 0x00) + +#define LC3_CFG_48_6 \ + LC3_CFG(LC3_CONFIG_FREQ_48KHZ, \ + LC3_CONFIG_DURATION_10, \ + LC3_CONFIG_FRAME_LEN_48_6) + +#define BASE_LC3_48_6 \ + BASE_LC3(40000, 1, 1, LC3_CFG_48_6, 0x00, 0x01, 0x00) + +#define BASE_VS(_cc) \ + BASE(40000, 1, 1, \ + 0xFF, 0x00, 0x00, 0x00, 0x00, \ + _cc, 0x00, 0x01, 0x00) + +#define BASE_LC3_8_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_8_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_8_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_8_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_16_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_16_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_16_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_16_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_24_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_24_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_24_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_24_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_32_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_32_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_32_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_32_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_44_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_44_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_44_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_44_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_48_1_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_1, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_48_2_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_2, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_48_3_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_3, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_48_4_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_4, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_48_5_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_5, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_LC3_48_6_MBIS \ + BASE_LC3(40000, 1, 2, LC3_CFG_48_6, 0x00, 0x01, 0x00, 0x02, 0x00) + +#define BASE_VS_MBIS(_cc) \ + BASE(40000, 1, 2, \ + 0xFF, 0x00, 0x00, 0x00, 0x00, \ + _cc, 0x00, 0x01, 0x00, 0x02, 0x00) #define LC3_QOS_UNFRAMED 0x00 #define LC3_QOS_FRAMED 0x01 @@ -163,6 +485,7 @@ { \ .ucast.cig_id = 0x00, \ .ucast.cis_id = 0x00, \ + .ucast.framing = _frame, \ .ucast.delay = _pd, \ .ucast.target_latency = _t_lat, \ .ucast.io_qos.interval = _interval, \ @@ -181,130 +504,694 @@ #define LC3_QOS_UCAST_FRAMED(_pd, _t_lat, _interval, _lat, _sdu, _rtn) \ LC3_QOS_UCAST(LC3_QOS_FRAMED, _pd, _t_lat, _interval, _lat, _sdu, _rtn) -#define LC3_QOS_8_1_1 \ +#define LC3_QOS_8_1_1_LATENCY 8u +#define LC3_QOS_8_1_1_RTN 2u + +#define LC3_QOS_8_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 8u, 26u, 2u) + LC3_QOS_8_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_1, \ + LC3_QOS_8_1_1_RTN) +#define LC3_QOS_8_1_1 LC3_QOS_8_1_1_AC(1) + +#define LC3_QOS_8_1_2_LATENCY 75u +#define LC3_QOS_8_1_2_RTN 13u -#define LC3_QOS_8_1_2 \ +#define LC3_QOS_8_1_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 75u, 26u, 13u) + LC3_QOS_8_1_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_1, \ + LC3_QOS_8_1_2_RTN) +#define LC3_QOS_8_1_2 LC3_QOS_8_1_2_AC(1) -#define LC3_QOS_8_2_1 \ +#define LC3_QOS_8_2_1_LATENCY 10u +#define LC3_QOS_8_2_1_RTN 2u + +#define LC3_QOS_8_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 10u, 30u, 2u) + LC3_QOS_8_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_2, \ + LC3_QOS_8_2_1_RTN) +#define LC3_QOS_8_2_1 LC3_QOS_8_2_1_AC(1) + +#define LC3_QOS_8_2_2_LATENCY 95u +#define LC3_QOS_8_2_2_RTN 13u -#define LC3_QOS_8_2_2 \ +#define LC3_QOS_8_2_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 95u, 30u, 13u) + LC3_QOS_8_2_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_2, \ + LC3_QOS_8_2_2_RTN) +#define LC3_QOS_8_2_2 LC3_QOS_8_2_2_AC(1) -#define LC3_QOS_16_1_1 \ - LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 8u, 30u, 2u) +#define LC3_QOS_16_1_1_LATENCY 8u +#define LC3_QOS_16_1_1_RTN 2u -#define LC3_QOS_16_1_2 \ +#define LC3_QOS_16_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 75u, 30u, 13u) + LC3_QOS_16_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_1, \ + LC3_QOS_16_1_1_RTN) +#define LC3_QOS_16_1_1 LC3_QOS_16_1_1_AC(1) -#define LC3_QOS_16_2_1 \ - LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 10u, 40u, 2u) +#define LC3_QOS_16_1_2_LATENCY 75u +#define LC3_QOS_16_1_2_RTN 13u -#define LC3_QOS_16_2_2 \ +#define LC3_QOS_16_1_2_AC(_ac) \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_16_1_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_1, \ + LC3_QOS_16_1_2_RTN) +#define LC3_QOS_16_1_2 LC3_QOS_16_1_2_AC(1) + +#define LC3_QOS_16_1_GS_LATENCY 15u +#define LC3_QOS_16_1_GS_RTN 1u +#define LC3_QOS_16_1_GS \ + LC3_QOS_UCAST_7_5_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_16_1_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_16_1, \ + LC3_QOS_16_1_GS_RTN) + +#define LC3_QOS_16_2_1_LATENCY 10u +#define LC3_QOS_16_2_1_RTN 2u + +#define LC3_QOS_16_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 95u, 40u, 13u) + LC3_QOS_16_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_2, \ + LC3_QOS_16_2_1_RTN) +#define LC3_QOS_16_2_1 LC3_QOS_16_2_1_AC(1) + +#define LC3_QOS_16_2_2_LATENCY 95u +#define LC3_QOS_16_2_2_RTN 13u -#define LC3_QOS_24_1_1 \ +#define LC3_QOS_16_2_2_AC(_ac) \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_16_2_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_2, \ + LC3_QOS_16_2_2_RTN) +#define LC3_QOS_16_2_2 LC3_QOS_16_2_2_AC(1) + +#define LC3_QOS_16_2_GS_LATENCY 20u +#define LC3_QOS_16_2_GS_RTN 1u +#define LC3_QOS_16_2_GS \ + LC3_QOS_UCAST_10_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_16_2_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_16_2, \ + LC3_QOS_16_2_GS_RTN) + +#define LC3_QOS_24_1_1_LATENCY 8u +#define LC3_QOS_24_1_1_RTN 2u + +#define LC3_QOS_24_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 8u, 45u, 2u) + LC3_QOS_24_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_1, \ + LC3_QOS_24_1_1_RTN) +#define LC3_QOS_24_1_1 LC3_QOS_24_1_1_AC(1) + +#define LC3_QOS_24_1_2_LATENCY 75u +#define LC3_QOS_24_1_2_RTN 13u -#define LC3_QOS_24_1_2 \ +#define LC3_QOS_24_1_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 75u, 45u, 13u) + LC3_QOS_24_1_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_1, \ + LC3_QOS_24_1_2_RTN) +#define LC3_QOS_24_1_2 LC3_QOS_24_1_2_AC(1) + +#define LC3_QOS_24_2_1_LATENCY 10u +#define LC3_QOS_24_2_1_RTN 2u -#define LC3_QOS_24_2_1 \ +#define LC3_QOS_24_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 10u, 60u, 2u) + LC3_QOS_24_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_2, \ + LC3_QOS_24_2_1_RTN) +#define LC3_QOS_24_2_1 LC3_QOS_24_2_1_AC(1) -#define LC3_QOS_24_2_2 \ +#define LC3_QOS_24_2_2_LATENCY 95u +#define LC3_QOS_24_2_2_RTN 13u + +#define LC3_QOS_24_2_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 95u, 60u, 13u) + LC3_QOS_24_2_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_2, \ + LC3_QOS_24_2_2_RTN) +#define LC3_QOS_24_2_2 LC3_QOS_24_2_2_AC(1) -#define LC3_QOS_32_1_1 \ - LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 8u, 60u, 2u) +#define LC3_QOS_32_1_1_LATENCY 8u +#define LC3_QOS_32_1_1_RTN 2u -#define LC3_QOS_32_1_2 \ +#define LC3_QOS_32_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 75u, 60u, 13u) + LC3_QOS_32_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_1_RTN) +#define LC3_QOS_32_1_1 LC3_QOS_32_1_1_AC(1) -#define LC3_QOS_32_2_1 \ - LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 10u, 80u, 2u) +#define LC3_QOS_32_1_2_LATENCY 75u +#define LC3_QOS_32_1_2_RTN 13u -#define LC3_QOS_32_2_2 \ +#define LC3_QOS_32_1_2_AC(_ac) \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_32_1_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_2_RTN) +#define LC3_QOS_32_1_2 LC3_QOS_32_1_2_AC(1) + +#define LC3_QOS_32_1_GS_LATENCY 15u +#define LC3_QOS_32_1_GS_RTN 1u +#define LC3_QOS_32_1_GS \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_32_1_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_GS_RTN) + +#define LC3_QOS_32_1_GR_LATENCY 15u +#define LC3_QOS_32_1_GR_RTN 1u +#define LC3_QOS_32_1_GR_AC(_ac) \ + LC3_QOS_UCAST_7_5_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_32_1_GS_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_GS_RTN) +#define LC3_QOS_32_1_GR LC3_QOS_32_1_GR_AC(1) + +#define LC3_QOS_32_2_1_LATENCY 10u +#define LC3_QOS_32_2_1_RTN 2u + +#define LC3_QOS_32_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 95u, 80u, 13u) + LC3_QOS_32_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_1_RTN) +#define LC3_QOS_32_2_1 LC3_QOS_32_2_1_AC(1) + +#define LC3_QOS_32_2_2_LATENCY 95u +#define LC3_QOS_32_2_2_RTN 13u -#define LC3_QOS_44_1_1 \ +#define LC3_QOS_32_2_2_AC(_ac) \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_32_2_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_2_RTN) +#define LC3_QOS_32_2_2 LC3_QOS_32_2_2_AC(1) + +#define LC3_QOS_32_2_GS_LATENCY 20u +#define LC3_QOS_32_2_GS_RTN 1u +#define LC3_QOS_32_2_GS \ + LC3_QOS_UCAST_10_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_32_2_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_GS_RTN) + +#define LC3_QOS_32_2_GR_LATENCY 20u +#define LC3_QOS_32_2_GR_RTN 1u +#define LC3_QOS_32_2_GR_AC(_ac) \ + LC3_QOS_UCAST_10_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_32_2_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_GR_RTN) +#define LC3_QOS_32_2_GR LC3_QOS_32_2_GR_AC(1) + +#define LC3_QOS_44_1_INTERVAL 8163u +#define LC3_QOS_44_1_1_LATENCY 24u +#define LC3_QOS_44_1_1_RTN 5u + +#define LC3_QOS_44_1_1_AC(_ac) \ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 8163u, 24u, 98u, 5u) + LC3_QOS_44_1_INTERVAL, \ + LC3_QOS_44_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_1_RTN) +#define LC3_QOS_44_1_1 LC3_QOS_44_1_1_AC(1) + +#define LC3_QOS_44_1_2_LATENCY 80u +#define LC3_QOS_44_1_2_RTN 13u -#define LC3_QOS_44_1_2 \ +#define LC3_QOS_44_1_2_AC(_ac) \ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 8163u, 80u, 98u, 13u) + LC3_QOS_44_1_INTERVAL, \ + LC3_QOS_44_1_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_2_RTN) +#define LC3_QOS_44_1_2 LC3_QOS_44_1_2_AC(1) -#define LC3_QOS_44_2_1 \ +#define LC3_QOS_44_2_INTERVAL 10884u +#define LC3_QOS_44_2_1_LATENCY 31u +#define LC3_QOS_44_2_1_RTN 5u + +#define LC3_QOS_44_2_1_AC(_ac) \ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 10884u, 31u, 130u, 5u) + LC3_QOS_44_2_INTERVAL, \ + LC3_QOS_44_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_1_RTN) +#define LC3_QOS_44_2_1 LC3_QOS_44_2_1_AC(1) + +#define LC3_QOS_44_2_2_LATENCY 85u +#define LC3_QOS_44_2_2_RTN 13u -#define LC3_QOS_44_2_2 \ +#define LC3_QOS_44_2_2_AC(_ac) \ LC3_QOS_UCAST_FRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 10884u, 85u, 130u, 13u) + LC3_QOS_44_2_INTERVAL, \ + LC3_QOS_44_2_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_2_RTN) +#define LC3_QOS_44_2_2 LC3_QOS_44_2_2_AC(1) -#define LC3_QOS_48_1_1 \ - LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 15u, 75u, 5u) +#define LC3_QOS_48_1_1_LATENCY 15u +#define LC3_QOS_48_1_1_RTN 5u -#define LC3_QOS_48_1_2 \ +#define LC3_QOS_48_1_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 75u, 75u, 13u) + LC3_QOS_48_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1,\ + LC3_QOS_48_1_1_RTN) +#define LC3_QOS_48_1_1 LC3_QOS_48_1_1_AC(1) -#define LC3_QOS_48_2_1 \ - LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 20u, 100u, 5u) +#define LC3_QOS_48_1_2_LATENCY 75u +#define LC3_QOS_48_1_2_RTN 13u -#define LC3_QOS_48_2_2 \ +#define LC3_QOS_48_1_2_AC(_ac) \ + LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_48_1_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1, \ + LC3_QOS_48_1_2_RTN) +#define LC3_QOS_48_1_2 LC3_QOS_48_1_2_AC(1) + +#define LC3_QOS_48_1_GS_LATENCY 15u +#define LC3_QOS_48_1_GS_RTN 1u + +#define LC3_QOS_48_1_GS \ + LC3_QOS_UCAST_7_5_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_48_1_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_48_1, \ + LC3_QOS_48_1_GS_RTN) + +#define LC3_QOS_48_1_GR_LATENCY 15u +#define LC3_QOS_48_1_GR_RTN 1u + +#define LC3_QOS_48_1_GR_AC(_ac) \ + LC3_QOS_UCAST_7_5_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_48_1_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1, \ + LC3_QOS_48_1_GR_RTN) +#define LC3_QOS_48_1_GR LC3_QOS_48_1_GR_AC(1) + +#define LC3_QOS_48_2_1_LATENCY 20u +#define LC3_QOS_48_2_1_RTN 5u + +#define LC3_QOS_48_2_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 95u, 100u, 13u) + LC3_QOS_48_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_1_RTN) +#define LC3_QOS_48_2_1 LC3_QOS_48_2_1_AC(1) + +#define LC3_QOS_48_2_2_LATENCY 95u +#define LC3_QOS_48_2_2_RTN 13u -#define LC3_QOS_48_3_1 \ +#define LC3_QOS_48_2_2_AC(_ac) \ + LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_48_2_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_2_RTN) +#define LC3_QOS_48_2_2 LC3_QOS_48_2_2_AC(1) + +#define LC3_QOS_48_2_GS_LATENCY 20u +#define LC3_QOS_48_2_GS_RTN 1u + +#define LC3_QOS_48_2_GS \ + LC3_QOS_UCAST_10_UNFRAMED(60000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ + LC3_QOS_48_2_GS_LATENCY, \ + LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_GS_RTN) + +#define LC3_QOS_48_2_GR_LATENCY 20u +#define LC3_QOS_48_2_GR_RTN 1u + +#define LC3_QOS_48_2_GR_AC(_ac) \ + LC3_QOS_UCAST_10_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_48_2_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_GR_RTN) +#define LC3_QOS_48_2_GR LC3_QOS_48_2_GR_AC(1) + +#define LC3_QOS_48_3_1_LATENCY 15u +#define LC3_QOS_48_3_1_RTN 5u + +#define LC3_QOS_48_3_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 15u, 90u, 5u) + LC3_QOS_48_3_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ + LC3_QOS_48_3_1_RTN) +#define LC3_QOS_48_3_1 LC3_QOS_48_3_1_AC(1) -#define LC3_QOS_48_3_2 \ +#define LC3_QOS_48_3_2_LATENCY 75u +#define LC3_QOS_48_3_2_RTN 13u + +#define LC3_QOS_48_3_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 75u, 90u, 13u) + LC3_QOS_48_3_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ + LC3_QOS_48_3_2_RTN) +#define LC3_QOS_48_3_2 LC3_QOS_48_3_2_AC(1) + +#define LC3_QOS_48_3_GR_LATENCY 15u +#define LC3_QOS_48_3_GR_RTN 1u + +#define LC3_QOS_48_3_GR_AC(_ac) \ + LC3_QOS_UCAST_7_5_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_48_3_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ + LC3_QOS_48_3_GR_RTN) +#define LC3_QOS_48_3_GR LC3_QOS_48_3_GR_AC(1) + +#define LC3_QOS_48_4_1_LATENCY 20u +#define LC3_QOS_48_4_1_RTN 5u -#define LC3_QOS_48_4_1 \ +#define LC3_QOS_48_4_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 20u, 120u, 5u) + LC3_QOS_48_4_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ + LC3_QOS_48_4_1_RTN) +#define LC3_QOS_48_4_1 LC3_QOS_48_4_1_AC(1) -#define LC3_QOS_48_4_2 \ +#define LC3_QOS_48_4_2_LATENCY 100u +#define LC3_QOS_48_4_2_RTN 13u + +#define LC3_QOS_48_4_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 100u, 120u, 13u) + LC3_QOS_48_4_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ + LC3_QOS_48_4_2_RTN) +#define LC3_QOS_48_4_2 LC3_QOS_48_4_2_AC(1) + +#define LC3_QOS_48_4_GR_LATENCY 20u +#define LC3_QOS_48_4_GR_RTN 1u + +#define LC3_QOS_48_4_GR_AC(_ac) \ + LC3_QOS_UCAST_10_UNFRAMED(10000u, BT_BAP_CONFIG_LATENCY_LOW, \ + LC3_QOS_48_4_GR_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ + LC3_QOS_48_4_GR_RTN) +#define LC3_QOS_48_4_GR LC3_QOS_48_4_GR_AC(1) + +#define LC3_QOS_48_5_1_LATENCY 15u +#define LC3_QOS_48_5_1_RTN 5u -#define LC3_QOS_48_5_1 \ +#define LC3_QOS_48_5_1_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 15u, 117u, 5u) + LC3_QOS_48_5_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_5, \ + LC3_QOS_48_5_1_RTN) +#define LC3_QOS_48_5_1 LC3_QOS_48_5_1_AC(1) -#define LC3_QOS_48_5_2 \ +#define LC3_QOS_48_5_2_LATENCY 75u +#define LC3_QOS_48_5_2_RTN 13u + +#define LC3_QOS_48_5_2_AC(_ac) \ LC3_QOS_UCAST_7_5_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 75u, 117u, 13u) + LC3_QOS_48_5_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_5, \ + LC3_QOS_48_5_2_RTN) +#define LC3_QOS_48_5_2 LC3_QOS_48_5_2_AC(1) + +#define LC3_QOS_48_6_1_LATENCY 20u +#define LC3_QOS_48_6_1_RTN 5u -#define LC3_QOS_48_6_1 \ +#define LC3_QOS_48_6_1_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 20u, 155u, 5u) + LC3_QOS_48_6_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_6, \ + LC3_QOS_48_6_1_RTN) +#define LC3_QOS_48_6_1 LC3_QOS_48_6_1_AC(1) -#define LC3_QOS_48_6_2 \ +#define LC3_QOS_48_6_2_LATENCY 100u +#define LC3_QOS_48_6_2_RTN 13u + +#define LC3_QOS_48_6_2_AC(_ac) \ LC3_QOS_UCAST_10_UNFRAMED(40000u, BT_BAP_CONFIG_LATENCY_BALANCED, \ - 100u, 155u, 13u) + LC3_QOS_48_6_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_6, \ + LC3_QOS_48_6_2_RTN) +#define LC3_QOS_48_6_2 LC3_QOS_48_6_2_AC(1) + +#define LC3_QOS_BCAST(_frame, _pd, _interval, _lat, _sdu, _rtn) \ +{ \ + .bcast.big = 0x00, \ + .bcast.bis = 0x00, \ + .bcast.framing = _frame, \ + .bcast.delay = _pd, \ + .bcast.io_qos.interval = _interval, \ + .bcast.io_qos.latency = _lat, \ + .bcast.io_qos.sdu = _sdu, \ + .bcast.io_qos.phy = BT_BAP_CONFIG_PHY_2M, \ + .bcast.io_qos.rtn = _rtn, \ +} + +#define LC3_QOS_BCAST_7_5_UNFRAMED(_pd, _lat, _sdu, _rtn) \ + LC3_QOS_BCAST(LC3_QOS_UNFRAMED, _pd, 7500u, _lat, _sdu, _rtn) + +#define LC3_QOS_BCAST_10_UNFRAMED(_pd, _lat, _sdu, _rtn) \ + LC3_QOS_BCAST(LC3_QOS_UNFRAMED, _pd, 10000u, _lat, _sdu, _rtn) + +#define LC3_QOS_BCAST_FRAMED(_pd, _interval, _lat, _sdu, _rtn) \ + LC3_QOS_BCAST(LC3_QOS_FRAMED, _pd, _interval, _lat, _sdu, _rtn) + +#define LC3_QOS_8_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_8_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_1, \ + LC3_QOS_8_1_1_RTN) +#define LC3_QOS_8_1_1_B LC3_QOS_8_1_1_B_AC(1) + +#define LC3_QOS_8_1_2_B_LATENCY 75u +#define LC3_QOS_8_1_2_B_RTN 4u +#define LC3_QOS_8_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_8_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_1, \ + LC3_QOS_8_1_2_B_RTN) +#define LC3_QOS_8_1_2_B LC3_QOS_8_1_2_B_AC(1) + +#define LC3_QOS_8_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_8_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_2, \ + LC3_QOS_8_2_1_RTN) +#define LC3_QOS_8_2_1_B LC3_QOS_8_2_1_B_AC(1) + +#define LC3_QOS_8_2_2_B_LATENCY 60u +#define LC3_QOS_8_2_2_B_RTN 4u +#define LC3_QOS_8_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_8_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_8_2, \ + LC3_QOS_8_2_2_B_RTN) +#define LC3_QOS_8_2_2_B LC3_QOS_8_2_2_B_AC(1) + +#define LC3_QOS_16_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_16_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_1, \ + LC3_QOS_16_1_1_RTN) +#define LC3_QOS_16_1_1_B LC3_QOS_16_1_1_B_AC(1) + +#define LC3_QOS_16_1_2_B_LATENCY 45u +#define LC3_QOS_16_1_2_B_RTN 4u +#define LC3_QOS_16_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_16_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_1, \ + LC3_QOS_16_1_2_B_RTN) +#define LC3_QOS_16_1_2_B LC3_QOS_16_1_2_B_AC(1) + +#define LC3_QOS_16_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_16_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_2, \ + LC3_QOS_16_2_1_RTN) +#define LC3_QOS_16_2_1_B LC3_QOS_16_2_1_B_AC(1) + +#define LC3_QOS_16_2_2_B_LATENCY 60u +#define LC3_QOS_16_2_2_B_RTN 4u +#define LC3_QOS_16_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_16_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_16_2, \ + LC3_QOS_16_2_2_B_RTN) +#define LC3_QOS_16_2_2_B LC3_QOS_16_2_2_B_AC(1) + +#define LC3_QOS_24_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_24_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_1, \ + LC3_QOS_24_1_1_RTN) +#define LC3_QOS_24_1_1_B LC3_QOS_24_1_1_B_AC(1) + +#define LC3_QOS_24_1_2_B_LATENCY 45u +#define LC3_QOS_24_1_2_B_RTN 4u +#define LC3_QOS_24_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_24_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_1, \ + LC3_QOS_24_1_2_B_RTN) +#define LC3_QOS_24_1_2_B LC3_QOS_24_1_2_B_AC(1) + +#define LC3_QOS_24_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_24_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_2, \ + LC3_QOS_24_2_1_RTN) +#define LC3_QOS_24_2_1_B LC3_QOS_24_2_1_B_AC(1) + +#define LC3_QOS_24_2_2_B_LATENCY 60u +#define LC3_QOS_24_2_2_B_RTN 4u +#define LC3_QOS_24_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_24_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_24_2, \ + LC3_QOS_24_2_2_B_RTN) +#define LC3_QOS_24_2_2_B LC3_QOS_24_2_2_B_AC(1) + +#define LC3_QOS_32_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_32_1_1_LATENCY, \ + LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_1_RTN) +#define LC3_QOS_32_1_1_B LC3_QOS_32_1_1_B_AC(1) + +#define LC3_QOS_32_1_2_B_LATENCY 45u +#define LC3_QOS_32_1_2_B_RTN 4u +#define LC3_QOS_32_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_32_1_2_B_LATENCY, \ + LC3_CONFIG_FRAME_LEN_32_1, \ + LC3_QOS_32_1_2_B_RTN) +#define LC3_QOS_32_1_2_B LC3_QOS_32_1_2_B_AC(1) + +#define LC3_QOS_32_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_32_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_1_RTN) +#define LC3_QOS_32_2_1_B LC3_QOS_32_2_1_B_AC(1) + +#define LC3_QOS_32_2_2_B_LATENCY 60u +#define LC3_QOS_32_2_2_B_RTN 4u +#define LC3_QOS_32_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_32_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_32_2, \ + LC3_QOS_32_2_2_B_RTN) +#define LC3_QOS_32_2_2_B LC3_QOS_32_2_2_B_AC(1) + +#define LC3_QOS_44_1_1_B_RTN 4u +#define LC3_QOS_44_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_FRAMED(40000u, LC3_QOS_44_1_INTERVAL, \ + LC3_QOS_44_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_1_B_RTN) +#define LC3_QOS_44_1_1_B LC3_QOS_44_1_1_B_AC(1) + +#define LC3_QOS_44_1_2_B_LATENCY 54u +#define LC3_QOS_44_1_2_B_RTN 4u +#define LC3_QOS_44_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_FRAMED(40000u, LC3_QOS_44_1_INTERVAL, \ + LC3_QOS_44_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_2_B_RTN) +#define LC3_QOS_44_1_2_B LC3_QOS_44_1_2_B_AC(1) + +#define LC3_QOS_44_2_1_B_RTN 4u +#define LC3_QOS_44_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_FRAMED(40000u, LC3_QOS_44_2_INTERVAL, \ + LC3_QOS_44_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_1_B_RTN) +#define LC3_QOS_44_2_1_B LC3_QOS_44_2_1_B_AC(1) + +#define LC3_QOS_44_2_2_B_LATENCY 60u +#define LC3_QOS_44_2_2_B_RTN 4u +#define LC3_QOS_44_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_FRAMED(40000u, LC3_QOS_44_2_INTERVAL, \ + LC3_QOS_44_2_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_2_RTN) +#define LC3_QOS_44_2_2_B LC3_QOS_44_2_2_B_AC(1) + +#define LC3_QOS_48_1_1_B_RTN 4u +#define LC3_QOS_48_1_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_1_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1,\ + LC3_QOS_48_1_1_B_RTN) +#define LC3_QOS_48_1_1_B LC3_QOS_48_1_1_B_AC(1) + +#define LC3_QOS_48_1_2_B_LATENCY 50u +#define LC3_QOS_48_1_2_B_RTN 4u +#define LC3_QOS_48_1_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_1_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_1, \ + LC3_QOS_48_1_2_B_RTN) +#define LC3_QOS_48_1_2_B LC3_QOS_48_1_2_B_AC(1) + +#define LC3_QOS_48_2_1_B_RTN 4u +#define LC3_QOS_48_2_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_2_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_1_B_RTN) +#define LC3_QOS_48_2_1_B LC3_QOS_48_2_1_B_AC(1) + +#define LC3_QOS_48_2_2_B_LATENCY 65u +#define LC3_QOS_48_2_2_B_RTN 4u +#define LC3_QOS_48_2_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_2_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_2, \ + LC3_QOS_48_2_2_B_RTN) +#define LC3_QOS_48_2_2_B LC3_QOS_48_2_2_B_AC(1) + +#define LC3_QOS_48_3_1_B_RTN 4u +#define LC3_QOS_48_3_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_3_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ + LC3_QOS_48_3_1_B_RTN) +#define LC3_QOS_48_3_1_B LC3_QOS_48_3_1_B_AC(1) + +#define LC3_QOS_48_3_2_B_LATENCY 50u +#define LC3_QOS_48_3_2_B_RTN 4u +#define LC3_QOS_48_3_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_3_2_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_3, \ + LC3_QOS_48_3_2_RTN) +#define LC3_QOS_48_3_2_B LC3_QOS_48_3_2_B_AC(1) + +#define LC3_QOS_48_4_1_B_RTN 4u +#define LC3_QOS_48_4_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_4_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ + LC3_QOS_48_4_1_B_RTN) +#define LC3_QOS_48_4_1_B LC3_QOS_48_4_1_B_AC(1) + +#define LC3_QOS_48_4_2_B_LATENCY 65u +#define LC3_QOS_48_4_2_B_RTN 4u +#define LC3_QOS_48_4_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_4_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_4, \ + LC3_QOS_48_4_2_B_RTN) +#define LC3_QOS_48_4_2_B LC3_QOS_48_4_2_B_AC(1) + +#define LC3_QOS_48_5_1_B_RTN 4u +#define LC3_QOS_48_5_1_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_5_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_5, \ + LC3_QOS_48_5_1_B_RTN) +#define LC3_QOS_48_5_1_B LC3_QOS_48_5_1_B_AC(1) + +#define LC3_QOS_48_5_2_B_LATENCY 50u +#define LC3_QOS_48_5_2_B_RTN 4u +#define LC3_QOS_48_5_2_B_AC(_ac) \ + LC3_QOS_BCAST_7_5_UNFRAMED(40000u, LC3_QOS_48_5_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_5, \ + LC3_QOS_48_5_2_B_RTN) +#define LC3_QOS_48_5_2_B LC3_QOS_48_5_2_B_AC(1) + +#define LC3_QOS_48_6_1_B_RTN 5u +#define LC3_QOS_48_6_1_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_6_1_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_6, \ + LC3_QOS_48_6_1_B_RTN) +#define LC3_QOS_48_6_1_B LC3_QOS_48_6_1_B_AC(1) + +#define LC3_QOS_48_6_2_B_LATENCY 65u +#define LC3_QOS_48_6_2_B_RTN 4u +#define LC3_QOS_48_6_2_B_AC(_ac) \ + LC3_QOS_BCAST_10_UNFRAMED(40000u, LC3_QOS_48_6_2_B_LATENCY, \ + (_ac) * LC3_CONFIG_FRAME_LEN_48_6, \ + LC3_QOS_48_6_2_B_RTN) +#define LC3_QOS_48_6_2_B LC3_QOS_48_6_2_B_AC(1)
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/mainloop-notify.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/mainloop-notify.c
Changed
@@ -15,6 +15,7 @@ #define _GNU_SOURCE #include <stdio.h> #include <errno.h> +#include <limits.h> #include <unistd.h> #include <stdlib.h> #include <stddef.h> @@ -130,7 +131,7 @@ fd = io_get_fd(io); result = read(fd, &si, sizeof(si)); - if (result != sizeof(si)) + if (result != sizeof(si) || si.ssi_signo > INT_MAX) return false; if (data && data->func)
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/mcp.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/mcp.c
Changed
@@ -600,6 +600,9 @@ unsigned int bt_mcp_play(struct bt_mcp *mcp) { + if (!mcp) + return 0; + if (!(mcp->session.cp_op_supported & BT_MCS_CMD_PLAY_SUPPORTED)) return -ENOTSUP; @@ -610,6 +613,9 @@ unsigned int bt_mcp_pause(struct bt_mcp *mcp) { + if (!mcp) + return 0; + if (!(mcp->session.cp_op_supported & BT_MCS_CMD_PAUSE_SUPPORTED)) return -ENOTSUP; @@ -620,6 +626,9 @@ unsigned int bt_mcp_stop(struct bt_mcp *mcp) { + if (!mcp) + return 0; + if (!(mcp->session.cp_op_supported & BT_MCS_CMD_STOP_SUPPORTED)) return -ENOTSUP; @@ -628,10 +637,41 @@ return mcp_send(mcp, BT_MCS_CMD_STOP); } +unsigned int bt_mcp_next_track(struct bt_mcp *mcp) +{ + if (!mcp) + return 0; + + if (!(mcp->session.cp_op_supported & BT_MCS_CMD_NEXT_TRACK_SUPPORTED)) + return -ENOTSUP; + + DBG(mcp, "mcp %p", mcp); + + return mcp_send(mcp, BT_MCS_CMD_NEXT_TRACK); +} + +unsigned int bt_mcp_previous_track(struct bt_mcp *mcp) +{ + if (!mcp) + return 0; + + if (!(mcp->session.cp_op_supported & BT_MCS_CMD_PREV_TRACK_SUPPORTED)) + return -ENOTSUP; + + DBG(mcp, "mcp %p", mcp); + + return mcp_send(mcp, BT_MCS_CMD_PREV_TRACK); +} + static void mcp_mp_set_player_name(struct bt_mcp *mcp, const uint8_t *value, uint16_t length) { - struct event_callback *cb = mcp->cb; + struct event_callback *cb; + + if (!mcp) + return; + + cb = mcp->cb; if (cb && cb->cbs && cb->cbs->player_name) cb->cbs->player_name(mcp, value, length); @@ -640,7 +680,12 @@ static void mcp_mp_set_track_title(struct bt_mcp *mcp, const uint8_t *value, uint16_t length) { - struct event_callback *cb = mcp->cb; + struct event_callback *cb; + + if (!mcp) + return; + + cb = mcp->cb; if (cb && cb->cbs && cb->cbs->track_title) cb->cbs->track_title(mcp, value, length); @@ -648,7 +693,12 @@ static void mcp_mp_set_title_duration(struct bt_mcp *mcp, int32_t duration) { - struct event_callback *cb = mcp->cb; + struct event_callback *cb; + + if (!mcp) + return; + + cb = mcp->cb; DBG(mcp, "Track Duration 0x%08x", duration); @@ -658,7 +708,12 @@ static void mcp_mp_set_title_position(struct bt_mcp *mcp, int32_t position) { - struct event_callback *cb = mcp->cb; + struct event_callback *cb; + + if (!mcp) + return; + + cb = mcp->cb; DBG(mcp, "Track Position 0x%08x", position); @@ -668,7 +723,12 @@ static void mcp_mp_set_media_state(struct bt_mcp *mcp, uint8_t state) { - struct event_callback *cb = mcp->cb; + struct event_callback *cb; + + if (!mcp) + return; + + cb = mcp->cb; DBG(mcp, "Media State 0x%02x", state); @@ -1292,6 +1352,9 @@ { struct event_callback *cb; + if (!mcp) + return; + if (mcp->cb) free(mcp->cb); @@ -1377,6 +1440,9 @@ void bt_mcp_register(struct gatt_db *db) { + if (!db) + return; + mcp_db_new(db); } @@ -1384,6 +1450,9 @@ { bt_uuid_t uuid; + if (!mcp) + return false; + DBG(mcp, "mcp %p", mcp); mcp->client = bt_gatt_client_clone(client); @@ -1412,6 +1481,9 @@ void bt_mcp_detach(struct bt_mcp *mcp) { + if (!mcp) + return; + DBG(mcp, "%p", mcp); bt_gatt_client_unref(mcp->client);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/mcp.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/mcp.h
Changed
@@ -59,3 +59,5 @@ unsigned int bt_mcp_play(struct bt_mcp *mcp); unsigned int bt_mcp_pause(struct bt_mcp *mcp); unsigned int bt_mcp_stop(struct bt_mcp *mcp); +unsigned int bt_mcp_next_track(struct bt_mcp *mcp); +unsigned int bt_mcp_previous_track(struct bt_mcp *mcp);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/ringbuf.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/ringbuf.c
Changed
@@ -237,7 +237,7 @@ ringbuf->in_tracing(ringbuf->buffer + offset, end, ringbuf->in_data); - if (len - end > 0) { + if ((size_t) len > end) { /* Put the remainder of string at the beginning */ memcpy(ringbuf->buffer, str + end, len - end);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/shell.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/shell.c
Changed
@@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2017 Intel Corporation. All rights reserved. - * + * Copyright 2024 NXP * */ @@ -258,6 +258,120 @@ } } +static int bt_shell_queue_exec(char *line) +{ + int err; + + /* Queue if already executing */ + if (data.line) { + /* Check if prompt is being held then release using the line */ + if (!bt_shell_release_prompt(line)) + return 0; + queue_push_tail(data.queue, strdup(line)); + return 0; + } + + bt_shell_printf("%s\n", line); + + err = bt_shell_exec(line); + if (!err) + data.line = strdup(line); + + return err; +} + +static bool input_read(struct io *io, void *user_data) +{ + int fd; + char *line = NULL; + size_t len = 0; + ssize_t nread; + + fd = io_get_fd(io); + + if (fd < 0) { + printf("io_get_fd() returned %d\n", fd); + return false; + } + + if (fd == STDIN_FILENO) { + rl_callback_read_char(); + return true; + } + + if (!data.f) { + data.f = fdopen(fd, "r"); + if (!data.f) { + printf("fdopen: %s (%d)\n", strerror(errno), errno); + return false; + } + } + + nread = getline(&line, &len, data.f); + if (nread > 0) { + int err; + + if (linenread - 1 == '\n') + linenread - 1 = '\0'; + + err = bt_shell_queue_exec(line); + if (err < 0) + printf("%s: %s (%d)\n", line, strerror(-err), -err); + } else { + fclose(data.f); + data.f = NULL; + } + + free(line); + + return true; +} + +static bool io_hup(struct io *io, void *user_data) +{ + if (queue_remove(data.inputs, io)) { + if (!queue_isempty(data.inputs)) + return false; + } + + mainloop_quit(); + + return false; +} + +static bool bt_shell_script_attach(int fd) +{ + struct io *io; + + io = io_new(fd); + if (!io) + return false; + + io_set_read_handler(io, input_read, NULL, NULL); + io_set_disconnect_handler(io, io_hup, NULL, NULL); + + queue_push_tail(data.inputs, io); + + return true; +} + +static void cmd_script(int argc, char *argv) +{ + int fd; + + fd = open(argv1, O_RDONLY); + if (fd < 0) { + printf("Unable to open %s: %s (%d)\n", argv1, + strerror(errno), errno); + bt_shell_noninteractive_quit(EXIT_FAILURE); + return; + } + + printf("Running script %s...\n", argv1); + + bt_shell_script_attach(fd); +} + static const struct bt_shell_menu_entry default_menu = { { "back", NULL, cmd_back, "Return to main menu", NULL, NULL, cmd_back_exists }, @@ -271,6 +385,7 @@ "Display help about this program" }, { "export", NULL, cmd_export, "Print environment variables" }, + { "script", "<filename>", cmd_script, "Run script" }, { } }; @@ -638,7 +753,15 @@ bt_shell_printf("%s\n", data.line); if (!bt_shell_release_prompt(data.line)) { - bt_shell_dequeue_exec(); + /* If a prompt was released with this line, + * try to release all the other prompts, + * if any are left. Otherwise, the next + * line will be executed on + * bt_shell_noninteractive_quit. + */ + if (data.saved_prompt) + bt_shell_dequeue_exec(); + return; } @@ -693,6 +816,13 @@ prompt_input(str, func, user_data); free(str); + + if (data.line && !queue_isempty(data.queue)) + /* If a prompt was set to receive input and + * data is already available, try to execute + * the line and release the prompt. + */ + bt_shell_dequeue_exec(); } static void prompt_free(void *data) @@ -738,8 +868,6 @@ static void rl_handler(char *input) { - HIST_ENTRY *last; - if (!input) { rl_insert_text("quit"); rl_redisplay(); @@ -754,14 +882,6 @@ if (!bt_shell_release_prompt(input)) goto done; - last = history_get(history_length + history_base - 1); - /* append only if input is different from previous command */ - if (!last || strcmp(input, last->line)) - add_history(input); - - if (data.monitor) - bt_log_printf(0xffff, data.name, LOG_INFO, "%s", input); - bt_shell_exec(input); done: @@ -1018,18 +1138,6 @@ return matches; } -static bool io_hup(struct io *io, void *user_data) -{ - if (queue_remove(data.inputs, io)) { - if (!queue_isempty(data.inputs)) - return false; - } - - mainloop_quit(); - - return false; -} - static void signal_callback(int signum, void *user_data) { static bool terminated = false; @@ -1194,11 +1302,12 @@ data.mode = 1; goto done; case 's': - if (optarg) + if (optarg && data.init_fd < 0) { data.init_fd = open(optarg, O_RDONLY); - if (data.init_fd < 0) - printf("Unable to open %s: %s (%d)\n", optarg, - strerror(errno), errno); + if (data.init_fd < 0) + printf("Unable to open %s: %s (%d)\n", + optarg, strerror(errno), errno); + } break; case 't': if (optarg) @@ -1225,13 +1334,15 @@ } } - if (c != opt->optionsindex - offset.val) { - usage(argc, argv, opt); - exit(EXIT_SUCCESS); - return; - } + if (opt && index >= 0 && (size_t)index >= offset) { + if (c != opt->optionsindex - offset.val) { + usage(argc, argv, opt); + exit(EXIT_SUCCESS); + return; + } - *opt->optargindex - offset = optarg ? : ""; + *opt->optargindex - offset = optarg ? : ""; + } } index = -1; @@ -1289,36 +1400,23 @@ return status; } -static int bt_shell_queue_exec(char *line) -{ - int err; - - /* Queue if already executing */ - if (data.line) { - /* Check if prompt is being held then release using the line */ - if (!bt_shell_release_prompt(line)) - return 0; - queue_push_tail(data.queue, strdup(line)); - return 0; - } - - bt_shell_printf("%s\n", line); - - err = bt_shell_exec(line); - if (!err) - data.line = strdup(line); - - return err; -} - int bt_shell_exec(const char *input) { + HIST_ENTRY *last; wordexp_t w; int err; if (!input) return 0; + last = history_get(history_length + history_base - 1); + /* append only if input is different from previous command */ + if (!last || strcmp(input, last->line)) + add_history(input); + + if (data.monitor) + bt_log_printf(0xffff, data.name, LOG_INFO, "%s", input); + err = wordexp(input, &w, WRDE_NOCMD); switch (err) { case WRDE_BADCHAR: @@ -1362,7 +1460,9 @@ rl_cleanup(); queue_destroy(data.inputs, NULL); + data.inputs = NULL; queue_destroy(data.queue, free); + data.queue = NULL; queue_destroy(data.prompts, prompt_free); data.prompts = NULL; @@ -1434,48 +1534,6 @@ rl_redisplay(); } -static bool input_read(struct io *io, void *user_data) -{ - int fd; - char *line = NULL; - size_t len = 0; - ssize_t nread; - - fd = io_get_fd(io); - - if (fd == STDIN_FILENO) { - rl_callback_read_char(); - return true; - } - - if (!data.f) { - data.f = fdopen(fd, "r"); - if (!data.f) { - printf("fdopen: %s (%d)\n", strerror(errno), errno); - return false; - } - } - - nread = getline(&line, &len, data.f); - if (nread > 0) { - int err; - - if (linenread - 1 == '\n') - linenread - 1 = '\0'; - - err = bt_shell_queue_exec(line); - if (err < 0) - printf("%s: %s (%d)\n", line, strerror(-err), -err); - } else { - fclose(data.f); - data.f = NULL; - } - - free(line); - - return true; -} - static bool shell_quit(void *data) { mainloop_quit();
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/tester.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/tester.c
Changed
@@ -563,6 +563,38 @@ g_idle_add(done_callback, test); } +void tester_pre_setup_abort(void) +{ + struct test_case *test; + + if (!test_current) + return; + + test = test_current->data; + + if (test->stage != TEST_STAGE_PRE_SETUP) + return; + + if (test->timeout_id > 0) { + timeout_remove(test->timeout_id); + test->timeout_id = 0; + } + + print_progress(test->name, COLOR_YELLOW, "not run"); + + g_idle_add(done_callback, test); +} + +bool tester_pre_setup_skip_by_default(void) +{ + if (!option_prefix && !option_string) { + tester_pre_setup_abort(); + return true; + } + + return false; +} + void tester_setup_complete(void) { struct test_case *test;
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/tester.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/tester.h
Changed
@@ -59,6 +59,8 @@ void tester_pre_setup_complete(void); void tester_pre_setup_failed(void); +void tester_pre_setup_abort(void); +bool tester_pre_setup_skip_by_default(void); void tester_setup_complete(void); void tester_setup_failed(void);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/uhid.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/uhid.c
Changed
@@ -26,11 +26,28 @@ #define UHID_DEVICE_FILE "/dev/uhid" +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif + +struct uhid_replay { + bool active; + struct queue *out; + struct queue *in; + struct queue *rout; + struct queue *rin; +}; + struct bt_uhid { int ref_count; struct io *io; unsigned int notify_id; struct queue *notify_list; + struct queue *input; + uint8_t type; + bool created; + bool started; + struct uhid_replay *replay; }; struct uhid_notify { @@ -40,6 +57,18 @@ void *user_data; }; +static void uhid_replay_free(struct uhid_replay *replay) +{ + if (!replay) + return; + + queue_destroy(replay->rin, NULL); + queue_destroy(replay->in, free); + queue_destroy(replay->rout, NULL); + queue_destroy(replay->out, free); + free(replay); +} + static void uhid_free(struct bt_uhid *uhid) { if (uhid->io) @@ -48,6 +77,11 @@ if (uhid->notify_list) queue_destroy(uhid->notify_list, free); + if (uhid->input) + queue_destroy(uhid->input, free); + + uhid_replay_free(uhid->replay); + free(uhid); } @@ -63,6 +97,42 @@ notify->func(ev, notify->user_data); } +static struct uhid_replay *uhid_replay_new(void) +{ + struct uhid_replay *replay = new0(struct uhid_replay, 1); + + replay->out = queue_new(); + replay->in = queue_new(); + + return replay; +} + +static int bt_uhid_record(struct bt_uhid *uhid, bool input, + struct uhid_event *ev) +{ + if (!uhid) + return -EINVAL; + + /* Capture input events in replay mode and send the next replay event */ + if (uhid->replay && uhid->replay->active && input) { + queue_pop_head(uhid->replay->rin); + bt_uhid_replay(uhid); + return -EALREADY; + } + + if (!uhid->replay) + uhid->replay = uhid_replay_new(); + + if (input) + queue_push_tail(uhid->replay->in, + util_memdup(ev, sizeof(*ev))); + else + queue_push_tail(uhid->replay->out, + util_memdup(ev, sizeof(*ev))); + + return 0; +} + static bool uhid_read_handler(struct io *io, void *user_data) { struct bt_uhid *uhid = user_data; @@ -83,6 +153,13 @@ if ((size_t) len < sizeof(ev.type)) return false; + switch (ev.type) { + case UHID_GET_REPORT: + case UHID_SET_REPORT: + bt_uhid_record(uhid, false, &ev); + break; + } + queue_foreach(uhid->notify_list, notify_handler, &ev); return true; @@ -215,14 +292,11 @@ return true; } -int bt_uhid_send(struct bt_uhid *uhid, const struct uhid_event *ev) +static int uhid_send(struct bt_uhid *uhid, const struct uhid_event *ev) { ssize_t len; struct iovec iov; - if (!uhid->io) - return -ENOTCONN; - iov.iov_base = (void *) ev; iov.iov_len = sizeof(*ev); @@ -233,3 +307,267 @@ /* uHID kernel driver does not handle partial writes */ return len != sizeof(*ev) ? -EIO : 0; } + +int bt_uhid_send(struct bt_uhid *uhid, const struct uhid_event *ev) +{ + if (!uhid || !ev) + return -EINVAL; + + if (!uhid->io) + return -ENOTCONN; + + return uhid_send(uhid, ev); +} + +static bool input_dequeue(const void *data, const void *match_data) +{ + struct uhid_event *ev = (void *)data; + struct bt_uhid *uhid = (void *)match_data; + + return bt_uhid_send(uhid, ev) == 0; +} + +static void uhid_start(struct uhid_event *ev, void *user_data) +{ + struct bt_uhid *uhid = user_data; + + uhid->started = true; + + /* dequeue input events send while UHID_CREATE2 was in progress */ + queue_remove_all(uhid->input, input_dequeue, uhid, free); +} + +int bt_uhid_create(struct bt_uhid *uhid, const char *name, bdaddr_t *src, + bdaddr_t *dst, uint32_t vendor, uint32_t product, + uint32_t version, uint32_t country, uint8_t type, + void *rd_data, size_t rd_size) +{ + struct uhid_event ev; + int err; + + if (!uhid || !name || rd_size > sizeof(ev.u.create2.rd_data)) + return -EINVAL; + + if (uhid->created) + return 0; + + memset(&ev, 0, sizeof(ev)); + ev.type = UHID_CREATE2; + strncpy((char *) ev.u.create2.name, name, + sizeof(ev.u.create2.name) - 1); + if (src) + sprintf((char *)ev.u.create2.phys, + "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", + src->b5, src->b4, src->b3, src->b2, src->b1, + src->b0); + if (dst) + sprintf((char *)ev.u.create2.uniq, + "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", + dst->b5, dst->b4, dst->b3, dst->b2, dst->b1, + dst->b0); + ev.u.create2.vendor = vendor; + ev.u.create2.product = product; + ev.u.create2.version = version; + ev.u.create2.country = country; + ev.u.create2.bus = BUS_BLUETOOTH; + if (rd_size) + memcpy(ev.u.create2.rd_data, rd_data, rd_size); + ev.u.create2.rd_size = rd_size; + + err = bt_uhid_send(uhid, &ev); + if (err) + return err; + + bt_uhid_register(uhid, UHID_START, uhid_start, uhid); + + uhid->created = true; + uhid->started = false; + uhid->type = type; + + return 0; +} + +bool bt_uhid_created(struct bt_uhid *uhid) +{ + if (!uhid) + return false; + + return uhid->created; +} + +bool bt_uhid_started(struct bt_uhid *uhid) +{ + if (!uhid) + return false; + + return uhid->started; +} + +int bt_uhid_input(struct bt_uhid *uhid, uint8_t number, const void *data, + size_t size) +{ + struct uhid_event ev; + struct uhid_input2_req *req = &ev.u.input2; + size_t len = 0; + + if (!uhid) + return -EINVAL; + + memset(&ev, 0, sizeof(ev)); + ev.type = UHID_INPUT2; + + if (number) { + req->datalen++ = number; + req->size = 1 + MIN(size, sizeof(req->data) - 1); + } else + req->size = MIN(size, sizeof(req->data)); + + if (data && size) + memcpy(&req->datalen, data, req->size - len); + + /* Queue events if UHID_START has not been received yet */ + if (!uhid->started) { + if (!uhid->input) + uhid->input = queue_new(); + + queue_push_tail(uhid->input, util_memdup(&ev, sizeof(ev))); + return 0; + } + + return bt_uhid_send(uhid, &ev); +} + +int bt_uhid_set_report_reply(struct bt_uhid *uhid, uint8_t id, uint8_t status) +{ + struct uhid_event ev; + struct uhid_set_report_reply_req *rsp = &ev.u.set_report_reply; + + if (!uhid) + return false; + + memset(&ev, 0, sizeof(ev)); + ev.type = UHID_SET_REPORT_REPLY; + rsp->id = id; + rsp->err = status; + + if (bt_uhid_record(uhid, true, &ev) == -EALREADY) + return 0; + + return bt_uhid_send(uhid, &ev); +} + +int bt_uhid_get_report_reply(struct bt_uhid *uhid, uint8_t id, uint8_t number, + uint8_t status, const void *data, size_t size) +{ + struct uhid_event ev; + struct uhid_get_report_reply_req *rsp = &ev.u.get_report_reply; + size_t len = 0; + + if (!uhid) + return false; + + memset(&ev, 0, sizeof(ev)); + ev.type = UHID_GET_REPORT_REPLY; + rsp->id = id; + rsp->err = status; + + if (!data || !size) + goto done; + + if (number) { + rsp->datalen++ = number; + rsp->size += MIN(size, sizeof(rsp->data) - 1); + } else + rsp->size = MIN(size, sizeof(ev.u.input.data)); + + memcpy(&rsp->datalen, data, rsp->size - len); + +done: + if (bt_uhid_record(uhid, true, &ev) == -EALREADY) + return 0; + + return bt_uhid_send(uhid, &ev); +} + +int bt_uhid_destroy(struct bt_uhid *uhid, bool force) +{ + struct uhid_event ev; + int err; + + if (!uhid) + return -EINVAL; + + /* Force destroy for non-keyboard devices - keyboards are not destroyed + * on disconnect since they can glitch on reconnection losing + * keypresses. + */ + if (!force && uhid->type != BT_UHID_KEYBOARD) + force = true; + + if (!uhid->created || !force) + return 0; + + memset(&ev, 0, sizeof(ev)); + ev.type = UHID_DESTROY; + + err = bt_uhid_send(uhid, &ev); + if (err < 0) + return err; + + uhid->created = false; + uhid_replay_free(uhid->replay); + uhid->replay = NULL; + + return err; +} + +static void queue_append(void *data, void *user_data) +{ + queue_push_tail(user_data, data); +} + +static struct queue *queue_dup(struct queue *q) +{ + struct queue *dup; + + if (!q || queue_isempty(q)) + return NULL; + + dup = queue_new(); + + queue_foreach(q, queue_append, dup); + + return dup; +} + +int bt_uhid_replay(struct bt_uhid *uhid) +{ + struct uhid_event *ev; + + if (!uhid || !uhid->started) + return -EINVAL; + + if (!uhid->replay) + return 0; + + if (uhid->replay->active) + goto resend; + + uhid->replay->active = true; + queue_destroy(uhid->replay->rin, NULL); + uhid->replay->rin = queue_dup(uhid->replay->in); + + queue_destroy(uhid->replay->rout, NULL); + uhid->replay->rout = queue_dup(uhid->replay->out); + +resend: + ev = queue_pop_head(uhid->replay->rout); + if (!ev) { + uhid->replay->active = false; + return 0; + } + + queue_foreach(uhid->notify_list, notify_handler, ev); + + return 0; +}
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/uhid.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/uhid.h
Changed
@@ -11,9 +11,35 @@ #include <stdbool.h> #include <stdint.h> #include <linux/uhid.h> +#include <bluetooth/bluetooth.h> struct bt_uhid; +enum { + BT_UHID_NONE = 0, + BT_UHID_KEYBOARD, + BT_UHID_MOUSE, + BT_UHID_GAMING, + BT_UHID_TABLET +}; + +static inline uint8_t bt_uhid_icon_to_type(const char *icon) +{ + if (!icon) + return BT_UHID_NONE; + + if (!strcmp(icon, "input-keyboard")) + return BT_UHID_KEYBOARD; + else if (!strcmp(icon, "input-mouse")) + return BT_UHID_MOUSE; + else if (!strcmp(icon, "input-gaming")) + return BT_UHID_GAMING; + else if (!strcmp(icon, "input-tablet")) + return BT_UHID_TABLET; + else + return BT_UHID_NONE; +} + struct bt_uhid *bt_uhid_new_default(void); struct bt_uhid *bt_uhid_new(int fd); @@ -29,3 +55,16 @@ bool bt_uhid_unregister_all(struct bt_uhid *uhid); int bt_uhid_send(struct bt_uhid *uhid, const struct uhid_event *ev); +int bt_uhid_create(struct bt_uhid *uhid, const char *name, bdaddr_t *src, + bdaddr_t *dst, uint32_t vendor, uint32_t product, + uint32_t version, uint32_t country, uint8_t type, + void *rd_data, size_t rd_size); +bool bt_uhid_created(struct bt_uhid *uhid); +bool bt_uhid_started(struct bt_uhid *uhid); +int bt_uhid_input(struct bt_uhid *uhid, uint8_t number, const void *data, + size_t size); +int bt_uhid_set_report_reply(struct bt_uhid *uhid, uint8_t id, uint8_t status); +int bt_uhid_get_report_reply(struct bt_uhid *uhid, uint8_t id, uint8_t number, + uint8_t status, const void *data, size_t size); +int bt_uhid_destroy(struct bt_uhid *uhid, bool force); +int bt_uhid_replay(struct bt_uhid *uhid);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/util.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/util.c
Changed
@@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2012-2014 Intel Corporation. All rights reserved. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -175,6 +175,58 @@ return NULL; } +/* Helper to itertate over LTV entries */ +bool util_ltv_foreach(const uint8_t *data, uint8_t len, uint8_t *type, + util_ltv_func_t func, void *user_data) +{ + struct iovec iov; + int i; + + if (!func || !data) + return false; + + iov.iov_base = (void *) data; + iov.iov_len = len; + + for (i = 0; iov.iov_len; i++) { + uint8_t l, t, *v; + + if (!util_iov_pull_u8(&iov, &l)) + return false; + + if (!l) { + func(i, l, 0, NULL, user_data); + continue; + } + + if (!util_iov_pull_u8(&iov, &t)) + return false; + + l--; + + if (l) { + v = util_iov_pull_mem(&iov, l); + if (!v) + return false; + } else + v = NULL; + + if (!type || *type == t) + func(i, l, t, v, user_data); + } + + return true; +} + +/* Helper to add l,t,v data in an iovec struct */ +void util_ltv_push(struct iovec *output, uint8_t l, uint8_t t, void *v) +{ + output->iov_base = realloc(output->iov_base, output->iov_len + l + 2); + util_iov_push_u8(output, l + 1); + util_iov_push_u8(output, t); + util_iov_push_mem(output, l, v); +} + /* Helper to print debug information of LTV entries */ bool util_debug_ltv(const uint8_t *data, uint8_t len, const struct util_ltv_debugger *debugger, size_t num, @@ -484,6 +536,22 @@ return p; } +void *util_iov_append(struct iovec *iov, const void *data, size_t len) +{ + iov->iov_base = realloc(iov->iov_base, iov->iov_len + len); + return util_iov_push_mem(iov, len, data); +} + +struct iovec *util_iov_new(void *data, size_t len) +{ + struct iovec *iov; + + iov = new0(struct iovec, 1); + util_iov_append(iov, data, len); + + return iov; +} + void *util_iov_pull(struct iovec *iov, size_t len) { if (!iov) @@ -1508,9 +1576,23 @@ { 0xfd60, "Sercomm Corporation" }, { 0xfd5f, "Oculus VR, LLC" }, /* SDO defined */ - { 0xfffc, "AirFuel Alliance" }, - { 0xfffe, "Alliance for Wireless Power (A4WP)" }, - { 0xfffd, "Fast IDentity Online Alliance (FIDO)" }, + { 0xfccc, "Wi-Fi Easy Connect Specification" }, + { 0xffef, "Wi-Fi Direct Specification" }, + { 0xfff0, "Public Key Open Credential (PKOC)" }, + { 0xfff1, "ICCE Digital Key" }, + { 0xfff2, "Aliro" }, + { 0xfff3, "FiRa Consortium" }, + { 0xfff4, "FiRa Consortium" }, + { 0xfff5, "Car Connectivity Consortium, LLC" }, + { 0xfff6, "Matter Profile ID" }, + { 0xfff7, "Zigbee Direct" }, + { 0xfff8, "Mopria Alliance BLE" }, + { 0xfff9, "FIDO2 Secure Client-To-Authenticator Transport" }, + { 0xfffa, "ASTM Remote ID" }, + { 0xfffb, "Direct Thread Commissioning" }, + { 0xfffc, "Wireless Power Transfer (WPT)" }, + { 0xfffd, "Universal Second Factor Authenticator" }, + { 0xfffe, "Wireless Power Transfer" }, { } }; @@ -1595,6 +1677,8 @@ { "a6695ace-ee7f-4fb9-881a-5fac66c629af", "BlueZ Offload Codecs"}, { "6fbaf188-05e0-496a-9885-d6ddfdb4e03e", "BlueZ Experimental ISO Socket"}, + { "69518c4c-b69f-4679-8bc1-c021b47b5733", + "BlueZ Experimental Poll Errqueue"}, { } };
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/util.h -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/util.h
Changed
@@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2012-2014 Intel Corporation. All rights reserved. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * * */ @@ -85,7 +85,7 @@ })) #define newa(t, n) ((t*) alloca(sizeof(t)*(n))) -#define malloc0(n) (calloc((n), 1)) +#define malloc0(n) (calloc(1, (n))) char *strdelimit(char *str, char *del, char c); int strsuffix(const char *str, const char *suffix); @@ -134,10 +134,18 @@ util_debug_func_t func, void *user_data); }; +void util_ltv_push(struct iovec *output, uint8_t l, uint8_t t, void *v); + bool util_debug_ltv(const uint8_t *data, uint8_t len, const struct util_ltv_debugger *debugger, size_t num, util_debug_func_t function, void *user_data); +typedef void (*util_ltv_func_t)(size_t i, uint8_t l, uint8_t t, uint8_t *v, + void *user_data); + +bool util_ltv_foreach(const uint8_t *data, uint8_t len, uint8_t *type, + util_ltv_func_t func, void *user_data); + unsigned char util_get_dt(const char *parent, const char *name); ssize_t util_getrandom(void *buf, size_t buflen, unsigned int flags); @@ -145,6 +153,14 @@ uint8_t util_get_uid(uint64_t *bitmap, uint8_t max); void util_clear_uid(uint64_t *bitmap, uint8_t id); +#define util_data(args...) ((const unsigned char) { args }) + +#define UTIL_IOV_INIT(args...) \ +{ \ + .iov_base = (void *)util_data(args), \ + .iov_len = sizeof(util_data(args)), \ +} + struct iovec *util_iov_dup(const struct iovec *iov, size_t cnt); int util_iov_memcmp(const struct iovec *iov1, const struct iovec *iov2); void util_iov_memcpy(struct iovec *iov, void *src, size_t len); @@ -159,6 +175,8 @@ void *util_iov_push_le16(struct iovec *iov, uint16_t val); void *util_iov_push_be16(struct iovec *iov, uint16_t val); void *util_iov_push_u8(struct iovec *iov, uint8_t val); +void *util_iov_append(struct iovec *iov, const void *data, size_t len); +struct iovec *util_iov_new(void *data, size_t len); void *util_iov_pull(struct iovec *iov, size_t len); void *util_iov_pull_mem(struct iovec *iov, size_t len); void *util_iov_pull_le64(struct iovec *iov, uint64_t *val);
View file
_service:tar_scm:bluez-5.71.tar.xz/src/shared/vcp.c -> _service:tar_scm:bluez-5.77.tar.xz/src/shared/vcp.c
Changed
@@ -39,6 +39,9 @@ #define BT_ATT_ERROR_INVALID_CHANGE_COUNTER 0x80 #define BT_ATT_ERROR_OPCODE_NOT_SUPPORTED 0x81 #define BT_ATT_ERROR_VALUE_OUT_OF_RANGE 0x82 +#define BT_ATT_AICS_ERROR_VALUE_OUT_OF_RANGE 0x83 +#define BT_ATT_AICS_ERROR_MUTE_DISABLED 0x82 +#define BT_ATT_AICS_ERROR_GAIN_MODE_CHANGE_NOT_ALLOWED 0x84 #define BT_VCP_NA BIT(0) #define BT_VCP_FRONT_LEFT BIT(1) @@ -70,10 +73,52 @@ #define BT_VCP_LEFT_SURROUND BIT(27) #define BT_VCP_RIGHT_SURROUND BIT(28) +#define VCS_TOTAL_NUM_HANDLES 11 +#define AICS_TOTAL_NUM_HANDLES 16 + +/* AICS Audio Input Type Values */ +#define AICS_AUD_IP_TYPE_UNSPECIFIED 0x00 +#define AICS_AUD_IP_TYPE_BLUETOOTH 0x01 +#define AICS_AUD_IP_TYPE_MICROPHONE 0x02 +#define AICS_AUD_IP_TYPE_ANALOG 0x03 +#define AICS_AUD_IP_TYPE_DIGITAL 0x04 +#define AICS_AUD_IP_TYPE_RADIO 0x05 +#define AICS_AUD_IP_TYPE_STREAMING 0x06 +#define AICS_AUD_IP_TYPE_AMBIENT 0x07 + +/* AICS Audio Input Status Values */ +#define AICS_AUD_IP_STATUS_INACTIVE 0x00 +#define AICS_AUD_IP_STATUS_ACTIVE 0x01 + +/* AICS Audio Input Control Point Opcodes */ +#define BT_AICS_SET_GAIN_SETTING 0x01 +#define BT_AICS_UNMUTE 0x02 +#define BT_AICS_MUTE 0x03 +#define BT_AICS_SET_MANUAL_GAIN_MODE 0x04 +#define BT_AICS_SET_AUTO_GAIN_MODE 0x05 + +/* AICS Gain Mode Field Value */ +#define AICS_GAIN_MODE_MANUAL_ONLY 0x00 +#define AICS_GAIN_MODE_AUTO_ONLY 0x01 +#define AICS_GAIN_MODE_MANUAL 0x02 +#define AICS_GAIN_MODE_AUTO 0x03 + +/* AICS Mute Field Values */ +#define AICS_NOT_MUTED 0x00 +#define AICS_MUTED 0x01 +#define AICS_DISABLED 0x02 + +#define AICS_GAIN_SETTING_UNITS 1 +#define AICS_GAIN_SETTING_MAX_VALUE 127 +#define AICS_GAIN_SETTING_MIN_VALUE -128 + +#define AICS_GAIN_SETTING_DEFAULT_VALUE 88 + struct bt_vcp_db { struct gatt_db *db; struct bt_vcs *vcs; struct bt_vocs *vocs; + struct bt_aics *aics; }; typedef void (*vcp_func_t)(struct bt_vcp *vcp, bool success, uint8_t att_ecode, @@ -138,6 +183,10 @@ unsigned int audio_loc_id; unsigned int ao_dec_id; + unsigned int aics_ip_state_id; + unsigned int aics_ip_status_id; + unsigned int aics_ip_descr_id; + struct queue *notify; struct queue *pending; @@ -190,6 +239,43 @@ struct gatt_db_attribute *voaodec_ccc; }; +struct aud_ip_st { + int8_t gain_setting; + uint8_t mute; + uint8_t gain_mode; + uint8_t chg_counter; +} __packed; + +struct gain_setting_prop { + uint8_t gain_setting_units; + int8_t gain_setting_min; + int8_t gain_setting_max; +} __packed; + +struct bt_aics_set_gain_setting { + uint8_t change_counter; + int8_t gain_setting; +} __packed; + +struct bt_aics { + struct bt_vcp_db *vdb; + struct aud_ip_st *aud_ipst; + struct gain_setting_prop *gain_settingprop; + uint8_t aud_input_type; + uint8_t aud_input_status; + char *aud_input_descr; + struct gatt_db_attribute *service; + struct gatt_db_attribute *aud_ip_state; + struct gatt_db_attribute *aud_ip_state_ccc; + struct gatt_db_attribute *gain_stting_prop; + struct gatt_db_attribute *aud_ip_type; + struct gatt_db_attribute *aud_ip_status; + struct gatt_db_attribute *aud_ip_status_ccc; + struct gatt_db_attribute *aud_ip_cp; + struct gatt_db_attribute *aud_ip_dscrptn; + struct gatt_db_attribute *aud_ip_dscrptn_ccc; +}; + static struct queue *vcp_db; static struct queue *vcp_cbs; static struct queue *sessions; @@ -268,6 +354,20 @@ return vcp->rdb->vocs; } +static struct bt_aics *vcp_get_aics(struct bt_vcp *vcp) +{ + if (!vcp) + return NULL; + + if (vcp->rdb->aics) + return vcp->rdb->aics; + + vcp->rdb->aics = new0(struct bt_aics, 1); + vcp->rdb->aics->vdb = vcp->rdb; + + return vcp->rdb->aics; +} + static void vcp_detached(void *data, void *user_data) { struct bt_vcp_cb *cb = data; @@ -298,6 +398,7 @@ free(vdb->vcs); free(vdb->vocs); + free(vdb->aics); free(vdb); } @@ -986,6 +1087,488 @@ iov.iov_len); } +static void aics_input_state_read(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offset, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + struct bt_aics *aics = user_data; + struct iovec iov; + + iov.iov_base = aics->aud_ipst; + iov.iov_len = sizeof(*aics->aud_ipst); + + gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base, + iov.iov_len); +} + +static void aics_gain_setting_prop_read(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offset, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + struct bt_aics *aics = user_data; + struct iovec iov; + + iov.iov_base = aics->gain_settingprop; + iov.iov_len = sizeof(*aics->gain_settingprop); + + gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base, + iov.iov_len); +} + +static void aics_audio_input_type_read(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offset, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + struct bt_aics *aics = user_data; + struct iovec iov; + + iov.iov_base = &aics->aud_input_type; + iov.iov_len = sizeof(aics->aud_input_type); + + gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base, + iov.iov_len); +} + +static void aics_input_status_read(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offset, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + struct bt_aics *aics = user_data; + struct iovec iov; + + iov.iov_base = &aics->aud_input_status; + iov.iov_len = sizeof(aics->aud_input_status); + + gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base, + iov.iov_len); +} + +static struct aud_ip_st *vdb_get_audipst(struct bt_vcp_db *vdb) +{ + if (!vdb->aics) + return NULL; + + if (vdb->aics->aud_ipst) + return vdb->aics->aud_ipst; + + return NULL; +} + +static struct gain_setting_prop *vdb_get_gainsettingprop( + struct bt_vcp_db *vdb) +{ + if (!vdb->aics) + return NULL; + + if (vdb->aics->gain_settingprop) + return vdb->aics->gain_settingprop; + + return NULL; +} + +static uint8_t aics_set_gain_setting(struct bt_aics *aics, + struct bt_vcp *vcp, struct iovec *iov) +{ + struct bt_vcp_db *vdb; + struct aud_ip_st *audipst; + struct bt_aics_set_gain_setting *req; + struct gain_setting_prop *gainsettngprop; + uint8_t ret = 1; + + vdb = vcp_get_vdb(vcp); + if (!vdb) { + DBG(vcp, "error: VDB not available"); + ret = 0; + goto respond; + } + + audipst = vdb_get_audipst(vdb); + if (!audipst) { + DBG(vcp, "error: Audio Input State value is not available"); + ret = 0; + goto respond; + + } + + req = iov_pull_mem(iov, sizeof(*req)); + if (!req) { + ret = 0; + goto respond; + + } + + if (req->change_counter != audipst->chg_counter) { + DBG(vcp, "Change Counter Mismatch Audio Input State!"); + ret = BT_ATT_ERROR_INVALID_CHANGE_COUNTER; + goto respond; + } + + if (audipst->gain_mode != AICS_GAIN_MODE_MANUAL_ONLY && + audipst->gain_mode != AICS_GAIN_MODE_MANUAL) { + DBG(vcp, "Gain Mode is not Manual only or Manual"); + ret = BT_ATT_AICS_ERROR_GAIN_MODE_CHANGE_NOT_ALLOWED; + goto respond; + } + + gainsettngprop = vdb_get_gainsettingprop(vdb); + if (req->gain_setting > gainsettngprop->gain_setting_max || + req->gain_setting < gainsettngprop->gain_setting_min) { + DBG(vcp, "error: Value Out of Range"); + ret = BT_ATT_AICS_ERROR_VALUE_OUT_OF_RANGE; + goto respond; + } + + audipst->gain_setting = req->gain_setting; + /*Increment Change Counter*/ + audipst->chg_counter = -~audipst->chg_counter; + gatt_db_attribute_notify(vdb->aics->aud_ip_state, (void *)audipst, + sizeof(struct aud_ip_st), + bt_vcp_get_att(vcp)); + ret = 0; + +respond: + return ret; +} + +static uint8_t aics_unmute(struct bt_aics *aics, struct bt_vcp *vcp, + struct iovec *iov) +{ + struct bt_vcp_db *vdb; + struct aud_ip_st *audipst; + uint8_t *change_counter; + uint8_t ret = 1; + + vdb = vcp_get_vdb(vcp); + if (!vdb) { + DBG(vcp, "error: VDB not available"); + ret = 0; + goto respond; + + } + + audipst = vdb_get_audipst(vdb); + if (!audipst) { + DBG(vcp, "error: Audio Input State value is not available"); + ret = 0; + goto respond; + + } + change_counter = iov_pull_mem(iov, sizeof(*change_counter)); + if (!change_counter) { + ret = 0; + goto respond; + + } + + if (*change_counter != audipst->chg_counter) { + DBG(vcp, "Change Counter Mismatch Audio Input State!"); + ret = BT_ATT_ERROR_INVALID_CHANGE_COUNTER; + goto respond; + } + + if (audipst->mute == AICS_DISABLED) { + DBG(vcp, "Mute state is Disabled!"); + ret = BT_ATT_AICS_ERROR_MUTE_DISABLED; + goto respond; + } + + audipst->mute = AICS_NOT_MUTED; + /*Increment Change Counter*/ + audipst->chg_counter = -~audipst->chg_counter; + gatt_db_attribute_notify(vdb->aics->aud_ip_state, (void *)audipst, + sizeof(struct aud_ip_st), + bt_vcp_get_att(vcp)); + ret = 0; + +respond: + return ret; +} + +static uint8_t aics_mute(struct bt_aics *aics, struct bt_vcp *vcp, + struct iovec *iov) +{ + struct bt_vcp_db *vdb; + struct aud_ip_st *audipst; + uint8_t *change_counter; + uint8_t ret = 1; + + vdb = vcp_get_vdb(vcp); + if (!vdb) { + DBG(vcp, "error: VDB not available"); + ret = 0; + goto respond; + } + + audipst = vdb_get_audipst(vdb); + if (!audipst) { + DBG(vcp, "error: Audio Input State value is not available"); + ret = 0; + goto respond; + } + change_counter = iov_pull_mem(iov, sizeof(*change_counter)); + if (!change_counter) { + ret = 0; + goto respond; + } + + if (*change_counter != audipst->chg_counter) { + DBG(vcp, "Change Counter Mismatch Audio Input State!"); + ret = BT_ATT_ERROR_INVALID_CHANGE_COUNTER; + goto respond; + } + + if (audipst->mute == AICS_DISABLED) { + DBG(vcp, "Mute state is Disabled!"); + ret = BT_ATT_AICS_ERROR_MUTE_DISABLED; + goto respond; + } + + audipst->mute = AICS_MUTED; + /*Increment Change Counter*/ + audipst->chg_counter = -~audipst->chg_counter; + gatt_db_attribute_notify(vdb->aics->aud_ip_state, (void *)audipst, + sizeof(struct aud_ip_st), + bt_vcp_get_att(vcp)); + ret = 0; + +respond: + return ret; +} + +static uint8_t aics_set_manual_gain_mode(struct bt_aics *aics, + struct bt_vcp *vcp, struct iovec *iov) +{ + struct bt_vcp_db *vdb; + struct aud_ip_st *audipst; + uint8_t *change_counter; + uint8_t ret = 1; + + vdb = vcp_get_vdb(vcp); + if (!vdb) { + DBG(vcp, "error: VDB not available"); + ret = 0; + goto respond; + } + + audipst = vdb_get_audipst(vdb); + if (!audipst) { + DBG(vcp, "error: Audio Input State value is not available"); + ret = 0; + goto respond; + } + + change_counter = iov_pull_mem(iov, sizeof(*change_counter)); + if (!change_counter) { + ret = 0; + goto respond; + } + + if (*change_counter != audipst->chg_counter) { + DBG(vcp, "Change Counter Mismatch Audio Input State!"); + ret = BT_ATT_ERROR_INVALID_CHANGE_COUNTER; + goto respond; + } + + if (audipst->gain_mode == AICS_GAIN_MODE_AUTO_ONLY || + audipst->gain_mode == AICS_GAIN_MODE_MANUAL_ONLY) { + DBG(vcp, "error!! gain mode is Automatic only or Manual only"); + ret = BT_ATT_AICS_ERROR_GAIN_MODE_CHANGE_NOT_ALLOWED; + goto respond; + } + + if (audipst->gain_mode == AICS_GAIN_MODE_AUTO) { + audipst->gain_mode = AICS_GAIN_MODE_MANUAL; + /*Increment Change Counter*/ + audipst->chg_counter = -~audipst->chg_counter; + gatt_db_attribute_notify(vdb->aics->aud_ip_state, + (void *)audipst, + sizeof(struct aud_ip_st), + bt_vcp_get_att(vcp)); + ret = 0; + } else { + DBG(vcp, + "error!! Gain mode field value not Automatic"); + ret = BT_ATT_AICS_ERROR_GAIN_MODE_CHANGE_NOT_ALLOWED; + } + +respond: + return ret; +} + +static uint8_t aics_set_auto_gain_mode(struct bt_aics *aics, struct bt_vcp *vcp, + struct iovec *iov) +{ + struct bt_vcp_db *vdb; + struct aud_ip_st *audipst; + uint8_t *change_counter; + uint8_t ret = 1; + + vdb = vcp_get_vdb(vcp); + if (!vdb) { + DBG(vcp, "error: VDB not available"); + ret = 0; + goto respond; + } + + audipst = vdb_get_audipst(vdb); + if (!audipst) { + DBG(vcp, "error: Audio Input State value is not available"); + ret = 0; + goto respond; + } + change_counter = iov_pull_mem(iov, sizeof(*change_counter)); + if (!change_counter) { + ret = 0; + goto respond; + } + + if (*change_counter != audipst->chg_counter) { + DBG(vcp, "Change Counter Mismatch Audio Input State!"); + ret = BT_ATT_ERROR_INVALID_CHANGE_COUNTER; + goto respond; + } + + if (audipst->gain_mode == AICS_GAIN_MODE_AUTO_ONLY || + audipst->gain_mode == AICS_GAIN_MODE_MANUAL_ONLY) { + DBG(vcp, "error!! gain mode is Automatic only or Manual only"); + ret = BT_ATT_AICS_ERROR_GAIN_MODE_CHANGE_NOT_ALLOWED; + goto respond; + } + + if (audipst->gain_mode == AICS_GAIN_MODE_MANUAL) { + audipst->gain_mode = AICS_GAIN_MODE_AUTO; + /*Increment Change Counter*/ + audipst->chg_counter = -~audipst->chg_counter; + gatt_db_attribute_notify(vdb->aics->aud_ip_state, + (void *)audipst, + sizeof(struct aud_ip_st), bt_vcp_get_att(vcp)); + ret = 0; + } else { + DBG(vcp, "error!! Gain mode field value is not Manual"); + ret = BT_ATT_AICS_ERROR_GAIN_MODE_CHANGE_NOT_ALLOWED; + } + +respond: + return ret; +} + +#define AICS_OP(_str, _op, _size, _func) \ + { \ + .str = _str, \ + .op = _op, \ + .size = _size, \ + .func = _func, \ + } + +struct aics_op_handler { + const char *str; + uint8_t op; + size_t size; + uint8_t (*func)(struct bt_aics *aics, struct bt_vcp *vcp, + struct iovec *iov); +} aics_handlers = { + AICS_OP("Set Gain Setting", BT_AICS_SET_GAIN_SETTING, + sizeof(struct bt_aics_set_gain_setting), + aics_set_gain_setting), + AICS_OP("Unmute", BT_AICS_UNMUTE, + sizeof(uint8_t), aics_unmute), + AICS_OP("Mute", BT_AICS_MUTE, + sizeof(uint8_t), aics_mute), + AICS_OP("Set Manual Gain Mode", BT_AICS_SET_MANUAL_GAIN_MODE, + sizeof(uint8_t), aics_set_manual_gain_mode), + AICS_OP("Set Automatic Gain Mode", BT_AICS_SET_AUTO_GAIN_MODE, + sizeof(uint8_t), aics_set_auto_gain_mode), + {} +}; + +static void aics_ip_cp_write(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offset, + const uint8_t *value, size_t len, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + struct bt_aics *aics = user_data; + struct bt_vcp *vcp = vcp_get_session(att, aics->vdb->db); + struct iovec iov = { + .iov_base = (void *) value, + .iov_len = len, + }; + uint8_t *aics_op; + struct aics_op_handler *handler; + uint8_t ret = BT_ATT_ERROR_REQUEST_NOT_SUPPORTED; + + DBG(vcp, "AICS Control Point Write"); + + if (offset) { + DBG(vcp, "invalid offset %d", offset); + ret = BT_ATT_ERROR_INVALID_OFFSET; + goto respond; + } + + if (len < sizeof(*aics_op)) { + DBG(vcp, "invalid len %ld < %ld sizeof(*param)", len, + sizeof(*aics_op)); + ret = BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN; + goto respond; + } + + aics_op = iov_pull_mem(&iov, sizeof(*aics_op)); + + for (handler = aics_handlers; handler && handler->str; handler++) { + if (handler->op != *aics_op) + continue; + + if (iov.iov_len < handler->size) { + DBG(vcp, "invalid len %ld < %ld handler->size", len, + handler->size); + ret = BT_ATT_ERROR_OPCODE_NOT_SUPPORTED; + goto respond; + } + + break; + } + + if (handler && handler->str) { + DBG(vcp, "%s", handler->str); + + ret = handler->func(aics, vcp, &iov); + } else { + DBG(vcp, "Unknown opcode 0x%02x", *aics_op); + ret = BT_ATT_ERROR_OPCODE_NOT_SUPPORTED; + } + +respond: + gatt_db_attribute_write_result(attrib, id, ret); +} + +static void aics_input_descr_read(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offset, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + struct bt_aics *aics = user_data; + struct iovec iov; + + iov.iov_base = aics->aud_input_descr; + iov.iov_len = strlen(aics->aud_input_descr); + + gatt_db_attribute_read_result(attrib, id, 0, iov.iov_base, + iov.iov_len); +} + +static void aics_input_descr_write(struct gatt_db_attribute *attrib, + unsigned int id, uint16_t offset, + const uint8_t *value, size_t len, + uint8_t opcode, struct bt_att *att, + void *user_data) +{ + /* TODO : AICS optional feature */ +} + static struct bt_vcs *vcs_new(struct gatt_db *db, struct bt_vcp_db *vdb) { struct bt_vcs *vcs; @@ -1004,9 +1587,12 @@ /* Populate DB with VCS attributes */ bt_uuid16_create(&uuid, VCS_UUID); - vcs->service = gatt_db_add_service(db, &uuid, true, 10); + vcs->service = gatt_db_add_service(db, &uuid, true, + VCS_TOTAL_NUM_HANDLES); gatt_db_service_add_included(vcs->service, vdb->vocs->service); gatt_db_service_set_active(vdb->vocs->service, true); + gatt_db_service_add_included(vcs->service, vdb->aics->service); + gatt_db_service_set_active(vdb->aics->service, true); bt_uuid16_create(&uuid, VOL_STATE_CHRC_UUID); vcs->vs = gatt_db_service_add_characteristic(vcs->service, @@ -1115,6 +1701,108 @@ return vocs; } +static struct bt_aics *aics_new(struct gatt_db *db) +{ + struct bt_aics *aics; + struct aud_ip_st *aics_aud_ip_st; + struct gain_setting_prop *aics_gain_settng_prop; + char *ip_descr; + char ip_descr_str = "Blueooth"; + bt_uuid_t uuid; + + if (!db) + return NULL; + + aics = new0(struct bt_aics, 1); + + aics_aud_ip_st = new0(struct aud_ip_st, 1); + aics_gain_settng_prop = new0(struct gain_setting_prop, 1); + ip_descr = malloc(256); + memset(ip_descr, 0, 256); + + aics_aud_ip_st->mute = AICS_NOT_MUTED; + aics_aud_ip_st->gain_mode = AICS_GAIN_MODE_MANUAL; + aics_aud_ip_st->gain_setting = AICS_GAIN_SETTING_DEFAULT_VALUE; + aics->aud_ipst = aics_aud_ip_st; + aics_gain_settng_prop->gain_setting_units = AICS_GAIN_SETTING_UNITS; + aics_gain_settng_prop->gain_setting_max = AICS_GAIN_SETTING_MAX_VALUE; + aics_gain_settng_prop->gain_setting_min = AICS_GAIN_SETTING_MIN_VALUE; + aics->gain_settingprop = aics_gain_settng_prop; + aics->aud_input_type = AICS_AUD_IP_TYPE_BLUETOOTH; + aics->aud_input_status = AICS_AUD_IP_STATUS_ACTIVE; + memcpy(ip_descr, ip_descr_str, strlen(ip_descr_str)); + aics->aud_input_descr = ip_descr; + + /* Populate DB with AICS attributes */ + bt_uuid16_create(&uuid, AUDIO_INPUT_CS_UUID); + aics->service = gatt_db_add_service(db, &uuid, false, + AICS_TOTAL_NUM_HANDLES); + + bt_uuid16_create(&uuid, AICS_INPUT_STATE_CHAR_UUID); + aics->aud_ip_state = gatt_db_service_add_characteristic(aics->service, + &uuid, + BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + aics_input_state_read, + NULL, + aics); + aics->aud_ip_state_ccc = gatt_db_service_add_ccc(aics->service, + BT_ATT_PERM_READ | BT_ATT_PERM_WRITE); + + bt_uuid16_create(&uuid, AICS_GAIN_SETTING_PROP_CHAR_UUID); + aics->gain_stting_prop = gatt_db_service_add_characteristic( + aics->service, + &uuid, + BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ, + aics_gain_setting_prop_read, NULL, + aics); + + bt_uuid16_create(&uuid, AICS_AUDIO_INPUT_TYPE_CHAR_UUID); + aics->aud_ip_type = gatt_db_service_add_characteristic(aics->service, + &uuid, + BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ, + aics_audio_input_type_read, NULL, + aics); + + bt_uuid16_create(&uuid, AICS_INPUT_STATUS_CHAR_UUID); + aics->aud_ip_status = gatt_db_service_add_characteristic(aics->service, + &uuid, + BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY, + aics_input_status_read, NULL, + aics); + aics->aud_ip_status_ccc = gatt_db_service_add_ccc(aics->service, + BT_ATT_PERM_READ | BT_ATT_PERM_WRITE); + + bt_uuid16_create(&uuid, AICS_AUDIO_INPUT_CP_CHRC_UUID); + aics->aud_ip_cp = gatt_db_service_add_characteristic(aics->service, + &uuid, + BT_ATT_PERM_WRITE, + BT_GATT_CHRC_PROP_WRITE, + NULL, aics_ip_cp_write, + aics); + + bt_uuid16_create(&uuid, AICS_INPUT_DESCR_CHAR_UUID); + aics->aud_ip_dscrptn = gatt_db_service_add_characteristic(aics->service, + &uuid, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP | + BT_GATT_CHRC_PROP_NOTIFY, + aics_input_descr_read, + aics_input_descr_write, + aics); + aics->aud_ip_dscrptn_ccc = gatt_db_service_add_ccc(aics->service, + BT_ATT_PERM_READ | BT_ATT_PERM_WRITE); + + return aics; +} + static struct bt_vcp_db *vcp_db_new(struct gatt_db *db) { struct bt_vcp_db *vdb; @@ -1130,6 +1818,10 @@ vdb->vocs = vocs_new(db); vdb->vocs->vdb = vdb; + + vdb->aics = aics_new(db); + vdb->aics->vdb = vdb; + vdb->vcs = vcs_new(db, vdb); vdb->vcs->vdb = vdb; @@ -1689,6 +2381,307 @@ } +static void read_aics_audio_ip_state(struct bt_vcp *vcp, bool success, + uint8_t att_ecode, + const uint8_t *value, uint16_t length, + void *user_data) +{ + struct aud_ip_st *ip_st; + struct iovec iov = { + .iov_base = (void *) value, + .iov_len = length, + }; + + if (!success) { + DBG(vcp, "Unable to read Audio Input State: error 0x%02x", + att_ecode); + return; + } + + ip_st = iov_pull_mem(&iov, sizeof(*ip_st)); + if (!ip_st) { + DBG(vcp, "Unable to get Audio Input State"); + return; + } + + DBG(vcp, "Audio Input State, Gain Setting:%d", ip_st->gain_setting); + DBG(vcp, "Audio Input State, Mute:%x", ip_st->mute); + DBG(vcp, "Audio Input State, Gain Mode:%x", ip_st->gain_mode); + DBG(vcp, "Audio Input State, Change Counter:%x", ip_st->chg_counter); +} + +static void aics_ip_state_notify(struct bt_vcp *vcp, uint16_t value_handle, + const uint8_t *value, uint16_t length, + void *user_data) +{ + struct aud_ip_st ip_st; + + memcpy(&ip_st, value, sizeof(struct aud_ip_st)); + + DBG(vcp, "Audio Input State, Gain Setting:%d", ip_st.gain_setting); + DBG(vcp, "Audio Input State, Mute:%x", ip_st.mute); + DBG(vcp, "Audio Input State, Gain Mode:%x", ip_st.gain_mode); + DBG(vcp, "Audio Input State, Change Counter:%x", ip_st.chg_counter); +} + +static void read_aics_gain_setting_prop(struct bt_vcp *vcp, bool success, + uint8_t att_ecode, + const uint8_t *value, uint16_t length, + void *user_data) +{ + struct gain_setting_prop *aics_gain_setting_prop; + struct iovec iov = { + .iov_base = (void *) value, + .iov_len = length, + }; + + if (!value) { + DBG(vcp, "Unable to get Gain Setting Properties Char"); + return; + } + + if (!success) { + DBG(vcp, + "Unable to read Gain Setting Properties Char: 0x%02x", + att_ecode); + return; + } + + aics_gain_setting_prop = iov_pull_mem(&iov, + sizeof(*aics_gain_setting_prop)); + if (!aics_gain_setting_prop) { + DBG(vcp, "Unable to get Gain Setting Properties Char"); + return; + } + + DBG(vcp, "Gain Setting Properties, Units: %x", + aics_gain_setting_prop->gain_setting_units); + DBG(vcp, "Gain Setting Properties, Min Value: %d", + aics_gain_setting_prop->gain_setting_min); + DBG(vcp, "Gain Setting Properties, Max Value: %d", + aics_gain_setting_prop->gain_setting_max); +} + +static void read_aics_aud_ip_type(struct bt_vcp *vcp, bool success, + uint8_t att_ecode, + const uint8_t *value, uint16_t length, + void *user_data) +{ + uint8_t ip_type; + + if (!success) { + DBG(vcp, + "Unable to read Audio Input Type Char: error 0x%02x", + att_ecode); + return; + } + + memcpy(&ip_type, value, length); + + DBG(vcp, "Audio Input Type : %x", ip_type); +} + +static void read_aics_audio_ip_status(struct bt_vcp *vcp, bool success, + uint8_t att_ecode, + const uint8_t *value, uint16_t length, + void *user_data) +{ + uint8_t ip_status; + + if (!success) { + DBG(vcp, + "Unable to read Audio Input Status Char: 0x%02x", att_ecode); + return; + } + + memcpy(&ip_status, value, length); + + DBG(vcp, "Audio Input Status : %x", ip_status); +} + +static void aics_ip_status_notify(struct bt_vcp *vcp, uint16_t value_handle, + const uint8_t *value, + uint16_t length, + void *user_data) +{ + uint8_t ip_status; + + memcpy(&ip_status, value, length); + + DBG(vcp, "Audio Input Status, %x", ip_status); +} + +static void read_aics_audio_ip_description(struct bt_vcp *vcp, bool success, + uint8_t att_ecode, + const uint8_t *value, + uint16_t length, + void *user_data) +{ + char *ip_descrptn; + + if (!value) { + DBG(vcp, "Unable to get Audio Input Description"); + return; + } + + if (!success) { + DBG(vcp, + "Unable to read Audio Input Description Char: error 0x%02x", + att_ecode); + return; + } + + ip_descrptn = malloc(length+1); + memset(ip_descrptn, 0, length+1); + memcpy(ip_descrptn, value, length); + + if (!ip_descrptn) { + DBG(vcp, "Unable to get Audio Input Description"); + return; + } + + DBG(vcp, "Audio Input Description: %s", ip_descrptn); + free(ip_descrptn); + ip_descrptn = NULL; +} + +static void aics_audio_ip_desr_notify(struct bt_vcp *vcp, uint16_t value_handle, + const uint8_t *value, uint16_t length, + void *user_data) +{ + char *aud_ip_desr; + + aud_ip_desr = malloc(length+1); + memset(aud_ip_desr, 0, length+1); + memcpy(aud_ip_desr, value, length); + + DBG(vcp, "Audio Input Description Notify, %s", aud_ip_desr); + free(aud_ip_desr); + aud_ip_desr = NULL; +} + +static void foreach_aics_char(struct gatt_db_attribute *attr, void *user_data) +{ + struct bt_vcp *vcp = user_data; + uint16_t value_handle; + bt_uuid_t uuid, uuid_ipstate, uuid_gain_setting_prop, uuid_ip_type, + uuid_ip_status, uuid_ip_cp, uuid_ip_decs; + struct bt_aics *aics; + + if (!gatt_db_attribute_get_char_data(attr, NULL, &value_handle, + NULL, NULL, &uuid)) + return; + + bt_uuid16_create(&uuid_ipstate, AICS_INPUT_STATE_CHAR_UUID); + bt_uuid16_create(&uuid_gain_setting_prop, + AICS_GAIN_SETTING_PROP_CHAR_UUID); + bt_uuid16_create(&uuid_ip_type, AICS_AUDIO_INPUT_TYPE_CHAR_UUID); + bt_uuid16_create(&uuid_ip_status, AICS_INPUT_STATUS_CHAR_UUID); + bt_uuid16_create(&uuid_ip_cp, AICS_AUDIO_INPUT_CP_CHRC_UUID); + bt_uuid16_create(&uuid_ip_decs, AICS_INPUT_DESCR_CHAR_UUID); + + + if (!bt_uuid_cmp(&uuid, &uuid_ipstate)) { + DBG(vcp, + "AICS Audio Input State Char found: handle 0x%04x", + value_handle); + + aics = vcp_get_aics(vcp); + if (!aics || aics->aud_ip_state) + return; + + aics->aud_ip_state = attr; + + vcp_read_value(vcp, value_handle, + read_aics_audio_ip_state, vcp); + + vcp->aics_ip_state_id = vcp_register_notify(vcp, value_handle, + aics_ip_state_notify, NULL); + + return; + } + + if (!bt_uuid_cmp(&uuid, &uuid_gain_setting_prop)) { + DBG(vcp, + "AICS Gain Setting Properties Char found: handle 0x%04x", + value_handle); + + aics = vcp_get_aics(vcp); + if (!aics || aics->gain_stting_prop) + return; + + aics->gain_stting_prop = attr; + + vcp_read_value(vcp, value_handle, read_aics_gain_setting_prop, + vcp); + return; + } + + if (!bt_uuid_cmp(&uuid, &uuid_ip_type)) { + DBG(vcp, "AICS Audio Input Type Char found: handle 0x%04x", + value_handle); + + aics = vcp_get_aics(vcp); + if (!aics || aics->aud_ip_type) + return; + + aics->aud_ip_type = attr; + + vcp_read_value(vcp, value_handle, read_aics_aud_ip_type, + vcp); + return; + } + + if (!bt_uuid_cmp(&uuid, &uuid_ip_status)) { + DBG(vcp, + "AICS Audio Input Status Char found: handle 0x%04x", + value_handle); + + aics = vcp_get_aics(vcp); + if (!aics || aics->aud_ip_status) + return; + + aics->aud_ip_status = attr; + + vcp_read_value(vcp, value_handle, + read_aics_audio_ip_status, vcp); + + vcp->aics_ip_status_id = vcp_register_notify(vcp, value_handle, + aics_ip_status_notify, NULL); + + return; + } + + if (!bt_uuid_cmp(&uuid, &uuid_ip_cp)) { + DBG(vcp, "AICS Input CP found: handle 0x%04x", value_handle); + + aics = vcp_get_aics(vcp); + if (!aics || aics->aud_ip_cp) + return; + + aics->aud_ip_cp = attr; + + return; + } + + if (!bt_uuid_cmp(&uuid, &uuid_ip_decs)) { + DBG(vcp, + "AICS Audio Input Description Char found: handle 0x%04x", + value_handle); + + aics = vcp_get_aics(vcp); + if (!aics || aics->aud_ip_dscrptn) + return; + + aics->aud_ip_dscrptn = attr; + + vcp_read_value(vcp, value_handle, + read_aics_audio_ip_description, vcp); + vcp->aics_ip_descr_id = vcp_register_notify(vcp, value_handle, + aics_audio_ip_desr_notify, NULL); + } +} + static void foreach_vcs_service(struct gatt_db_attribute *attr, void *user_data) { @@ -1708,6 +2701,9 @@ struct bt_vcp *vcp = user_data; struct bt_vocs *vocs = vcp_get_vocs(vcp); + if (!vocs || !attr) + return; + vocs->service = attr; gatt_db_service_set_claimed(attr, true); @@ -1715,6 +2711,19 @@ gatt_db_service_foreach_char(attr, foreach_vocs_char, vcp); } +static void foreach_aics_service(struct gatt_db_attribute *attr, + void *user_data) +{ + struct bt_vcp *vcp = user_data; + struct bt_aics *aics = vcp_get_aics(vcp); + + aics->service = attr; + + gatt_db_service_set_claimed(attr, true); + + gatt_db_service_foreach_char(attr, foreach_aics_char, vcp); +} + bool bt_vcp_attach(struct bt_vcp *vcp, struct bt_gatt_client *client) { bt_uuid_t uuid; @@ -1740,6 +2749,9 @@ bt_uuid16_create(&uuid, VOL_OFFSET_CS_UUID); gatt_db_foreach_service(vcp->rdb->db, &uuid, foreach_vocs_service, vcp); + bt_uuid16_create(&uuid, AUDIO_INPUT_CS_UUID); + gatt_db_foreach_service(vcp->rdb->db, &uuid, foreach_aics_service, vcp); + return true; }
View file
_service:tar_scm:bluez-5.71.tar.xz/test/agent.py -> _service:tar_scm:bluez-5.77.tar.xz/test/agent.py
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later import sys
View file
_service:tar_scm:bluez-5.71.tar.xz/test/example-advertisement -> _service:tar_scm:bluez-5.77.tar.xz/test/example-advertisement
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import print_function
View file
_service:tar_scm:bluez-5.71.tar.xz/test/example-gatt-client -> _service:tar_scm:bluez-5.77.tar.xz/test/example-gatt-client
Changed
@@ -2,10 +2,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later import dbus -try: - from gi.repository import GObject -except ImportError: - import gobject as GObject +from gi.repository import GLib import sys from dbus.mainloop.glib import DBusGMainLoop @@ -189,7 +186,7 @@ global bus bus = dbus.SystemBus() global mainloop - mainloop = GObject.MainLoop() + mainloop = GLib.MainLoop() om = dbus.Interface(bus.get_object(BLUEZ_SERVICE_NAME, '/'), DBUS_OM_IFACE) om.connect_to_signal('InterfacesRemoved', interfaces_removed_cb)
View file
_service:tar_scm:bluez-5.71.tar.xz/test/example-gatt-server -> _service:tar_scm:bluez-5.77.tar.xz/test/example-gatt-server
Changed
@@ -7,10 +7,7 @@ import dbus.service import array -try: - from gi.repository import GObject -except ImportError: - import gobject as GObject +from gi.repository import GLib import sys from random import randint @@ -305,7 +302,7 @@ if not self.notifying: return - GObject.timeout_add(1000, self.hr_msrmt_cb) + GLib.timeout_add(1000, self.hr_msrmt_cb) def StartNotify(self): if self.notifying: @@ -392,7 +389,7 @@ service) self.notifying = False self.battery_lvl = 100 - GObject.timeout_add(5000, self.drain_battery) + GLib.timeout_add(5000, self.drain_battery) def notify_battery_level(self): if not self.notifying: @@ -649,7 +646,7 @@ app = Application(bus) - mainloop = GObject.MainLoop() + mainloop = GLib.MainLoop() print('Registering GATT application...')
View file
_service:tar_scm:bluez-5.71.tar.xz/test/ftp-client -> _service:tar_scm:bluez-5.77.tar.xz/test/ftp-client
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/list-devices -> _service:tar_scm:bluez-5.77.tar.xz/test/list-devices
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/map-client -> _service:tar_scm:bluez-5.77.tar.xz/test/map-client
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/monitor-bluetooth -> _service:tar_scm:bluez-5.77.tar.xz/test/monitor-bluetooth
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/opp-client -> _service:tar_scm:bluez-5.77.tar.xz/test/opp-client
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/pbap-client -> _service:tar_scm:bluez-5.77.tar.xz/test/pbap-client
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/sap_client.py -> _service:tar_scm:bluez-5.77.tar.xz/test/sap_client.py
Changed
@@ -165,7 +165,7 @@ def __validate(self): if self.value is not None and self.value not in (0x00, 0x01, 0x02, 0x03, 0x04): - print "Warning. ConnectionStatus value in reserved range (0x%x)" % self.value + print("Warning. ConnectionStatus value in reserved range (0x%x)" % self.value) def deserialize(self, buf): ret = SAPParam.deserialize(self, buf) @@ -183,7 +183,7 @@ def __validate(self): if self.value is not None and self.value not in (0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07): - print "Warning. ResultCode value in reserved range (0x%x)" % self.value + print("Warning. ResultCode value in reserved range (0x%x)" % self.value) def deserialize(self, buf): ret = SAPParam.deserialize(self, buf) @@ -201,7 +201,7 @@ def __validate(self): if self.value is not None and self.value not in (0x00, 0x01): - print "Warning. DisconnectionType value in reserved range (0x%x)" % self.value + print("Warning. DisconnectionType value in reserved range (0x%x)" % self.value) def deserialize(self, buf): ret = SAPParam.deserialize(self, buf) @@ -227,7 +227,7 @@ def __validate(self): if self.value is not None and self.value not in (0x00, 0x01, 0x02, 0x03, 0x04, 0x05): - print "Warning. StatusChange value in reserved range (0x%x)" % self.value + print("Warning. StatusChange value in reserved range (0x%x)" % self.value) def deserialize(self, buf): ret = SAPParam.deserialize(self, buf) @@ -245,7 +245,7 @@ def __validate(self): if self.value is not None and self.value not in (0x00, 0x01): - print "Warning. TransportProtoco value in reserved range (0x%x)" % self.value + print("Warning. TransportProtoco value in reserved range (0x%x)" % self.value) def deserialize(self, buf): ret = SAPParam.deserialize(self, buf) @@ -728,7 +728,7 @@ self.port = first_match"port" self.host = first_match"host" - print "SAP Service found on %s(%s)" % first_match"name" % self.host + print("SAP Service found on %s(%s)" % first_match"name" % self.host) def __connectRFCOMM(self): self.sock=BluetoothSocket( RFCOMM ) @@ -739,19 +739,19 @@ def __sendMsg(self, msg): if isinstance(msg, SAPMessage): s = msg.serialize() - print "\tTX: " + msg.getContent() + print("\tTX: " + msg.getContent()) return self.sock.send(s.tostring()) def __rcvMsg(self, msg): if isinstance(msg, SAPMessage): - print "\tRX Wait: %s(id = 0x%.2x)" % (msg.name, msg.id) + print("\tRX Wait: %s(id = 0x%.2x)" % (msg.name, msg.id)) data = self.sock.recv(self.bufsize) if data: if msg.deserialize(array('B',data)): - print "\tRX: len(%d) %s" % (len(data), msg.getContent()) + print("\tRX: len(%d) %s" % (len(data), msg.getContent())) return msg else: - print "msg: %s" % array('B',data) + print("msg: %s" % array('B',data)) raise BluetoothError ("Message deserialization failed.") else: raise BluetoothError ("Timeout. No data received.") @@ -797,8 +797,8 @@ return False else: return False - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_disconnectByClient(self, timeout=0): @@ -808,8 +808,8 @@ time.sleep(timeout) # let srv to close rfcomm self.__disconnectRFCOMM() return True - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_disconnectByServer(self, timeout=0): @@ -823,8 +823,8 @@ return self.proc_disconnectByClient(timeout) - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_transferAPDU(self, apdu = "Sample APDU command"): @@ -832,8 +832,8 @@ self.__sendMsg(SAPMessage_TRANSFER_APDU_REQ(apdu)) params = self.__rcvMsg(SAPMessage_TRANSFER_APDU_RESP()).getParams() return True - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_transferATR(self): @@ -841,8 +841,8 @@ self.__sendMsg(SAPMessage_TRANSFER_ATR_REQ()) params = self.__rcvMsg(SAPMessage_TRANSFER_ATR_RESP()).getParams() return True - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_powerSimOff(self): @@ -850,8 +850,8 @@ self.__sendMsg(SAPMessage_POWER_SIM_OFF_REQ()) params = self.__rcvMsg(SAPMessage_POWER_SIM_OFF_RESP()).getParams() return True - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_powerSimOn(self): @@ -862,8 +862,8 @@ return self.proc_transferATR() return True - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_resetSim(self): @@ -874,23 +874,23 @@ return self.proc_transferATR() return True - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_reportStatus(self): try: params = self.__rcvMsg(SAPMessage_STATUS_IND()).getParams() - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_transferCardReaderStatus(self): try: self.__sendMsg(SAPMessage_TRANSFER_CARD_READER_STATUS_REQ()) params = self.__rcvMsg(SAPMessage_TRANSFER_CARD_READER_STATUS_RESP()).getParams() - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_errorResponse(self): @@ -899,8 +899,8 @@ self.__sendMsg(SAPMessage_CONNECT_REQ()) params = self.__rcvMsg(SAPMessage_ERROR_RESP()).getParams() - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False def proc_setTransportProtocol(self, protocol = 0): @@ -922,8 +922,8 @@ else: return False - except BluetoothError , e: - print "Error. " +str(e) + except BluetoothError as e: + print("Error. " +str(e)) return False if __name__ == "__main__":
View file
_service:tar_scm:bluez-5.71.tar.xz/test/simple-agent -> _service:tar_scm:bluez-5.77.tar.xz/test/simple-agent
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/simple-endpoint -> _service:tar_scm:bluez-5.77.tar.xz/test/simple-endpoint
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/simple-player -> _service:tar_scm:bluez-5.77.tar.xz/test/simple-player
Changed
@@ -1,7 +1,7 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later -from __future__ import print_function + import os import sys @@ -119,7 +119,7 @@ return True try: - exec "self.player.%s" % s + exec("self.player.%s" % s) except Exception as e: print(e) pass
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-adapter -> _service:tar_scm:bluez-5.77.tar.xz/test/test-adapter
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-device -> _service:tar_scm:bluez-5.77.tar.xz/test/test-device
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-discovery -> _service:tar_scm:bluez-5.77.tar.xz/test/test-discovery
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-gatt-profile -> _service:tar_scm:bluez-5.77.tar.xz/test/test-gatt-profile
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-health -> _service:tar_scm:bluez-5.77.tar.xz/test/test-health
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-health-sink -> _service:tar_scm:bluez-5.77.tar.xz/test/test-health-sink
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-hfp -> _service:tar_scm:bluez-5.77.tar.xz/test/test-hfp
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-manager -> _service:tar_scm:bluez-5.77.tar.xz/test/test-manager
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-nap -> _service:tar_scm:bluez-5.77.tar.xz/test/test-nap
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-network -> _service:tar_scm:bluez-5.77.tar.xz/test/test-network
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-profile -> _service:tar_scm:bluez-5.77.tar.xz/test/test-profile
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/test/test-sap-server -> _service:tar_scm:bluez-5.77.tar.xz/test/test-sap-server
Changed
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later from __future__ import absolute_import, print_function, unicode_literals
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/bluetooth-logger.service.in -> _service:tar_scm:bluez-5.77.tar.xz/tools/bluetooth-logger.service.in
Changed
@@ -4,7 +4,7 @@ Service Type=simple -ExecStart=@pkglibexecdir@/btmon-logger -p -b /var/log/bluetooth/hci.log +ExecStart=@PKGLIBEXECDIR@/btmon-logger -p -b /var/log/bluetooth/hci.log NotifyAccess=main CapabilityBoundingSet=CAP_NET_RAW LimitNPROC=1
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/btgatt-client.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/btgatt-client.c
Changed
@@ -33,6 +33,7 @@ #include "src/shared/queue.h" #include "src/shared/gatt-db.h" #include "src/shared/gatt-client.h" +#include "src/shared/gatt-helpers.h" #define ATT_CID 4 @@ -57,6 +58,7 @@ struct bt_gatt_client *gatt; unsigned int reliable_session_id; + bool sec_retry; }; static void print_prompt(void) @@ -172,6 +174,7 @@ fprintf(stderr, "Failed to allocate memory for client\n"); return NULL; } + cli->sec_retry = true; cli->att = bt_att_new(fd, false); if (!cli->att) { @@ -488,6 +491,7 @@ char *argv512; int i; char *endptr = NULL; + unsigned int id; if (!bt_gatt_client_is_ready(cli->gatt)) { printf("GATT client not initialized\n"); @@ -514,9 +518,12 @@ } } - if (!bt_gatt_client_read_multiple(cli->gatt, value, argc, - read_multiple_cb, NULL, NULL)) + id = bt_gatt_client_read_multiple(cli->gatt, value, argc, + read_multiple_cb, NULL, NULL); + if (!id) printf("Failed to initiate read multiple procedure\n"); + else if (!cli->sec_retry) + bt_gatt_client_set_retry(cli->gatt, id, false); free(value); } @@ -558,6 +565,7 @@ int argc = 0; uint16_t handle; char *endptr = NULL; + unsigned int id; if (!bt_gatt_client_is_ready(cli->gatt)) { printf("GATT client not initialized\n"); @@ -575,9 +583,12 @@ return; } - if (!bt_gatt_client_read_value(cli->gatt, handle, read_cb, - NULL, NULL)) + id = bt_gatt_client_read_value(cli->gatt, handle, read_cb, + NULL, NULL); + if (!id) printf("Failed to initiate read value procedure\n"); + else if (!cli->sec_retry) + bt_gatt_client_set_retry(cli->gatt, id, false); } static void read_long_value_usage(void) @@ -592,6 +603,7 @@ uint16_t handle; uint16_t offset; char *endptr = NULL; + unsigned int id; if (!bt_gatt_client_is_ready(cli->gatt)) { printf("GATT client not initialized\n"); @@ -616,9 +628,12 @@ return; } - if (!bt_gatt_client_read_long_value(cli->gatt, handle, offset, read_cb, - NULL, NULL)) + id = bt_gatt_client_read_long_value(cli->gatt, handle, offset, read_cb, + NULL, NULL); + if (!id) printf("Failed to initiate read long value procedure\n"); + else if (!cli->sec_retry) + bt_gatt_client_set_retry(cli->gatt, id, false); } static void write_value_usage(void) @@ -659,6 +674,7 @@ uint8_t *value = NULL; bool without_response = false; bool signed_write = false; + unsigned int id; if (!bt_gatt_client_is_ready(cli->gatt)) { printf("GATT client not initialized\n"); @@ -740,10 +756,13 @@ goto done; } - if (!bt_gatt_client_write_value(cli->gatt, handle, value, length, + id = bt_gatt_client_write_value(cli->gatt, handle, value, length, write_cb, - NULL, NULL)) + NULL, NULL); + if (!id) printf("Failed to initiate write procedure\n"); + else if (!cli->sec_retry) + bt_gatt_client_set_retry(cli->gatt, id, false); done: free(value); @@ -789,6 +808,7 @@ int length; uint8_t *value = NULL; bool reliable_writes = false; + unsigned int id; if (!bt_gatt_client_is_ready(cli->gatt)) { printf("GATT client not initialized\n"); @@ -863,11 +883,14 @@ } } - if (!bt_gatt_client_write_long_value(cli->gatt, reliable_writes, handle, + id = bt_gatt_client_write_long_value(cli->gatt, reliable_writes, handle, offset, value, length, write_long_cb, - NULL, NULL)) + NULL, NULL); + if (!id) printf("Failed to initiate long write procedure\n"); + else if (!cli->sec_retry) + bt_gatt_client_set_retry(cli->gatt, id, false); free(value); } @@ -999,12 +1022,18 @@ value, length, write_long_cb, NULL, NULL); - if (!cli->reliable_session_id) + if (!cli->reliable_session_id) { printf("Failed to proceed prepare write\n"); - else + } else { + if (!cli->sec_retry) + bt_gatt_client_set_retry(cli->gatt, + cli->reliable_session_id, + false); + printf("Prepare write success.\n" "Session id: %d to be used on next write\n", cli->reliable_session_id); + } free(value); } @@ -1236,6 +1265,36 @@ printf("Security level: %u\n", level); } +static void set_security_retry_usage(void) +{ + printf("Usage: set-security-retry <y/n>\n" + "e.g.:\n" + "\tset-security-retry n\n"); +} + +static void cmd_set_security_retry(struct client *cli, char *cmd_str) +{ + char *argv2; + int argc = 0; + + if (!bt_gatt_client_is_ready(cli->gatt)) { + printf("GATT client not initialized\n"); + return; + } + + if (!parse_args(cmd_str, 1, argv, &argc) || argc != 1) { + set_security_retry_usage(); + return; + } + + if (argv00 == 'y') + cli->sec_retry = true; + else if (argv00 == 'n') + cli->sec_retry = false; + else + printf("Invalid argument: %s\n", argv0); +} + static bool convert_sign_key(char *optarg, uint8_t key16) { int i; @@ -1295,6 +1354,166 @@ set_sign_key_usage(); } +static void search_service_cb(bool success, uint8_t att_ecode, + struct bt_gatt_result *result, + void *user_data) +{ + struct bt_gatt_iter iter; + uint16_t start_handle, end_handle; + uint128_t u128; + bt_uuid_t uuid; + char uuid_strMAX_LEN_UUID_STR; + + if (!success) { + PRLOG("\nService discovery failed: %s (0x%02x)\n", + ecode_to_string(att_ecode), att_ecode); + return; + } + + if (!result || !bt_gatt_iter_init(&iter, result)) + return; + + printf("\n"); + while (bt_gatt_iter_next_service(&iter, &start_handle, &end_handle, + u128.data)) { + bt_uuid128_create(&uuid, u128); + bt_uuid_to_string(&uuid, uuid_str, sizeof(uuid_str)); + printf("Found start handle: 0x%04x, end handle: 0x%04x, " + "UUID: %s\n", + start_handle, end_handle, uuid_str); + } + PRLOG("\n"); +} + +static void cmd_search_all_primary_services(struct client *cli, char *cmd_str) +{ + if (!bt_gatt_client_is_ready(cli->gatt)) { + printf("GATT client not initialized\n"); + return; + } + + bt_gatt_discover_all_primary_services(bt_gatt_client_get_att(cli->gatt), + NULL, + search_service_cb, + NULL, + NULL); +} + +static void search_service_usage(void) +{ + printf("Usage: search-service <uuid>\n" + "e.g.:\n" + "\tsearch-service 1800\n"); +} + +static void cmd_search_service(struct client *cli, char *cmd_str) +{ + char *argv2; + int argc = 0; + bt_uuid_t uuid; + + if (!bt_gatt_client_is_ready(cli->gatt)) { + printf("GATT client not initialized\n"); + return; + } + + if (!parse_args(cmd_str, 1, argv, &argc) || argc != 1) { + search_service_usage(); + return; + } + + if (bt_string_to_uuid(&uuid, argv0) < 0) { + printf("Invalid UUID: %s\n", argv0); + return; + } + + bt_gatt_discover_primary_services(bt_gatt_client_get_att(cli->gatt), + &uuid, 0x0001, 0xFFFF, + search_service_cb, + NULL, + NULL); +} + +static void search_characteristics_usage(void) +{ + printf("Usage: search-characteristics <start_hanlde> <end_handle> " + "<uuid>\n" + "e.g.:\n" + "\tsearch-characteristics 0x0001 0xFFFF 1800\n"); +} + +static void search_characteristics_cb(bool success, uint8_t att_ecode, + struct bt_gatt_result *result, + void *user_data) +{ + struct bt_gatt_iter iter; + uint16_t handle, length; + const uint8_t *value; + int i; + + if (!success) { + PRLOG("\nCharacteristics discovery failed: %s (0x%02x)\n", + ecode_to_string(att_ecode), att_ecode); + return; + } + + if (!result || !bt_gatt_iter_init(&iter, result)) + return; + + printf("\n"); + while (bt_gatt_iter_next_read_by_type(&iter, &handle, &length, + &value)) { + printf("Found handle: 0x%04x value: ", handle); + for (i = 0; i < length; i++) + printf("%02x ", valuei); + printf("\n"); + } + PRLOG("\n"); +} + +static void cmd_search_characteristics(struct client *cli, char *cmd_str) +{ + char *argv4; + int argc = 0; + uint16_t start_handle, end_handle; + char *endptr = NULL; + bt_uuid_t uuid; + + if (!bt_gatt_client_is_ready(cli->gatt)) { + printf("GATT client not initialized\n"); + return; + } + + if (!parse_args(cmd_str, 3, argv, &argc) || argc != 3) { + search_characteristics_usage(); + return; + } + + start_handle = strtol(argv0, &endptr, 0); + if (!endptr || *endptr != '\0') { + printf("Invalid start handle: %s\n", argv0); + return; + } + + end_handle = strtol(argv1, &endptr, 0); + if (!endptr || *endptr != '\0') { + printf("Invalid end handle: %s\n", argv1); + return; + } + + if (bt_string_to_uuid(&uuid, argv2) < 0) { + printf("Invalid UUID: %s\n", argv2); + return; + } + + bt_gatt_read_by_type(bt_gatt_client_get_att(cli->gatt), start_handle, + end_handle, + &uuid, + search_characteristics_cb, + NULL, + NULL); +} + static void cmd_help(struct client *cli, char *cmd_str); typedef void (*command_func_t)(struct client *cli, char *cmd_str); @@ -1327,8 +1546,16 @@ "\tSet security level on le connection"}, { "get-security", cmd_get_security, "\tGet security level on le connection"}, + { "set-security-retry", cmd_set_security_retry, + "\tSet retry on security error by elevating security"}, { "set-sign-key", cmd_set_sign_key, "\tSet signing key for signed write command"}, + { "search-all-primary-services", cmd_search_all_primary_services, + "\tSearch all primary services"}, + { "search-service", cmd_search_service, + "\tSearch service"}, + { "search-characteristics", cmd_search_characteristics, + "\tSearch characteristics"}, { } };
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/btsnoop.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/btsnoop.c
Changed
@@ -448,7 +448,7 @@ acl_flags = buf2 >> 4; /* use only packet with ACL start flag */ - if (acl_flags & 0x02) { + if ((acl_flags & 0x02) && len > 9) { if (current_cid == 0x0040 && pdu_len > 0) { int i; if (!pdu_first) @@ -472,7 +472,7 @@ current_cid = buf8 << 8 | buf7; memcpy(pdu_buf, buf + 9, len - 9); pdu_len = len - 9; - } else if (acl_flags & 0x01) { + } else if ((acl_flags & 0x01) && len > 5) { memcpy(pdu_buf + pdu_len, buf + 5, len - 5); pdu_len += len - 5; }
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/hcidump.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/hcidump.c
Changed
@@ -610,7 +610,7 @@ " -m, --manufacturer=compid Default manufacturer\n" " -w, --save-dump=file Save dump to a file\n" " -r, --read-dump=file Read dump from a file\n" - " -t, --ts Display time stamps\n" + " -t, --timestamp Display time stamps\n" " -a, --ascii Dump data in ascii\n" " -x, --hex Dump data in hex\n" " -X, --ext Dump data in hex and ascii\n"
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/iso-tester.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/iso-tester.c
Changed
@@ -4,7 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. - * Copyright 2023 NXP + * Copyright 2023-2024 NXP * */ @@ -18,11 +18,15 @@ #include <poll.h> #include <stdbool.h> +#include <linux/errqueue.h> +#include <linux/net_tstamp.h> + #include <glib.h> #include "lib/bluetooth.h" #include "lib/iso.h" #include "lib/mgmt.h" +#include "lib/uuid.h" #include "monitor/bt.h" #include "emulator/vhci.h" @@ -34,6 +38,10 @@ #include "src/shared/util.h" #include "src/shared/queue.h" +#include "tester.h" + +#define EIR_SERVICE_DATA_16 0x16 + #define QOS_IO(_interval, _latency, _sdu, _phy, _rtn) \ { \ .interval = _interval, \ @@ -264,10 +272,10 @@ .bcode = _bcode, \ .options = 0x00, \ .skip = 0x0000, \ - .sync_timeout = 0x4000, \ + .sync_timeout = BT_ISO_SYNC_TIMEOUT, \ .sync_cte_type = 0x00, \ .mse = 0x00, \ - .timeout = 0x4000, \ + .timeout = BT_ISO_SYNC_TIMEOUT, \ }, \ } @@ -391,7 +399,7 @@ 0x01, /* Number of Subgroups */ 0x01, /* Number of BIS */ 0x06, 0x00, 0x00, 0x00, 0x00, /* Code ID = LC3 (0x06) */ - 0x11, /* Codec Specific Configuration */ + 0x10, /* Codec Specific Configuration */ 0x02, 0x01, 0x03, /* 16 KHZ */ 0x02, 0x02, 0x01, /* 10 ms */ 0x05, 0x03, 0x01, 0x00, 0x00, 0x00, /* Front Left */ @@ -411,7 +419,7 @@ 0x01, /* Number of Subgroups */ 0x02, /* Number of BIS */ 0x06, 0x00, 0x00, 0x00, 0x00, /* Code ID = LC3 (0x06) */ - 0x11, /* Codec Specific Configuration */ + 0x10, /* Codec Specific Configuration */ 0x02, 0x01, 0x03, /* 16 KHZ */ 0x02, 0x02, 0x01, /* 10 ms */ 0x05, 0x03, 0x01, 0x00, 0x00, 0x00, /* Front Left */ @@ -438,7 +446,7 @@ 0x01, /* Number of Subgroups */ 0x01, /* Number of BIS */ 0x06, 0x00, 0x00, 0x00, 0x00, /* Code ID = LC3 (0x06) */ - 0x11, /* Codec Specific Configuration */ + 0x10, /* Codec Specific Configuration */ 0x02, 0x01, 0x03, /* 16 KHZ */ 0x02, 0x02, 0x01, /* 10 ms */ 0x05, 0x03, 0x01, 0x00, 0x00, 0x00, /* Front Left */ @@ -462,11 +470,12 @@ uint16_t handle; uint16_t acl_handle; struct queue *io_queue; - unsigned int io_id2; + unsigned int io_id4; uint8_t client_num; int step; bool reconnect; bool suspending; + struct tx_tstamp_data tx_ts; }; struct iso_client_data { @@ -487,8 +496,30 @@ size_t base_len; bool listen_bind; bool pa_bind; + bool big; + + /* Enable SO_TIMESTAMPING with these flags */ + uint32_t so_timestamping; + + /* Enable SO_TIMESTAMPING using CMSG instead of setsockopt() */ + bool cmsg_timestamping; + + /* Number of additional packets to send, before SO_TIMESTAMPING. + * Used to test kernel timestamp TX queue logic. + */ + unsigned int repeat_send_pre_ts; + + /* Number of additional packets to send, after SO_TIMESTAMPING. + * Used for testing TX timestamping OPT_ID. + */ + unsigned int repeat_send; + + /* Disable BT_POLL_ERRQUEUE before enabling TX timestamping */ + bool no_poll_errqueue; }; +typedef bool (*iso_defer_accept_t)(struct test_data *data, GIOChannel *io); + static void mgmt_debug(const char *str, void *user_data) { const char *prefix = user_data; @@ -620,6 +651,18 @@ 0x00, /* Action - disable */ }; +static const uint8_t set_poll_errqueue_param = { + 0x33, 0x57, 0x7b, 0xb4, 0x21, 0xc0, 0xc1, 0x8b, /* UUID */ + 0x79, 0x46, 0x9f, 0xb6, 0x4c, 0x8c, 0x51, 0x69, + 0x01, /* Action - enable */ +}; + +static const uint8_t reset_poll_errqueue_param = { + 0x33, 0x57, 0x7b, 0xb4, 0x21, 0xc0, 0xc1, 0x8b, /* UUID */ + 0x79, 0x46, 0x9f, 0xb6, 0x4c, 0x8c, 0x51, 0x69, + 0x00, /* Action - disable */ +}; + static void set_iso_socket_callback(uint8_t status, uint16_t length, const void *param, void *user_data) { @@ -631,9 +674,26 @@ tester_print("ISO socket feature is enabled"); } +static void set_poll_errqueue_callback(uint8_t status, uint16_t length, + const void *param, void *user_data) +{ + if (status != MGMT_STATUS_SUCCESS) { + tester_print("Poll Errqueue feature could not be enabled"); + return; + } + + tester_print("Poll Errqueue feature is enabled"); +} + static void test_pre_setup(const void *test_data) { struct test_data *data = tester_get_data(); + const struct iso_client_data *isodata = test_data; + + if (isodata && isodata->so_timestamping) { + if (tester_pre_setup_skip_by_default()) + return; + } data->mgmt = mgmt_new_default(); if (!data->mgmt) { @@ -649,6 +709,13 @@ sizeof(set_iso_socket_param), set_iso_socket_param, set_iso_socket_callback, NULL, NULL); + if (isodata && isodata->no_poll_errqueue) { + mgmt_send(data->mgmt, MGMT_OP_SET_EXP_FEATURE, MGMT_INDEX_NONE, + sizeof(set_poll_errqueue_param), + set_poll_errqueue_param, + set_poll_errqueue_callback, NULL, NULL); + } + mgmt_send(data->mgmt, MGMT_OP_READ_INDEX_LIST, MGMT_INDEX_NONE, 0, NULL, read_index_list_callback, NULL, NULL); } @@ -656,11 +723,19 @@ static void test_post_teardown(const void *test_data) { struct test_data *data = tester_get_data(); + const struct iso_client_data *isodata = test_data; mgmt_send(data->mgmt, MGMT_OP_SET_EXP_FEATURE, MGMT_INDEX_NONE, sizeof(reset_iso_socket_param), reset_iso_socket_param, NULL, NULL, NULL); + if (isodata && isodata->no_poll_errqueue) { + mgmt_send(data->mgmt, MGMT_OP_SET_EXP_FEATURE, MGMT_INDEX_NONE, + sizeof(reset_poll_errqueue_param), + reset_poll_errqueue_param, + NULL, NULL, NULL); + } + hciemu_unref(data->hciemu); data->hciemu = NULL; } @@ -675,15 +750,14 @@ static void test_data_free(void *test_data) { struct test_data *data = test_data; + unsigned int i; if (data->io_queue) queue_destroy(data->io_queue, io_free); - if (data->io_id0 > 0) - g_source_remove(data->io_id0); - - if (data->io_id1 > 0) - g_source_remove(data->io_id1); + for (i = 0; i < ARRAY_SIZE(data->io_id); ++i) + if (data->io_idi > 0) + g_source_remove(data->io_idi); free(data); } @@ -985,6 +1059,48 @@ .send = &send_16_2_1, }; +static const struct iso_client_data connect_send_tx_timestamping = { + .qos = QOS_16_2_1, + .expect_err = 0, + .send = &send_16_2_1, + .so_timestamping = (SOF_TIMESTAMPING_SOFTWARE | + SOF_TIMESTAMPING_OPT_ID | + SOF_TIMESTAMPING_TX_SOFTWARE), + .repeat_send = 1, + .repeat_send_pre_ts = 2, +}; + +static const struct iso_client_data connect_send_tx_sched_timestamping = { + .qos = QOS_16_2_1, + .expect_err = 0, + .send = &send_16_2_1, + .so_timestamping = (SOF_TIMESTAMPING_SOFTWARE | + SOF_TIMESTAMPING_TX_SOFTWARE | + SOF_TIMESTAMPING_OPT_TSONLY | + SOF_TIMESTAMPING_TX_SCHED), + .repeat_send = 1, +}; + +static const struct iso_client_data connect_send_tx_cmsg_timestamping = { + .qos = QOS_16_2_1, + .expect_err = 0, + .send = &send_16_2_1, + .so_timestamping = (SOF_TIMESTAMPING_SOFTWARE | + SOF_TIMESTAMPING_TX_SOFTWARE), + .repeat_send = 1, + .cmsg_timestamping = true, +}; + +static const struct iso_client_data connect_send_tx_no_poll_timestamping = { + .qos = QOS_16_2_1, + .expect_err = 0, + .send = &send_16_2_1, + .so_timestamping = (SOF_TIMESTAMPING_SOFTWARE | + SOF_TIMESTAMPING_TX_SOFTWARE), + .repeat_send = 1, + .no_poll_errqueue = true, +}; + static const struct iso_client_data listen_16_2_1_recv = { .qos = QOS_16_2_1, .expect_err = 0, @@ -1299,6 +1415,7 @@ .recv = &send_16_2_1, .bcast = true, .server = true, + .big = true, }; static const struct iso_client_data bcast_enc_16_2_1_recv = { @@ -1307,6 +1424,7 @@ .recv = &send_16_2_1, .bcast = true, .server = true, + .big = true, }; static const struct iso_client_data bcast_16_2_1_recv_defer = { @@ -1317,6 +1435,7 @@ .bcast = true, .server = true, .listen_bind = true, + .big = true, }; static const struct iso_client_data bcast_16_2_1_recv_defer_no_bis = { @@ -1325,6 +1444,7 @@ .defer = true, .bcast = true, .server = true, + .big = true, }; static const struct iso_client_data bcast_16_2_1_recv_defer_pa_bind = { @@ -1334,6 +1454,17 @@ .bcast = true, .server = true, .pa_bind = true, + .big = true, +}; + +static const struct iso_client_data bcast_16_2_1_recv_defer_get_base = { + .qos = QOS_IN_16_2_1, + .expect_err = 0, + .defer = true, + .bcast = true, + .server = true, + .base = base_lc3_ac_12, + .base_len = sizeof(base_lc3_ac_12), }; static const struct iso_client_data bcast_ac_12 = { @@ -1408,14 +1539,17 @@ struct test_data *data = user_data; const struct iso_client_data *isodata = data->test_data; + --data->step; + tester_print("Client received %u bytes of data", len); if (isodata->send && (isodata->send->iov_len != len || memcmp(isodata->send->iov_base, buf, len))) { if (!isodata->recv->iov_base) tester_test_failed(); - } else + } else if (!data->step) { tester_test_passed(); + } } static void bthost_iso_disconnected(void *user_data) @@ -1496,9 +1630,16 @@ if (isodata->bcast) { bthost_set_pa_params(host); bthost_set_pa_enable(host, 0x01); - bthost_create_big(host, 1, - isodata->qos.bcast.encryption, - isodata->qos.bcast.bcode); + + if (isodata->base) + bthost_set_base(host, isodata->base, + isodata->base_len); + + if (isodata->big) + bthost_create_big(host, 1, + isodata->qos.bcast.encryption, + isodata->qos.bcast.bcode); + } else if (!isodata->send && isodata->recv) { const uint8_t *bdaddr; @@ -1668,6 +1809,7 @@ master_bdaddr = hciemu_get_central_bdaddr(data->hciemu); if (!master_bdaddr) { tester_warn("No master bdaddr"); + close(sk); return -ENODEV; } @@ -2056,17 +2198,156 @@ data->io_id0 = g_io_add_watch(io, G_IO_IN, iso_recv_data, data); } -static void iso_send(struct test_data *data, GIOChannel *io) +static gboolean iso_recv_errqueue(GIOChannel *io, GIOCondition cond, + gpointer user_data) { + struct test_data *data = user_data; const struct iso_client_data *isodata = data->test_data; - ssize_t ret; + int sk = g_io_channel_unix_get_fd(io); + int err; + + data->step--; + + err = tx_tstamp_recv(&data->tx_ts, sk, isodata->send->iov_len); + if (err > 0) + return TRUE; + else if (!err && !data->step) + tester_test_passed(); + else + tester_test_failed(); + + data->io_id2 = 0; + return FALSE; +} + +static gboolean iso_fail_errqueue(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + struct test_data *data = user_data; + + tester_warn("Unexpected POLLERR"); + tester_test_failed(); + + data->io_id3 = 0; + return FALSE; +} + +static gboolean iso_timer_errqueue(gpointer user_data) +{ + struct test_data *data = user_data; + GIOChannel *io; + gboolean ret; + + io = queue_peek_head(data->io_queue); + g_assert(io); + + ret = iso_recv_errqueue(io, G_IO_IN, data); + if (!ret) { + if (data->io_id3) + g_source_remove(data->io_id3); + data->io_id3 = 0; + } + + return ret; +} + +static void iso_tx_timestamping(struct test_data *data, GIOChannel *io) +{ + const struct iso_client_data *isodata = data->test_data; + int so = isodata->so_timestamping; int sk; + int err; + unsigned int count; + + if (!(isodata->so_timestamping & SOF_TIMESTAMPING_TX_RECORD_MASK)) + return; + + tester_print("Enabling TX timestamping"); + + tx_tstamp_init(&data->tx_ts, isodata->so_timestamping); + + for (count = 0; count < isodata->repeat_send + 1; ++count) + data->step += tx_tstamp_expect(&data->tx_ts); sk = g_io_channel_unix_get_fd(io); + if (isodata->no_poll_errqueue) { + uint32_t flag = 0; + + err = setsockopt(sk, SOL_BLUETOOTH, BT_POLL_ERRQUEUE, + &flag, sizeof(flag)); + if (err < 0) { + tester_warn("setsockopt BT_POLL_ERRQUEUE: %s (%d)", + strerror(errno), errno); + tester_test_failed(); + return; + } + + if (!data->io_queue) + data->io_queue = queue_new(); + queue_push_head(data->io_queue, g_io_channel_ref(io)); + + data->io_id2 = g_timeout_add(100, iso_timer_errqueue, data); + data->io_id3 = g_io_add_watch(io, G_IO_ERR, iso_fail_errqueue, + data); + } else { + uint32_t flag = 1; + + err = setsockopt(sk, SOL_BLUETOOTH, BT_POLL_ERRQUEUE, + &flag, sizeof(flag)); + if (err >= 0) { + tester_warn("BT_POLL_ERRQUEUE available"); + tester_test_failed(); + return; + } + + data->io_id2 = g_io_add_watch(io, G_IO_ERR, iso_recv_errqueue, + data); + } + + if (isodata->cmsg_timestamping) + so &= ~SOF_TIMESTAMPING_TX_RECORD_MASK; + + err = setsockopt(sk, SOL_SOCKET, SO_TIMESTAMPING, &so, sizeof(so)); + if (err < 0) { + tester_warn("setsockopt SO_TIMESTAMPING: %s (%d)", + strerror(errno), errno); + tester_test_failed(); + return; + } +} + +static void iso_send_data(struct test_data *data, GIOChannel *io) +{ + const struct iso_client_data *isodata = data->test_data; + char controlCMSG_SPACE(sizeof(uint32_t)); + struct msghdr msg = { + .msg_iov = (struct iovec *)isodata->send, + .msg_iovlen = 1, + }; + struct cmsghdr *cmsg; + ssize_t ret; + int sk; + tester_print("Writing %zu bytes of data", isodata->send->iov_len); - ret = writev(sk, isodata->send, 1); + sk = g_io_channel_unix_get_fd(io); + + if (isodata->cmsg_timestamping) { + memset(control, 0, sizeof(control)); + msg.msg_control = control; + msg.msg_controllen = sizeof(control); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING; + cmsg->cmsg_len = CMSG_LEN(sizeof(uint32_t)); + + *((uint32_t *)CMSG_DATA(cmsg)) = (isodata->so_timestamping & + SOF_TIMESTAMPING_TX_RECORD_MASK); + } + + ret = sendmsg(sk, &msg, 0); if (ret < 0 || isodata->send->iov_len != (size_t) ret) { tester_warn("Failed to write %zu bytes: %s (%d)", isodata->send->iov_len, strerror(errno), errno); @@ -2074,6 +2355,22 @@ return; } + data->step++; +} + +static void iso_send(struct test_data *data, GIOChannel *io) +{ + const struct iso_client_data *isodata = data->test_data; + unsigned int count; + + for (count = 0; count < isodata->repeat_send_pre_ts; ++count) + iso_send_data(data, io); + + iso_tx_timestamping(data, io); + + for (count = 0; count < isodata->repeat_send + 1; ++count) + iso_send_data(data, io); + if (isodata->bcast) { tester_test_passed(); return; @@ -2181,6 +2478,7 @@ socklen_t len; struct bt_iso_qos qos; bool ret = true; + uint8_t baseBASE_MAX_LENGTH = {0}; sk = g_io_channel_unix_get_fd(io); @@ -2209,6 +2507,27 @@ return FALSE; } + if (isodata->bcast && isodata->server && isodata->base) { + len = BASE_MAX_LENGTH; + + if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_BASE, + base, &len) < 0) { + tester_warn("Can't get socket option : %s (%d)", + strerror(errno), errno); + data->step = 0; + tester_test_failed(); + return FALSE; + } + + if (len != isodata->base_len || + memcmp(base, isodata->base, len)) { + tester_warn("Unexpected BASE"); + data->step = 0; + tester_test_failed(); + return FALSE; + } + } + len = sizeof(sk_err); if (getsockopt(sk, SOL_SOCKET, SO_ERROR, &sk_err, &len) < 0) @@ -2582,11 +2901,10 @@ } } -static bool iso_defer_accept(struct test_data *data, GIOChannel *io) +static bool iso_defer_accept_bcast(struct test_data *data, GIOChannel *io) { int sk; char c; - struct pollfd pfd; const struct iso_client_data *isodata = data->test_data; struct sockaddr_iso *addr = NULL; @@ -2610,6 +2928,31 @@ free(addr); } + if (read(sk, &c, 1) < 0) { + tester_warn("read: %s (%d)", strerror(errno), errno); + return false; + } + + tester_print("Accept deferred setup"); + + data->io_queue = queue_new(); + if (data->io_queue) + queue_push_tail(data->io_queue, io); + + data->io_id0 = g_io_add_watch(io, G_IO_IN, + iso_accept_cb, NULL); + + return true; +} + +static bool iso_defer_accept_ucast(struct test_data *data, GIOChannel *io) +{ + int sk; + char c; + struct pollfd pfd; + + sk = g_io_channel_unix_get_fd(io); + memset(&pfd, 0, sizeof(pfd)); pfd.fd = sk; pfd.events = POLLOUT; @@ -2632,12 +2975,8 @@ if (data->io_queue) queue_push_tail(data->io_queue, io); - if (isodata->bcast) - data->io_id0 = g_io_add_watch(io, G_IO_IN, - iso_accept_cb, NULL); - else - data->io_id0 = g_io_add_watch(io, G_IO_OUT, - iso_connect_cb, NULL); + data->io_id0 = g_io_add_watch(io, G_IO_OUT, + iso_connect_cb, NULL); return true; } @@ -2648,6 +2987,9 @@ struct test_data *data = tester_get_data(); const struct iso_client_data *isodata = data->test_data; int sk, new_sk; + iso_defer_accept_t iso_accept = isodata->bcast ? + iso_defer_accept_bcast : + iso_defer_accept_ucast; data->io_id0 = 0; @@ -2676,7 +3018,7 @@ return false; } - if (!iso_defer_accept(data, io)) { + if (!iso_accept(data, io)) { tester_warn("Unable to accept deferred setup"); tester_test_failed(); } @@ -3172,6 +3514,25 @@ test_iso("ISO Send - Success", &connect_16_2_1_send, setup_powered, test_connect); + /* Test basic TX timestamping */ + test_iso("ISO Send - TX Timestamping", &connect_send_tx_timestamping, + setup_powered, test_connect); + + /* Test schedule-time TX timestamps are emitted */ + test_iso("ISO Send - TX Sched Timestamping", + &connect_send_tx_sched_timestamping, setup_powered, + test_connect); + + /* Test TX timestamping with flags set via per-packet CMSG */ + test_iso("ISO Send - TX CMSG Timestamping", + &connect_send_tx_cmsg_timestamping, setup_powered, + test_connect); + + /* Test TX timestamping and disabling POLLERR wakeup */ + test_iso("ISO Send - TX No Poll Timestamping", + &connect_send_tx_no_poll_timestamping, setup_powered, + test_connect); + test_iso("ISO Receive - Success", &listen_16_2_1_recv, setup_powered, test_listen); @@ -3358,6 +3719,10 @@ &bcast_16_2_1_recv_defer_pa_bind, setup_powered, test_bcast_recv_defer); + test_iso("ISO Broadcaster Receiver Defer Get BASE - Success", + &bcast_16_2_1_recv_defer_get_base, + setup_powered, + test_bcast_recv); test_iso("ISO Broadcaster AC 12 - Success", &bcast_ac_12, setup_powered, test_bcast);
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/isotest.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/isotest.c
Changed
@@ -46,10 +46,13 @@ #define NSEC_USEC(_t) (_t / 1000L) #define SEC_USEC(_t) (_t * 1000000L) #define TS_USEC(_ts) (SEC_USEC((_ts)->tv_sec) + NSEC_USEC((_ts)->tv_nsec)) +#define ROUND_CLOSEST(_x, _y) (((_x) + (_y / 2)) / (_y)) #define DEFAULT_BIG_ID 0x01 #define DEFAULT_BIS_ID 0x01 +#define MAX_DATA_SIZE 0x40000000 + /* Test modes */ enum { SEND, @@ -642,7 +645,7 @@ } syslog(LOG_INFO, "Receiving ..."); - while ((len = read(sk, buf, data_size)) > 0) { + while ((len = read(sk, buf, data_size)) >= 0) { if (fd >= 0) { len = write(fd, buf, len); if (len < 0) { @@ -680,7 +683,7 @@ int r; r = recv(sk, buf, data_size, 0); - if (r <= 0) { + if (r < 0) { if (r < 0) syslog(LOG_ERR, "Read failed: %s (%d)", strerror(errno), errno); @@ -720,7 +723,7 @@ syslog(LOG_INFO, "Opening %s ...", filename); fd = open(filename, O_RDONLY); - if (fd <= 0) { + if (fd < 0) { syslog(LOG_ERR, "Can't open file %s: %s\n", filename, strerror(errno)); } @@ -834,7 +837,9 @@ } /* num of packets = latency (ms) / interval (us) */ - num = (out->latency * 1000 / out->interval); + num = ROUND_CLOSEST(out->latency * 1000, out->interval); + if (!num) + num = 1; syslog(LOG_INFO, "Number of packets: %d", num); @@ -843,8 +848,7 @@ * latency: * jitter buffer = 2 * (SDU * subevents) */ - sndbuf = 2 * ((out->latency * 1000 / out->interval) * - out->sdu); + sndbuf = 2 * (num * out->sdu); len = sizeof(sndbuf); if (setsockopt(sk, SOL_SOCKET, SO_SNDBUF, &sndbuf, len) < 0) { @@ -922,7 +926,7 @@ if (!err) fd = open_file(altername); - if (fd <= 0) + if (fd < 0) fd = open_file(filename); } @@ -950,6 +954,8 @@ close(sk_arri); free(sk_arr); + if (fd >= 0) + close(fd); return; } @@ -1249,7 +1255,7 @@ break; case 'b': - if (optarg) + if (optarg && atoi(optarg) < MAX_DATA_SIZE) data_size = atoi(optarg); break; @@ -1454,9 +1460,18 @@ switch (mode) { case SEND: - send_mode(filename, argvoptind + i, i, repeat); - if (filename && strchr(filename, ',')) - filename = strchr(filename, ',') + 1; + peer = argvoptind + i; + if (bachk(peer) < 0) { + fprintf(stderr, "Invalid peer address '%s'\n", + peer); + exit(1); + } + send_mode(filename, peer, i, repeat); + if (filename && strchr(filename, ',')) { + char *tmp = filename; + filename = strdup(strchr(filename, ',') + 1); + free(tmp); + } break; case RECONNECT: @@ -1469,6 +1484,11 @@ case CONNECT: peer = argvoptind + i; + if (bachk(peer) < 0) { + fprintf(stderr, "Invalid peer address '%s'\n", + peer); + exit(1); + } mgmt_set_experimental(); @@ -1506,7 +1526,7 @@ free(sk_arr); } else { - sk = do_connect(argvoptind + i); + sk = do_connect(peer); if (sk < 0) exit(1);
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/l2cap-tester.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/l2cap-tester.c
Changed
@@ -30,6 +30,9 @@ #include "src/shared/tester.h" #include "src/shared/mgmt.h" +#include "src/shared/util.h" + +#include "tester.h" struct test_data { const void *test_data; @@ -38,12 +41,16 @@ struct hciemu *hciemu; enum hciemu_type hciemu_type; unsigned int io_id; + unsigned int err_io_id; uint16_t handle; uint16_t scid; uint16_t dcid; + struct l2cap_options l2o; int sk; int sk2; bool host_disconnected; + int step; + struct tx_tstamp_data tx_ts; }; struct l2cap_data { @@ -51,6 +58,9 @@ uint16_t server_psm; uint16_t cid; uint8_t mode; + uint16_t mtu; + uint16_t mps; + uint16_t credits; int expect_err; int timeout; @@ -86,6 +96,12 @@ bool defer; bool shut_sock_wr; + + /* Enable SO_TIMESTAMPING with these flags */ + uint32_t so_timestamping; + + /* Number of additional packets to send. */ + unsigned int repeat_send; }; static void print_debug(const char *str, void *user_data) @@ -202,6 +218,12 @@ static void test_pre_setup(const void *test_data) { struct test_data *data = tester_get_data(); + const struct l2cap_data *l2data = test_data; + + if (l2data && l2data->so_timestamping) { + if (tester_pre_setup_skip_by_default()) + return; + } data->mgmt = mgmt_new_default(); if (!data->mgmt) { @@ -226,6 +248,11 @@ data->io_id = 0; } + if (data->err_io_id > 0) { + g_source_remove(data->err_io_id); + data->err_io_id = 0; + } + hciemu_unref(data->hciemu); data->hciemu = NULL; } @@ -245,6 +272,7 @@ break; \ user->hciemu_type = HCIEMU_TYPE_BREDR; \ user->io_id = 0; \ + user->err_io_id = 0; \ user->test_data = data; \ tester_add_full(name, data, \ test_pre_setup, setup, func, NULL, \ @@ -259,6 +287,7 @@ break; \ user->hciemu_type = HCIEMU_TYPE_LE; \ user->io_id = 0; \ + user->err_io_id = 0; \ user->test_data = data; \ tester_add_full(name, data, \ test_pre_setup, setup, func, NULL, \ @@ -307,6 +336,16 @@ static uint8_t l2_data = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; +const uint8_t l2_data_32k32768 = { 0 ... 4095 = 0x00, + 4096 ... 8191 = 0x01, + 8192 ... 12287 = 0x02, + 12288 ... 16383 = 0x03, + 16384 ... 20479 = 0x04, + 20480 ... 24575 = 0x05, + 24576 ... 28671 = 0x06, + 28672 ... 32767 = 0x07, +}; + static const struct l2cap_data client_connect_read_success_test = { .client_psm = 0x1001, .server_psm = 0x1001, @@ -314,6 +353,13 @@ .data_len = sizeof(l2_data), }; +static const struct l2cap_data client_connect_read_32k_success_test = { + .client_psm = 0x1001, + .server_psm = 0x1001, + .read_data = l2_data_32k, + .data_len = sizeof(l2_data_32k), +}; + static const struct l2cap_data client_connect_write_success_test = { .client_psm = 0x1001, .server_psm = 0x1001, @@ -321,6 +367,24 @@ .data_len = sizeof(l2_data), }; +static const struct l2cap_data client_connect_write_32k_success_test = { + .client_psm = 0x1001, + .server_psm = 0x1001, + .write_data = l2_data_32k, + .data_len = sizeof(l2_data_32k), +}; + +static const struct l2cap_data client_connect_tx_timestamping_test = { + .client_psm = 0x1001, + .server_psm = 0x1001, + .write_data = l2_data, + .data_len = sizeof(l2_data), + .so_timestamping = (SOF_TIMESTAMPING_SOFTWARE | + SOF_TIMESTAMPING_OPT_ID | + SOF_TIMESTAMPING_TX_SOFTWARE), + .repeat_send = 2, +}; + static const struct l2cap_data client_connect_shut_wr_success_test = { .client_psm = 0x1001, .server_psm = 0x1001, @@ -363,6 +427,16 @@ .data_len = sizeof(l2_data), }; +static const struct l2cap_data l2cap_server_read_32k_success_test = { + .server_psm = 0x1001, + .send_cmd_code = BT_L2CAP_PDU_CONN_REQ, + .send_cmd = l2cap_connect_req, + .send_cmd_len = sizeof(l2cap_connect_req), + .expect_cmd_code = BT_L2CAP_PDU_CONN_RSP, + .read_data = l2_data_32k, + .data_len = sizeof(l2_data_32k), +}; + static const struct l2cap_data l2cap_server_write_success_test = { .server_psm = 0x1001, .send_cmd_code = BT_L2CAP_PDU_CONN_REQ, @@ -373,6 +447,16 @@ .data_len = sizeof(l2_data), }; +static const struct l2cap_data l2cap_server_write_32k_success_test = { + .server_psm = 0x1001, + .send_cmd_code = BT_L2CAP_PDU_CONN_REQ, + .send_cmd = l2cap_connect_req, + .send_cmd_len = sizeof(l2cap_connect_req), + .expect_cmd_code = BT_L2CAP_PDU_CONN_RSP, + .write_data = l2_data_32k, + .data_len = sizeof(l2_data_32k), +}; + static const uint8_t l2cap_sec_block_rsp = { 0x00, 0x00, /* dcid */ 0x41, 0x00, /* scid */ 0x03, 0x00, /* Sec Block */ @@ -457,6 +541,62 @@ .timeout = 1, }; +static const struct l2cap_data le_client_connect_read_success_test = { + .client_psm = 0x0080, + .server_psm = 0x0080, + .read_data = l2_data, + .data_len = sizeof(l2_data), +}; + +static const struct l2cap_data le_client_connect_read_32k_success_test = { + .client_psm = 0x0080, + .server_psm = 0x0080, + .mtu = 672, + .mps = 251, + /* Given enough credits to complete the transfer without waiting for + * more credits. + * credits = round_up(data size / mtu) * round_up(mtu / mps) + * credits = 49 * 3 + * credits = 147 + */ + .credits = 147, + .read_data = l2_data_32k, + .data_len = sizeof(l2_data_32k), +}; + +static const struct l2cap_data le_client_connect_write_success_test = { + .client_psm = 0x0080, + .server_psm = 0x0080, + .write_data = l2_data, + .data_len = sizeof(l2_data), +}; + +static const struct l2cap_data le_client_connect_write_32k_success_test = { + .client_psm = 0x0080, + .server_psm = 0x0080, + .mtu = 672, + .mps = 251, + /* Given enough credits to complete the transfer without waiting for + * more credits. + * credits = round_up(data size / mtu) * round_up(mtu / mps) + * credits = 49 * 3 + * credits = 147 + */ + .credits = 147, + .write_data = l2_data_32k, + .data_len = sizeof(l2_data_32k), +}; + +static const struct l2cap_data le_client_connect_tx_timestamping_test = { + .client_psm = 0x0080, + .server_psm = 0x0080, + .write_data = l2_data, + .data_len = sizeof(l2_data), + .so_timestamping = (SOF_TIMESTAMPING_SOFTWARE | + SOF_TIMESTAMPING_OPT_ID | + SOF_TIMESTAMPING_TX_SOFTWARE), +}; + static const struct l2cap_data le_client_connect_adv_success_test_1 = { .client_psm = 0x0080, .server_psm = 0x0080, @@ -1044,48 +1184,54 @@ tester_test_passed(); } -static gboolean client_received_data(GIOChannel *io, GIOCondition cond, - gpointer user_data) +static void received_data(struct test_data *tdata, const void *buf, + uint16_t len, const void *data, + uint16_t data_len) { - struct test_data *data = tester_get_data(); - const struct l2cap_data *l2data = data->test_data; - char buf1024; - int sk; + static struct iovec iov; - sk = g_io_channel_unix_get_fd(io); - if (read(sk, buf, l2data->data_len) != l2data->data_len) { - tester_warn("Unable to read %u bytes", l2data->data_len); - tester_test_failed(); - return FALSE; - } + util_iov_append(&iov, buf, len); + + tester_debug("read: %d/%zu", len, iov.iov_len); + + /* Check if all the data has been received */ + if (iov.iov_len < data_len) + return; - if (memcmp(buf, l2data->read_data, l2data->data_len)) + --tdata->step; + + if (iov.iov_len != data_len || memcmp(iov.iov_base, data, data_len)) tester_test_failed(); - else + else if (!tdata->step) tester_test_passed(); - return FALSE; + free(iov.iov_base); + iov.iov_base = NULL; + iov.iov_len = 0; } -static gboolean server_received_data(GIOChannel *io, GIOCondition cond, +static gboolean sock_received_data(GIOChannel *io, GIOCondition cond, gpointer user_data) { struct test_data *data = tester_get_data(); const struct l2cap_data *l2data = data->test_data; char buf1024; int sk; + ssize_t len; sk = g_io_channel_unix_get_fd(io); - if (read(sk, buf, l2data->data_len) != l2data->data_len) { - tester_warn("Unable to read %u bytes", l2data->data_len); + + len = read(sk, buf, sizeof(buf)); + if (len < 0) { + tester_warn("Unable to read: %s (%d)", strerror(errno), errno); tester_test_failed(); return FALSE; } - if (memcmp(buf, l2data->read_data, l2data->data_len)) - tester_test_failed(); - else - tester_test_passed(); + received_data(data, buf, len, l2data->read_data, l2data->data_len); + + if (data->step) + return TRUE; return FALSE; } @@ -1096,32 +1242,7 @@ struct test_data *data = tester_get_data(); const struct l2cap_data *l2data = data->test_data; - if (len != l2data->data_len) { - tester_test_failed(); - return; - } - - if (memcmp(buf, l2data->write_data, l2data->data_len)) - tester_test_failed(); - else - tester_test_passed(); -} - -static void server_bthost_received_data(const void *buf, uint16_t len, - void *user_data) -{ - struct test_data *data = tester_get_data(); - const struct l2cap_data *l2data = data->test_data; - - if (len != l2data->data_len) { - tester_test_failed(); - return; - } - - if (memcmp(buf, l2data->write_data, l2data->data_len)) - tester_test_failed(); - else - tester_test_passed(); + received_data(data, buf, len, l2data->write_data, l2data->data_len); } static gboolean socket_closed_cb(GIOChannel *io, GIOCondition cond, @@ -1168,45 +1289,180 @@ static bool check_mtu(struct test_data *data, int sk) { const struct l2cap_data *l2data = data->test_data; - struct l2cap_options l2o; socklen_t len; - memset(&l2o, 0, sizeof(l2o)); + memset(&data->l2o, 0, sizeof(data->l2o)); if (data->hciemu_type == HCIEMU_TYPE_LE && (l2data->client_psm || l2data->server_psm)) { /* LE CoC enabled kernels should support BT_RCVMTU and * BT_SNDMTU. */ - len = sizeof(l2o.imtu); + len = sizeof(data->l2o.imtu); if (getsockopt(sk, SOL_BLUETOOTH, BT_RCVMTU, - &l2o.imtu, &len) < 0) { + &data->l2o.imtu, &len) < 0) { tester_warn("getsockopt(BT_RCVMTU): %s (%d)", strerror(errno), errno); return false; } - len = sizeof(l2o.omtu); + len = sizeof(data->l2o.omtu); if (getsockopt(sk, SOL_BLUETOOTH, BT_SNDMTU, - &l2o.omtu, &len) < 0) { + &data->l2o.omtu, &len) < 0) { tester_warn("getsockopt(BT_SNDMTU): %s (%d)", strerror(errno), errno); return false; } + + /* Take SDU len into account */ + data->l2o.imtu -= 2; + data->l2o.omtu -= 2; } else { /* For non-LE CoC enabled kernels we need to fall back to * L2CAP_OPTIONS, so test support for it as well */ - len = sizeof(l2o); - if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &len) < 0) { + len = sizeof(data->l2o); + if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &data->l2o, + &len) < 0) { tester_warn("getsockopt(L2CAP_OPTIONS): %s (%d)", strerror(errno), errno); return false; - } + } } return true; } +static gboolean recv_errqueue(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + struct test_data *data = user_data; + const struct l2cap_data *l2data = data->test_data; + int sk = g_io_channel_unix_get_fd(io); + int err; + + data->step--; + + err = tx_tstamp_recv(&data->tx_ts, sk, l2data->data_len); + if (err > 0) + return TRUE; + else if (!err && !data->step) + tester_test_passed(); + else + tester_test_failed(); + + data->err_io_id = 0; + return FALSE; +} + +static void l2cap_tx_timestamping(struct test_data *data, GIOChannel *io) +{ + const struct l2cap_data *l2data = data->test_data; + int so = l2data->so_timestamping; + int sk; + int err; + unsigned int count; + + if (!(l2data->so_timestamping & SOF_TIMESTAMPING_TX_RECORD_MASK)) + return; + + sk = g_io_channel_unix_get_fd(io); + + tester_print("Enabling TX timestamping"); + + tx_tstamp_init(&data->tx_ts, l2data->so_timestamping); + + for (count = 0; count < l2data->repeat_send + 1; ++count) + data->step += tx_tstamp_expect(&data->tx_ts); + + err = setsockopt(sk, SOL_SOCKET, SO_TIMESTAMPING, &so, sizeof(so)); + if (err < 0) { + tester_warn("setsockopt SO_TIMESTAMPING: %s (%d)", + strerror(errno), errno); + tester_test_failed(); + return; + } + + data->err_io_id = g_io_add_watch(io, G_IO_ERR, recv_errqueue, data); +} + +static int l2cap_send(int sk, const void *data, size_t len, uint16_t mtu) +{ + struct iovec iov = { (void *)data, len }; + int err; + size_t total = 0; + + len = MIN(mtu, len); + + while (iov.iov_len) { + size_t l = MIN(iov.iov_len, len); + + err = write(sk, util_iov_pull_mem(&iov, l), l); + if (err < 0) + return -errno; + + total += err; + tester_debug("write: %d/%zu", err, total); + } + + return total; +} + +static void l2cap_read_data(struct test_data *data, GIOChannel *io, + uint16_t cid) +{ + const struct l2cap_data *l2data = data->test_data; + struct bthost *bthost; + struct iovec iov = { (void *)l2data->read_data, l2data->data_len }; + size_t len; + + data->step = 0; + + bthost = hciemu_client_get_host(data->hciemu); + g_io_add_watch(io, G_IO_IN, sock_received_data, NULL); + + len = MIN(iov.iov_len, data->l2o.imtu); + + while (iov.iov_len) { + size_t l = MIN(iov.iov_len, len); + + bthost_send_cid(bthost, data->handle, cid, + util_iov_pull_mem(&iov, l), l); + } + + ++data->step; +} + +static void l2cap_write_data(struct test_data *data, GIOChannel *io, + uint16_t cid) +{ + const struct l2cap_data *l2data = data->test_data; + struct bthost *bthost; + ssize_t ret; + int sk; + unsigned int count; + + sk = g_io_channel_unix_get_fd(io); + + data->step = 0; + + bthost = hciemu_client_get_host(data->hciemu); + bthost_add_cid_hook(bthost, data->handle, cid, bthost_received_data, + NULL); + + l2cap_tx_timestamping(data, io); + + for (count = 0; count < l2data->repeat_send + 1; ++count) { + ret = l2cap_send(sk, l2data->write_data, l2data->data_len, + data->l2o.omtu); + if (ret != l2data->data_len) { + tester_warn("Unable to write all data: " + "%zd != %u", ret, l2data->data_len); + tester_test_failed(); + } + ++data->step; + } +} + static gboolean l2cap_connect_cb(GIOChannel *io, GIOCondition cond, gpointer user_data) { @@ -1229,7 +1485,7 @@ goto failed; } - tester_print("Successfully connected"); + tester_print("Successfully connected to CID 0x%04x", data->dcid); if (!check_mtu(data, sk)) { tester_test_failed(); @@ -1237,29 +1493,10 @@ } if (l2data->read_data) { - struct bthost *bthost; - - bthost = hciemu_client_get_host(data->hciemu); - g_io_add_watch(io, G_IO_IN, client_received_data, NULL); - - bthost_send_cid(bthost, data->handle, data->dcid, - l2data->read_data, l2data->data_len); - + l2cap_read_data(data, io, data->dcid); return FALSE; } else if (l2data->write_data) { - struct bthost *bthost; - ssize_t ret; - - bthost = hciemu_client_get_host(data->hciemu); - bthost_add_cid_hook(bthost, data->handle, data->dcid, - bthost_received_data, NULL); - - ret = write(sk, l2data->write_data, l2data->data_len); - if (ret != l2data->data_len) { - tester_warn("Unable to write all data"); - tester_test_failed(); - } - + l2cap_write_data(data, io, data->dcid); return FALSE; } else if (l2data->shut_sock_wr) { g_io_add_watch(io, G_IO_HUP, socket_closed_cb, NULL); @@ -1413,6 +1650,8 @@ { struct test_data *data = user_data; + tester_debug("Client connect CID 0x%04x handle 0x%04x", cid, handle); + data->dcid = cid; data->handle = handle; } @@ -1473,9 +1712,20 @@ if (l2data->shut_sock_wr) host_disconnect_cb = client_l2cap_disconnect_cb; - bthost_add_l2cap_server(bthost, l2data->server_psm, - host_connect_cb, host_disconnect_cb, - data); + if (l2data->mtu || l2data->mps || l2data->credits) + bthost_add_l2cap_server_custom(bthost, + l2data->server_psm, + l2data->mtu, + l2data->mps, + l2data->credits, + host_connect_cb, + host_disconnect_cb, + data); + else + bthost_add_l2cap_server(bthost, l2data->server_psm, + host_connect_cb, + host_disconnect_cb, + data); } if (l2data->direct_advertising) @@ -1958,31 +2208,10 @@ } if (l2data->read_data) { - struct bthost *bthost; - - bthost = hciemu_client_get_host(data->hciemu); - g_io_add_watch(io, G_IO_IN, server_received_data, NULL); - bthost_send_cid(bthost, data->handle, data->dcid, - l2data->read_data, l2data->data_len); - - g_io_channel_unref(io); - + l2cap_read_data(data, io, data->dcid); return FALSE; } else if (l2data->write_data) { - struct bthost *bthost; - ssize_t ret; - - bthost = hciemu_client_get_host(data->hciemu); - bthost_add_cid_hook(bthost, data->handle, data->scid, - server_bthost_received_data, NULL); - - ret = write(sk, l2data->write_data, l2data->data_len); - - if (ret != l2data->data_len) { - tester_warn("Unable to write all data"); - tester_test_failed(); - } - + l2cap_write_data(data, io, data->scid); return FALSE; } @@ -2276,10 +2505,22 @@ &client_connect_read_success_test, setup_powered_client, test_connect); + test_l2cap_bredr("L2CAP BR/EDR Client - Read 32k Success", + &client_connect_read_32k_success_test, + setup_powered_client, test_connect); + test_l2cap_bredr("L2CAP BR/EDR Client - Write Success", &client_connect_write_success_test, setup_powered_client, test_connect); + test_l2cap_bredr("L2CAP BR/EDR Client - Write 32k Success", + &client_connect_write_32k_success_test, + setup_powered_client, test_connect); + + test_l2cap_bredr("L2CAP BR/EDR Client - TX Timestamping", + &client_connect_tx_timestamping_test, + setup_powered_client, test_connect); + test_l2cap_bredr("L2CAP BR/EDR Client - Invalid PSM 1", &client_connect_nval_psm_test_1, setup_powered_client, test_connect); @@ -2304,10 +2545,18 @@ &l2cap_server_read_success_test, setup_powered_server, test_server); + test_l2cap_bredr("L2CAP BR/EDR Server - Read 32k Success", + &l2cap_server_read_32k_success_test, + setup_powered_server, test_server); + test_l2cap_bredr("L2CAP BR/EDR Server - Write Success", &l2cap_server_write_success_test, setup_powered_server, test_server); + test_l2cap_bredr("L2CAP BR/EDR Server - Write 32k Success", + &l2cap_server_write_32k_success_test, + setup_powered_server, test_server); + test_l2cap_bredr("L2CAP BR/EDR Server - Security Block", &l2cap_server_sec_block_test, setup_powered_server, test_server); @@ -2334,6 +2583,21 @@ test_l2cap_le("L2CAP LE Client - Timeout", &le_client_connect_timeout_test_1, setup_powered_client, test_connect_timeout); + test_l2cap_le("L2CAP LE Client - Read Success", + &le_client_connect_read_success_test, + setup_powered_client, test_connect); + test_l2cap_le("L2CAP LE Client - Read 32k Success", + &le_client_connect_read_32k_success_test, + setup_powered_client, test_connect); + test_l2cap_le("L2CAP LE Client - Write Success", + &le_client_connect_write_success_test, + setup_powered_client, test_connect); + test_l2cap_le("L2CAP LE Client - Write 32k Success", + &le_client_connect_write_32k_success_test, + setup_powered_client, test_connect); + test_l2cap_le("L2CAP LE Client - TX Timestamping", + &le_client_connect_tx_timestamping_test, + setup_powered_client, test_connect); test_l2cap_le("L2CAP LE Client, Direct Advertising - Success", &le_client_connect_adv_success_test_1, setup_powered_client, test_connect);
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/l2test.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/l2test.c
Changed
@@ -913,7 +913,7 @@ timestamp = 0; memset(ts, 0, sizeof(ts)); } else { - sprintf(ts, "%lld.%lld ", + snprintf(ts, sizeof(ts), "%lld.%lld ", (long long)tv.tv_sec, (long long)tv.tv_usec); } @@ -975,6 +975,11 @@ buflen = (size > omtu) ? omtu : size; len = send(sk, buf + sent, buflen, 0); + if (len < 0) { + syslog(LOG_ERR, "Send failed: %s (%d)", + strerror(errno), errno); + exit(1); + } sent += len; size -= len;
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/mesh-cfgclient.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/mesh-cfgclient.c
Changed
@@ -2021,6 +2021,7 @@ result.server = server; result.rssi = rssi; result.id = 0; + result.last_seen = time(NULL); if (n > 16 && n <= 18) result.oob_info = l_get_be16(prov_data + 16); @@ -2043,8 +2044,6 @@ } else if (dev->rssi < result.rssi) *dev = result; - dev->last_seen = time(NULL); - l_queue_insert(devices, dev, sort_rssi, NULL); done:
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/mesh/mesh-db.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/mesh/mesh-db.c
Changed
@@ -503,7 +503,8 @@ uint8_t uuid16; uint16_t unicast, key_idx; const char *str; - int ele_cnt, key_cnt; + uint8_t ele_cnt; + int key_cnt; int j; jnode = json_object_array_get_idx(jnodes, i); @@ -528,14 +529,13 @@ continue; json_object_object_get_ex(jnode, "elements", &jarray); - if (!jarray || json_object_get_type(jarray) != json_type_array) + if (!jarray || + json_object_get_type(jarray) != json_type_array || + json_object_array_length(jarray) > MAX_ELE_COUNT) continue; ele_cnt = json_object_array_length(jarray); - if (ele_cnt > MAX_ELE_COUNT) - continue; - json_object_object_get_ex(jnode, "netKeys", &jarray); if (!jarray || json_object_get_type(jarray) != json_type_array) continue;
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/mgmt-tester.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/mgmt-tester.c
Changed
@@ -1688,53 +1688,6 @@ .expect_hci_len = sizeof(set_sc_on_write_sc_support_param), }; -static const char set_hs_on_param = { 0x01 }; -static const char set_hs_invalid_param = { 0x02 }; -static const char set_hs_garbage_param = { 0x01, 0x00 }; -static const char set_hs_settings_param_1 = { 0xc0, 0x01, 0x00, 0x00 }; - -static const struct generic_data set_hs_on_success_test = { - .setup_settings = settings_ssp, - .send_opcode = MGMT_OP_SET_HS, - .send_param = set_hs_on_param, - .send_len = sizeof(set_hs_on_param), - .expect_status = MGMT_STATUS_SUCCESS, - .expect_param = set_hs_settings_param_1, - .expect_len = sizeof(set_hs_settings_param_1), - .expect_settings_set = MGMT_SETTING_HS, -}; - -static const struct generic_data set_hs_on_invalid_param_test_1 = { - .setup_settings = settings_ssp, - .send_opcode = MGMT_OP_SET_HS, - .expect_status = MGMT_STATUS_INVALID_PARAMS, -}; - -static const struct generic_data set_hs_on_invalid_param_test_2 = { - .setup_settings = settings_ssp, - .send_opcode = MGMT_OP_SET_HS, - .send_param = set_hs_invalid_param, - .send_len = sizeof(set_hs_invalid_param), - .expect_status = MGMT_STATUS_INVALID_PARAMS, -}; - -static const struct generic_data set_hs_on_invalid_param_test_3 = { - .setup_settings = settings_ssp, - .send_opcode = MGMT_OP_SET_HS, - .send_param = set_hs_garbage_param, - .send_len = sizeof(set_hs_garbage_param), - .expect_status = MGMT_STATUS_INVALID_PARAMS, -}; - -static const struct generic_data set_hs_on_invalid_index_test = { - .setup_settings = settings_ssp, - .send_index_none = true, - .send_opcode = MGMT_OP_SET_HS, - .send_param = set_hs_on_param, - .send_len = sizeof(set_hs_on_param), - .expect_status = MGMT_STATUS_INVALID_INDEX, -}; - static uint16_t settings_le = { MGMT_OP_SET_LE, 0 }; static const char set_le_on_param = { 0x01 }; @@ -1886,14 +1839,13 @@ 'n', 'a', 'm', 'e' }; static const uint8_t set_adv_scan_rsp_data_name_1 = { - 0x0c, /* Scan rsp data len */ - 0x0b, /* Local name data len */ + 0x0b, /* Scan rsp data len */ + 0x0a, /* Local name data len */ 0x09, /* Complete name */ 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "Test name" */ - 0x00, /* null */ /* padding */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; static const struct generic_data set_adv_on_local_name_test_1 = { @@ -1926,17 +1878,16 @@ }; static const uint8_t set_adv_scan_rsp_data_name_and_appearance = { - 0x10, /* scan rsp data len */ + 0x0f, /* scan rsp data len */ 0x03, /* appearance data len */ 0x19, /* eir_appearance */ 0x54, 0x65, /* appearance value */ - 0x0b, /* local name data len */ + 0x0a, /* local name data len */ 0x09, /* complete name */ 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "test name" */ - 0x00, /* null */ /* padding */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; @@ -3216,7 +3167,7 @@ .send_opcode = MGMT_OP_PAIR_DEVICE, .send_func = pair_device_send_param_func, .force_power_off = true, - .expect_status = MGMT_STATUS_NOT_POWERED, + .expect_status = MGMT_STATUS_DISCONNECTED, .expect_func = pair_device_expect_param_func, }; @@ -5668,7 +5619,7 @@ 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ 0x09, /* version */ 0xf1, 0x05, /* manufacturer */ - 0xff, 0xbf, 0x01, 0x00, /* supported settings */ + 0xff, 0xbe, 0x01, 0x00, /* supported settings */ 0x80, 0x00, 0x00, 0x00, /* current settings */ 0x09, 0x00, /* eir length */ 0x04, /* dev class length */ @@ -5708,7 +5659,7 @@ 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ 0x09, /* version */ 0xf1, 0x05, /* manufacturer */ - 0xff, 0xbf, 0x01, 0x00, /* supported settings */ + 0xff, 0xbe, 0x01, 0x00, /* supported settings */ 0x81, 0x02, 0x00, 0x00, /* current settings */ 0x0D, 0x00, /* eir length */ 0x04, /* dev class length */ @@ -5740,7 +5691,7 @@ 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ 0x09, /* version */ 0xf1, 0x05, /* manufacturer */ - 0xff, 0xbf, 0x01, 0x00, /* supported settings */ + 0xff, 0xbe, 0x01, 0x00, /* supported settings */ 0x80, 0x02, 0x00, 0x00, /* current settings */ 0x16, 0x00, /* eir length */ 0x04, /* dev class length */ @@ -5775,7 +5726,7 @@ 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ 0x09, /* version */ 0xf1, 0x05, /* manufacturer */ - 0xff, 0xbf, 0x01, 0x00, /* supported settings */ + 0xff, 0xbe, 0x01, 0x00, /* supported settings */ 0x80, 0x02, 0x00, 0x00, /* current settings */ 0x1a, 0x00, /* eir length */ 0x04, /* dev class length */ @@ -5829,7 +5780,7 @@ 0x00, 0x00, 0x00, 0x01, 0xaa, 0x00, /* btaddr */ 0x09, /* version */ 0xf1, 0x05, /* manufacturer */ - 0xff, 0xbf, 0x01, 0x00, /* supported settings */ + 0xff, 0xbe, 0x01, 0x00, /* supported settings */ 0x81, 0x02, 0x00, 0x00, /* current settings */ 0x1a, 0x00, /* eir len */ 0x04, /* dev class len */ @@ -7899,8 +7850,8 @@ }; static const uint8_t set_scan_rsp_data_name_fits_in_scrsp = { - 0x0c, /* Scan rsp data len */ - 0x0b, /* Local name data len */ + 0x0b, /* Scan rsp data len */ + 0x0a, /* Local name data len */ 0x09, /* Complete name */ 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "Test name" */ /* padding */ @@ -7925,8 +7876,8 @@ }; static const uint8_t set_scan_rsp_data_shortened_name_fits = { - 0x0d, /* Scan rsp data len */ - 0x0c, /* Local name data len */ + 0x0c, /* Scan rsp data len */ + 0x0b, /* Local name data len */ 0x08, /* Short name */ 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x31, /* "Test name1" */ @@ -7952,8 +7903,8 @@ }; static const uint8_t set_scan_rsp_data_short_name_fits = { - 0x07, /* Scan rsp data len */ - 0x06, /* Local name data len */ + 0x06, /* Scan rsp data len */ + 0x05, /* Local name data len */ 0x08, /* Short name */ 0x54, 0x65, 0x73, 0x74, /* "Test*/ @@ -7993,16 +7944,16 @@ }; static const uint8_t set_scan_rsp_data_param_name_data_ok = { - 0x1e, /* Scan rsp data len */ + 0x1d, /* Scan rsp data len */ /* scan rsp data */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0b, /* Local name data len */ + 0x0a, /* Local name data len */ 0x09, /* Complete name */ - 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x00, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "Test name" */ /* padding */ - 0x00, + 0x00, 0x00, }; static const struct generic_data add_advertising_name_data_ok = { @@ -8097,19 +8048,19 @@ }; static const uint8_t set_scan_rsp_data_name_data_appear = { - 0x1e, /* Scan rsp data len */ + 0x1d, /* Scan rsp data len */ 0x03, /* appearance len */ 0x19, /* EIR_APPEARANCE */ 0x54, 0x65, /* appearance value */ /* scan rsp data */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0b, /* Local name data len */ + 0x0a, /* Local name data len */ 0x09, /* Complete name */ - 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x00, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "Test name" */ /* padding */ - 0x00, + 0x00, 0x00, }; static const struct generic_data add_advertising_name_data_appear = { @@ -8798,6 +8749,7 @@ .len = sizeof(le_set_ext_adv_enable_inst_2), .param = le_set_ext_adv_enable_inst_2, }, + {}, }; static const struct generic_data multi_ext_advertising_add_second_2 = { @@ -8845,6 +8797,7 @@ .len = sizeof(advertising_instance1_param), .param = advertising_instance1_param, }, + {}, }; static const struct generic_data multi_ext_advertising_remove = { @@ -8877,6 +8830,7 @@ { .opcode = BT_HCI_CMD_LE_CLEAR_ADV_SETS, }, + {}, }; static const struct generic_data multi_ext_advertising_remove_all = { @@ -8913,6 +8867,7 @@ .len = sizeof(set_ext_adv_data_test1), .param = set_ext_adv_data_test1, }, + {}, }; static const struct generic_data multi_ext_advertising_add_no_power = { @@ -9019,11 +8974,11 @@ 0x01, /* handle */ 0x03, /* complete data */ 0x01, /* controller should not fragment */ - 0x0c, /* Scan rsp data len */ - 0x0b, /* Local name data len */ + 0x0b, /* Scan rsp data len */ + 0x0a, /* Local name data len */ 0x09, /* Complete name */ /* "Test name" */ - 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x00, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, }; static const struct generic_data add_ext_advertising_name_fits_in_scrsp = { @@ -9046,11 +9001,11 @@ 0x01, /* handle */ 0x03, /* complete data */ 0x01, /* controller should not fragment */ - 0x0d, /* Scan rsp data len */ - 0x0c, /* Local name data len */ + 0x0c, /* Scan rsp data len */ + 0x0b, /* Local name data len */ 0x08, /* Short name */ /* "Test name1" */ - 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x31, 0x00, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x31, }; static const struct generic_data add_ext_advertising_shortened_name_in_scrsp = { @@ -9073,13 +9028,13 @@ 0x01, /* handle */ 0x03, /* complete data */ 0x01, /* controller should not fragment */ - 0x1e, /* Scan rsp data len */ + 0x1d, /* Scan rsp data len */ /* scan rsp data */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0b, /* Local name data len */ + 0x0a, /* Local name data len */ 0x09, /* Complete name */ - 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x00, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "Test name" */ }; @@ -9116,16 +9071,16 @@ 0x01, /* handle */ 0x03, /* complete data */ 0x01, /* controller should not fragment */ - 0x1e, /* Scan rsp data len */ + 0x1d, /* Scan rsp data len */ 0x03, /* appearance len */ 0x19, /* EIR_APPEARANCE */ 0x54, 0x65, /* appearance value */ /* scan rsp data */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0b, /* Local name data len */ + 0x0a, /* Local name data len */ 0x09, /* Complete name */ - 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x00, + 0x54, 0x65, 0x73, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, /* "Test name" */ }; @@ -9696,8 +9651,8 @@ 0x12, 0x00, /* Interval */ 0x12, 0x00, /* Window */ 0x01, /* Type */ - 0x12, 0x00, /* Interval */ - 0x12, 0x00, /* Window */ + 0x36, 0x00, /* Interval */ + 0x36, 0x00, /* Window */ }; static const struct generic_data start_discovery_le_ext_scan_param = { @@ -9778,8 +9733,8 @@ 0x12, 0x00, /* Interval */ 0x12, 0x00, /* Window */ 0x01, /* Type */ - 0x12, 0x00, /* Interval */ - 0x12, 0x00, /* Window */ + 0x36, 0x00, /* Interval */ + 0x36, 0x00, /* Window */ }; static const struct generic_data start_discovery_le_coded_scan_param = { @@ -9809,8 +9764,8 @@ 0x12, 0x00, /* Interval */ 0x12, 0x00, /* Window */ 0x01, /* Type */ - 0x12, 0x00, /* Interval */ - 0x12, 0x00, /* Window */ + 0x36, 0x00, /* Interval */ + 0x36, 0x00, /* Window */ }; static const struct generic_data start_discovery_le_1m_coded_scan_param = { @@ -10378,6 +10333,7 @@ .param = set_resolv_on_param, .len = sizeof(set_resolv_on_param), }, + {}, }; static const struct generic_data ll_privacy_add_device_3 = { @@ -10495,6 +10451,7 @@ .len = sizeof(le_add_to_resolv_list_param), .param = le_add_to_resolv_list_param }, + {}, }; static const struct generic_data ll_privacy_add_device_9 = { @@ -10823,6 +10780,7 @@ .param = set_resolv_on_param, .len = sizeof(set_resolv_on_param), }, + {}, }; static const uint8_t device_flags_changed_params_1 = { @@ -12698,18 +12656,22 @@ struct test_data *data = tester_get_data(); const struct generic_data *test = data->test_data; struct vhci *vhci = hciemu_get_vhci(data->hciemu); - char bufMAX_COREDUMP_BUF_LEN = {0}; + char bufMAX_COREDUMP_BUF_LEN + 1 = {0}; + int read; char delim = "\n"; char *line; char *saveptr; int i = 0; /* Read the generated devcoredump file */ - if (vhci_read_devcd(vhci, buf, sizeof(buf)) <= 0) { + read = vhci_read_devcd(vhci, buf, MAX_COREDUMP_BUF_LEN); + if (read <= 0) { tester_warn("Unable to read devcoredump"); tester_test_failed(); return; } + /* Make sure buf is nul-terminated */ + bufread = '\0'; /* Verify if all devcoredump header fields are present */ line = strtok_r(buf, delim, &saveptr); @@ -13081,22 +13043,6 @@ &set_sc_only_on_success_test_2, NULL, test_command_generic); - test_hs("Set High Speed on - Success", - &set_hs_on_success_test, - NULL, test_command_generic); - test_hs("Set High Speed on - Invalid parameters 1", - &set_hs_on_invalid_param_test_1, - NULL, test_command_generic); - test_hs("Set High Speed on - Invalid parameters 2", - &set_hs_on_invalid_param_test_2, - NULL, test_command_generic); - test_hs("Set High Speed on - Invalid parameters 3", - &set_hs_on_invalid_param_test_3, - NULL, test_command_generic); - test_hs("Set High Speed on - Invalid index", - &set_hs_on_invalid_index_test, - NULL, test_command_generic); - test_bredrle("Set Low Energy on - Success 1", &set_le_on_success_test_1, NULL, test_command_generic);
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/rctest.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/rctest.c
Changed
@@ -41,6 +41,8 @@ #define SIOCGSTAMP_OLD SIOCGSTAMP #endif +#define MAX_DATA_SIZE 0x40000000 + /* Test modes */ enum { SEND, @@ -500,7 +502,7 @@ timestamp = 0; memset(ts, 0, sizeof(ts)); } else { - sprintf(ts, "%lld.%lld ", + snprintf(ts, sizeof(ts), "%lld.%lld ", (long long)tv.tv_sec, (long long)tv.tv_usec); } @@ -554,7 +556,8 @@ exit(1); } len = read(fd, buf, data_size); - send(sk, buf, len, 0); + if (len > 0) + send(sk, buf, len, 0); close(fd); return; } else { @@ -748,7 +751,8 @@ break; case 'b': - data_size = atoi(optarg); + if (optarg && atoi(optarg) < MAX_DATA_SIZE) + data_size = atoi(optarg); break; case 'i':
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/rfcomm-tester.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/rfcomm-tester.c
Changed
@@ -30,6 +30,7 @@ #include "src/shared/tester.h" #include "src/shared/mgmt.h" +#include "src/shared/util.h" struct test_data { struct mgmt *mgmt; @@ -815,9 +816,7 @@ #define test_rfcomm(name, data, setup, func) \ do { \ struct test_data *user; \ - user = malloc(sizeof(struct test_data)); \ - if (!user) \ - break; \ + user = new0(struct test_data, 1); \ user->hciemu_type = HCIEMU_TYPE_BREDRLE52; \ user->test_data = data; \ user->io_id = 0; \
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/rfcomm.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/rfcomm.c
Changed
@@ -212,6 +212,7 @@ int i; pid_t pid; char **cmdargv; + struct sigaction sa; cmdargv = malloc((argc + 1) * sizeof(char *)); if (!cmdargv) @@ -225,10 +226,15 @@ switch (pid) { case 0: + memset(&sa, 0, sizeof(sa)); + sa.sa_handler = SIG_DFL; + sigaction(SIGCHLD, &sa, NULL); + sigaction(SIGPIPE, &sa, NULL); + i = execvp(cmdargv0, cmdargv); fprintf(stderr, "Couldn't execute command %s (errno=%d:%s)\n", cmdargv0, errno, strerror(errno)); - break; + _exit(EXIT_FAILURE); case -1: fprintf(stderr, "Couldn't fork to execute command %s\n", cmdargv0);
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/sco-tester.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/sco-tester.c
Changed
@@ -31,6 +31,8 @@ #include "src/shared/mgmt.h" #include "src/shared/util.h" +#include "tester.h" + struct test_data { const void *test_data; struct mgmt *mgmt; @@ -38,15 +40,24 @@ struct hciemu *hciemu; enum hciemu_type hciemu_type; unsigned int io_id; + unsigned int err_io_id; int sk; bool disable_esco; bool enable_codecs; + int step; + struct tx_tstamp_data tx_ts; }; struct sco_client_data { int expect_err; const uint8_t *send_data; uint16_t data_len; + + /* Enable SO_TIMESTAMPING with these flags */ + uint32_t so_timestamping; + + /* Number of additional packets to send. */ + unsigned int repeat_send; }; static void print_debug(const char *str, void *user_data) @@ -186,6 +197,12 @@ static void test_pre_setup(const void *test_data) { struct test_data *data = tester_get_data(); + const struct sco_client_data *scodata = test_data; + + if (scodata && scodata->so_timestamping) { + if (tester_pre_setup_skip_by_default()) + return; + } data->mgmt = mgmt_new_default(); if (!data->mgmt) { @@ -227,8 +244,10 @@ break; \ user->hciemu_type = HCIEMU_TYPE_BREDRLE; \ user->io_id = 0; \ + user->err_io_id = 0; \ user->sk = -1; \ user->test_data = data; \ + user->step = 0; \ user->disable_esco = _disable_esco; \ user->enable_codecs = _enable_codecs; \ tester_add_full(name, data, \ @@ -265,6 +284,16 @@ .send_data = data }; +static const struct sco_client_data connect_send_tx_timestamping = { + .expect_err = 0, + .data_len = sizeof(data), + .send_data = data, + .so_timestamping = (SOF_TIMESTAMPING_SOFTWARE | + SOF_TIMESTAMPING_OPT_ID | + SOF_TIMESTAMPING_TX_SOFTWARE), + .repeat_send = 2, +}; + static void client_connectable_complete(uint16_t opcode, uint8_t status, const void *param, uint8_t len, void *user_data) @@ -595,6 +624,59 @@ return 0; } +static gboolean recv_errqueue(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + struct test_data *data = user_data; + const struct sco_client_data *scodata = data->test_data; + int sk = g_io_channel_unix_get_fd(io); + int err; + + data->step--; + + err = tx_tstamp_recv(&data->tx_ts, sk, scodata->data_len); + if (err > 0) + return TRUE; + else if (!err && !data->step) + tester_test_passed(); + else + tester_test_failed(); + + data->err_io_id = 0; + return FALSE; +} + +static void sco_tx_timestamping(struct test_data *data, GIOChannel *io) +{ + const struct sco_client_data *scodata = data->test_data; + int so = scodata->so_timestamping; + int sk; + int err; + unsigned int count; + + if (!(scodata->so_timestamping & SOF_TIMESTAMPING_TX_RECORD_MASK)) + return; + + sk = g_io_channel_unix_get_fd(io); + + tester_print("Enabling TX timestamping"); + + tx_tstamp_init(&data->tx_ts, scodata->so_timestamping); + + for (count = 0; count < scodata->repeat_send + 1; ++count) + data->step += tx_tstamp_expect(&data->tx_ts); + + err = setsockopt(sk, SOL_SOCKET, SO_TIMESTAMPING, &so, sizeof(so)); + if (err < 0) { + tester_warn("setsockopt SO_TIMESTAMPING: %s (%d)", + strerror(errno), errno); + tester_test_failed(); + return; + } + + data->err_io_id = g_io_add_watch(io, G_IO_ERR, recv_errqueue, data); +} + static gboolean sco_connect_cb(GIOChannel *io, GIOCondition cond, gpointer user_data) { @@ -618,11 +700,21 @@ tester_print("Successfully connected"); if (scodata->send_data) { - ssize_t ret; + ssize_t ret = 0; + unsigned int count; + + data->step = 0; - tester_print("Writing %u bytes of data", scodata->data_len); + sco_tx_timestamping(data, io); - ret = write(sk, scodata->send_data, scodata->data_len); + tester_print("Writing %u*%u bytes of data", + scodata->repeat_send + 1, scodata->data_len); + + for (count = 0; count < scodata->repeat_send + 1; ++count) { + ret = write(sk, scodata->send_data, scodata->data_len); + if (scodata->data_len != ret) + break; + } if (scodata->data_len != ret) { tester_warn("Failed to write %u bytes: %zu %s (%d)", scodata->data_len, ret, strerror(errno), @@ -633,7 +725,7 @@ if (-err != scodata->expect_err) tester_test_failed(); - else + else if (!data->step) tester_test_passed(); return FALSE; @@ -869,6 +961,10 @@ test_sco("SCO CVSD Send - Success", &connect_send_success, setup_powered, test_connect); + test_sco("SCO CVSD Send - TX Timestamping", + &connect_send_tx_timestamping, + setup_powered, test_connect); + test_offload_sco("Basic SCO Get Socket Option - Offload - Success", NULL, setup_powered, test_codecs_getsockopt);
View file
_service:tar_scm:bluez-5.71.tar.xz/tools/test-runner.c -> _service:tar_scm:bluez-5.77.tar.xz/tools/test-runner.c
Changed
@@ -302,10 +302,10 @@ const char *path = "/tmp/bt-server-bredr"; char *chrdev, *serdev; - chrdev = alloca(32 + strlen(path)); + chrdev = alloca(48 + strlen(path)); sprintf(chrdev, "socket,path=%s,id=bt%d", path, i); - serdev = alloca(32); + serdev = alloca(48); sprintf(serdev, "pci-serial,chardev=bt%d", i); argvpos++ = "-chardev"; @@ -641,7 +641,7 @@ static pid_t start_btmon(const char *home) { const char *monitor = NULL; - char *argv3, *envp2; + char *argv3; pid_t pid; int i; @@ -679,7 +679,7 @@ } if (pid == 0) { - execve(argv0, argv, envp); + execv(argv0, argv); exit(EXIT_SUCCESS); } @@ -698,7 +698,7 @@ static pid_t start_btvirt(const char *home) { const char *btvirt = NULL; - char *argv3, *envp2; + char *argv3; pid_t pid; int i; @@ -736,7 +736,7 @@ } if (pid == 0) { - execve(argv0, argv, envp); + execv(argv0, argv); exit(EXIT_SUCCESS); } @@ -912,6 +912,11 @@ audio_pid0 = audio_pid1 = -1; start_next: + if (!run_auto && !cmdname) { + fprintf(stderr, "Missing command argument\n"); + return; + } + if (run_auto) { if (chdir(home + 5) < 0) { perror("Failed to change home test directory"); @@ -947,6 +952,8 @@ pid = fork(); if (pid < 0) { perror("Failed to fork new process"); + if (serial_fd >= 0) + close(serial_fd); return; }
View file
_service:tar_scm:bluez-5.77.tar.xz/tools/tester.h
Added
@@ -0,0 +1,166 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2022 Intel Corporation. + * + */ + +#include <stdbool.h> +#include <stdlib.h> +#include <stdint.h> +#include <time.h> +#include <sys/socket.h> +#include <linux/errqueue.h> +#include <linux/net_tstamp.h> + +#include <glib.h> + +#define SEC_NSEC(_t) ((_t) * 1000000000LL) +#define TS_NSEC(_ts) (SEC_NSEC((_ts)->tv_sec) + (_ts)->tv_nsec) + +struct tx_tstamp_data { + struct { + uint32_t id; + uint32_t type; + } expect16; + unsigned int pos; + unsigned int count; + unsigned int sent; + uint32_t so_timestamping; +}; + +static inline void tx_tstamp_init(struct tx_tstamp_data *data, + uint32_t so_timestamping) +{ + memset(data, 0, sizeof(*data)); + memset(data->expect, 0xff, sizeof(data->expect)); + + data->so_timestamping = so_timestamping; +} + +static inline int tx_tstamp_expect(struct tx_tstamp_data *data) +{ + unsigned int pos = data->count; + int steps; + + if (data->so_timestamping & SOF_TIMESTAMPING_TX_SCHED) { + g_assert(pos < ARRAY_SIZE(data->expect)); + data->expectpos.type = SCM_TSTAMP_SCHED; + data->expectpos.id = data->sent; + pos++; + } + + if (data->so_timestamping & SOF_TIMESTAMPING_TX_SOFTWARE) { + g_assert(pos < ARRAY_SIZE(data->expect)); + data->expectpos.type = SCM_TSTAMP_SND; + data->expectpos.id = data->sent; + pos++; + } + + data->sent++; + + steps = pos - data->count; + data->count = pos; + return steps; +} + +static inline int tx_tstamp_recv(struct tx_tstamp_data *data, int sk, int len) +{ + unsigned char control512; + ssize_t ret; + char buf1024; + struct msghdr msg; + struct iovec iov; + struct cmsghdr *cmsg; + struct scm_timestamping *tss = NULL; + struct sock_extended_err *serr = NULL; + struct timespec now; + + iov.iov_base = buf; + iov.iov_len = sizeof(buf); + + memset(&msg, 0, sizeof(msg)); + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = control; + msg.msg_controllen = sizeof(control); + + ret = recvmsg(sk, &msg, MSG_ERRQUEUE); + if (ret < 0) { + if (ret == EAGAIN || ret == EWOULDBLOCK) + return data->count - data->pos; + + tester_warn("Failed to read from errqueue: %s (%d)", + strerror(errno), errno); + return -EINVAL; + } + + if (data->so_timestamping & SOF_TIMESTAMPING_OPT_TSONLY) { + if (ret != 0) { + tester_warn("Packet copied back to errqueue"); + return -EINVAL; + } + } else if (len > ret) { + tester_warn("Packet not copied back to errqueue: %zd", ret); + return -EINVAL; + } + + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_TIMESTAMPING) { + tss = (void *)CMSG_DATA(cmsg); + } else if (cmsg->cmsg_level == SOL_BLUETOOTH && + cmsg->cmsg_type == BT_SCM_ERROR) { + serr = (void *)CMSG_DATA(cmsg); + } + } + + if (!tss) { + tester_warn("SCM_TIMESTAMPING not found"); + return -EINVAL; + } + + if (!serr) { + tester_warn("BT_SCM_ERROR not found"); + return -EINVAL; + } + + if (serr->ee_errno != ENOMSG || + serr->ee_origin != SO_EE_ORIGIN_TIMESTAMPING) { + tester_warn("BT_SCM_ERROR wrong for timestamping"); + return -EINVAL; + } + + clock_gettime(CLOCK_REALTIME, &now); + + if (TS_NSEC(&now) < TS_NSEC(tss->ts) || + TS_NSEC(&now) > TS_NSEC(tss->ts) + SEC_NSEC(10)) { + tester_warn("nonsense in timestamp"); + return -EINVAL; + } + + if (data->pos >= data->count) { + tester_warn("Too many timestamps"); + return -EINVAL; + } + + if ((data->so_timestamping & SOF_TIMESTAMPING_OPT_ID) && + serr->ee_data != data->expectdata->pos.id) { + tester_warn("Bad timestamp id %u", serr->ee_data); + return -EINVAL; + } + + if (serr->ee_info != data->expectdata->pos.type) { + tester_warn("Bad timestamp type %u", serr->ee_info); + return -EINVAL; + } + + tester_print("Got valid TX timestamp %u", data->pos); + + ++data->pos; + + return data->count - data->pos; +}
View file
_service:tar_scm:bluez-5.71.tar.xz/unit/test-bap.c -> _service:tar_scm:bluez-5.77.tar.xz/unit/test-bap.c
Changed
@@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. + * Copyright 2024 NXP * * */ @@ -35,12 +36,14 @@ struct test_config { struct bt_bap_pac_qos pqos; struct iovec cc; + struct iovec base; struct bt_bap_qos qos; bool snk; bool src; bool vs; uint8_t state; bt_bap_state_func_t state_func; + uint8_t streams; }; struct test_data { @@ -49,9 +52,12 @@ struct bt_bap *bap; struct bt_bap_pac *snk; struct bt_bap_pac *src; + struct bt_bap_pac *bsrc; + struct bt_bap_pac *bsnk; + struct iovec *base; struct iovec *caps; struct test_config *cfg; - struct bt_bap_stream *stream; + struct queue *streams; size_t iovcnt; struct iovec *iov; }; @@ -60,14 +66,14 @@ * Frequencies: 8Khz 11Khz 16Khz 22Khz 24Khz 32Khz 44.1Khz 48Khz * Duration: 7.5 ms 10 ms * Channel count: 3 - * Frame length: 30-240 + * Frame length: 26-240 */ static struct iovec lc3_caps = LC3_CAPABILITIES(LC3_FREQ_ANY, LC3_DURATION_ANY, - 3u, 30, 240); + 3u, 26, 240); #define iov_data(args...) ((const struct iovec) { args }) -#define define_test(name, function, _cfg, args...) \ +#define define_test(name, setup, function, _cfg, args...) \ do { \ const struct iovec iov = { args }; \ static struct test_data data; \ @@ -75,7 +81,8 @@ data.cfg = _cfg; \ data.iovcnt = ARRAY_SIZE(iov_data(args)); \ data.iov = util_iov_dup(iov, ARRAY_SIZE(iov_data(args))); \ - tester_add(name, &data, test_setup, function, \ + data.streams = queue_new(); \ + tester_add(name, &data, setup, function, \ test_teardown); \ } while (0) @@ -368,11 +375,13 @@ case BT_BAP_STREAM_STATE_ENABLING: return; case BT_BAP_STREAM_STATE_DISABLING: - id = bt_bap_stream_disable(data->stream, true, bap_disable, + id = bt_bap_stream_disable(stream, true, bap_disable, data); break; case BT_BAP_STREAM_STATE_STREAMING: - id = bt_bap_stream_start(data->stream, bap_start, data); + if (data->cfg->snk) + return; + id = bt_bap_stream_start(stream, bap_start, data); break; } @@ -393,7 +402,7 @@ if (data->cfg->state > BT_BAP_STREAM_STATE_QOS) { unsigned int qos_id; - qos_id = bt_bap_stream_enable(data->stream, true, NULL, + qos_id = bt_bap_stream_enable(stream, true, NULL, bap_enable, data); g_assert(qos_id); } @@ -413,7 +422,7 @@ if (data->cfg->state > BT_BAP_STREAM_STATE_CONFIG) { unsigned int qos_id; - qos_id = bt_bap_stream_qos(data->stream, &data->cfg->qos, + qos_id = bt_bap_stream_qos(stream, &data->cfg->qos, bap_qos, data); g_assert(qos_id); } @@ -424,13 +433,16 @@ { struct test_data *data = user_data; unsigned int config_id; + struct bt_bap_stream *stream; - data->stream = bt_bap_stream_new(data->bap, lpac, rpac, + stream = bt_bap_stream_new(data->bap, lpac, rpac, &data->cfg->qos, &data->cfg->cc); - g_assert(data->stream); + g_assert(stream); + + queue_push_tail(data->streams, stream); - config_id = bt_bap_stream_config(data->stream, &data->cfg->qos, + config_id = bt_bap_stream_config(stream, &data->cfg->qos, &data->cfg->cc, bap_config, data); g_assert(config_id); @@ -506,6 +518,186 @@ bt_bap_attach(data->bap, data->client); } +static int pac_config(struct bt_bap_stream *stream, struct iovec *cfg, + struct bt_bap_qos *qos, bt_bap_pac_config_t cb, + void *user_data) +{ + cb(stream, 0); + + return 0; +} + +static struct bt_bap_pac_ops bcast_pac_ops = { + .config = pac_config, +}; + +static void bsrc_pac_added(struct bt_bap_pac *pac, void *user_data) +{ + struct test_data *data = user_data; + struct bt_bap_stream *stream; + + bt_bap_pac_set_ops(pac, &bcast_pac_ops, NULL); + + for (uint8_t i = 0; i < data->cfg->streams; i++) { + stream = bt_bap_stream_new(data->bap, pac, NULL, + &data->cfg->qos, + &data->cfg->cc); + g_assert(stream); + + queue_push_tail(data->streams, stream); + + bt_bap_stream_config(stream, &data->cfg->qos, + &data->cfg->cc, NULL, data); + } +} + +static void bsrc_state_cfg(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + struct test_data *data = user_data; + + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + data->base = bt_bap_stream_get_base(stream); + + g_assert(data->base); + g_assert(data->base->iov_len == data->cfg->base.iov_len); + g_assert(memcmp(data->base->iov_base, data->cfg->base.iov_base, + data->base->iov_len) == 0); + + tester_test_passed(); + break; + } +} + +static void bsnk_pac_added(struct bt_bap_pac *pac, void *user_data) +{ + struct test_data *data = user_data; + struct bt_bap_pac *lpac; + struct iovec *cc; + struct bt_bap_codec codec = {0}; + struct bt_bap_stream *stream; + uint8_t bis_idx = 1; + + bt_bap_pac_set_ops(pac, &bcast_pac_ops, NULL); + + if (data->cfg->vs) + codec.id = 0xff; + else + codec.id = LC3_ID; + + for (uint8_t i = 0; i < data->cfg->streams; i++) { + bt_bap_verify_bis(data->bap, bis_idx++, &codec, + &data->cfg->cc, NULL, &lpac, &cc); + + g_assert(lpac); + g_assert(pac == lpac); + g_assert(cc); + + stream = bt_bap_stream_new(data->bap, + pac, NULL, &data->cfg->qos, cc); + + g_assert(stream); + + queue_push_tail(data->streams, stream); + + bt_bap_stream_config(stream, &data->cfg->qos, + cc, NULL, NULL); + + util_iov_free(cc, 1); + } +} + +static void bsnk_state(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + struct test_data *data = user_data; + struct iovec *cc; + + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + /* Check that stream has been configured as expected */ + cc = bt_bap_stream_get_config(stream); + + g_assert(cc); + g_assert(cc->iov_len == data->cfg->cc.iov_len); + g_assert(memcmp(cc->iov_base, data->cfg->cc.iov_base, + cc->iov_len) == 0); + + tester_test_passed(); + break; + } +} + +static void test_bcast_config(struct test_data *data) +{ + if (!data->cfg) + return; + + if (data->cfg->src) { + bt_bap_pac_register(data->bap, bsrc_pac_added, + NULL, data, NULL); + + if (data->cfg->vs) + data->bsrc = bt_bap_add_vendor_pac(data->db, + "test-bap-bsrc", + BT_BAP_BCAST_SOURCE, + 0x0ff, 0x0000, 0x0000, + NULL, data->caps, + NULL); + else + data->bsrc = bt_bap_add_pac(data->db, "test-bap-bsrc", + BT_BAP_BCAST_SOURCE, + LC3_ID, + NULL, data->caps, + NULL); + + g_assert(data->bsrc); + } + + if (data->cfg->snk) { + bt_bap_pac_register(data->bap, bsnk_pac_added, + NULL, data, NULL); + + if (data->cfg->vs) + data->bsnk = bt_bap_add_vendor_pac(data->db, + "test-bap-bsnk", + BT_BAP_BCAST_SINK, + 0xff, 0x0000, 0x0000, + NULL, data->caps, + NULL); + else + data->bsnk = bt_bap_add_pac(data->db, "test-bap-bsnk", + BT_BAP_BCAST_SINK, + LC3_ID, + NULL, data->caps, + NULL); + + g_assert(data->bsnk); + } +} + +static void test_bcast(const void *user_data) +{ + struct test_data *data = (void *)user_data; + + data->db = gatt_db_new(); + g_assert(data->db); + + data->bap = bt_bap_new(data->db, data->db); + g_assert(data->bap); + + bt_bap_set_debug(data->bap, print_debug, "bt_bap:", NULL); + + bt_bap_attach_broadcast(data->bap); + + if (data->cfg && data->cfg->state_func) + bt_bap_state_register(data->bap, data->cfg->state_func, NULL, + data, NULL); + + test_bcast_config(data); +} + static void test_teardown(const void *user_data) { struct test_data *data = (void *)user_data; @@ -514,10 +706,16 @@ bt_gatt_client_unref(data->client); util_iov_free(data->iov, data->iovcnt); + util_iov_free(data->base, 1); + bt_bap_remove_pac(data->snk); bt_bap_remove_pac(data->src); + bt_bap_remove_pac(data->bsrc); + bt_bap_remove_pac(data->bsnk); gatt_db_unref(data->db); + queue_destroy(data->streams, NULL); + tester_teardown_complete(); } @@ -738,22 +936,25 @@ * The IUT reads the values of the characteristics specified in the PAC * Characteristic and Location Characteristic columns. */ - define_test("BAP/UCL/DISC/BV-01-C", test_client, NULL, DISC_SNK_LC3); - define_test("BAP/UCL/DISC/BV-02-C", test_client, NULL, DISC_SRC_LC3); + define_test("BAP/UCL/DISC/BV-01-C", test_setup, test_client, NULL, + DISC_SNK_LC3); + define_test("BAP/UCL/DISC/BV-02-C", test_setup, test_client, NULL, + DISC_SRC_LC3); /* BAP/UCL/DISC/BV-06-C Discover Available Audio Contexts * * The IUT successfully reads the value of the Available Audio Contexts * characteristic on the LowerTester. */ - define_test("BAP/UCL/DISC/BV-06-C", test_client, NULL, DISC_CTX_LC3); + define_test("BAP/UCL/DISC/BV-06-C", test_setup, test_client, NULL, + DISC_CTX_LC3); /* BAP/UCL/DISC/BV-05-C Discover Supported Audio Contexts * * The IUT successfully reads the value of the Supported Audio Contexts * characteristic on the Lower Tester. */ - define_test("BAP/UCL/DISC/BV-05-C", test_client, NULL, + define_test("BAP/UCL/DISC/BV-05-C", test_setup, test_client, NULL, DISC_SUP_CTX_LC3); /* BAP/UCL/DISC/BV-03-C Discover Sink ASE_ID @@ -762,9 +963,9 @@ * The IUT successfully reads the ASE_ID values of each discovered ASE * characteristic on the LowerTester. */ - define_test("BAP/UCL/DISC/BV-03-C", test_client, NULL, + define_test("BAP/UCL/DISC/BV-03-C", test_setup, test_client, NULL, DISC_SNK_ASE_LC3); - define_test("BAP/UCL/DISC/BV-04-C", test_client, NULL, + define_test("BAP/UCL/DISC/BV-04-C", test_setup, test_client, NULL, DISC_SRC_ASE_LC3); } @@ -1158,69 +1359,69 @@ static void test_scc_cc_lc3(void) { define_test("BAP/UCL/SCC/BV-001-C UCL SRC Config Codec, LC3 8_1", - test_client, &cfg_snk_8_1, SCC_SNK_8_1); + test_setup, test_client, &cfg_snk_8_1, SCC_SNK_8_1); define_test("BAP/UCL/SCC/BV-002-C UCL SRC Config Codec, LC3 8_2", - test_client, &cfg_snk_8_2, SCC_SNK_8_2); + test_setup, test_client, &cfg_snk_8_2, SCC_SNK_8_2); define_test("BAP/UCL/SCC/BV-003-C UCL SRC Config Codec, LC3 16_1", - test_client, &cfg_snk_16_1, SCC_SNK_16_1); + test_setup, test_client, &cfg_snk_16_1, SCC_SNK_16_1); define_test("BAP/UCL/SCC/BV-004-C UCL SRC Config Codec, LC3 16_2", - test_client, &cfg_snk_16_2, SCC_SNK_16_2); + test_setup, test_client, &cfg_snk_16_2, SCC_SNK_16_2); define_test("BAP/UCL/SCC/BV-005-C UCL SRC Config Codec, LC3 24_1", - test_client, &cfg_snk_24_1, SCC_SNK_24_1); + test_setup, test_client, &cfg_snk_24_1, SCC_SNK_24_1); define_test("BAP/UCL/SCC/BV-006-C UCL SRC Config Codec, LC3 24_2", - test_client, &cfg_snk_24_2, SCC_SNK_24_2); + test_setup, test_client, &cfg_snk_24_2, SCC_SNK_24_2); define_test("BAP/UCL/SCC/BV-007-C UCL SRC Config Codec, LC3 32_1", - test_client, &cfg_snk_32_1, SCC_SNK_32_1); + test_setup, test_client, &cfg_snk_32_1, SCC_SNK_32_1); define_test("BAP/UCL/SCC/BV-008-C UCL SRC Config Codec, LC3 32_2", - test_client, &cfg_snk_32_2, SCC_SNK_32_2); + test_setup, test_client, &cfg_snk_32_2, SCC_SNK_32_2); define_test("BAP/UCL/SCC/BV-009-C UCL SRC Config Codec, LC3 44.1_1", - test_client, &cfg_snk_44_1, SCC_SNK_44_1); + test_setup, test_client, &cfg_snk_44_1, SCC_SNK_44_1); define_test("BAP/UCL/SCC/BV-010-C UCL SRC Config Codec, LC3 44.1_2", - test_client, &cfg_snk_44_2, SCC_SNK_44_2); + test_setup, test_client, &cfg_snk_44_2, SCC_SNK_44_2); define_test("BAP/UCL/SCC/BV-011-C UCL SRC Config Codec, LC3 48_1", - test_client, &cfg_snk_48_1, SCC_SNK_48_1); + test_setup, test_client, &cfg_snk_48_1, SCC_SNK_48_1); define_test("BAP/UCL/SCC/BV-012-C UCL SRC Config Codec, LC3 48_2", - test_client, &cfg_snk_48_2, SCC_SNK_48_2); + test_setup, test_client, &cfg_snk_48_2, SCC_SNK_48_2); define_test("BAP/UCL/SCC/BV-013-C UCL SRC Config Codec, LC3 48_3", - test_client, &cfg_snk_48_3, SCC_SNK_48_3); + test_setup, test_client, &cfg_snk_48_3, SCC_SNK_48_3); define_test("BAP/UCL/SCC/BV-014-C UCL SRC Config Codec, LC3 48_4", - test_client, &cfg_snk_48_4, SCC_SNK_48_4); + test_setup, test_client, &cfg_snk_48_4, SCC_SNK_48_4); define_test("BAP/UCL/SCC/BV-015-C UCL SRC Config Codec, LC3 48_5", - test_client, &cfg_snk_48_5, SCC_SNK_48_5); + test_setup, test_client, &cfg_snk_48_5, SCC_SNK_48_5); define_test("BAP/UCL/SCC/BV-016-C UCL SRC Config Codec, LC3 48_6", - test_client, &cfg_snk_48_6, SCC_SNK_48_6); + test_setup, test_client, &cfg_snk_48_6, SCC_SNK_48_6); define_test("BAP/UCL/SCC/BV-017-C UCL SNK Config Codec, LC3 8_1", - test_client, &cfg_src_8_1, SCC_SRC_8_1); + test_setup, test_client, &cfg_src_8_1, SCC_SRC_8_1); define_test("BAP/UCL/SCC/BV-018-C UCL SNK Config Codec, LC3 8_2", - test_client, &cfg_src_8_2, SCC_SRC_8_2); + test_setup, test_client, &cfg_src_8_2, SCC_SRC_8_2); define_test("BAP/UCL/SCC/BV-019-C UCL SNK Config Codec, LC3 16_1", - test_client, &cfg_src_16_1, SCC_SRC_16_1); + test_setup, test_client, &cfg_src_16_1, SCC_SRC_16_1); define_test("BAP/UCL/SCC/BV-020-C UCL SNK Config Codec, LC3 16_2", - test_client, &cfg_src_16_2, SCC_SRC_16_2); + test_setup, test_client, &cfg_src_16_2, SCC_SRC_16_2); define_test("BAP/UCL/SCC/BV-021-C UCL SNK Config Codec, LC3 24_1", - test_client, &cfg_src_24_1, SCC_SRC_24_1); + test_setup, test_client, &cfg_src_24_1, SCC_SRC_24_1); define_test("BAP/UCL/SCC/BV-022-C UCL SNK Config Codec, LC3 24_2", - test_client, &cfg_src_24_2, SCC_SRC_24_2); + test_setup, test_client, &cfg_src_24_2, SCC_SRC_24_2); define_test("BAP/UCL/SCC/BV-023-C UCL SNK Config Codec, LC3 32_1", - test_client, &cfg_src_32_1, SCC_SRC_32_1); + test_setup, test_client, &cfg_src_32_1, SCC_SRC_32_1); define_test("BAP/UCL/SCC/BV-024-C UCL SNK Config Codec, LC3 32_2", - test_client, &cfg_src_32_2, SCC_SRC_32_2); + test_setup, test_client, &cfg_src_32_2, SCC_SRC_32_2); define_test("BAP/UCL/SCC/BV-025-C UCL SNK Config Codec, LC3 44.1_1", - test_client, &cfg_src_44_1, SCC_SRC_44_1); + test_setup, test_client, &cfg_src_44_1, SCC_SRC_44_1); define_test("BAP/UCL/SCC/BV-026-C UCL SNK Config Codec, LC3 44.1_2", - test_client, &cfg_src_44_2, SCC_SRC_44_2); + test_setup, test_client, &cfg_src_44_2, SCC_SRC_44_2); define_test("BAP/UCL/SCC/BV-027-C UCL SNK Config Codec, LC3 48_1", - test_client, &cfg_src_48_1, SCC_SRC_48_1); + test_setup, test_client, &cfg_src_48_1, SCC_SRC_48_1); define_test("BAP/UCL/SCC/BV-028-C UCL SNK Config Codec, LC3 48_2", - test_client, &cfg_src_48_2, SCC_SRC_48_2); + test_setup, test_client, &cfg_src_48_2, SCC_SRC_48_2); define_test("BAP/UCL/SCC/BV-029-C UCL SNK Config Codec, LC3 48_3", - test_client, &cfg_src_48_3, SCC_SRC_48_3); + test_setup, test_client, &cfg_src_48_3, SCC_SRC_48_3); define_test("BAP/UCL/SCC/BV-030-C UCL SNK Config Codec, LC3 48_4", - test_client, &cfg_src_48_4, SCC_SRC_48_4); + test_setup, test_client, &cfg_src_48_4, SCC_SRC_48_4); define_test("BAP/UCL/SCC/BV-031-C UCL SNK Config Codec, LC3 48_5", - test_client, &cfg_src_48_5, SCC_SRC_48_5); + test_setup, test_client, &cfg_src_48_5, SCC_SRC_48_5); define_test("BAP/UCL/SCC/BV-032-C UCL SNK Config Codec, LC3 48_6", - test_client, &cfg_src_48_6, SCC_SRC_48_6); + test_setup, test_client, &cfg_src_48_6, SCC_SRC_48_6); } static struct test_config cfg_snk_vs = { @@ -1261,9 +1462,9 @@ static void test_scc_cc_vs(void) { define_test("BAP/UCL/SCC/BV-033-C UCL SRC Config Codec, VS", - test_client, &cfg_snk_vs, SCC_SNK_VS); + test_setup, test_client, &cfg_snk_vs, SCC_SNK_VS); define_test("BAP/UCL/SCC/BV-034-C UCL SNK Config Codec, VS", - test_client, &cfg_src_vs, SCC_SRC_VS); + test_setup, test_client, &cfg_src_vs, SCC_SRC_VS); } static struct test_config cfg_snk_8_1_1 = { @@ -1436,12 +1637,12 @@ #define SCC_SNK_44_1_1 \ SCC_SNK_44_1, \ - QOS_SNK(0xe3, 0x1f, 0x00, 0x00, 0x02, 0x62, 0x00, 0x05, 0x18, 0x00, \ + QOS_SNK(0xe3, 0x1f, 0x00, 0x01, 0x02, 0x62, 0x00, 0x05, 0x18, 0x00, \ 0x40, 0x9c, 0x00) #define SCC_SNK_44_2_1 \ SCC_SNK_44_2, \ - QOS_SNK(0x84, 0x2a, 0x00, 0x00, 0x02, 0x82, 0x00, 0x05, 0x1f, 0x00, \ + QOS_SNK(0x84, 0x2a, 0x00, 0x01, 0x02, 0x82, 0x00, 0x05, 0x1f, 0x00, \ 0x40, 0x9c, 0x00) #define SCC_SNK_48_1_1 \ @@ -1644,12 +1845,12 @@ #define SCC_SRC_44_1_1 \ SCC_SRC_44_1, \ - QOS_SRC(0xe3, 0x1f, 0x00, 0x00, 0x02, 0x62, 0x00, 0x05, 0x18, 0x00, \ + QOS_SRC(0xe3, 0x1f, 0x00, 0x01, 0x02, 0x62, 0x00, 0x05, 0x18, 0x00, \ 0x40, 0x9c, 0x00) #define SCC_SRC_44_2_1 \ SCC_SRC_44_2, \ - QOS_SRC(0x84, 0x2a, 0x00, 0x00, 0x02, 0x82, 0x00, 0x05, 0x1f, 0x00, \ + QOS_SRC(0x84, 0x2a, 0x00, 0x01, 0x02, 0x82, 0x00, 0x05, 0x1f, 0x00, \ 0x40, 0x9c, 0x00) #define SCC_SRC_48_1_1 \ @@ -1836,12 +2037,12 @@ #define SCC_SNK_44_1_2 \ SCC_SNK_44_1, \ - QOS_SNK(0xe3, 0x1f, 0x00, 0x00, 0x02, 0x62, 0x00, 0x0d, 0x50, 0x00, \ + QOS_SNK(0xe3, 0x1f, 0x00, 0x01, 0x02, 0x62, 0x00, 0x0d, 0x50, 0x00, \ 0x40, 0x9c, 0x00) #define SCC_SNK_44_2_2 \ SCC_SNK_44_2, \ - QOS_SNK(0x84, 0x2a, 0x00, 0x00, 0x02, 0x82, 0x00, 0x0d, 0x55, 0x00, \ + QOS_SNK(0x84, 0x2a, 0x00, 0x01, 0x02, 0x82, 0x00, 0x0d, 0x55, 0x00, \ 0x40, 0x9c, 0x00) #define SCC_SNK_48_1_2 \ @@ -2028,12 +2229,12 @@ #define SCC_SRC_44_1_2 \ SCC_SRC_44_1, \ - QOS_SRC(0xe3, 0x1f, 0x00, 0x00, 0x02, 0x62, 0x00, 0x0d, 0x50, 0x00, \ + QOS_SRC(0xe3, 0x1f, 0x00, 0x01, 0x02, 0x62, 0x00, 0x0d, 0x50, 0x00, \ 0x40, 0x9c, 0x00) #define SCC_SRC_44_2_2 \ SCC_SRC_44_2, \ - QOS_SRC(0x84, 0x2a, 0x00, 0x00, 0x02, 0x82, 0x00, 0x0d, 0x55, 0x00, \ + QOS_SRC(0x84, 0x2a, 0x00, 0x01, 0x02, 0x82, 0x00, 0x0d, 0x55, 0x00, \ 0x40, 0x9c, 0x00) #define SCC_SRC_48_1_2 \ @@ -2077,133 +2278,197 @@ static void test_scc_qos_lc3(void) { define_test("BAP/UCL/SCC/BV-035-C UCL SRC Config QoS, LC3 8_1_1", - test_client, &cfg_snk_8_1_1, SCC_SNK_8_1_1); + test_setup, test_client, &cfg_snk_8_1_1, + SCC_SNK_8_1_1); define_test("BAP/UCL/SCC/BV-036-C UCL SRC Config QoS, LC3 8_2_1", - test_client, &cfg_snk_8_2_1, SCC_SNK_8_2_1); + test_setup, test_client, &cfg_snk_8_2_1, + SCC_SNK_8_2_1); define_test("BAP/UCL/SCC/BV-037-C UCL SRC Config QoS, LC3 16_1_1", - test_client, &cfg_snk_16_1_1, SCC_SNK_16_1_1); + test_setup, test_client, &cfg_snk_16_1_1, + SCC_SNK_16_1_1); define_test("BAP/UCL/SCC/BV-038-C UCL SRC Config QoS, LC3 16_2_1", - test_client, &cfg_snk_16_2_1, SCC_SNK_16_2_1); + test_setup, test_client, &cfg_snk_16_2_1, + SCC_SNK_16_2_1); define_test("BAP/UCL/SCC/BV-039-C UCL SRC Config QoS, LC3 24_1_1", - test_client, &cfg_snk_24_1_1, SCC_SNK_24_1_1); + test_setup, test_client, &cfg_snk_24_1_1, + SCC_SNK_24_1_1); define_test("BAP/UCL/SCC/BV-040-C UCL SRC Config QoS, LC3 24_2_1", - test_client, &cfg_snk_24_2_1, SCC_SNK_24_2_1); + test_setup, test_client, &cfg_snk_24_2_1, + SCC_SNK_24_2_1); define_test("BAP/UCL/SCC/BV-041-C UCL SRC Config QoS, LC3 32_1_1", - test_client, &cfg_snk_32_1_1, SCC_SNK_32_1_1); + test_setup, test_client, &cfg_snk_32_1_1, + SCC_SNK_32_1_1); define_test("BAP/UCL/SCC/BV-042-C UCL SRC Config QoS, LC3 32_2_1", - test_client, &cfg_snk_32_2_1, SCC_SNK_32_2_1); + test_setup, test_client, &cfg_snk_32_2_1, + SCC_SNK_32_2_1); define_test("BAP/UCL/SCC/BV-043-C UCL SRC Config QoS, LC3 44.1_1_1", - test_client, &cfg_snk_44_1_1, SCC_SNK_44_1_1); + test_setup, test_client, &cfg_snk_44_1_1, + SCC_SNK_44_1_1); define_test("BAP/UCL/SCC/BV-044-C UCL SRC Config QoS, LC3 44.1_2_1", - test_client, &cfg_snk_44_2_1, SCC_SNK_44_2_1); + test_setup, test_client, &cfg_snk_44_2_1, + SCC_SNK_44_2_1); define_test("BAP/UCL/SCC/BV-045-C UCL SRC Config QoS, LC3 48_1_1", - test_client, &cfg_snk_48_1_1, SCC_SNK_48_1_1); + test_setup, test_client, &cfg_snk_48_1_1, + SCC_SNK_48_1_1); define_test("BAP/UCL/SCC/BV-046-C UCL SRC Config QoS, LC3 48_2_1", - test_client, &cfg_snk_48_2_1, SCC_SNK_48_2_1); + test_setup, test_client, &cfg_snk_48_2_1, + SCC_SNK_48_2_1); define_test("BAP/UCL/SCC/BV-047-C UCL SRC Config QoS, LC3 48_3_1", - test_client, &cfg_snk_48_3_1, SCC_SNK_48_3_1); + test_setup, test_client, &cfg_snk_48_3_1, + SCC_SNK_48_3_1); define_test("BAP/UCL/SCC/BV-048-C UCL SRC Config QoS, LC3 48_4_1", - test_client, &cfg_snk_48_4_1, SCC_SNK_48_4_1); + test_setup, test_client, &cfg_snk_48_4_1, + SCC_SNK_48_4_1); define_test("BAP/UCL/SCC/BV-049-C UCL SRC Config QoS, LC3 48_5_1", - test_client, &cfg_snk_48_5_1, SCC_SNK_48_5_1); + test_setup, test_client, &cfg_snk_48_5_1, + SCC_SNK_48_5_1); define_test("BAP/UCL/SCC/BV-050-C UCL SRC Config QoS, LC3 48_6_1", - test_client, &cfg_snk_48_6_1, SCC_SNK_48_6_1); + test_setup, test_client, &cfg_snk_48_6_1, + SCC_SNK_48_6_1); define_test("BAP/UCL/SCC/BV-051-C UCL SNK Config QoS, LC3 8_1_1", - test_client, &cfg_src_8_1_1, SCC_SRC_8_1_1); + test_setup, test_client, &cfg_src_8_1_1, + SCC_SRC_8_1_1); define_test("BAP/UCL/SCC/BV-052-C UCL SNK Config QoS, LC3 8_2_1", - test_client, &cfg_src_8_2_1, SCC_SRC_8_2_1); + test_setup, test_client, &cfg_src_8_2_1, + SCC_SRC_8_2_1); define_test("BAP/UCL/SCC/BV-053-C UCL SNK Config QoS, LC3 16_1_1", - test_client, &cfg_src_16_1_1, SCC_SRC_16_1_1); + test_setup, test_client, &cfg_src_16_1_1, + SCC_SRC_16_1_1); define_test("BAP/UCL/SCC/BV-054-C UCL SNK Config QoS, LC3 16_2_1", - test_client, &cfg_src_16_2_1, SCC_SRC_16_2_1); + test_setup, test_client, &cfg_src_16_2_1, + SCC_SRC_16_2_1); define_test("BAP/UCL/SCC/BV-055-C UCL SNK Config QoS, LC3 24_1_1", - test_client, &cfg_src_24_1_1, SCC_SRC_24_1_1); + test_setup, test_client, &cfg_src_24_1_1, + SCC_SRC_24_1_1); define_test("BAP/UCL/SCC/BV-056-C UCL SNK Config QoS, LC3 24_2_1", - test_client, &cfg_src_24_2_1, SCC_SRC_24_2_1); + test_setup, test_client, &cfg_src_24_2_1, + SCC_SRC_24_2_1); define_test("BAP/UCL/SCC/BV-057-C UCL SNK Config QoS, LC3 32_1_1", - test_client, &cfg_src_32_1_1, SCC_SRC_32_1_1); + test_setup, test_client, &cfg_src_32_1_1, + SCC_SRC_32_1_1); define_test("BAP/UCL/SCC/BV-058-C UCL SNK Config QoS, LC3 32_2_1", - test_client, &cfg_src_32_2_1, SCC_SRC_32_2_1); + test_setup, test_client, &cfg_src_32_2_1, + SCC_SRC_32_2_1); define_test("BAP/UCL/SCC/BV-059-C UCL SNK Config QoS, LC3 44.1_1_1", - test_client, &cfg_src_44_1_1, SCC_SRC_44_1_1); + test_setup, test_client, &cfg_src_44_1_1, + SCC_SRC_44_1_1); define_test("BAP/UCL/SCC/BV-060-C UCL SNK Config QoS, LC3 44.1_2_1", - test_client, &cfg_src_44_2_1, SCC_SRC_44_2_1); + test_setup, test_client, &cfg_src_44_2_1, + SCC_SRC_44_2_1); define_test("BAP/UCL/SCC/BV-061-C UCL SNK Config QoS, LC3 48_1_1", - test_client, &cfg_src_48_1_1, SCC_SRC_48_1_1); + test_setup, test_client, &cfg_src_48_1_1, + SCC_SRC_48_1_1); define_test("BAP/UCL/SCC/BV-062-C UCL SNK Config QoS, LC3 48_2_1", - test_client, &cfg_src_48_2_1, SCC_SRC_48_2_1); + test_setup, test_client, &cfg_src_48_2_1, + SCC_SRC_48_2_1); define_test("BAP/UCL/SCC/BV-063-C UCL SNK Config QoS, LC3 48_3_1", - test_client, &cfg_src_48_3_1, SCC_SRC_48_3_1); + test_setup, test_client, &cfg_src_48_3_1, + SCC_SRC_48_3_1); define_test("BAP/UCL/SCC/BV-064-C UCL SNK Config QoS, LC3 48_4_1", - test_client, &cfg_src_48_4_1, SCC_SRC_48_4_1); + test_setup, test_client, &cfg_src_48_4_1, + SCC_SRC_48_4_1); define_test("BAP/UCL/SCC/BV-065-C UCL SNK Config QoS, LC3 48_5_1", - test_client, &cfg_src_48_5_1, SCC_SRC_48_5_1); + test_setup, test_client, &cfg_src_48_5_1, + SCC_SRC_48_5_1); define_test("BAP/UCL/SCC/BV-066-C UCL SNK Config QoS, LC3 48_6_1", - test_client, &cfg_src_48_6_1, SCC_SRC_48_6_1); + test_setup, test_client, &cfg_src_48_6_1, + SCC_SRC_48_6_1); define_test("BAP/UCL/SCC/BV-067-C UCL SRC Config QoS, LC3 8_1_2", - test_client, &cfg_snk_8_1_2, SCC_SNK_8_1_2); + test_setup, test_client, &cfg_snk_8_1_2, + SCC_SNK_8_1_2); define_test("BAP/UCL/SCC/BV-068-C UCL SRC Config QoS, LC3 8_2_2", - test_client, &cfg_snk_8_2_2, SCC_SNK_8_2_2); + test_setup, test_client, &cfg_snk_8_2_2, + SCC_SNK_8_2_2); define_test("BAP/UCL/SCC/BV-069-C UCL SRC Config QoS, LC3 16_1_2", - test_client, &cfg_snk_16_1_2, SCC_SNK_16_1_2); + test_setup, test_client, &cfg_snk_16_1_2, + SCC_SNK_16_1_2); define_test("BAP/UCL/SCC/BV-070-C UCL SRC Config QoS, LC3 16_2_2", - test_client, &cfg_snk_16_2_2, SCC_SNK_16_2_2); + test_setup, test_client, &cfg_snk_16_2_2, + SCC_SNK_16_2_2); define_test("BAP/UCL/SCC/BV-071-C UCL SRC Config QoS, LC3 24_1_2", - test_client, &cfg_snk_24_1_2, SCC_SNK_24_1_2); + test_setup, test_client, &cfg_snk_24_1_2, + SCC_SNK_24_1_2); define_test("BAP/UCL/SCC/BV-072-C UCL SRC Config QoS, LC3 24_2_2", - test_client, &cfg_snk_24_2_2, SCC_SNK_24_2_2); + test_setup, test_client, &cfg_snk_24_2_2, + SCC_SNK_24_2_2); define_test("BAP/UCL/SCC/BV-073-C UCL SRC Config QoS, LC3 32_1_2", - test_client, &cfg_snk_32_1_2, SCC_SNK_32_1_2); + test_setup, test_client, &cfg_snk_32_1_2, + SCC_SNK_32_1_2); define_test("BAP/UCL/SCC/BV-074-C UCL SRC Config QoS, LC3 32_2_2", - test_client, &cfg_snk_32_2_2, SCC_SNK_32_2_2); + test_setup, test_client, &cfg_snk_32_2_2, + SCC_SNK_32_2_2); define_test("BAP/UCL/SCC/BV-075-C UCL SRC Config QoS, LC3 44.1_1_2", - test_client, &cfg_snk_44_1_2, SCC_SNK_44_1_2); + test_setup, test_client, &cfg_snk_44_1_2, + SCC_SNK_44_1_2); define_test("BAP/UCL/SCC/BV-076-C UCL SRC Config QoS, LC3 44.1_2_2", - test_client, &cfg_snk_44_2_2, SCC_SNK_44_2_2); + test_setup, test_client, &cfg_snk_44_2_2, + SCC_SNK_44_2_2); define_test("BAP/UCL/SCC/BV-077-C UCL SRC Config QoS, LC3 48_1_2", - test_client, &cfg_snk_48_1_2, SCC_SNK_48_1_2); + test_setup, test_client, &cfg_snk_48_1_2, + SCC_SNK_48_1_2); define_test("BAP/UCL/SCC/BV-078-C UCL SRC Config QoS, LC3 48_2_2", - test_client, &cfg_snk_48_2_2, SCC_SNK_48_2_2); + test_setup, test_client, &cfg_snk_48_2_2, + SCC_SNK_48_2_2); define_test("BAP/UCL/SCC/BV-079-C UCL SRC Config QoS, LC3 48_3_2", - test_client, &cfg_snk_48_3_2, SCC_SNK_48_3_2); + test_setup, test_client, &cfg_snk_48_3_2, + SCC_SNK_48_3_2); define_test("BAP/UCL/SCC/BV-080-C UCL SRC Config QoS, LC3 48_4_2", - test_client, &cfg_snk_48_4_2, SCC_SNK_48_4_2); + test_setup, test_client, &cfg_snk_48_4_2, + SCC_SNK_48_4_2); define_test("BAP/UCL/SCC/BV-081-C UCL SRC Config QoS, LC3 48_5_2", - test_client, &cfg_snk_48_5_2, SCC_SNK_48_5_2); + test_setup, test_client, &cfg_snk_48_5_2, + SCC_SNK_48_5_2); define_test("BAP/UCL/SCC/BV-082-C UCL SRC Config QoS, LC3 48_6_2", - test_client, &cfg_snk_48_6_2, SCC_SNK_48_6_2); + test_setup, test_client, &cfg_snk_48_6_2, + SCC_SNK_48_6_2); define_test("BAP/UCL/SCC/BV-083-C UCL SNK Config QoS, LC3 8_1_2", - test_client, &cfg_src_8_1_2, SCC_SRC_8_1_2); + test_setup, test_client, &cfg_src_8_1_2, + SCC_SRC_8_1_2); define_test("BAP/UCL/SCC/BV-084-C UCL SNK Config QoS, LC3 8_2_2", - test_client, &cfg_src_8_2_2, SCC_SRC_8_2_2); + test_setup, test_client, &cfg_src_8_2_2, + SCC_SRC_8_2_2); define_test("BAP/UCL/SCC/BV-085-C UCL SNK Config QoS, LC3 16_1_2", - test_client, &cfg_src_16_1_2, SCC_SRC_16_1_2); + test_setup, test_client, &cfg_src_16_1_2, + SCC_SRC_16_1_2); define_test("BAP/UCL/SCC/BV-086-C UCL SNK Config QoS, LC3 16_2_2", - test_client, &cfg_src_16_2_2, SCC_SRC_16_2_2); + test_setup, test_client, &cfg_src_16_2_2, + SCC_SRC_16_2_2); define_test("BAP/UCL/SCC/BV-087-C UCL SNK Config QoS, LC3 24_1_2", - test_client, &cfg_src_24_1_2, SCC_SRC_24_1_2); + test_setup, test_client, &cfg_src_24_1_2, + SCC_SRC_24_1_2); define_test("BAP/UCL/SCC/BV-088-C UCL SNK Config QoS, LC3 24_2_2", - test_client, &cfg_src_24_2_2, SCC_SRC_24_2_2); + test_setup, test_client, &cfg_src_24_2_2, + SCC_SRC_24_2_2); define_test("BAP/UCL/SCC/BV-089-C UCL SNK Config QoS, LC3 32_1_2", - test_client, &cfg_src_32_1_2, SCC_SRC_32_1_2); + test_setup, test_client, &cfg_src_32_1_2, + SCC_SRC_32_1_2); define_test("BAP/UCL/SCC/BV-090-C UCL SNK Config QoS, LC3 32_2_2", - test_client, &cfg_src_32_2_2, SCC_SRC_32_2_2); + test_setup, test_client, &cfg_src_32_2_2, + SCC_SRC_32_2_2); define_test("BAP/UCL/SCC/BV-091-C UCL SNK Config QoS, LC3 44.1_1_2", - test_client, &cfg_src_44_1_2, SCC_SRC_44_1_2); + test_setup, test_client, &cfg_src_44_1_2, + SCC_SRC_44_1_2); define_test("BAP/UCL/SCC/BV-092-C UCL SNK Config QoS, LC3 44.1_2_2", - test_client, &cfg_src_44_2_2, SCC_SRC_44_2_2); + test_setup, test_client, &cfg_src_44_2_2, + SCC_SRC_44_2_2); define_test("BAP/UCL/SCC/BV-093-C UCL SNK Config QoS, LC3 48_1_2", - test_client, &cfg_src_48_1_2, SCC_SRC_48_1_2); + test_setup, test_client, &cfg_src_48_1_2, + SCC_SRC_48_1_2); define_test("BAP/UCL/SCC/BV-094-C UCL SNK Config QoS, LC3 48_2_2", - test_client, &cfg_src_48_2_2, SCC_SRC_48_2_2); + test_setup, test_client, &cfg_src_48_2_2, + SCC_SRC_48_2_2); define_test("BAP/UCL/SCC/BV-095-C UCL SNK Config QoS, LC3 48_3_2", - test_client, &cfg_src_48_3_2, SCC_SRC_48_3_2); + test_setup, test_client, &cfg_src_48_3_2, + SCC_SRC_48_3_2); define_test("BAP/UCL/SCC/BV-096-C UCL SNK Config QoS, LC3 48_4_2", - test_client, &cfg_src_48_4_2, SCC_SRC_48_4_2); + test_setup, test_client, &cfg_src_48_4_2, + SCC_SRC_48_4_2); define_test("BAP/UCL/SCC/BV-097-C UCL SNK Config QoS, LC3 48_5_2", - test_client, &cfg_src_48_5_2, SCC_SRC_48_5_2); + test_setup, test_client, &cfg_src_48_5_2, + SCC_SRC_48_5_2); define_test("BAP/UCL/SCC/BV-098-C UCL SNK Config QoS, LC3 48_6_2", - test_client, &cfg_src_48_6_2, SCC_SRC_48_6_2); + test_setup, test_client, &cfg_src_48_6_2, + SCC_SRC_48_6_2); } static struct test_config cfg_snk_qos_vs = { @@ -2243,9 +2508,11 @@ static void test_scc_qos_vs(void) { define_test("BAP/UCL/SCC/BV-099-C UCL SNK Config QoS, VS", - test_client, &cfg_src_qos_vs, SCC_SRC_QOS_VS); + test_setup, test_client, &cfg_src_qos_vs, + SCC_SRC_QOS_VS); define_test("BAP/UCL/SCC/BV-100-C UCL SRC QoS Codec, VS", - test_client, &cfg_snk_qos_vs, SCC_SNK_QOS_VS); + test_setup, test_client, &cfg_snk_qos_vs, + SCC_SNK_QOS_VS); } static struct test_config cfg_snk_enable = { @@ -2291,8 +2558,7 @@ * Handle: 0x001c * Data: 030300000403020100 */ -#define SCC_SRC_ENABLE \ - SCC_SRC_16_2_1, \ +#define SRC_ENABLE \ IOV_DATA(0x52, 0x22, 0x00, 0x03, 0x01, 0x03, 0x04, 0x03, 0x02, 0x01, \ 00), \ IOV_DATA(0x1b, 0x22, 0x00, 0x03, 0x01, 0x01, 0x00, 0x00), \ @@ -2300,6 +2566,10 @@ IOV_DATA(0x1b, 0x1c, 0x00, 0x03, 0x03, 0x00, 0x00, 0x04, 0x03, 0x02, \ 0x01, 0x00) +#define SCC_SRC_ENABLE \ + SCC_SRC_16_2_1, \ + SRC_ENABLE + /* Test Purpose: * Verify that a Unicast Client IUT can initiate an Enable operation for an ASE * with a Unicast Server that is either in the Audio Sink role or the Audio @@ -2312,9 +2582,11 @@ static void test_scc_enable(void) { define_test("BAP/UCL/SCC/BV-101-C UCL SRC Enable", - test_client, &cfg_snk_enable, SCC_SNK_ENABLE); + test_setup, test_client, &cfg_snk_enable, + SCC_SNK_ENABLE); define_test("BAP/UCL/SCC/BV-102-C UCL SNK Enable", - test_client, &cfg_src_enable, SCC_SRC_ENABLE); + test_setup, test_client, &cfg_src_enable, + SCC_SRC_ENABLE); } static struct test_config cfg_snk_disable = { @@ -2383,7 +2655,7 @@ switch (new_state) { case BT_BAP_STREAM_STATE_STREAMING: - id = bt_bap_stream_disable(data->stream, true, bap_disable, + id = bt_bap_stream_disable(stream, true, bap_disable, data); g_assert(id); break; @@ -2408,7 +2680,7 @@ * Handle: 0x0016 * Data: 0101010400403020100 */ -#define ASE_SRC_START \ +#define SRC_START \ IOV_DATA(0x52, 0x22, 0x00, 0x04, 0x01, 0x03), \ IOV_DATA(0x1b, 0x22, 0x00, 0x04, 0x01, 0x03, 0x00, 0x00), \ IOV_NULL, \ @@ -2417,7 +2689,7 @@ #define SCC_SRC_DISABLE_STREAMING \ SCC_SRC_ENABLE, \ - ASE_SRC_START, \ + SRC_START, \ ASE_SRC_DISABLE /* Test Purpose: @@ -2431,12 +2703,14 @@ static void test_scc_disable(void) { define_test("BAP/UCL/SCC/BV-103-C UCL SNK Disable in Enabling State", - test_client, &cfg_src_disable, SCC_SRC_DISABLE); + test_setup, test_client, &cfg_src_disable, + SCC_SRC_DISABLE); define_test("BAP/UCL/SCC/BV-104-C UCL SRC Disable in Enabling or " "Streaming state", - test_client, &cfg_snk_disable, SCC_SNK_DISABLE); + test_setup, test_client, &cfg_snk_disable, + SCC_SNK_DISABLE); define_test("BAP/UCL/SCC/BV-105-C UCL SNK Disable in Streaming State", - test_client, &cfg_src_disable_streaming, + test_setup, test_client, &cfg_src_disable_streaming, SCC_SRC_DISABLE_STREAMING); } @@ -2457,7 +2731,7 @@ switch (new_state) { case BT_BAP_STREAM_STATE_CONFIG: - id = bt_bap_stream_release(data->stream, bap_release, data); + id = bt_bap_stream_release(stream, bap_release, data); g_assert(id); break; } @@ -2526,7 +2800,7 @@ switch (new_state) { case BT_BAP_STREAM_STATE_QOS: - id = bt_bap_stream_release(data->stream, bap_release, data); + id = bt_bap_stream_release(stream, bap_release, data); g_assert(id); break; } @@ -2565,7 +2839,7 @@ switch (new_state) { case BT_BAP_STREAM_STATE_ENABLING: - id = bt_bap_stream_release(data->stream, bap_release, data); + id = bt_bap_stream_release(stream, bap_release, data); g_assert(id); break; } @@ -2604,7 +2878,7 @@ switch (new_state) { case BT_BAP_STREAM_STATE_STREAMING: - id = bt_bap_stream_release(data->stream, bap_release, data); + id = bt_bap_stream_release(stream, bap_release, data); g_assert(id); break; } @@ -2620,7 +2894,7 @@ #define SCC_SRC_START_RELEASE \ SCC_SRC_ENABLE, \ - ASE_SRC_START, \ + SRC_START, \ ASE_SRC_RELEASE static void state_disable_release(struct bt_bap_stream *stream, @@ -2632,7 +2906,7 @@ switch (new_state) { case BT_BAP_STREAM_STATE_DISABLING: - id = bt_bap_stream_release(data->stream, bap_release, data); + id = bt_bap_stream_release(stream, bap_release, data); g_assert(id); break; } @@ -2662,28 +2936,32 @@ { define_test("BAP/UCL/SCC/BV-106-C UCL SNK Release in Codec Configured" " state", - test_client, &cfg_src_cc_release, SCC_SRC_CC_RELEASE); + test_setup, test_client, &cfg_src_cc_release, + SCC_SRC_CC_RELEASE); define_test("BAP/UCL/SCC/BV-107-C UCL SRC Release in Codec Configured" " state", - test_client, &cfg_snk_cc_release, SCC_SNK_CC_RELEASE); + test_setup, test_client, &cfg_snk_cc_release, + SCC_SNK_CC_RELEASE); define_test("BAP/UCL/SCC/BV-108-C UCL SNK Release in QoS Configured" " state", - test_client, &cfg_src_qos_release, SCC_SRC_QOS_RELEASE); + test_setup, test_client, &cfg_src_qos_release, + SCC_SRC_QOS_RELEASE); define_test("BAP/UCL/SCC/BV-109-C UCL SRC Release in QoS Configured" " state", - test_client, &cfg_snk_qos_release, SCC_SNK_QOS_RELEASE); + test_setup, test_client, &cfg_snk_qos_release, + SCC_SNK_QOS_RELEASE); define_test("BAP/UCL/SCC/BV-110-C UCL SNK Release in Enabling state", - test_client, &cfg_src_enable_release, + test_setup, test_client, &cfg_src_enable_release, SCC_SRC_ENABLE_RELEASE); define_test("BAP/UCL/SCC/BV-111-C UCL SRC Release in Enabling or" " Streaming state", - test_client, &cfg_snk_enable_release, + test_setup, test_client, &cfg_snk_enable_release, SCC_SNK_ENABLE_RELEASE); define_test("BAP/UCL/SCC/BV-112-C UCL SNK Release in Streaming state", - test_client, &cfg_src_start_release, + test_setup, test_client, &cfg_src_start_release, SCC_SRC_START_RELEASE); define_test("BAP/UCL/SCC/BV-113-C UCL SNK Release in Disabling state", - test_client, &cfg_src_disable_release, + test_setup, test_client, &cfg_src_disable_release, SCC_SRC_DISABLE_RELEASE); } @@ -2705,7 +2983,7 @@ switch (new_state) { case BT_BAP_STREAM_STATE_ENABLING: - id = bt_bap_stream_metadata(data->stream, &iov, bap_metadata, + id = bt_bap_stream_metadata(stream, &iov, bap_metadata, data); g_assert(id); break; @@ -2781,7 +3059,7 @@ switch (new_state) { case BT_BAP_STREAM_STATE_STREAMING: - id = bt_bap_stream_metadata(data->stream, &iov, bap_metadata, + id = bt_bap_stream_metadata(stream, &iov, bap_metadata, data); g_assert(id); break; @@ -2798,7 +3076,7 @@ #define SCC_SRC_METADATA_STREAMING \ SCC_SRC_ENABLE, \ - ASE_SRC_START, \ + SRC_START, \ ASE_SRC_METADATA /* Unicast Client Initiates Update Metadata Operation @@ -2815,16 +3093,2476 @@ { define_test("BAP/UCL/SCC/BV-115-C UCL SNK Update Metadata in Enabling " "State", - test_client, &cfg_src_metadata, SCC_SRC_METADATA); + test_setup, test_client, &cfg_src_metadata, + SCC_SRC_METADATA); define_test("BAP/UCL/SCC/BV-116-C UCL SRC Update Metadata in Enabling " "or Streaming state", - test_client, &cfg_snk_metadata, SCC_SNK_METADATA); + test_setup, test_client, &cfg_snk_metadata, + SCC_SNK_METADATA); define_test("BAP/UCL/SCC/BV-117-C UCL SNK Update Metadata in Streaming" " State", - test_client, &cfg_src_metadata_streaming, + test_setup, test_client, &cfg_src_metadata_streaming, SCC_SRC_METADATA_STREAMING); } +#define SNK_ENABLE \ + IOV_DATA(0x52, 0x22, 0x00, 0x03, 0x01, 0x01, 0x04, 0x03, 0x02, 0x01, \ + 00), \ + IOV_DATA(0x1b, 0x22, 0x00, 0x03, 0x01, 0x01, 0x00, 0x00), \ + IOV_NULL, \ + IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x03, 0x00, 0x00, 0x04, 0x03, 0x02, \ + 0x01, 0x00) + +#define SNK_START \ + IOV_NULL, \ + IOV_DATA(0x1b, 0x16, 0x00, 0x01, 0x04, 0x00, 0x00, 0x04, 0x03, 0x02, \ + 0x01, 0x00) + +static struct test_config str_snk_ac2_8_1_1 = { + .cc = LC3_CONFIG_8_1_AC(1), + .qos = LC3_QOS_8_1_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK(_freq, _ac, _dur, _len) \ + SCC_SNK_LC3(0x10, 0x02, 0x01, _freq, 0x02, 0x02, _dur, 0x03, 0x04, \ + _len, _len >> 8, 0x05, 0x03, _ac, 0x00, 0x00, 0x00) + +#define STR_SNK_8(_ac, _dur, _len) \ + STR_SNK(LC3_CONFIG_FREQ_8KHZ, _ac, _dur, _len) + +#define STR_SNK_8_1(_ac) \ + STR_SNK_8(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_8_1) + +#define STR_SNK_QOS(_interval, _frame, _sdu, _rtn, _latency) \ + QOS_SNK(_interval & 0xff, _interval >> 8 & 0xff, \ + _interval >> 16 & 0xff, _frame, 0x02, _sdu & 0xff, \ + _sdu >> 8 & 0xff, _rtn, \ + _latency, _latency >> 8, 0x40, 0x9c, 0x00) + +#define STR_SNK_QOS_1(_sdu, _rtn, _latency) \ + STR_SNK_QOS(7500u, LC3_QOS_UNFRAMED, _sdu, _rtn, _latency) + +#define STR_SNK_8_1_1(_chans) \ + STR_SNK_8_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_8_1, LC3_QOS_8_1_1_RTN, \ + LC3_QOS_8_1_1_LATENCY) + +#define STR_SNK_AC2_8_1_1 \ + STR_SNK_8_1_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_8_1_1 = { + .cc = LC3_CONFIG_8_1_AC(2), + .qos = LC3_QOS_8_1_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_8_1_1 \ + STR_SNK_8_1_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_8_2_1 = { + .cc = LC3_CONFIG_8_2_AC(1), + .qos = LC3_QOS_8_2_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_8_2(_ac) \ + STR_SNK_8(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_8_2) + +#define STR_SNK_QOS_2(_sdu, _rtn, _latency) \ + STR_SNK_QOS(10000u, LC3_QOS_UNFRAMED, _sdu, _rtn, _latency) + +#define STR_SNK_8_2_1(_chans) \ + STR_SNK_8_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_8_2, LC3_QOS_8_2_1_RTN, \ + LC3_QOS_8_2_1_LATENCY) + +#define STR_SNK_AC2_8_2_1 \ + STR_SNK_8_2_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_8_2_1 = { + .cc = LC3_CONFIG_8_2_AC(2), + .qos = LC3_QOS_8_2_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_8_2_1 \ + STR_SNK_8_2_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_8_1_2 = { + .cc = LC3_CONFIG_8_1_AC(1), + .qos = LC3_QOS_8_1_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_8_1_2(_chans) \ + STR_SNK_8_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_8_1, LC3_QOS_8_1_2_RTN, \ + LC3_QOS_8_1_2_LATENCY) + +#define STR_SNK_AC2_8_1_2 \ + STR_SNK_8_1_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_8_1_2 = { + .cc = LC3_CONFIG_8_1_AC(2), + .qos = LC3_QOS_8_1_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_8_1_2 \ + STR_SNK_8_1_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_8_2_2 = { + .cc = LC3_CONFIG_8_2_AC(1), + .qos = LC3_QOS_8_2_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_8_2_2(_chans) \ + STR_SNK_8_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_8_2, LC3_QOS_8_2_2_RTN, \ + LC3_QOS_8_2_2_LATENCY) + +#define STR_SNK_AC2_8_2_2 \ + STR_SNK_8_2_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_8_2_2 = { + .cc = LC3_CONFIG_8_2_AC(2), + .qos = LC3_QOS_8_2_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_8_2_2 \ + STR_SNK_8_2_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_16_1_1 = { + .cc = LC3_CONFIG_16_1_AC(1), + .qos = LC3_QOS_16_1_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_16(_ac, _dur, _len) \ + STR_SNK(LC3_CONFIG_FREQ_16KHZ, _ac, _dur, _len) + +#define STR_SNK_16_1(_ac) \ + STR_SNK_16(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_16_1) + +#define STR_SNK_16_1_1(_chans) \ + STR_SNK_16_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_16_1, LC3_QOS_16_1_1_RTN, \ + LC3_QOS_16_1_1_LATENCY) + +#define STR_SNK_AC2_16_1_1 \ + STR_SNK_16_1_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_16_1_1 = { + .cc = LC3_CONFIG_16_1_AC(2), + .qos = LC3_QOS_16_1_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_16_1_1 \ + STR_SNK_16_1_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_16_2_1 = { + .cc = LC3_CONFIG_16_2_AC(1), + .qos = LC3_QOS_16_2_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_16_2(_ac) \ + STR_SNK_16(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_16_2) + +#define STR_SNK_16_2_1(_chans) \ + STR_SNK_16_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_16_2, LC3_QOS_16_2_1_RTN, \ + LC3_QOS_16_2_1_LATENCY) + +#define STR_SNK_AC2_16_2_1 \ + STR_SNK_16_2_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_16_2_1 = { + .cc = LC3_CONFIG_16_2_AC(2), + .qos = LC3_QOS_16_2_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_16_2_1 \ + STR_SNK_16_2_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_16_1_2 = { + .cc = LC3_CONFIG_16_1_AC(1), + .qos = LC3_QOS_16_1_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_16(_ac, _dur, _len) \ + STR_SNK(LC3_CONFIG_FREQ_16KHZ, _ac, _dur, _len) + +#define STR_SNK_16_1_2(_chans) \ + STR_SNK_16_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_16_1, LC3_QOS_16_1_2_RTN, \ + LC3_QOS_16_1_2_LATENCY) + +#define STR_SNK_AC2_16_1_2 \ + STR_SNK_16_1_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_16_1_2 = { + .cc = LC3_CONFIG_16_1_AC(2), + .qos = LC3_QOS_16_1_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_16_1_2 \ + STR_SNK_16_1_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_16_2_2 = { + .cc = LC3_CONFIG_16_2_AC(1), + .qos = LC3_QOS_16_2_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_16_2(_ac) \ + STR_SNK_16(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_16_2) + +#define STR_SNK_16_2_2(_chans) \ + STR_SNK_16_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_16_2, LC3_QOS_16_2_2_RTN, \ + LC3_QOS_16_2_2_LATENCY) + +#define STR_SNK_AC2_16_2_2 \ + STR_SNK_16_2_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_16_2_2 = { + .cc = LC3_CONFIG_16_2_AC(2), + .qos = LC3_QOS_16_2_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_16_2_2 \ + STR_SNK_16_2_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_24_1_1 = { + .cc = LC3_CONFIG_24_1_AC(1), + .qos = LC3_QOS_24_1_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_24(_ac, _dur, _len) \ + STR_SNK(LC3_CONFIG_FREQ_24KHZ, _ac, _dur, _len) + +#define STR_SNK_24_1(_ac) \ + STR_SNK_24(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_24_1) + +#define STR_SNK_24_1_1(_chans) \ + STR_SNK_24_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_24_1, LC3_QOS_24_1_1_RTN, \ + LC3_QOS_24_1_1_LATENCY) + +#define STR_SNK_AC2_24_1_1 \ + STR_SNK_24_1_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_24_1_1 = { + .cc = LC3_CONFIG_24_1_AC(2), + .qos = LC3_QOS_24_1_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_24_1_1 \ + STR_SNK_24_1_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_24_2_1 = { + .cc = LC3_CONFIG_24_2_AC(1), + .qos = LC3_QOS_24_2_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_24_2(_ac) \ + STR_SNK_24(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_24_2) + +#define STR_SNK_24_2_1(_chans) \ + STR_SNK_24_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_24_2, LC3_QOS_24_2_1_RTN, \ + LC3_QOS_24_2_1_LATENCY) + +#define STR_SNK_AC2_24_2_1 \ + STR_SNK_24_2_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_24_2_1 = { + .cc = LC3_CONFIG_24_2_AC(2), + .qos = LC3_QOS_24_2_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_24_2_1 \ + STR_SNK_24_2_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_24_1_2 = { + .cc = LC3_CONFIG_24_1_AC(1), + .qos = LC3_QOS_24_1_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_24_1_2(_chans) \ + STR_SNK_24_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_24_1, LC3_QOS_24_1_2_RTN, \ + LC3_QOS_24_1_2_LATENCY) + +#define STR_SNK_AC2_24_1_2 \ + STR_SNK_24_1_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_24_1_2 = { + .cc = LC3_CONFIG_24_1_AC(2), + .qos = LC3_QOS_24_1_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_24_1_2 \ + STR_SNK_24_1_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_24_2_2 = { + .cc = LC3_CONFIG_24_2_AC(1), + .qos = LC3_QOS_24_2_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_24_2_2(_chans) \ + STR_SNK_24_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_24_2, LC3_QOS_24_2_2_RTN, \ + LC3_QOS_24_2_2_LATENCY) + +#define STR_SNK_AC2_24_2_2 \ + STR_SNK_24_2_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_24_2_2 = { + .cc = LC3_CONFIG_24_2_AC(2), + .qos = LC3_QOS_24_2_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_24_2_2 \ + STR_SNK_24_2_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_32_1_1 = { + .cc = LC3_CONFIG_32_1_AC(1), + .qos = LC3_QOS_32_1_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_32(_ac, _dur, _len) \ + STR_SNK(LC3_CONFIG_FREQ_32KHZ, _ac, _dur, _len) + +#define STR_SNK_32_1(_ac) \ + STR_SNK_32(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_32_1) + +#define STR_SNK_32_1_1(_chans) \ + STR_SNK_32_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_32_1, LC3_QOS_32_1_1_RTN, \ + LC3_QOS_32_1_1_LATENCY) + +#define STR_SNK_AC2_32_1_1 \ + STR_SNK_32_1_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_32_1_1 = { + .cc = LC3_CONFIG_32_1_AC(2), + .qos = LC3_QOS_32_1_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_32_1_1 \ + STR_SNK_32_1_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_32_2_1 = { + .cc = LC3_CONFIG_32_2_AC(1), + .qos = LC3_QOS_32_2_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_32_2(_ac) \ + STR_SNK_32(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_32_2) + +#define STR_SNK_32_2_1(_chans) \ + STR_SNK_32_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_32_2, LC3_QOS_32_2_1_RTN, \ + LC3_QOS_32_2_1_LATENCY) + +#define STR_SNK_AC2_32_2_1 \ + STR_SNK_32_2_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_32_2_1 = { + .cc = LC3_CONFIG_32_2_AC(2), + .qos = LC3_QOS_32_2_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_32_2_1 \ + STR_SNK_32_2_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_32_1_2 = { + .cc = LC3_CONFIG_32_1_AC(1), + .qos = LC3_QOS_32_1_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_32_1_2(_chans) \ + STR_SNK_32_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_32_1, LC3_QOS_32_1_2_RTN, \ + LC3_QOS_32_1_2_LATENCY) + +#define STR_SNK_AC2_32_1_2 \ + STR_SNK_32_1_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_32_1_2 = { + .cc = LC3_CONFIG_32_1_AC(2), + .qos = LC3_QOS_32_1_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_32_1_2 \ + STR_SNK_32_1_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_32_2_2 = { + .cc = LC3_CONFIG_32_2_AC(1), + .qos = LC3_QOS_32_2_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_32_2_2(_chans) \ + STR_SNK_32_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_32_2, LC3_QOS_32_2_2_RTN, \ + LC3_QOS_32_2_2_LATENCY) + +#define STR_SNK_AC2_32_2_2 \ + STR_SNK_32_2_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_32_2_2 = { + .cc = LC3_CONFIG_32_2_AC(2), + .qos = LC3_QOS_32_2_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_32_2_2 \ + STR_SNK_32_2_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_44_1_1 = { + .cc = LC3_CONFIG_44_1_AC(1), + .qos = LC3_QOS_44_1_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_44(_ac, _dur, _len) \ + STR_SNK(LC3_CONFIG_FREQ_44KHZ, _ac, _dur, _len) + +#define STR_SNK_44_1(_ac) \ + STR_SNK_44(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_44_1) + +#define STR_SNK_QOS_44_1(_sdu, _rtn, _latency) \ + STR_SNK_QOS(LC3_QOS_44_1_INTERVAL, LC3_QOS_FRAMED, _sdu, _rtn, \ + _latency) + +#define STR_SNK_44_1_1(_chans) \ + STR_SNK_44_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_44_1(_chans * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_1_RTN, LC3_QOS_44_1_1_LATENCY) + +#define STR_SNK_AC2_44_1_1 \ + STR_SNK_44_1_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_44_1_1 = { + .cc = LC3_CONFIG_44_1_AC(2), + .qos = LC3_QOS_44_1_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_44_1_1 \ + STR_SNK_44_1_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_44_2_1 = { + .cc = LC3_CONFIG_44_2_AC(1), + .qos = LC3_QOS_44_2_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_44_2(_ac) \ + STR_SNK_44(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_44_2) + +#define STR_SNK_QOS_44_2(_sdu, _rtn, _latency) \ + STR_SNK_QOS(LC3_QOS_44_2_INTERVAL, LC3_QOS_FRAMED, _sdu, _rtn, \ + _latency) + +#define STR_SNK_44_2_1(_chans) \ + STR_SNK_44_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_44_2(_chans * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_1_RTN, LC3_QOS_44_2_1_LATENCY) + +#define STR_SNK_AC2_44_2_1 \ + STR_SNK_44_2_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_44_2_1 = { + .cc = LC3_CONFIG_44_2_AC(2), + .qos = LC3_QOS_44_2_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_44_2_1 \ + STR_SNK_44_2_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_44_1_2 = { + .cc = LC3_CONFIG_44_1_AC(1), + .qos = LC3_QOS_44_1_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_44_1_2(_chans) \ + STR_SNK_44_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_44_1(_chans * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_2_RTN, LC3_QOS_44_1_2_LATENCY) + +#define STR_SNK_AC2_44_1_2 \ + STR_SNK_44_1_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_44_1_2 = { + .cc = LC3_CONFIG_44_1_AC(2), + .qos = LC3_QOS_44_1_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_44_1_2 \ + STR_SNK_44_1_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_44_2_2 = { + .cc = LC3_CONFIG_44_2_AC(1), + .qos = LC3_QOS_44_2_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_44_2_2(_chans) \ + STR_SNK_44_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_44_2(_chans * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_2_RTN, LC3_QOS_44_2_2_LATENCY) + +#define STR_SNK_AC2_44_2_2 \ + STR_SNK_44_2_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_44_2_2 = { + .cc = LC3_CONFIG_44_2_AC(2), + .qos = LC3_QOS_44_2_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_44_2_2 \ + STR_SNK_44_2_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_1_1 = { + .cc = LC3_CONFIG_48_1_AC(1), + .qos = LC3_QOS_48_1_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48(_ac, _dur, _len) \ + STR_SNK(LC3_CONFIG_FREQ_48KHZ, _ac, _dur, _len) + +#define STR_SNK_48_1(_ac) \ + STR_SNK_48(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_1) + +#define STR_SNK_48_1_1(_chans) \ + STR_SNK_48_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_1, LC3_QOS_48_1_1_RTN, \ + LC3_QOS_48_1_1_LATENCY) + +#define STR_SNK_AC2_48_1_1 \ + STR_SNK_48_1_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_1_1 = { + .cc = LC3_CONFIG_48_1_AC(2), + .qos = LC3_QOS_48_1_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_1_1 \ + STR_SNK_48_1_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_2_1 = { + .cc = LC3_CONFIG_48_2_AC(1), + .qos = LC3_QOS_48_2_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_2(_ac) \ + STR_SNK_48(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_2) + +#define STR_SNK_48_2_1(_chans) \ + STR_SNK_48_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_2, LC3_QOS_48_2_1_RTN, \ + LC3_QOS_48_2_1_LATENCY) + +#define STR_SNK_AC2_48_2_1 \ + STR_SNK_48_2_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_2_1 = { + .cc = LC3_CONFIG_48_2_AC(2), + .qos = LC3_QOS_48_2_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_2_1 \ + STR_SNK_48_2_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_3_1 = { + .cc = LC3_CONFIG_48_3_AC(1), + .qos = LC3_QOS_48_3_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_3(_ac) \ + STR_SNK_48(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_3) + +#define STR_SNK_48_3_1(_chans) \ + STR_SNK_48_3((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_3, LC3_QOS_48_3_1_RTN, \ + LC3_QOS_48_3_1_LATENCY) + +#define STR_SNK_AC2_48_3_1 \ + STR_SNK_48_3_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_3_1 = { + .cc = LC3_CONFIG_48_3_AC(2), + .qos = LC3_QOS_48_3_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_3_1 \ + STR_SNK_48_3_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_4_1 = { + .cc = LC3_CONFIG_48_4_AC(1), + .qos = LC3_QOS_48_4_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_4(_ac) \ + STR_SNK_48(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_4) + +#define STR_SNK_48_4_1(_chans) \ + STR_SNK_48_4((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_4, LC3_QOS_48_4_1_RTN, \ + LC3_QOS_48_4_1_LATENCY) + +#define STR_SNK_AC2_48_4_1 \ + STR_SNK_48_4_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_4_1 = { + .cc = LC3_CONFIG_48_4_AC(2), + .qos = LC3_QOS_48_4_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_4_1 \ + STR_SNK_48_4_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_5_1 = { + .cc = LC3_CONFIG_48_5_AC(1), + .qos = LC3_QOS_48_5_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_5(_ac) \ + STR_SNK_48(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_5) + +#define STR_SNK_48_5_1(_chans) \ + STR_SNK_48_5((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_5, LC3_QOS_48_5_1_RTN, \ + LC3_QOS_48_5_1_LATENCY) + +#define STR_SNK_AC2_48_5_1 \ + STR_SNK_48_5_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_5_1 = { + .cc = LC3_CONFIG_48_5_AC(2), + .qos = LC3_QOS_48_5_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_5_1 \ + STR_SNK_48_5_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_6_1 = { + .cc = LC3_CONFIG_48_6_AC(1), + .qos = LC3_QOS_48_6_1_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_6(_ac) \ + STR_SNK_48(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_6) + +#define STR_SNK_48_6_1(_chans) \ + STR_SNK_48_6((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_6, LC3_QOS_48_6_1_RTN, \ + LC3_QOS_48_6_1_LATENCY) + +#define STR_SNK_AC2_48_6_1 \ + STR_SNK_48_6_1(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_6_1 = { + .cc = LC3_CONFIG_48_6_AC(2), + .qos = LC3_QOS_48_6_1_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_6_1 \ + STR_SNK_48_6_1(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_1_2 = { + .cc = LC3_CONFIG_48_1_AC(1), + .qos = LC3_QOS_48_1_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_1_2(_chans) \ + STR_SNK_48_1((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_1, LC3_QOS_48_1_2_RTN, \ + LC3_QOS_48_1_2_LATENCY) + +#define STR_SNK_AC2_48_1_2 \ + STR_SNK_48_1_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_1_2 = { + .cc = LC3_CONFIG_48_1_AC(2), + .qos = LC3_QOS_48_1_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_1_2 \ + STR_SNK_48_1_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_2_2 = { + .cc = LC3_CONFIG_48_2_AC(1), + .qos = LC3_QOS_48_2_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_2_2(_chans) \ + STR_SNK_48_2((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_2, LC3_QOS_48_2_2_RTN, \ + LC3_QOS_48_2_2_LATENCY) + +#define STR_SNK_AC2_48_2_2 \ + STR_SNK_48_2_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_2_2 = { + .cc = LC3_CONFIG_48_2_AC(2), + .qos = LC3_QOS_48_2_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_2_2 \ + STR_SNK_48_2_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_3_2 = { + .cc = LC3_CONFIG_48_3_AC(1), + .qos = LC3_QOS_48_3_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_3_2(_chans) \ + STR_SNK_48_3((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_3, LC3_QOS_48_3_2_RTN, \ + LC3_QOS_48_3_2_LATENCY) + +#define STR_SNK_AC2_48_3_2 \ + STR_SNK_48_3_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_3_2 = { + .cc = LC3_CONFIG_48_3_AC(2), + .qos = LC3_QOS_48_3_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_3_2 \ + STR_SNK_48_3_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_4_2 = { + .cc = LC3_CONFIG_48_4_AC(1), + .qos = LC3_QOS_48_4_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_4_2(_chans) \ + STR_SNK_48_4((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_4, LC3_QOS_48_4_2_RTN, \ + LC3_QOS_48_4_2_LATENCY) + +#define STR_SNK_AC2_48_4_2 \ + STR_SNK_48_4_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_4_2 = { + .cc = LC3_CONFIG_48_4_AC(2), + .qos = LC3_QOS_48_4_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_4_2 \ + STR_SNK_48_4_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_5_2 = { + .cc = LC3_CONFIG_48_5_AC(1), + .qos = LC3_QOS_48_5_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_5_2(_chans) \ + STR_SNK_48_5((BIT(_chans) - 1)), \ + STR_SNK_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_5, LC3_QOS_48_5_2_RTN, \ + LC3_QOS_48_5_2_LATENCY) + +#define STR_SNK_AC2_48_5_2 \ + STR_SNK_48_5_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_5_2 = { + .cc = LC3_CONFIG_48_5_AC(2), + .qos = LC3_QOS_48_5_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_5_2 \ + STR_SNK_48_5_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac2_48_6_2 = { + .cc = LC3_CONFIG_48_6_AC(1), + .qos = LC3_QOS_48_6_2_AC(1), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_48_6_2(_chans) \ + STR_SNK_48_6((BIT(_chans) - 1)), \ + STR_SNK_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_6, LC3_QOS_48_6_2_RTN, \ + LC3_QOS_48_6_2_LATENCY) + +#define STR_SNK_AC2_48_6_2 \ + STR_SNK_48_6_2(1), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_snk_ac10_48_6_2 = { + .cc = LC3_CONFIG_48_6_AC(2), + .qos = LC3_QOS_48_6_2_AC(2), + .snk = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SNK_AC10_48_6_2 \ + STR_SNK_48_6_2(2), \ + SNK_ENABLE, \ + SNK_START + +static struct test_config str_src_ac1_8_1_1 = { + .cc = LC3_CONFIG_8_1_AC(1), + .qos = LC3_QOS_8_1_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC(_freq, _ac, _dur, _len) \ + SCC_SRC_LC3(0x10, 0x02, 0x01, _freq, 0x02, 0x02, _dur, 0x03, 0x04, \ + _len, _len >> 8, 0x05, 0x03, _ac, 0x00, 0x00, 0x00) + +#define STR_SRC_8(_ac, _dur, _len) \ + STR_SRC(LC3_CONFIG_FREQ_8KHZ, _ac, _dur, _len) + +#define STR_SRC_8_1(_ac) \ + STR_SRC_8(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_8_1) + +#define STR_SRC_QOS(_interval, _frame, _sdu, _rtn, _latency) \ + QOS_SRC(_interval & 0xff, _interval >> 8 & 0xff, \ + _interval >> 16 & 0xff, _frame, 0x02, _sdu & 0xff, \ + _sdu >> 8 & 0xff, _rtn, \ + _latency, _latency >> 8, 0x40, 0x9c, 0x00) + +#define STR_SRC_QOS_1(_sdu, _rtn, _latency) \ + STR_SRC_QOS(7500u, LC3_QOS_UNFRAMED, _sdu, _rtn, _latency) + +#define STR_SRC_8_1_1(_chans) \ + STR_SRC_8_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_8_1, LC3_QOS_8_1_1_RTN, \ + LC3_QOS_8_1_1_LATENCY) + +#define STR_SRC_AC1_8_1_1 \ + STR_SRC_8_1_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_8_1_1 = { + .cc = LC3_CONFIG_8_1_AC(2), + .qos = LC3_QOS_8_1_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_8_1_1 \ + STR_SRC_8_1_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_8_2_1 = { + .cc = LC3_CONFIG_8_2_AC(1), + .qos = LC3_QOS_8_2_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_8_2(_ac) \ + STR_SRC_8(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_8_2) + +#define STR_SRC_QOS_2(_sdu, _rtn, _latency) \ + STR_SRC_QOS(10000u, LC3_QOS_UNFRAMED, _sdu, _rtn, _latency) + +#define STR_SRC_8_2_1(_chans) \ + STR_SRC_8_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_8_2, LC3_QOS_8_2_1_RTN, \ + LC3_QOS_8_2_1_LATENCY) + +#define STR_SRC_AC1_8_2_1 \ + STR_SRC_8_2_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_8_2_1 = { + .cc = LC3_CONFIG_8_2_AC(2), + .qos = LC3_QOS_8_2_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_8_2_1 \ + STR_SRC_8_2_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_16_1_1 = { + .cc = LC3_CONFIG_16_1_AC(1), + .qos = LC3_QOS_16_1_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_16(_ac, _dur, _len) \ + STR_SRC(LC3_CONFIG_FREQ_16KHZ, _ac, _dur, _len) + +#define STR_SRC_16_1(_ac) \ + STR_SRC_16(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_16_1) + +#define STR_SRC_16_1_1(_chans) \ + STR_SRC_16_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_16_1, LC3_QOS_16_1_1_RTN, \ + LC3_QOS_16_1_1_LATENCY) + +#define STR_SRC_AC1_16_1_1 \ + STR_SRC_16_1_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_16_1_1 = { + .cc = LC3_CONFIG_16_1_AC(2), + .qos = LC3_QOS_16_1_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_16_1_1 \ + STR_SRC_16_1_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_16_2_1 = { + .cc = LC3_CONFIG_16_2_AC(1), + .qos = LC3_QOS_16_2_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_16_2(_ac) \ + STR_SRC_16(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_16_2) + +#define STR_SRC_16_2_1(_chans) \ + STR_SRC_16_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_16_2, LC3_QOS_16_2_1_RTN, \ + LC3_QOS_16_2_1_LATENCY) + +#define STR_SRC_AC1_16_2_1 \ + STR_SRC_16_2_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_16_2_1 = { + .cc = LC3_CONFIG_16_2_AC(2), + .qos = LC3_QOS_16_2_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_16_2_1 \ + STR_SRC_16_2_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_24_1_1 = { + .cc = LC3_CONFIG_24_1_AC(1), + .qos = LC3_QOS_24_1_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_24(_ac, _dur, _len) \ + STR_SRC(LC3_CONFIG_FREQ_24KHZ, _ac, _dur, _len) + +#define STR_SRC_24_1(_ac) \ + STR_SRC_24(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_24_1) + +#define STR_SRC_24_1_1(_chans) \ + STR_SRC_24_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_24_1, LC3_QOS_24_1_1_RTN, \ + LC3_QOS_24_1_1_LATENCY) + +#define STR_SRC_AC1_24_1_1 \ + STR_SRC_24_1_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_24_1_1 = { + .cc = LC3_CONFIG_24_1_AC(2), + .qos = LC3_QOS_24_1_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_24_1_1 \ + STR_SRC_24_1_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_24_2_1 = { + .cc = LC3_CONFIG_24_2_AC(1), + .qos = LC3_QOS_24_2_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_24_2(_ac) \ + STR_SRC_24(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_24_2) + +#define STR_SRC_24_2_1(_chans) \ + STR_SRC_24_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_24_2, LC3_QOS_24_2_1_RTN, \ + LC3_QOS_24_2_1_LATENCY) + +#define STR_SRC_AC1_24_2_1 \ + STR_SRC_24_2_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_24_2_1 = { + .cc = LC3_CONFIG_24_2_AC(2), + .qos = LC3_QOS_24_2_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_24_2_1 \ + STR_SRC_24_2_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_32_1_1 = { + .cc = LC3_CONFIG_32_1_AC(1), + .qos = LC3_QOS_32_1_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_32(_ac, _dur, _len) \ + STR_SRC(LC3_CONFIG_FREQ_32KHZ, _ac, _dur, _len) + +#define STR_SRC_32_1(_ac) \ + STR_SRC_32(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_32_1) + +#define STR_SRC_32_1_1(_chans) \ + STR_SRC_32_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_32_1, LC3_QOS_32_1_1_RTN, \ + LC3_QOS_32_1_1_LATENCY) + +#define STR_SRC_AC1_32_1_1 \ + STR_SRC_32_1_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_32_1_1 = { + .cc = LC3_CONFIG_32_1_AC(2), + .qos = LC3_QOS_32_1_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_32_1_1 \ + STR_SRC_32_1_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_32_2_1 = { + .cc = LC3_CONFIG_32_2_AC(1), + .qos = LC3_QOS_32_2_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_32_2(_ac) \ + STR_SRC_32(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_32_2) + +#define STR_SRC_32_2_1(_chans) \ + STR_SRC_32_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_32_2, LC3_QOS_32_2_1_RTN, \ + LC3_QOS_32_2_1_LATENCY) + +#define STR_SRC_AC1_32_2_1 \ + STR_SRC_32_2_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_32_2_1 = { + .cc = LC3_CONFIG_32_2_AC(2), + .qos = LC3_QOS_32_2_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_32_2_1 \ + STR_SRC_32_2_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_44_1_1 = { + .cc = LC3_CONFIG_44_1_AC(1), + .qos = LC3_QOS_44_1_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_44(_ac, _dur, _len) \ + STR_SRC(LC3_CONFIG_FREQ_44KHZ, _ac, _dur, _len) + +#define STR_SRC_44_1(_ac) \ + STR_SRC_44(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_44_1) + +#define STR_SRC_QOS_44_1(_sdu, _rtn, _latency) \ + STR_SRC_QOS(LC3_QOS_44_1_INTERVAL, LC3_QOS_FRAMED, _sdu, _rtn, \ + _latency) + +#define STR_SRC_44_1_1(_chans) \ + STR_SRC_44_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_44_1(_chans * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_1_RTN, LC3_QOS_44_1_1_LATENCY) + +#define STR_SRC_AC1_44_1_1 \ + STR_SRC_44_1_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_44_1_1 = { + .cc = LC3_CONFIG_44_1_AC(2), + .qos = LC3_QOS_44_1_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_44_1_1 \ + STR_SRC_44_1_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_44_2_1 = { + .cc = LC3_CONFIG_44_2_AC(1), + .qos = LC3_QOS_44_2_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_44_2(_ac) \ + STR_SRC_44(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_44_2) + +#define STR_SRC_QOS_44_2(_sdu, _rtn, _latency) \ + STR_SRC_QOS(LC3_QOS_44_2_INTERVAL, LC3_QOS_FRAMED, _sdu, _rtn, \ + _latency) + +#define STR_SRC_44_2_1(_chans) \ + STR_SRC_44_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_44_2(_chans * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_1_RTN, LC3_QOS_44_2_1_LATENCY) + +#define STR_SRC_AC1_44_2_1 \ + STR_SRC_44_2_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_44_2_1 = { + .cc = LC3_CONFIG_44_2_AC(2), + .qos = LC3_QOS_44_2_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_44_2_1 \ + STR_SRC_44_2_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_1_1 = { + .cc = LC3_CONFIG_48_1_AC(1), + .qos = LC3_QOS_48_1_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_48(_ac, _dur, _len) \ + STR_SRC(LC3_CONFIG_FREQ_48KHZ, _ac, _dur, _len) + +#define STR_SRC_48_1(_ac) \ + STR_SRC_48(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_1) + +#define STR_SRC_48_1_1(_chans) \ + STR_SRC_48_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_1, LC3_QOS_48_1_1_RTN, \ + LC3_QOS_48_1_1_LATENCY) + +#define STR_SRC_AC1_48_1_1 \ + STR_SRC_48_1_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_48_1_1 = { + .cc = LC3_CONFIG_48_1_AC(2), + .qos = LC3_QOS_48_1_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_1_1 \ + STR_SRC_48_1_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_2_1 = { + .cc = LC3_CONFIG_48_2_AC(1), + .qos = LC3_QOS_48_2_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_48_2(_ac) \ + STR_SRC_48(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_2) + +#define STR_SRC_48_2_1(_chans) \ + STR_SRC_48_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_2, LC3_QOS_48_2_1_RTN, \ + LC3_QOS_48_2_1_LATENCY) + +#define STR_SRC_AC1_48_2_1 \ + STR_SRC_48_2_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_48_2_1 = { + .cc = LC3_CONFIG_48_2_AC(2), + .qos = LC3_QOS_48_2_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_2_1 \ + STR_SRC_48_2_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_3_1 = { + .cc = LC3_CONFIG_48_3_AC(1), + .qos = LC3_QOS_48_3_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_48_3(_ac) \ + STR_SRC_48(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_3) + +#define STR_SRC_48_3_1(_chans) \ + STR_SRC_48_3((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_3, LC3_QOS_48_3_1_RTN, \ + LC3_QOS_48_3_1_LATENCY) + +#define STR_SRC_AC1_48_3_1 \ + STR_SRC_48_3_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_48_3_1 = { + .cc = LC3_CONFIG_48_3_AC(2), + .qos = LC3_QOS_48_3_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_3_1 \ + STR_SRC_48_3_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_4_1 = { + .cc = LC3_CONFIG_48_4_AC(1), + .qos = LC3_QOS_48_4_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_48_4(_ac) \ + STR_SRC_48(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_4) + +#define STR_SRC_48_4_1(_chans) \ + STR_SRC_48_4((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_4, LC3_QOS_48_4_1_RTN, \ + LC3_QOS_48_4_1_LATENCY) + +#define STR_SRC_AC1_48_4_1 \ + STR_SRC_48_4_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_48_4_1 = { + .cc = LC3_CONFIG_48_4_AC(2), + .qos = LC3_QOS_48_4_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_4_1 \ + STR_SRC_48_4_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_5_1 = { + .cc = LC3_CONFIG_48_5_AC(1), + .qos = LC3_QOS_48_5_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_48_5(_ac) \ + STR_SRC_48(_ac, LC3_CONFIG_DURATION_7_5, LC3_CONFIG_FRAME_LEN_48_5) + +#define STR_SRC_48_5_1(_chans) \ + STR_SRC_48_5((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_5, LC3_QOS_48_5_1_RTN, \ + LC3_QOS_48_5_1_LATENCY) + +#define STR_SRC_AC1_48_5_1 \ + STR_SRC_48_5_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_48_5_1 = { + .cc = LC3_CONFIG_48_5_AC(2), + .qos = LC3_QOS_48_5_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_5_1 \ + STR_SRC_48_5_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_6_1 = { + .cc = LC3_CONFIG_48_6_AC(1), + .qos = LC3_QOS_48_6_1_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_48_6(_ac) \ + STR_SRC_48(_ac, LC3_CONFIG_DURATION_10, LC3_CONFIG_FRAME_LEN_48_6) + +#define STR_SRC_48_6_1(_chans) \ + STR_SRC_48_6((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_6, LC3_QOS_48_6_1_RTN, \ + LC3_QOS_48_6_1_LATENCY) + +#define STR_SRC_AC1_48_6_1 \ + STR_SRC_48_6_1(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_48_6_1 = { + .cc = LC3_CONFIG_48_6_AC(2), + .qos = LC3_QOS_48_6_1_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_6_1 \ + STR_SRC_48_6_1(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_8_1_2 = { + .cc = LC3_CONFIG_8_1_AC(1), + .qos = LC3_QOS_8_1_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_8_1_2(_chans) \ + STR_SRC_8_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_8_1, LC3_QOS_8_1_2_RTN, \ + LC3_QOS_8_1_2_LATENCY) + +#define STR_SRC_AC1_8_1_2 \ + STR_SRC_8_1_2(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_8_1_2 = { + .cc = LC3_CONFIG_8_1_AC(2), + .qos = LC3_QOS_8_1_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_8_1_2 \ + STR_SRC_8_1_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_8_2_2 = { + .cc = LC3_CONFIG_8_2_AC(1), + .qos = LC3_QOS_8_2_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_8_2_2(_chans) \ + STR_SRC_8_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_8_2, LC3_QOS_8_2_2_RTN, \ + LC3_QOS_8_2_2_LATENCY) + +#define STR_SRC_AC1_8_2_2 \ + STR_SRC_8_2_2(1), \ + SRC_ENABLE, \ + SNK_START + +static struct test_config str_src_ac4_8_2_2 = { + .cc = LC3_CONFIG_8_2_AC(2), + .qos = LC3_QOS_8_2_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_8_2_2 \ + STR_SRC_8_2_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_16_1_2 = { + .cc = LC3_CONFIG_16_1_AC(1), + .qos = LC3_QOS_16_1_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_16_1_2(_chans) \ + STR_SRC_16_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_16_1, LC3_QOS_16_1_2_RTN, \ + LC3_QOS_16_1_2_LATENCY) + +#define STR_SRC_AC1_16_1_2 \ + STR_SRC_16_1_2(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_16_1_2 = { + .cc = LC3_CONFIG_16_1_AC(2), + .qos = LC3_QOS_16_1_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_16_1_2 \ + STR_SRC_16_1_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_16_2_2 = { + .cc = LC3_CONFIG_16_2_AC(1), + .qos = LC3_QOS_16_2_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_16_2_2(_chans) \ + STR_SRC_16_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_16_2, LC3_QOS_16_2_2_RTN, \ + LC3_QOS_16_2_2_LATENCY) + +#define STR_SRC_AC1_16_2_2 \ + STR_SRC_16_2_2(1), \ + SRC_ENABLE, \ + SNK_START + +static struct test_config str_src_ac4_16_2_2 = { + .cc = LC3_CONFIG_16_2_AC(2), + .qos = LC3_QOS_16_2_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_16_2_2 \ + STR_SRC_16_2_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_24_1_2 = { + .cc = LC3_CONFIG_24_1_AC(1), + .qos = LC3_QOS_24_1_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_24_1_2(_chans) \ + STR_SRC_24_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_24_1, LC3_QOS_24_1_2_RTN, \ + LC3_QOS_24_1_2_LATENCY) + +#define STR_SRC_AC1_24_1_2 \ + STR_SRC_24_1_2(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_24_1_2 = { + .cc = LC3_CONFIG_24_1_AC(2), + .qos = LC3_QOS_24_1_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_24_1_2 \ + STR_SRC_24_1_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_24_2_2 = { + .cc = LC3_CONFIG_24_2_AC(1), + .qos = LC3_QOS_24_2_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_24_2_2(_chans) \ + STR_SRC_24_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_24_2, LC3_QOS_24_2_2_RTN, \ + LC3_QOS_24_2_2_LATENCY) + +#define STR_SRC_AC1_24_2_2 \ + STR_SRC_24_2_2(1), \ + SRC_ENABLE, \ + SNK_START + +static struct test_config str_src_ac4_24_2_2 = { + .cc = LC3_CONFIG_24_2_AC(2), + .qos = LC3_QOS_24_2_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_24_2_2 \ + STR_SRC_24_2_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_32_1_2 = { + .cc = LC3_CONFIG_32_1_AC(1), + .qos = LC3_QOS_32_1_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_32_1_2(_chans) \ + STR_SRC_32_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_32_1, LC3_QOS_32_1_2_RTN, \ + LC3_QOS_32_1_2_LATENCY) + +#define STR_SRC_AC1_32_1_2 \ + STR_SRC_32_1_2(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_32_1_2 = { + .cc = LC3_CONFIG_32_1_AC(2), + .qos = LC3_QOS_32_1_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_32_1_2 \ + STR_SRC_32_1_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_32_2_2 = { + .cc = LC3_CONFIG_32_2_AC(1), + .qos = LC3_QOS_32_2_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_32_2_2(_chans) \ + STR_SRC_32_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_32_2, LC3_QOS_32_2_2_RTN, \ + LC3_QOS_32_2_2_LATENCY) + +#define STR_SRC_AC1_32_2_2 \ + STR_SRC_32_2_2(1), \ + SRC_ENABLE, \ + SNK_START + +static struct test_config str_src_ac4_32_2_2 = { + .cc = LC3_CONFIG_32_2_AC(2), + .qos = LC3_QOS_32_2_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_32_2_2 \ + STR_SRC_32_2_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_44_1_2 = { + .cc = LC3_CONFIG_44_1_AC(1), + .qos = LC3_QOS_44_1_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + + +#define STR_SRC_44_1_2(_chans) \ + STR_SRC_44_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_44_1(_chans * LC3_CONFIG_FRAME_LEN_44_1, \ + LC3_QOS_44_1_2_RTN, LC3_QOS_44_1_2_LATENCY) + +#define STR_SRC_AC1_44_1_2 \ + STR_SRC_44_1_2(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_44_1_2 = { + .cc = LC3_CONFIG_44_1_AC(2), + .qos = LC3_QOS_44_1_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_44_1_2 \ + STR_SRC_44_1_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_44_2_2 = { + .cc = LC3_CONFIG_44_2_AC(1), + .qos = LC3_QOS_44_2_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_44_2_2(_chans) \ + STR_SRC_44_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_44_2(_chans * LC3_CONFIG_FRAME_LEN_44_2, \ + LC3_QOS_44_2_2_RTN, LC3_QOS_44_2_2_LATENCY) + +#define STR_SRC_AC1_44_2_2 \ + STR_SRC_44_2_2(1), \ + SRC_ENABLE, \ + SNK_START + +static struct test_config str_src_ac4_44_2_2 = { + .cc = LC3_CONFIG_44_2_AC(2), + .qos = LC3_QOS_44_2_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_44_2_2 \ + STR_SRC_44_2_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_1_2 = { + .cc = LC3_CONFIG_48_1_AC(1), + .qos = LC3_QOS_48_1_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + + +#define STR_SRC_48_1_2(_chans) \ + STR_SRC_48_1((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_1, LC3_QOS_48_1_2_RTN, \ + LC3_QOS_48_1_2_LATENCY) + +#define STR_SRC_AC1_48_1_2 \ + STR_SRC_48_1_2(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_48_1_2 = { + .cc = LC3_CONFIG_48_1_AC(2), + .qos = LC3_QOS_48_1_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_1_2 \ + STR_SRC_48_1_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_2_2 = { + .cc = LC3_CONFIG_48_2_AC(1), + .qos = LC3_QOS_48_2_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_48_2_2(_chans) \ + STR_SRC_48_2((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_2, LC3_QOS_48_2_2_RTN, \ + LC3_QOS_48_2_2_LATENCY) + +#define STR_SRC_AC1_48_2_2 \ + STR_SRC_48_2_2(1), \ + SRC_ENABLE, \ + SNK_START + +static struct test_config str_src_ac4_48_2_2 = { + .cc = LC3_CONFIG_48_2_AC(2), + .qos = LC3_QOS_48_2_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_2_2 \ + STR_SRC_48_2_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_3_2 = { + .cc = LC3_CONFIG_48_3_AC(1), + .qos = LC3_QOS_48_3_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + + +#define STR_SRC_48_3_2(_chans) \ + STR_SRC_48_3((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_3, LC3_QOS_48_3_2_RTN, \ + LC3_QOS_48_3_2_LATENCY) + +#define STR_SRC_AC1_48_3_2 \ + STR_SRC_48_3_2(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_48_3_2 = { + .cc = LC3_CONFIG_48_3_AC(2), + .qos = LC3_QOS_48_3_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_3_2 \ + STR_SRC_48_3_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_4_2 = { + .cc = LC3_CONFIG_48_4_AC(1), + .qos = LC3_QOS_48_4_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_48_4_2(_chans) \ + STR_SRC_48_4((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_4, LC3_QOS_48_4_2_RTN, \ + LC3_QOS_48_4_2_LATENCY) + +#define STR_SRC_AC1_48_4_2 \ + STR_SRC_48_4_2(1), \ + SRC_ENABLE, \ + SNK_START + +static struct test_config str_src_ac4_48_4_2 = { + .cc = LC3_CONFIG_48_4_AC(2), + .qos = LC3_QOS_48_4_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_4_2 \ + STR_SRC_48_4_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_5_2 = { + .cc = LC3_CONFIG_48_5_AC(1), + .qos = LC3_QOS_48_5_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + + +#define STR_SRC_48_5_2(_chans) \ + STR_SRC_48_5((BIT(_chans) - 1)), \ + STR_SRC_QOS_1(_chans * LC3_CONFIG_FRAME_LEN_48_5, LC3_QOS_48_5_2_RTN, \ + LC3_QOS_48_5_2_LATENCY) + +#define STR_SRC_AC1_48_5_2 \ + STR_SRC_48_5_2(1), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac4_48_5_2 = { + .cc = LC3_CONFIG_48_5_AC(2), + .qos = LC3_QOS_48_5_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_5_2 \ + STR_SRC_48_5_2(2), \ + SRC_ENABLE, \ + SRC_START + +static struct test_config str_src_ac1_48_6_2 = { + .cc = LC3_CONFIG_48_6_AC(1), + .qos = LC3_QOS_48_6_2_AC(1), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_48_6_2(_chans) \ + STR_SRC_48_6((BIT(_chans) - 1)), \ + STR_SRC_QOS_2(_chans * LC3_CONFIG_FRAME_LEN_48_6, LC3_QOS_48_6_2_RTN, \ + LC3_QOS_48_6_2_LATENCY) + +#define STR_SRC_AC1_48_6_2 \ + STR_SRC_48_6_2(1), \ + SRC_ENABLE, \ + SNK_START + +static struct test_config str_src_ac4_48_6_2 = { + .cc = LC3_CONFIG_48_6_AC(2), + .qos = LC3_QOS_48_6_2_AC(2), + .src = true, + .state = BT_BAP_STREAM_STATE_STREAMING, +}; + +#define STR_SRC_AC4_48_6_2 \ + STR_SRC_48_6_2(2), \ + SRC_ENABLE, \ + SRC_START + +/* Unicast Client Streaming – 1 Unicast Server, 1 Stream, 1 CIS – LC3 + * + * Test Purpose: + * Verify that a Unicast Client IUT can stream audio data over one unicast + * Audio Stream to or from a Unicast Server. + * + * Pass verdict: + * If the IUT is in the Audio Sink role, the IUT receives SDUs with a zero or + * more length that contains LC3-encoded data formatted using the LC3 Media + * Packet format (defined in 3 Section 4.2). + */ +static void test_str_1_1_1_lc3(void) +{ + define_test("BAP/UCL/STR/BV-001-C UCL, AC 2, LC3 8_1_1", + test_setup, test_client, &str_snk_ac2_8_1_1, + STR_SNK_AC2_8_1_1); + define_test("BAP/UCL/STR/BV-002-C UCL, AC 10, LC3 8_1_1", + test_setup, test_client, &str_snk_ac10_8_1_1, + STR_SNK_AC10_8_1_1); + define_test("BAP/UCL/STR/BV-003-C UCL, AC 2, LC3 8_2_1", + test_setup, test_client, &str_snk_ac2_8_2_1, + STR_SNK_AC2_8_2_1); + define_test("BAP/UCL/STR/BV-004-C UCL, AC 10, LC3 8_2_1", + test_setup, test_client, &str_snk_ac10_8_2_1, + STR_SNK_AC10_8_2_1); + define_test("BAP/UCL/STR/BV-005-C UCL, AC 2, LC3 16_1_1", + test_setup, test_client, &str_snk_ac2_16_1_1, + STR_SNK_AC2_16_1_1); + define_test("BAP/UCL/STR/BV-006-C UCL, AC 10, LC3 16_1_1", + test_setup, test_client, &str_snk_ac10_16_1_1, + STR_SNK_AC10_16_1_1); + define_test("BAP/UCL/STR/BV-007-C UCL, AC 2, LC3 16_2_1", + test_setup, test_client, &str_snk_ac2_16_2_1, + STR_SNK_AC2_16_2_1); + define_test("BAP/UCL/STR/BV-008-C UCL, AC 10, LC3 16_2_1", + test_setup, test_client, &str_snk_ac10_16_2_1, + STR_SNK_AC10_16_2_1); + define_test("BAP/UCL/STR/BV-009-C UCL, AC 2, LC3 24_1_1", + test_setup, test_client, &str_snk_ac2_24_1_1, + STR_SNK_AC2_24_1_1); + define_test("BAP/UCL/STR/BV-010-C UCL, AC 10, LC3 24_1_1", + test_setup, test_client, &str_snk_ac10_24_1_1, + STR_SNK_AC10_24_1_1); + define_test("BAP/UCL/STR/BV-011-C UCL, AC 2, LC3 24_2_1", + test_setup, test_client, &str_snk_ac2_24_2_1, + STR_SNK_AC2_24_2_1); + define_test("BAP/UCL/STR/BV-012-C UCL, AC 10, LC3 24_2_1", + test_setup, test_client, &str_snk_ac10_24_2_1, + STR_SNK_AC10_24_2_1); + define_test("BAP/UCL/STR/BV-013-C UCL, AC 2, LC3 32_1_1", + test_setup, test_client, &str_snk_ac2_32_1_1, + STR_SNK_AC2_32_1_1); + define_test("BAP/UCL/STR/BV-014-C UCL, AC 10, LC3 32_1_1", + test_setup, test_client, &str_snk_ac10_32_1_1, + STR_SNK_AC10_32_1_1); + define_test("BAP/UCL/STR/BV-015-C UCL, AC 2, LC3 32_2_1", + test_setup, test_client, &str_snk_ac2_32_2_1, + STR_SNK_AC2_32_2_1); + define_test("BAP/UCL/STR/BV-016-C UCL, AC 10, LC3 32_2_1", + test_setup, test_client, &str_snk_ac10_32_2_1, + STR_SNK_AC10_32_2_1); + define_test("BAP/UCL/STR/BV-017-C UCL, AC 2, LC3 441_1_1", + test_setup, test_client, &str_snk_ac2_44_1_1, + STR_SNK_AC2_44_1_1); + define_test("BAP/UCL/STR/BV-018-C UCL, AC 10, LC3 441_1_1", + test_setup, test_client, &str_snk_ac10_44_1_1, + STR_SNK_AC10_44_1_1); + define_test("BAP/UCL/STR/BV-019-C UCL, AC 2, LC3 44_2_1", + test_setup, test_client, &str_snk_ac2_44_2_1, + STR_SNK_AC2_44_2_1); + define_test("BAP/UCL/STR/BV-020-C UCL, AC 10, LC3 44_2_1", + test_setup, test_client, &str_snk_ac10_44_2_1, + STR_SNK_AC10_44_2_1); + define_test("BAP/UCL/STR/BV-021-C UCL, AC 2, LC3 48_1_1", + test_setup, test_client, &str_snk_ac2_48_1_1, + STR_SNK_AC2_48_1_1); + define_test("BAP/UCL/STR/BV-022-C UCL, AC 10, LC3 48_1_1", + test_setup, test_client, &str_snk_ac10_48_1_1, + STR_SNK_AC10_48_1_1); + define_test("BAP/UCL/STR/BV-023-C UCL, AC 2, LC3 48_2_1", + test_setup, test_client, &str_snk_ac2_48_2_1, + STR_SNK_AC2_48_2_1); + define_test("BAP/UCL/STR/BV-024-C UCL, AC 10, LC3 48_2_1", + test_setup, test_client, &str_snk_ac10_48_2_1, + STR_SNK_AC10_48_2_1); + define_test("BAP/UCL/STR/BV-025-C UCL, AC 2, LC3 48_3_1", + test_setup, test_client, &str_snk_ac2_48_3_1, + STR_SNK_AC2_48_3_1); + define_test("BAP/UCL/STR/BV-026-C UCL, AC 10, LC3 48_3_1", + test_setup, test_client, &str_snk_ac10_48_3_1, + STR_SNK_AC10_48_3_1); + define_test("BAP/UCL/STR/BV-027-C UCL, AC 2, LC3 48_4_1", + test_setup, test_client, &str_snk_ac2_48_4_1, + STR_SNK_AC2_48_4_1); + define_test("BAP/UCL/STR/BV-028-C UCL, AC 10, LC3 48_4_1", + test_setup, test_client, &str_snk_ac10_48_4_1, + STR_SNK_AC10_48_4_1); + define_test("BAP/UCL/STR/BV-029-C UCL, AC 2, LC3 48_5_1", + test_setup, test_client, &str_snk_ac2_48_5_1, + STR_SNK_AC2_48_5_1); + define_test("BAP/UCL/STR/BV-030-C UCL, AC 10, LC3 48_5_1", + test_setup, test_client, &str_snk_ac10_48_5_1, + STR_SNK_AC10_48_5_1); + define_test("BAP/UCL/STR/BV-031-C UCL, AC 2, LC3 48_6_1", + test_setup, test_client, &str_snk_ac2_48_6_1, + STR_SNK_AC2_48_6_1); + define_test("BAP/UCL/STR/BV-032-C UCL, AC 10, LC3 48_6_1", + test_setup, test_client, &str_snk_ac10_48_6_1, + STR_SNK_AC10_48_6_1); + define_test("BAP/UCL/STR/BV-033-C UCL, SRC, AC 1, LC3 8_1_1", + test_setup, test_client, &str_src_ac1_8_1_1, + STR_SRC_AC1_8_1_1); + define_test("BAP/UCL/STR/BV-034-C UCL, SRC, AC 4, LC3 8_1_1", + test_setup, test_client, &str_src_ac4_8_1_1, + STR_SRC_AC4_8_1_1); + define_test("BAP/UCL/STR/BV-035-C UCL, SRC, AC 1, LC3 8_2_1", + test_setup, test_client, &str_src_ac1_8_2_1, + STR_SRC_AC1_8_2_1); + define_test("BAP/UCL/STR/BV-036-C UCL, SRC, AC 4, LC3 8_2_1", + test_setup, test_client, &str_src_ac4_8_2_1, + STR_SRC_AC4_8_2_1); + define_test("BAP/UCL/STR/BV-037-C UCL, SRC, AC 1, LC3 16_1_1", + test_setup, test_client, &str_src_ac1_16_1_1, + STR_SRC_AC1_16_1_1); + define_test("BAP/UCL/STR/BV-038-C UCL, SRC, AC 4, LC3 16_1_1", + test_setup, test_client, &str_src_ac4_16_1_1, + STR_SRC_AC4_16_1_1); + define_test("BAP/UCL/STR/BV-039-C UCL, SRC, AC 1, LC3 16_2_1", + test_setup, test_client, &str_src_ac1_16_2_1, + STR_SRC_AC1_16_2_1); + define_test("BAP/UCL/STR/BV-040-C UCL, SRC, AC 4, LC3 16_2_1", + test_setup, test_client, &str_src_ac4_16_2_1, + STR_SRC_AC4_16_2_1); + define_test("BAP/UCL/STR/BV-041-C UCL, SRC, AC 1, LC3 24_1_1", + test_setup, test_client, &str_src_ac1_24_1_1, + STR_SRC_AC1_24_1_1); + define_test("BAP/UCL/STR/BV-042-C UCL, SRC, AC 4, LC3 24_1_1", + test_setup, test_client, &str_src_ac4_24_1_1, + STR_SRC_AC4_24_1_1); + define_test("BAP/UCL/STR/BV-043-C UCL, SRC, AC 1, LC3 24_2_1", + test_setup, test_client, &str_src_ac1_24_2_1, + STR_SRC_AC1_24_2_1); + define_test("BAP/UCL/STR/BV-044-C UCL, SRC, AC 4, LC3 24_2_1", + test_setup, test_client, &str_src_ac4_24_2_1, + STR_SRC_AC4_24_2_1); + define_test("BAP/UCL/STR/BV-045-C UCL, SRC, AC 1, LC3 32_1_1", + test_setup, test_client, &str_src_ac1_32_1_1, + STR_SRC_AC1_32_1_1); + define_test("BAP/UCL/STR/BV-046-C UCL, SRC, AC 4, LC3 32_1_1", + test_setup, test_client, &str_src_ac4_32_1_1, + STR_SRC_AC4_32_1_1); + define_test("BAP/UCL/STR/BV-047-C UCL, SRC, AC 1, LC3 32_2_1", + test_setup, test_client, &str_src_ac1_32_2_1, + STR_SRC_AC1_32_2_1); + define_test("BAP/UCL/STR/BV-048-C UCL, SRC, AC 4, LC3 32_2_1", + test_setup, test_client, &str_src_ac4_32_2_1, + STR_SRC_AC4_32_2_1); + define_test("BAP/UCL/STR/BV-049-C UCL, SRC, AC 1, LC3 44_1_1", + test_setup, test_client, &str_src_ac1_44_1_1, + STR_SRC_AC1_44_1_1); + define_test("BAP/UCL/STR/BV-050-C UCL, SRC, AC 4, LC3 44_1_1", + test_setup, test_client, &str_src_ac4_44_1_1, + STR_SRC_AC4_44_1_1); + define_test("BAP/UCL/STR/BV-051-C UCL, SRC, AC 1, LC3 44_2_1", + test_setup, test_client, &str_src_ac1_44_2_1, + STR_SRC_AC1_44_2_1); + define_test("BAP/UCL/STR/BV-052-C UCL, SRC, AC 4, LC3 44_2_1", + test_setup, test_client, &str_src_ac4_44_2_1, + STR_SRC_AC4_44_2_1); + define_test("BAP/UCL/STR/BV-053-C UCL, SRC, AC 1, LC3 48_1_1", + test_setup, test_client, &str_src_ac1_48_1_1, + STR_SRC_AC1_48_1_1); + define_test("BAP/UCL/STR/BV-054-C UCL, SRC, AC 4, LC3 48_1_1", + test_setup, test_client, &str_src_ac4_48_1_1, + STR_SRC_AC4_48_1_1); + define_test("BAP/UCL/STR/BV-055-C UCL, SRC, AC 1, LC3 48_2_1", + test_setup, test_client, &str_src_ac1_48_2_1, + STR_SRC_AC1_48_2_1); + define_test("BAP/UCL/STR/BV-056-C UCL, SRC, AC 4, LC3 48_2_1", + test_setup, test_client, &str_src_ac4_48_2_1, + STR_SRC_AC4_48_2_1); + define_test("BAP/UCL/STR/BV-057-C UCL, SRC, AC 1, LC3 48_3_1", + test_setup, test_client, &str_src_ac1_48_3_1, + STR_SRC_AC1_48_3_1); + define_test("BAP/UCL/STR/BV-058-C UCL, SRC, AC 4, LC3 48_3_1", + test_setup, test_client, &str_src_ac4_48_3_1, + STR_SRC_AC4_48_3_1); + define_test("BAP/UCL/STR/BV-059-C UCL, SRC, AC 1, LC3 48_4_1", + test_setup, test_client, &str_src_ac1_48_4_1, + STR_SRC_AC1_48_4_1); + define_test("BAP/UCL/STR/BV-060-C UCL, SRC, AC 4, LC3 48_4_1", + test_setup, test_client, &str_src_ac4_48_4_1, + STR_SRC_AC4_48_4_1); + define_test("BAP/UCL/STR/BV-061-C UCL, SRC, AC 1, LC3 48_5_1", + test_setup, test_client, &str_src_ac1_48_5_1, + STR_SRC_AC1_48_5_1); + define_test("BAP/UCL/STR/BV-062-C UCL, SRC, AC 4, LC3 48_5_1", + test_setup, test_client, &str_src_ac4_48_5_1, + STR_SRC_AC4_48_5_1); + define_test("BAP/UCL/STR/BV-063-C UCL, SRC, AC 1, LC3 48_6_1", + test_setup, test_client, &str_src_ac1_48_6_1, + STR_SRC_AC1_48_6_1); + define_test("BAP/UCL/STR/BV-064-C UCL, SRC, AC 4, LC3 48_6_1", + test_setup, test_client, &str_src_ac4_48_6_1, + STR_SRC_AC4_48_6_1); + define_test("BAP/UCL/STR/BV-065-C UCL, AC 2, LC3 8_1_2", + test_setup, test_client, &str_snk_ac2_8_1_2, + STR_SNK_AC2_8_1_2); + define_test("BAP/UCL/STR/BV-066-C UCL, AC 10, LC3 8_1_2", + test_setup, test_client, &str_snk_ac10_8_1_2, + STR_SNK_AC10_8_1_2); + define_test("BAP/UCL/STR/BV-067-C UCL, AC 2, LC3 8_2_2", + test_setup, test_client, &str_snk_ac2_8_2_2, + STR_SNK_AC2_8_2_2); + define_test("BAP/UCL/STR/BV-068-C UCL, AC 10, LC3 8_2_2", + test_setup, test_client, &str_snk_ac10_8_2_2, + STR_SNK_AC10_8_2_2); + define_test("BAP/UCL/STR/BV-069-C UCL, AC 2, LC3 16_1_2", + test_setup, test_client, &str_snk_ac2_16_1_2, + STR_SNK_AC2_16_1_2); + define_test("BAP/UCL/STR/BV-070-C UCL, AC 10, LC3 16_1_2", + test_setup, test_client, &str_snk_ac10_16_1_2, + STR_SNK_AC10_16_1_2); + define_test("BAP/UCL/STR/BV-071-C UCL, AC 2, LC3 16_2_2", + test_setup, test_client, &str_snk_ac2_16_2_2, + STR_SNK_AC2_16_2_2); + define_test("BAP/UCL/STR/BV-072-C UCL, AC 10, LC3 16_2_2", + test_setup, test_client, &str_snk_ac10_16_2_2, + STR_SNK_AC10_16_2_2); + define_test("BAP/UCL/STR/BV-073-C UCL, AC 2, LC3 24_1_2", + test_setup, test_client, &str_snk_ac2_24_1_2, + STR_SNK_AC2_24_1_2); + define_test("BAP/UCL/STR/BV-074-C UCL, AC 10, LC3 24_1_2", + test_setup, test_client, &str_snk_ac10_24_1_2, + STR_SNK_AC10_24_1_2); + define_test("BAP/UCL/STR/BV-075-C UCL, AC 2, LC3 24_2_2", + test_setup, test_client, &str_snk_ac2_24_2_2, + STR_SNK_AC2_24_2_2); + define_test("BAP/UCL/STR/BV-076-C UCL, AC 10, LC3 24_2_2", + test_setup, test_client, &str_snk_ac10_24_2_2, + STR_SNK_AC10_24_2_2); + define_test("BAP/UCL/STR/BV-077-C UCL, AC 2, LC3 32_1_2", + test_setup, test_client, &str_snk_ac2_32_1_2, + STR_SNK_AC2_32_1_2); + define_test("BAP/UCL/STR/BV-078-C UCL, AC 10, LC3 32_1_2", + test_setup, test_client, &str_snk_ac10_32_1_2, + STR_SNK_AC10_32_1_2); + define_test("BAP/UCL/STR/BV-079-C UCL, AC 2, LC3 32_2_2", + test_setup, test_client, &str_snk_ac2_32_2_2, + STR_SNK_AC2_32_2_2); + define_test("BAP/UCL/STR/BV-080-C UCL, AC 10, LC3 32_2_2", + test_setup, test_client, &str_snk_ac10_32_2_2, + STR_SNK_AC10_32_2_2); + define_test("BAP/UCL/STR/BV-081-C UCL, AC 2, LC3 44_1_2", + test_setup, test_client, &str_snk_ac2_44_1_2, + STR_SNK_AC2_44_1_2); + define_test("BAP/UCL/STR/BV-082-C UCL, AC 10, LC3 44_1_2", + test_setup, test_client, &str_snk_ac10_44_1_2, + STR_SNK_AC10_44_1_2); + define_test("BAP/UCL/STR/BV-083-C UCL, AC 2, LC3 44_2_2", + test_setup, test_client, &str_snk_ac2_44_2_2, + STR_SNK_AC2_44_2_2); + define_test("BAP/UCL/STR/BV-084-C UCL, AC 10, LC3 44_2_2", + test_setup, test_client, &str_snk_ac10_44_2_2, + STR_SNK_AC10_44_2_2); + define_test("BAP/UCL/STR/BV-085-C UCL, AC 2, LC3 48_1_2", + test_setup, test_client, &str_snk_ac2_48_1_2, + STR_SNK_AC2_48_1_2); + define_test("BAP/UCL/STR/BV-086-C UCL, AC 10, LC3 48_1_2", + test_setup, test_client, &str_snk_ac10_48_1_2, + STR_SNK_AC10_48_1_2); + define_test("BAP/UCL/STR/BV-087-C UCL, AC 2, LC3 48_2_2", + test_setup, test_client, &str_snk_ac2_48_2_2, + STR_SNK_AC2_48_2_2); + define_test("BAP/UCL/STR/BV-088-C UCL, AC 10, LC3 48_2_2", + test_setup, test_client, &str_snk_ac10_48_2_2, + STR_SNK_AC10_48_2_2); + define_test("BAP/UCL/STR/BV-089-C UCL, AC 2, LC3 48_3_2", + test_setup, test_client, &str_snk_ac2_48_3_2, + STR_SNK_AC2_48_3_2); + define_test("BAP/UCL/STR/BV-090-C UCL, AC 10, LC3 48_3_2", + test_setup, test_client, &str_snk_ac10_48_3_2, + STR_SNK_AC10_48_3_2); + define_test("BAP/UCL/STR/BV-091-C UCL, AC 2, LC3 48_4_2", + test_setup, test_client, &str_snk_ac2_48_4_2, + STR_SNK_AC2_48_4_2); + define_test("BAP/UCL/STR/BV-092-C UCL, AC 10, LC3 48_4_2", + test_setup, test_client, &str_snk_ac10_48_4_2, + STR_SNK_AC10_48_4_2); + define_test("BAP/UCL/STR/BV-093-C UCL, AC 2, LC3 48_5_2", + test_setup, test_client, &str_snk_ac2_48_5_2, + STR_SNK_AC2_48_5_2); + define_test("BAP/UCL/STR/BV-094-C UCL, AC 10, LC3 48_5_2", + test_setup, test_client, &str_snk_ac10_48_5_2, + STR_SNK_AC10_48_5_2); + define_test("BAP/UCL/STR/BV-095-C UCL, AC 2, LC3 48_6_2", + test_setup, test_client, &str_snk_ac2_48_6_2, + STR_SNK_AC2_48_6_2); + define_test("BAP/UCL/STR/BV-096-C UCL, AC 10, LC3 48_6_2", + test_setup, test_client, &str_snk_ac10_48_6_2, + STR_SNK_AC10_48_6_2); + define_test("BAP/UCL/STR/BV-097-C UCL, SRC, AC 1, LC3 8_1_2", + test_setup, test_client, &str_src_ac1_8_1_2, + STR_SRC_AC1_8_1_2); + define_test("BAP/UCL/STR/BV-098-C UCL, SRC, AC 4, LC3 8_1_2", + test_setup, test_client, &str_src_ac4_8_1_2, + STR_SRC_AC4_8_1_2); + define_test("BAP/UCL/STR/BV-099-C UCL, SRC, AC 1, LC3 8_2_2", + test_setup, test_client, &str_src_ac1_8_2_2, + STR_SRC_AC1_8_2_2); + define_test("BAP/UCL/STR/BV-100-C UCL, SRC, AC 4, LC3 8_2_2", + test_setup, test_client, &str_src_ac4_8_2_2, + STR_SRC_AC4_8_2_2); + define_test("BAP/UCL/STR/BV-101-C UCL, SRC, AC 1, LC3 16_1_2", + test_setup, test_client, &str_src_ac1_16_1_2, + STR_SRC_AC1_16_1_2); + define_test("BAP/UCL/STR/BV-102-C UCL, SRC, AC 4, LC3 16_1_2", + test_setup, test_client, &str_src_ac4_16_1_2, + STR_SRC_AC4_16_1_2); + define_test("BAP/UCL/STR/BV-103-C UCL, SRC, AC 1, LC3 16_2_2", + test_setup, test_client, &str_src_ac1_16_2_2, + STR_SRC_AC1_16_2_2); + define_test("BAP/UCL/STR/BV-104-C UCL, SRC, AC 4, LC3 16_2_2", + test_setup, test_client, &str_src_ac4_16_2_2, + STR_SRC_AC4_16_2_2); + define_test("BAP/UCL/STR/BV-105-C UCL, SRC, AC 1, LC3 24_1_2", + test_setup, test_client, &str_src_ac1_24_1_2, + STR_SRC_AC1_24_1_2); + define_test("BAP/UCL/STR/BV-106-C UCL, SRC, AC 4, LC3 24_1_2", + test_setup, test_client, &str_src_ac4_24_1_2, + STR_SRC_AC4_24_1_2); + define_test("BAP/UCL/STR/BV-107-C UCL, SRC, AC 1, LC3 24_2_2", + test_setup, test_client, &str_src_ac1_24_2_2, + STR_SRC_AC1_24_2_2); + define_test("BAP/UCL/STR/BV-108-C UCL, SRC, AC 4, LC3 24_2_2", + test_setup, test_client, &str_src_ac4_24_2_2, + STR_SRC_AC4_24_2_2); + define_test("BAP/UCL/STR/BV-109-C UCL, SRC, AC 1, LC3 32_1_2", + test_setup, test_client, &str_src_ac1_32_1_2, + STR_SRC_AC1_32_1_2); + define_test("BAP/UCL/STR/BV-110-C UCL, SRC, AC 4, LC3 32_1_2", + test_setup, test_client, &str_src_ac4_32_1_2, + STR_SRC_AC4_32_1_2); + define_test("BAP/UCL/STR/BV-111-C UCL, SRC, AC 1, LC3 32_2_2", + test_setup, test_client, &str_src_ac1_32_2_2, + STR_SRC_AC1_32_2_2); + define_test("BAP/UCL/STR/BV-112-C UCL, SRC, AC 4, LC3 32_2_2", + test_setup, test_client, &str_src_ac4_32_2_2, + STR_SRC_AC4_32_2_2); + define_test("BAP/UCL/STR/BV-113-C UCL, SRC, AC 1, LC3 44_1_2", + test_setup, test_client, &str_src_ac1_44_1_2, + STR_SRC_AC1_44_1_2); + define_test("BAP/UCL/STR/BV-114-C UCL, SRC, AC 4, LC3 44_1_2", + test_setup, test_client, &str_src_ac4_44_1_2, + STR_SRC_AC4_44_1_2); + define_test("BAP/UCL/STR/BV-115-C UCL, SRC, AC 1, LC3 44_2_2", + test_setup, test_client, &str_src_ac1_44_2_2, + STR_SRC_AC1_44_2_2); + define_test("BAP/UCL/STR/BV-116-C UCL, SRC, AC 4, LC3 44_2_2", + test_setup, test_client, &str_src_ac4_44_2_2, + STR_SRC_AC4_44_2_2); + define_test("BAP/UCL/STR/BV-117-C UCL, SRC, AC 1, LC3 48_1_2", + test_setup, test_client, &str_src_ac1_48_1_2, + STR_SRC_AC1_48_1_2); + define_test("BAP/UCL/STR/BV-118-C UCL, SRC, AC 4, LC3 48_1_2", + test_setup, test_client, &str_src_ac4_48_1_2, + STR_SRC_AC4_48_1_2); + define_test("BAP/UCL/STR/BV-119-C UCL, SRC, AC 1, LC3 48_2_2", + test_setup, test_client, &str_src_ac1_48_2_2, + STR_SRC_AC1_48_2_2); + define_test("BAP/UCL/STR/BV-120-C UCL, SRC, AC 4, LC3 48_2_2", + test_setup, test_client, &str_src_ac4_48_2_2, + STR_SRC_AC4_48_2_2); + define_test("BAP/UCL/STR/BV-121-C UCL, SRC, AC 1, LC3 48_3_2", + test_setup, test_client, &str_src_ac1_48_3_2, + STR_SRC_AC1_48_3_2); + define_test("BAP/UCL/STR/BV-122-C UCL, SRC, AC 4, LC3 48_3_2", + test_setup, test_client, &str_src_ac4_48_3_2, + STR_SRC_AC4_48_3_2); + define_test("BAP/UCL/STR/BV-123-C UCL, SRC, AC 1, LC3 48_4_2", + test_setup, test_client, &str_src_ac1_48_4_2, + STR_SRC_AC1_48_4_2); + define_test("BAP/UCL/STR/BV-124-C UCL, SRC, AC 4, LC3 48_4_2", + test_setup, test_client, &str_src_ac4_48_4_2, + STR_SRC_AC4_48_4_2); + define_test("BAP/UCL/STR/BV-121-C UCL, SRC, AC 1, LC3 48_5_2", + test_setup, test_client, &str_src_ac1_48_5_2, + STR_SRC_AC1_48_5_2); + define_test("BAP/UCL/STR/BV-122-C UCL, SRC, AC 4, LC3 48_5_2", + test_setup, test_client, &str_src_ac4_48_5_2, + STR_SRC_AC4_48_5_2); + define_test("BAP/UCL/STR/BV-123-C UCL, SRC, AC 1, LC3 48_6_2", + test_setup, test_client, &str_src_ac1_48_6_2, + STR_SRC_AC1_48_6_2); + define_test("BAP/UCL/STR/BV-124-C UCL, SRC, AC 4, LC3 48_6_2", + test_setup, test_client, &str_src_ac4_48_6_2, + STR_SRC_AC4_48_6_2); +} + static void test_scc(void) { test_scc_cc_lc3(); @@ -2835,6 +5573,1800 @@ test_scc_disable(); test_scc_release(); test_scc_metadata(); + test_str_1_1_1_lc3(); +} + +static struct test_config cfg_bsrc_8_1_1 = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_8_1_2 = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_8_2_1 = { + .cc = LC3_CONFIG_8_2, + .qos = LC3_QOS_8_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_8_2_2 = { + .cc = LC3_CONFIG_8_2, + .qos = LC3_QOS_8_2_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_16_1_1 = { + .cc = LC3_CONFIG_16_1, + .qos = LC3_QOS_16_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_16_1_2 = { + .cc = LC3_CONFIG_16_1, + .qos = LC3_QOS_16_1_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_16_2_1 = { + .cc = LC3_CONFIG_16_2, + .qos = LC3_QOS_16_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_16_2_2 = { + .cc = LC3_CONFIG_16_2, + .qos = LC3_QOS_16_2_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_24_1_1 = { + .cc = LC3_CONFIG_24_1, + .qos = LC3_QOS_24_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_24_1_2 = { + .cc = LC3_CONFIG_24_1, + .qos = LC3_QOS_24_1_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_24_2_1 = { + .cc = LC3_CONFIG_24_2, + .qos = LC3_QOS_24_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_24_2_2 = { + .cc = LC3_CONFIG_24_2, + .qos = LC3_QOS_24_2_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_32_1_1 = { + .cc = LC3_CONFIG_32_1, + .qos = LC3_QOS_32_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_32_1_2 = { + .cc = LC3_CONFIG_32_1, + .qos = LC3_QOS_32_1_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_32_2_1 = { + .cc = LC3_CONFIG_32_2, + .qos = LC3_QOS_32_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_32_2_2 = { + .cc = LC3_CONFIG_32_2, + .qos = LC3_QOS_32_2_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_44_1_1 = { + .cc = LC3_CONFIG_44_1, + .qos = LC3_QOS_44_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_44_1_2 = { + .cc = LC3_CONFIG_44_1, + .qos = LC3_QOS_44_1_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_44_2_1 = { + .cc = LC3_CONFIG_44_2, + .qos = LC3_QOS_44_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_44_2_2 = { + .cc = LC3_CONFIG_44_2, + .qos = LC3_QOS_44_2_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_1_1 = { + .cc = LC3_CONFIG_48_1, + .qos = LC3_QOS_48_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_1_2 = { + .cc = LC3_CONFIG_48_1, + .qos = LC3_QOS_48_1_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_1), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_2_1 = { + .cc = LC3_CONFIG_48_2, + .qos = LC3_QOS_48_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_2_2 = { + .cc = LC3_CONFIG_48_2, + .qos = LC3_QOS_48_2_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_2), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_3_1 = { + .cc = LC3_CONFIG_48_3, + .qos = LC3_QOS_48_3_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_3), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_3_2 = { + .cc = LC3_CONFIG_48_3, + .qos = LC3_QOS_48_3_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_3), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_4_1 = { + .cc = LC3_CONFIG_48_4, + .qos = LC3_QOS_48_4_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_4), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_4_2 = { + .cc = LC3_CONFIG_48_4, + .qos = LC3_QOS_48_4_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_4), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_5_1 = { + .cc = LC3_CONFIG_48_5, + .qos = LC3_QOS_48_5_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_5), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_5_2 = { + .cc = LC3_CONFIG_48_5, + .qos = LC3_QOS_48_5_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_5), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_6_1 = { + .cc = LC3_CONFIG_48_6, + .qos = LC3_QOS_48_6_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_6), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +static struct test_config cfg_bsrc_48_6_2 = { + .cc = LC3_CONFIG_48_6, + .qos = LC3_QOS_48_6_2_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_6), + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +#define VS_CC \ + 0x02, 0x01, 0x08, \ + 0x02, 0x02, 0x00, \ + 0x05, 0x03, 0x01, 0x00, 0x00, 0x00, \ + 0x03, 0x04, 0x75, 0x00 + +#define VS_CFG \ + 0x10, \ + VS_CC + +#define QOS_BCAST \ +{ \ + .bcast.big = 0x00, \ + .bcast.bis = 0x00, \ + .bcast.framing = LC3_QOS_UNFRAMED, \ + .bcast.delay = 40000, \ + .bcast.io_qos.interval = 7500, \ + .bcast.io_qos.latency = 10, \ + .bcast.io_qos.sdu = 40, \ + .bcast.io_qos.phy = BT_BAP_CONFIG_PHY_2M, \ + .bcast.io_qos.rtn = 2, \ +} + +static struct test_config cfg_bsrc_vs = { + .cc = UTIL_IOV_INIT(VS_CC), + .qos = QOS_BCAST, + .base = UTIL_IOV_INIT(BASE_VS(VS_CFG)), + .vs = true, + .src = true, + .state_func = bsrc_state_cfg, + .streams = 1, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can configure a broadcast + * Audio Stream with information defined by the values in its BASE + * structure. The verification is performed one Codec Setting and + * set of parameters at a time, as enumerated in the test cases in + * Table 4.73. + * + * Pass verdict: + * In step 2, the AdvData field of AUX_SYNC_IND and optionally + * AUX_CHAIN_IND PDUs contains the configured BASE information. + * + * In step 3, the IUT transmits the PA synchronization information in + * the SyncInfo field of the Extended Header field of AUX_ADV_IND PDUs. + * The AUX_ADV_IND PDUs include the Service Data AD Type in the AdvData + * field with the Service UUID equal to the Broadcast Audio Announcement + * Service UUID. The additional service data includes Broadcast_ID. + * + * Each value included in the Codec_Specific_Configuration is formatted in + * an LTV structure with the length, type, and value specified in Table 4.74. + */ +static void test_bsrc_scc_config(void) +{ + define_test("BAP/BSRC/SCC/BV-01-C Config Broadcast, LC3 8_1_1", + NULL, test_bcast, &cfg_bsrc_8_1_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-02-C Config Broadcast, LC3 8_2_1", + NULL, test_bcast, &cfg_bsrc_8_2_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-03-C Config Broadcast, LC3 16_1_1", + NULL, test_bcast, &cfg_bsrc_16_1_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-04-C Config Broadcast, LC3 16_2_1", + NULL, test_bcast, &cfg_bsrc_16_2_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-05-C Config Broadcast, LC3 24_1_1", + NULL, test_bcast, &cfg_bsrc_24_1_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-06-C Config Broadcast, LC3 24_2_1", + NULL, test_bcast, &cfg_bsrc_24_2_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-07-C Config Broadcast, LC3 32_1_1", + NULL, test_bcast, &cfg_bsrc_32_1_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-08-C Config Broadcast, LC3 32_2_1", + NULL, test_bcast, &cfg_bsrc_32_2_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-09-C Config Broadcast, LC3 44.1_1_1", + NULL, test_bcast, &cfg_bsrc_44_1_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-10-C Config Broadcast, LC3 44.1_2_1", + NULL, test_bcast, &cfg_bsrc_44_2_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-11-C Config Broadcast, LC3 48_1_1", + NULL, test_bcast, &cfg_bsrc_48_1_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-12-C Config Broadcast, LC3 48_2_1", + NULL, test_bcast, &cfg_bsrc_48_2_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-13-C Config Broadcast, LC3 48_3_1", + NULL, test_bcast, &cfg_bsrc_48_3_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-14-C Config Broadcast, LC3 48_4_1", + NULL, test_bcast, &cfg_bsrc_48_4_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-15-C Config Broadcast, LC3 48_5_1", + NULL, test_bcast, &cfg_bsrc_48_5_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-16-C Config Broadcast, LC3 48_6_1", + NULL, test_bcast, &cfg_bsrc_48_6_1, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-17-C Config Broadcast, LC3 8_1_2", + NULL, test_bcast, &cfg_bsrc_8_1_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-18-C Config Broadcast, LC3 8_2_2", + NULL, test_bcast, &cfg_bsrc_8_2_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-19-C Config Broadcast, LC3 16_1_2", + NULL, test_bcast, &cfg_bsrc_16_1_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-20-C Config Broadcast, LC3 16_2_2", + NULL, test_bcast, &cfg_bsrc_16_2_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-21-C Config Broadcast, LC3 24_1_2", + NULL, test_bcast, &cfg_bsrc_24_1_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-22-C Config Broadcast, LC3 24_2_2", + NULL, test_bcast, &cfg_bsrc_24_2_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-23-C Config Broadcast, LC3 32_1_2", + NULL, test_bcast, &cfg_bsrc_32_1_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-24-C Config Broadcast, LC3 32_2_2", + NULL, test_bcast, &cfg_bsrc_32_2_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-25-C Config Broadcast, LC3 44.1_1_2", + NULL, test_bcast, &cfg_bsrc_44_1_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-26-C Config Broadcast, LC3 44.1_2_2", + NULL, test_bcast, &cfg_bsrc_44_2_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-27-C Config Broadcast, LC3 48_1_2", + NULL, test_bcast, &cfg_bsrc_48_1_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-28-C Config Broadcast, LC3 48_2_2", + NULL, test_bcast, &cfg_bsrc_48_2_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-29-C Config Broadcast, LC3 48_3_2", + NULL, test_bcast, &cfg_bsrc_48_3_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-30-C Config Broadcast, LC3 48_4_2", + NULL, test_bcast, &cfg_bsrc_48_4_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-31-C Config Broadcast, LC3 48_5_2", + NULL, test_bcast, &cfg_bsrc_48_5_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-32-C Config Broadcast, LC3 48_6_2", + NULL, test_bcast, &cfg_bsrc_48_6_2, IOV_NULL); + + define_test("BAP/BSRC/SCC/BV-33-C Config Broadcast, VS", + NULL, test_bcast, &cfg_bsrc_vs, IOV_NULL); +} + +static void bsrc_state_estab(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_ENABLING: + bt_bap_stream_start(stream, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_STREAMING: + tester_test_passed(); + break; + } +} + +static struct test_config cfg_bsrc_8_1_1_estab = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .src = true, + .state_func = bsrc_state_estab, + .streams = 1, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can establish a broadcast + * Audio Stream. + * + * Pass verdict: + * The IUT sends AUX_SYNC_IND PDUs with an Extended Header + * containing BIGInfo in the ACAD field. The IUT sends BIS Data + * PDUs over the broadcast Audio Stream. + */ +static void test_bsrc_scc_estab(void) +{ + define_test("BAP/BSRC/SCC/BV-35-C Establishes Broadcast", + NULL, test_bcast, &cfg_bsrc_8_1_1_estab, IOV_NULL); +} + +static void bsrc_state_disable(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + if (old_state == BT_BAP_STREAM_STATE_IDLE) + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); + else if (old_state == BT_BAP_STREAM_STATE_STREAMING) + tester_test_passed(); + else + /* Other transitions to CONFIG state are invalid. */ + tester_test_failed(); + break; + case BT_BAP_STREAM_STATE_ENABLING: + bt_bap_stream_start(stream, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_STREAMING: + bt_bap_stream_disable(stream, true, NULL, NULL); + break; + } +} + +static struct test_config cfg_bsrc_8_1_1_disable = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .src = true, + .state_func = bsrc_state_disable, + .streams = 1, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can disable a broadcast + * Audio Stream. + * + * Pass verdict: + * The IUT sends a BIG_TERMINATE_IND PDU in step 1. + */ +static void test_bsrc_scc_disable(void) +{ + define_test("BAP/BSRC/SCC/BV-36-C Disables Broadcast", + NULL, test_bcast, &cfg_bsrc_8_1_1_disable, IOV_NULL); +} + +static void bsrc_state_release(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + if (old_state == BT_BAP_STREAM_STATE_IDLE) + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); + else if (old_state == BT_BAP_STREAM_STATE_STREAMING) + bt_bap_stream_release(stream, NULL, NULL); + else + /* Other transitions to CONFIG state are invalid. */ + tester_test_failed(); + break; + case BT_BAP_STREAM_STATE_ENABLING: + bt_bap_stream_start(stream, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_STREAMING: + bt_bap_stream_disable(stream, true, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_IDLE: + tester_test_passed(); + break; + } +} + +static struct test_config cfg_bsrc_8_1_1_release = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .src = true, + .state_func = bsrc_state_release, + .streams = 1, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can release a broadcast + * Audio Stream and transition from Configured state to Idle + * state. + * + * Pass verdict: + * The IUT stops transmitting periodic advertising. + */ +static void test_bsrc_scc_release(void) +{ + define_test("BAP/BSRC/SCC/BV-37-C Releases Broadcast", + NULL, test_bcast, &cfg_bsrc_8_1_1_release, IOV_NULL); +} + +static void test_bsrc_scc(void) +{ + test_bsrc_scc_config(); + test_bsrc_scc_estab(); + test_bsrc_scc_disable(); + test_bsrc_scc_release(); +} + +static struct test_config cfg_bsnk_8_1 = { + .cc = LC3_CONFIG_8_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_8_2 = { + .cc = LC3_CONFIG_8_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_16_1 = { + .cc = LC3_CONFIG_16_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_16_2 = { + .cc = LC3_CONFIG_16_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_24_1 = { + .cc = LC3_CONFIG_24_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_24_2 = { + .cc = LC3_CONFIG_24_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_32_1 = { + .cc = LC3_CONFIG_32_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_32_2 = { + .cc = LC3_CONFIG_32_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_44_1 = { + .cc = LC3_CONFIG_44_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_44_2 = { + .cc = LC3_CONFIG_44_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_48_1 = { + .cc = LC3_CONFIG_48_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_48_2 = { + .cc = LC3_CONFIG_48_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_48_3 = { + .cc = LC3_CONFIG_48_3, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_48_4 = { + .cc = LC3_CONFIG_48_4, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_48_5 = { + .cc = LC3_CONFIG_48_5, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_48_6 = { + .cc = LC3_CONFIG_48_6, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static struct test_config cfg_bsnk_vs = { + .cc = UTIL_IOV_INIT(VS_CC), + .qos = QOS_BCAST, + .snk = true, + .vs = true, + .state_func = bsnk_state, + .streams = 1, +}; + +static void test_bsnk_scc(void) +{ + define_test("BAP/BSNK/SCC/BV-01-C Sync to PA, LC3 8_1_1", + NULL, test_bcast, &cfg_bsnk_8_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-02-C Sync to PA, LC3 8_2_1", + NULL, test_bcast, &cfg_bsnk_8_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-03-C Sync to PA, LC3 16_1_1", + NULL, test_bcast, &cfg_bsnk_16_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-04-C Sync to PA, LC3 16_2_1", + NULL, test_bcast, &cfg_bsnk_16_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-05-C Sync to PA, LC3 24_1_1", + NULL, test_bcast, &cfg_bsnk_24_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-06-C Sync to PA, LC3 24_2_1", + NULL, test_bcast, &cfg_bsnk_24_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-07-C Sync to PA, LC3 32_1_1", + NULL, test_bcast, &cfg_bsnk_32_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-08-C Sync to PA, LC3 32_2_1", + NULL, test_bcast, &cfg_bsnk_32_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-09-C Sync to PA, LC3 44.1_1_1", + NULL, test_bcast, &cfg_bsnk_44_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-10-C Sync to PA, LC3 44.1_2_1", + NULL, test_bcast, &cfg_bsnk_44_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-11-C Sync to PA, LC3 48_1_1", + NULL, test_bcast, &cfg_bsnk_48_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-12-C Sync to PA, LC3 48_2_1", + NULL, test_bcast, &cfg_bsnk_48_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-13-C Sync to PA, LC3 48_3_1", + NULL, test_bcast, &cfg_bsnk_48_3, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-14-C Sync to PA, LC3 48_4_1", + NULL, test_bcast, &cfg_bsnk_48_4, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-15-C Sync to PA, LC3 48_5_1", + NULL, test_bcast, &cfg_bsnk_48_5, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-16-C Sync to PA, LC3 48_6_1", + NULL, test_bcast, &cfg_bsnk_48_6, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-17-C Sync to PA, LC3 8_1_2", + NULL, test_bcast, &cfg_bsnk_8_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-18-C Sync to PA, LC3 8_2_2", + NULL, test_bcast, &cfg_bsnk_8_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-19-C Sync to PA, LC3 16_1_2", + NULL, test_bcast, &cfg_bsnk_16_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-20-C Sync to PA, LC3 16_2_2", + NULL, test_bcast, &cfg_bsnk_16_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-21-C Sync to PA, LC3 24_1_2", + NULL, test_bcast, &cfg_bsnk_24_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-22-C Sync to PA, LC3 24_2_2", + NULL, test_bcast, &cfg_bsnk_24_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-23-C Sync to PA, LC3 32_1_2", + NULL, test_bcast, &cfg_bsnk_32_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-24-C Sync to PA, LC3 32_2_2", + NULL, test_bcast, &cfg_bsnk_32_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-25-C Sync to PA, LC3 44.1_1_2", + NULL, test_bcast, &cfg_bsnk_44_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-26-C Sync to PA, LC3 44.1_2_2", + NULL, test_bcast, &cfg_bsnk_44_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-27-C Sync to PA, LC3 48_1_2", + NULL, test_bcast, &cfg_bsnk_48_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-28-C Sync to PA, LC3 48_2_2", + NULL, test_bcast, &cfg_bsnk_48_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-29-C Sync to PA, LC3 48_3_2", + NULL, test_bcast, &cfg_bsnk_48_3, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-30-C Sync to PA, LC3 48_4_2", + NULL, test_bcast, &cfg_bsnk_48_4, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-31-C Sync to PA, LC3 48_5_2", + NULL, test_bcast, &cfg_bsnk_48_5, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-32-C Sync to PA, LC3 48_6_2", + NULL, test_bcast, &cfg_bsnk_48_6, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-33-C Sync to PA, VS", + NULL, test_bcast, &cfg_bsnk_vs, IOV_NULL); +} + +static void stream_count_streaming(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + uint8_t *num = user_data; + + if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_STREAMING) + (*num)++; +} + +static void bsnk_state_str(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + struct test_data *data = user_data; + struct iovec *cc; + uint8_t num = 0; + + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + if (old_state == BT_BAP_STREAM_STATE_IDLE) { + /* Check that stream has been configured as expected */ + cc = bt_bap_stream_get_config(stream); + + g_assert(cc); + g_assert(cc->iov_len == data->cfg->cc.iov_len); + g_assert(memcmp(cc->iov_base, data->cfg->cc.iov_base, + cc->iov_len) == 0); + + /* Enable stream */ + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); + } else if (old_state == BT_BAP_STREAM_STATE_CONFIG) { + /* Start stream */ + bt_bap_stream_start(stream, NULL, NULL); + } else { + /* Other state transitions are invalid */ + tester_test_failed(); + } + + break; + case BT_BAP_STREAM_STATE_STREAMING: + queue_foreach(data->streams, stream_count_streaming, &num); + + if (num == data->cfg->streams) + /* Test is completed after all streams have transitioned + * to STREAMING state. + */ + tester_test_passed(); + + break; + } +} + +static struct test_config cfg_bsnk_str_8_1 = { + .cc = LC3_CONFIG_8_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_8_2 = { + .cc = LC3_CONFIG_8_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_16_1 = { + .cc = LC3_CONFIG_16_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_16_2 = { + .cc = LC3_CONFIG_16_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_24_1 = { + .cc = LC3_CONFIG_24_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_24_2 = { + .cc = LC3_CONFIG_24_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_32_1 = { + .cc = LC3_CONFIG_32_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_32_2 = { + .cc = LC3_CONFIG_32_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_44_1 = { + .cc = LC3_CONFIG_44_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_44_2 = { + .cc = LC3_CONFIG_44_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_48_1 = { + .cc = LC3_CONFIG_48_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_48_2 = { + .cc = LC3_CONFIG_48_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_48_3 = { + .cc = LC3_CONFIG_48_3, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_48_4 = { + .cc = LC3_CONFIG_48_4, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_48_5 = { + .cc = LC3_CONFIG_48_5, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_48_6 = { + .cc = LC3_CONFIG_48_6, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_vs = { + .cc = UTIL_IOV_INIT(VS_CC), + .qos = QOS_BCAST, + .snk = true, + .vs = true, + .state_func = bsnk_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsnk_str_8_1_mbis = { + .cc = LC3_CONFIG_8_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_8_2_mbis = { + .cc = LC3_CONFIG_8_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_16_1_mbis = { + .cc = LC3_CONFIG_16_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_16_2_mbis = { + .cc = LC3_CONFIG_16_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_24_1_mbis = { + .cc = LC3_CONFIG_24_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_24_2_mbis = { + .cc = LC3_CONFIG_24_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_32_1_mbis = { + .cc = LC3_CONFIG_32_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_32_2_mbis = { + .cc = LC3_CONFIG_32_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_44_1_mbis = { + .cc = LC3_CONFIG_44_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_44_2_mbis = { + .cc = LC3_CONFIG_44_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_48_1_mbis = { + .cc = LC3_CONFIG_48_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_48_2_mbis = { + .cc = LC3_CONFIG_48_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_48_3_mbis = { + .cc = LC3_CONFIG_48_3, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_48_4_mbis = { + .cc = LC3_CONFIG_48_4, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_48_5_mbis = { + .cc = LC3_CONFIG_48_5, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_48_6_mbis = { + .cc = LC3_CONFIG_48_6, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsnk_str_vs_mbis = { + .cc = UTIL_IOV_INIT(VS_CC), + .qos = QOS_BCAST, + .snk = true, + .vs = true, + .state_func = bsnk_state_str, + .streams = 2, +}; + +static void test_bsnk_str(void) +{ + define_test("BAP/BSNK/STR/BV-01-C BSNK, LC3 8_1", + NULL, test_bcast, &cfg_bsnk_str_8_1, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-02-C BSNK, LC3 8_2", + NULL, test_bcast, &cfg_bsnk_str_8_2, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-03-C BSNK, LC3 16_1", + NULL, test_bcast, &cfg_bsnk_str_16_1, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-04-C BSNK, LC3 16_2", + NULL, test_bcast, &cfg_bsnk_str_16_2, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-05-C BSNK, LC3 24_1", + NULL, test_bcast, &cfg_bsnk_str_24_1, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-06-C BSNK, LC3 24_2", + NULL, test_bcast, &cfg_bsnk_str_24_2, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-07-C BSNK, LC3 32_1", + NULL, test_bcast, &cfg_bsnk_str_32_1, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-08-C BSNK, LC3 32_2", + NULL, test_bcast, &cfg_bsnk_str_32_2, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-09-C BSNK, LC3 44.1_1", + NULL, test_bcast, &cfg_bsnk_str_44_1, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-10-C BSNK, LC3 44.1_2", + NULL, test_bcast, &cfg_bsnk_str_44_2, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-11-C BSNK, LC3 48_1", + NULL, test_bcast, &cfg_bsnk_str_48_1, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-12-C BSNK, LC3 48_2", + NULL, test_bcast, &cfg_bsnk_str_48_2, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-13-C BSNK, LC3 48_3", + NULL, test_bcast, &cfg_bsnk_str_48_3, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-14-C BSNK, LC3 48_4", + NULL, test_bcast, &cfg_bsnk_str_48_4, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-15-C BSNK, LC3 48_5", + NULL, test_bcast, &cfg_bsnk_str_48_5, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-16-C BSNK, LC3 48_6", + NULL, test_bcast, &cfg_bsnk_str_48_6, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-17-C BSNK, VS", + NULL, test_bcast, &cfg_bsnk_str_vs, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-18-C BSNK, Multiple BISes, LC3 8_1", + NULL, test_bcast, &cfg_bsnk_str_8_1_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-19-C BSNK, Multiple BISes, LC3 8_2", + NULL, test_bcast, &cfg_bsnk_str_8_2_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-20-C BSNK, Multiple BISes, LC3 16_1", + NULL, test_bcast, &cfg_bsnk_str_16_1_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-21-C BSNK, Multiple BISes, LC3 16_2", + NULL, test_bcast, &cfg_bsnk_str_16_2_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-22-C BSNK, Multiple BISes, LC3 24_1", + NULL, test_bcast, &cfg_bsnk_str_24_1_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-23-C BSNK, Multiple BISes, LC3 24_2", + NULL, test_bcast, &cfg_bsnk_str_24_2_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-24-C BSNK, Multiple BISes, LC3 32_1", + NULL, test_bcast, &cfg_bsnk_str_32_1_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-25-C BSNK, Multiple BISes, LC3 32_2", + NULL, test_bcast, &cfg_bsnk_str_32_2_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-26-C BSNK, Multiple BISes, LC3 44.1_1", + NULL, test_bcast, &cfg_bsnk_str_44_1_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-27-C BSNK, Multiple BISes, LC3 44.1_2", + NULL, test_bcast, &cfg_bsnk_str_44_2_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-28-C BSNK, Multiple BISes, LC3 48_1", + NULL, test_bcast, &cfg_bsnk_str_48_1_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-29-C BSNK, Multiple BISes, LC3 48_2", + NULL, test_bcast, &cfg_bsnk_str_48_2_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-30-C BSNK, Multiple BISes, LC3 48_3", + NULL, test_bcast, &cfg_bsnk_str_48_3_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-31-C BSNK, Multiple BISes, LC3 48_4", + NULL, test_bcast, &cfg_bsnk_str_48_4_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-32-C BSNK, Multiple BISes, LC3 48_5", + NULL, test_bcast, &cfg_bsnk_str_48_5_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-33-C BSNK, Multiple BISes, LC3 48_6", + NULL, test_bcast, &cfg_bsnk_str_48_6_mbis, IOV_NULL); + + define_test("BAP/BSNK/STR/BV-34-C BSNK, Multiple BISes, VS", + NULL, test_bcast, &cfg_bsnk_str_vs_mbis, IOV_NULL); +} + +static void stream_count_config(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + uint8_t *streams = user_data; + + if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_CONFIG) + (*streams)++; +} + +static void stream_count_enabling(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + uint8_t *streams = user_data; + + if (bt_bap_stream_get_state(stream) == BT_BAP_STREAM_STATE_ENABLING) + (*streams)++; +} + +static void stream_enable(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); +} + +static void stream_start(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + + bt_bap_stream_start(stream, NULL, NULL); +} + +static void bsrc_state_str(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + struct test_data *data = user_data; + uint8_t streams = 0; + + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + queue_foreach(data->streams, stream_count_config, &streams); + + if (streams == data->cfg->streams) + /* After all streams have transitioned to CONFIG + * state, enable each one. + */ + queue_foreach(data->streams, stream_enable, NULL); + break; + case BT_BAP_STREAM_STATE_ENABLING: + queue_foreach(data->streams, stream_count_enabling, &streams); + + if (streams == 1) { + /* After the first stream has transitioned to ENABLING + * state, bt_bap_stream_get_base will generate the + * BASE from all previously configured streams. + */ + data->base = bt_bap_stream_get_base(stream); + + g_assert(data->base); + g_assert(data->base->iov_len == + data->cfg->base.iov_len); + g_assert(memcmp(data->base->iov_base, + data->cfg->base.iov_base, + data->base->iov_len) == 0); + } + + if (streams == data->cfg->streams) + /* After all streams have transitioned to ENABLING + * state, start each one. + */ + queue_foreach(data->streams, stream_start, NULL); + break; + case BT_BAP_STREAM_STATE_STREAMING: + queue_foreach(data->streams, stream_count_streaming, &streams); + + if (streams == data->cfg->streams) + /* Test is completed after all streams have transitioned + * to STREAMING state. + */ + tester_test_passed(); + break; + } +} + +static struct test_config cfg_bsrc_str_8_1 = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_1), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_8_2 = { + .cc = LC3_CONFIG_8_2, + .qos = LC3_QOS_8_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_2), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_16_1 = { + .cc = LC3_CONFIG_16_1, + .qos = LC3_QOS_16_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_1), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_16_2 = { + .cc = LC3_CONFIG_16_2, + .qos = LC3_QOS_16_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_2), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_24_1 = { + .cc = LC3_CONFIG_24_1, + .qos = LC3_QOS_24_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_1), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_24_2 = { + .cc = LC3_CONFIG_24_2, + .qos = LC3_QOS_24_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_2), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_32_1 = { + .cc = LC3_CONFIG_32_1, + .qos = LC3_QOS_32_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_1), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_32_2 = { + .cc = LC3_CONFIG_32_2, + .qos = LC3_QOS_32_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_2), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_44_1 = { + .cc = LC3_CONFIG_44_1, + .qos = LC3_QOS_44_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_1), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_44_2 = { + .cc = LC3_CONFIG_44_2, + .qos = LC3_QOS_44_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_2), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_48_1 = { + .cc = LC3_CONFIG_48_1, + .qos = LC3_QOS_48_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_1), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_48_2 = { + .cc = LC3_CONFIG_48_2, + .qos = LC3_QOS_48_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_2), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_48_3 = { + .cc = LC3_CONFIG_48_3, + .qos = LC3_QOS_48_3_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_3), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_48_4 = { + .cc = LC3_CONFIG_48_4, + .qos = LC3_QOS_48_4_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_4), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_48_5 = { + .cc = LC3_CONFIG_48_5, + .qos = LC3_QOS_48_5_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_5), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_48_6 = { + .cc = LC3_CONFIG_48_6, + .qos = LC3_QOS_48_6_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_6), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, +}; + +static struct test_config cfg_bsrc_str_vs = { + .cc = UTIL_IOV_INIT(VS_CC), + .qos = QOS_BCAST, + .base = UTIL_IOV_INIT(BASE_VS(VS_CFG)), + .src = true, + .state_func = bsrc_state_str, + .streams = 1, + .vs = true, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can stream one BIS to a + * Broadcast Sink. The verification is performed for each Config + * Settings in turn. + * + * Pass verdict: + * If the Codec ID is LC3, the IUT sends encoded LC3 audio data + * in BIS Data PDUs on the broadcast Audio Stream. The audio data + * is formatted using the LC3 Media Packet format. + * + * If the Codec ID is a vendor-specific Codec ID, the IUT sends BIS + * Data PDUs on the broadcast Audio Stream. The parameters included + * in the Codec_Specific_Configuration data are as defined in + * TSPX_VS_Codec_Specific_Configuration. + * + * If the Codec ID is LC3, each parameter included in + * Codec_Specific_Configuration data is formatted in an LTV structure + * with the length, type, and value specified in Table 4.79. + */ + +static void test_bsrc_str_1b(void) +{ + define_test("BAP/BSRC/STR/BV-01-C BSRC, LC3 8_1", + NULL, test_bcast, &cfg_bsrc_str_8_1, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-02-C BSRC, LC3 8_2", + NULL, test_bcast, &cfg_bsrc_str_8_2, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-03-C BSRC, LC3 16_1", + NULL, test_bcast, &cfg_bsrc_str_16_1, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-04-C BSRC, LC3 16_2", + NULL, test_bcast, &cfg_bsrc_str_16_2, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-05-C BSRC, LC3 24_1", + NULL, test_bcast, &cfg_bsrc_str_24_1, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-06-C BSRC, LC3 24_2", + NULL, test_bcast, &cfg_bsrc_str_24_2, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-07-C BSRC, LC3 32_1", + NULL, test_bcast, &cfg_bsrc_str_32_1, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-08-C BSRC, LC3 32_2", + NULL, test_bcast, &cfg_bsrc_str_32_2, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-09-C BSRC, LC3 44.1_1", + NULL, test_bcast, &cfg_bsrc_str_44_1, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-10-C BSRC, LC3 44.1_2", + NULL, test_bcast, &cfg_bsrc_str_44_2, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-11-C BSRC, LC3 48_1", + NULL, test_bcast, &cfg_bsrc_str_48_1, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-12-C BSRC, LC3 48_2", + NULL, test_bcast, &cfg_bsrc_str_48_2, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-13-C BSRC, LC3 48_3", + NULL, test_bcast, &cfg_bsrc_str_48_3, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-14-C BSRC, LC3 48_4", + NULL, test_bcast, &cfg_bsrc_str_48_4, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-15-C BSRC, LC3 48_5", + NULL, test_bcast, &cfg_bsrc_str_48_5, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-16-C BSRC, LC3 48_6", + NULL, test_bcast, &cfg_bsrc_str_48_6, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-17-C BSRC, VS", + NULL, test_bcast, &cfg_bsrc_str_vs, IOV_NULL); +} + +static struct test_config cfg_bsrc_str_8_1_mbis = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_8_2_mbis = { + .cc = LC3_CONFIG_8_2, + .qos = LC3_QOS_8_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_8_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_16_1_mbis = { + .cc = LC3_CONFIG_16_1, + .qos = LC3_QOS_16_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_16_2_mbis = { + .cc = LC3_CONFIG_16_2, + .qos = LC3_QOS_16_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_16_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_24_1_mbis = { + .cc = LC3_CONFIG_24_1, + .qos = LC3_QOS_24_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_24_2_mbis = { + .cc = LC3_CONFIG_24_2, + .qos = LC3_QOS_24_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_24_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_32_1_mbis = { + .cc = LC3_CONFIG_32_1, + .qos = LC3_QOS_32_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_32_2_mbis = { + .cc = LC3_CONFIG_32_2, + .qos = LC3_QOS_32_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_32_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_44_1_mbis = { + .cc = LC3_CONFIG_44_1, + .qos = LC3_QOS_44_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_44_2_mbis = { + .cc = LC3_CONFIG_44_2, + .qos = LC3_QOS_44_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_44_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_48_1_mbis = { + .cc = LC3_CONFIG_48_1, + .qos = LC3_QOS_48_1_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_1_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_48_2_mbis = { + .cc = LC3_CONFIG_48_2, + .qos = LC3_QOS_48_2_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_2_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_48_3_mbis = { + .cc = LC3_CONFIG_48_3, + .qos = LC3_QOS_48_3_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_3_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_48_4_mbis = { + .cc = LC3_CONFIG_48_4, + .qos = LC3_QOS_48_4_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_4_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_48_5_mbis = { + .cc = LC3_CONFIG_48_5, + .qos = LC3_QOS_48_5_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_5_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_48_6_mbis = { + .cc = LC3_CONFIG_48_6, + .qos = LC3_QOS_48_6_1_B, + .base = UTIL_IOV_INIT(BASE_LC3_48_6_MBIS), + .src = true, + .state_func = bsrc_state_str, + .streams = 2, +}; + +static struct test_config cfg_bsrc_str_vs_mbis = { + .cc = UTIL_IOV_INIT(VS_CC), + .qos = QOS_BCAST, + .base = UTIL_IOV_INIT(BASE_VS_MBIS(VS_CFG)), + .src = true, + .state_func = bsrc_state_str, + .vs = true, + .streams = 2, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can stream multiple BISes to + * a Broadcast Sink. The verification is performed for each set of + * parameters in turn, as specified in Table 4.82. + * + * Pass verdict: + * If the Codec ID is LC3, the IUT sends encoded LC3 audio data in + * BIS Data PDUs on each synchronized BIS. + * + * If the Codec ID is a vendor-specific Codec ID, the IUT sends BIS + * Data PDUs on each synchronized BIS. The parameters included in the + * Codec_Specific_Configuration data are as defined in + * TSPX_VS_Codec_Specific_Configuration. + * + * If the Codec ID is LC3, each parameter included in + * Codec_Specific_Configuration data is formatted in an LTV structure + * with the length, type, and value specified in Table 4.83. + */ +static void test_bsrc_str_2b(void) +{ + define_test("BAP/BSRC/STR/BV-18-C BSRC, Multiple BISes, LC3 8_1", + NULL, test_bcast, &cfg_bsrc_str_8_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-19-C BSRC, Multiple BISes, LC3 8_2", + NULL, test_bcast, &cfg_bsrc_str_8_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-20-C BSRC, Multiple BISes, LC3 16_1", + NULL, test_bcast, &cfg_bsrc_str_16_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-21-C BSRC, Multiple BISes, LC3 16_2", + NULL, test_bcast, &cfg_bsrc_str_16_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-22-C BSRC, Multiple BISes, LC3 24_1", + NULL, test_bcast, &cfg_bsrc_str_24_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-23-C BSRC, Multiple BISes, LC3 24_2", + NULL, test_bcast, &cfg_bsrc_str_24_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-24-C BSRC, Multiple BISes, LC3 32_1", + NULL, test_bcast, &cfg_bsrc_str_32_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-25-C BSRC, Multiple BISes, LC3 32_2", + NULL, test_bcast, &cfg_bsrc_str_32_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-26-C BSRC, Multiple BISes, LC3 44.1_1", + NULL, test_bcast, &cfg_bsrc_str_44_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-27-C BSRC, Multiple BISes, LC3 44.1_2", + NULL, test_bcast, &cfg_bsrc_str_44_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-28-C BSRC, Multiple BISes, LC3 48_1", + NULL, test_bcast, &cfg_bsrc_str_48_1_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-29-C BSRC, Multiple BISes, LC3 48_2", + NULL, test_bcast, &cfg_bsrc_str_48_2_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-30-C BSRC, Multiple BISes, LC3 48_3", + NULL, test_bcast, &cfg_bsrc_str_48_3_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-31-C BSRC, Multiple BISes, LC3 48_4", + NULL, test_bcast, &cfg_bsrc_str_48_4_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-32-C BSRC, Multiple BISes, LC3 48_5", + NULL, test_bcast, &cfg_bsrc_str_48_5_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-33-C BSRC, Multiple BISes, LC3 48_6", + NULL, test_bcast, &cfg_bsrc_str_48_6_mbis, IOV_NULL); + + define_test("BAP/BSRC/STR/BV-34-C BSRC, Multiple BISes, VS", + NULL, test_bcast, &cfg_bsrc_str_vs_mbis, IOV_NULL); +} + +static void test_bsrc_str(void) +{ + test_bsrc_str_1b(); + test_bsrc_str_2b(); } int main(int argc, char *argv) @@ -2843,6 +7375,10 @@ test_disc(); test_scc(); + test_bsrc_scc(); + test_bsnk_scc(); + test_bsnk_str(); + test_bsrc_str(); return tester_run(); }
View file
_service:tar_scm:bluez-5.71.tar.xz/unit/test-gatt.c -> _service:tar_scm:bluez-5.77.tar.xz/unit/test-gatt.c
Changed
@@ -1237,6 +1237,7 @@ if (handle) attrib = gatt_db_service_insert_characteristic(service_att, + handle - 1, handle, uuid, att_permissions, char_properties, @@ -1908,6 +1909,60 @@ return make_db(specs); } +/* + * Tiny database which fits into a single minimum sized-pdu with services + * added in the following order to check ability to create hash db: + * - one secondary service at handle 0x0003, + * - one primary service at the max handle, + * - one primary service at handle 0x0001. + */ + +static struct gatt_db *make_test_tail_db(void) +{ + const struct att_handle_spec specs = { + SECONDARY_SERVICE(0x0003, DEVICE_INFORMATION_UUID, 16), + CHARACTERISTIC_STR(GATT_CHARAC_MANUFACTURER_NAME_STRING, + BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_NOTIFY | + BT_GATT_CHRC_PROP_INDICATE | + BT_GATT_CHRC_PROP_EXT_PROP, + "BlueZ"), + DESCRIPTOR(GATT_CLIENT_CHARAC_CFG_UUID, BT_ATT_PERM_READ | + BT_ATT_PERM_WRITE, 0x00, 0x00), + DESCRIPTOR_STR(GATT_CHARAC_USER_DESC_UUID, BT_ATT_PERM_READ, + "Manufacturer Name"), + DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x01, + 0x00), + CHARACTERISTIC_STR(GATT_CHARAC_SOFTWARE_REVISION_STRING, + BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_INDICATE, + "5.59"), + DESCRIPTOR(GATT_CLIENT_CHARAC_CFG_UUID, BT_ATT_PERM_READ + | BT_ATT_PERM_WRITE, 0x00, 0x00), + + PRIMARY_SERVICE(0xFFFF - 9 + 1, GAP_UUID, 9), + INCLUDE(0x0003), + CHARACTERISTIC_STR(GATT_CHARAC_DEVICE_NAME, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ, + "BlueZ Unit Tester"), + CHARACTERISTIC(0000B009-0000-0000-0123-456789abcdef, + BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, + BT_GATT_CHRC_PROP_READ | + BT_GATT_CHRC_PROP_EXT_PROP, 0x09), + DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x01, + 0x00), + CHARACTERISTIC(GATT_CHARAC_APPEARANCE, BT_ATT_PERM_READ, + BT_GATT_CHRC_PROP_READ, 0x00, 0x00), + PRIMARY_SERVICE(0x0001, DEVICE_INFORMATION_UUID, 1), + { } + }; + + return make_db(specs); +} + static void test_client(gconstpointer data) { create_context(512, data); @@ -2345,10 +2400,22 @@ .length = 0x03, }; +static void test_hash_db(gconstpointer data) +{ + struct context *context = create_context(512, data); + + /* test that gatt_db_get_hash is able to manage services at tail end of + * a db. + */ + gatt_db_get_hash(context->server_db); + + context_quit(context); +} + int main(int argc, char *argv) { struct gatt_db *service_db_1, *service_db_2, *service_db_3; - struct gatt_db *ts_small_db, *ts_large_db_1; + struct gatt_db *ts_small_db, *ts_large_db_1, *ts_tail_db; tester_init(&argc, &argv); @@ -2357,6 +2424,7 @@ service_db_3 = make_service_data_3_db(); ts_small_db = make_test_spec_small_db(); ts_large_db_1 = make_test_spec_large_db_1(); + ts_tail_db = make_test_tail_db(); /* * Server Configuration @@ -4487,5 +4555,9 @@ raw_pdu(0xff, 0x00), raw_pdu()); + define_test_server("/robustness/hash-db", + test_hash_db, ts_tail_db, NULL, + {}); + return tester_run(); }
View file
_service:tar_scm:bluez-5.71.tar.xz/unit/test-hog.c -> _service:tar_scm:bluez-5.77.tar.xz/unit/test-hog.c
Changed
@@ -182,7 +182,7 @@ fd = open("/dev/null", O_WRONLY | O_CLOEXEC); g_assert(fd > 0); - context->hog = bt_hog_new(fd, name, vendor, product, version, NULL); + context->hog = bt_hog_new(fd, name, vendor, product, version, 0, NULL); g_assert(context->hog); channel = g_io_channel_unix_new(sv1);
View file
_service:tar_scm:bluez-5.71.tar.xz/unit/test-uhid.c -> _service:tar_scm:bluez-5.77.tar.xz/unit/test-uhid.c
Changed
@@ -117,8 +117,8 @@ len = write(context->fd, pdu->data, pdu->size); - - util_hexdump('<', pdu->data, len, test_debug, "uHID: "); + if (tester_use_debug()) + util_hexdump('<', pdu->data, len, test_debug, "uHID: "); g_assert_cmpint(len, ==, pdu->size); @@ -159,7 +159,8 @@ g_assert(len > 0); - util_hexdump('>', buf, len, test_debug, "uHID: "); + if (tester_use_debug()) + util_hexdump('>', buf, len, test_debug, "uHID: "); g_assert_cmpint(len, ==, pdu->size); @@ -228,19 +229,31 @@ static void test_client(gconstpointer data) { struct context *context = create_context(data); + int err; - if (g_str_equal(context->data->test_name, "/uhid/command/create")) - bt_uhid_send(context->uhid, &ev_create); + err = bt_uhid_create(context->uhid, "", NULL, NULL, 0, 0, 0, 0, + BT_UHID_NONE, NULL, 0); + if (err < 0) + tester_test_failed(); - if (g_str_equal(context->data->test_name, "/uhid/command/destroy")) - bt_uhid_send(context->uhid, &ev_destroy); + if (g_str_equal(context->data->test_name, "/uhid/command/destroy")) { + err = bt_uhid_destroy(context->uhid, true); + if (err < 0) + tester_test_failed(); + } if (g_str_equal(context->data->test_name, - "/uhid/command/feature_answer")) - bt_uhid_send(context->uhid, &ev_feature_answer); + "/uhid/command/feature_answer")) { + err = bt_uhid_send(context->uhid, &ev_feature_answer); + if (err < 0) + tester_test_failed(); + } - if (g_str_equal(context->data->test_name, "/uhid/command/input")) - bt_uhid_send(context->uhid, &ev_input); + if (g_str_equal(context->data->test_name, "/uhid/command/input")) { + err = bt_uhid_input(context->uhid, 0, NULL, 0); + if (err < 0) + tester_test_failed(); + } context_quit(context); }
View file
_service:tar_scm:bluez-5.71.tar.xz/unit/test-vcp.c -> _service:tar_scm:bluez-5.77.tar.xz/unit/test-vcp.c
Changed
@@ -206,7 +206,7 @@ * ATT: Exchange MTU Response (0x03) len 2 * Server RX MTU: 64 */ -#define VOCS_EXCHANGE_MTU \ +#define VCS_EXCHANGE_MTU \ IOV_DATA(0x02, 0x40, 0x00), \ IOV_DATA(0x03, 0x40, 0x00) @@ -217,23 +217,23 @@ * ATT: Read By Group Type Response (0x11) len 7 * Attribute data length: 6 * Attribute group list: 1 entry - * Handle range: 0x000d-0x0016 + * Handle range: 0x001d-0x0027 * UUID: Volume Control (0x1844) * * ATT: Read By Group Type Request (0x10) len 6 - * Handle range: 0x0017-0xffff + * Handle range: 0x0027-0xffff * Attribute group type: Primary Service (0x2800) * * ATT: Error Response (0x01) len 4 * Read By Group Type Request (0x10) - * Handle: 0x0017 + * Handle: 0x0027 * Error: Attribute Not Found (0x0a) */ -#define VOCS_PRIMARY_SERVICE_VCS \ +#define VOCS_AICS_PRIMARY_SERVICE_VCS \ IOV_DATA(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \ - IOV_DATA(0x11, 0x06, 0x0d, 0x00, 0x16, 0x00, 0x44, 0x18), \ - IOV_DATA(0x10, 0x17, 0x00, 0xff, 0xff, 0x00, 0x28), \ - IOV_DATA(0x01, 0x10, 0x17, 0x00, 0x0a) + IOV_DATA(0x11, 0x06, 0x1d, 0x00, 0x27, 0x00, 0x44, 0x18), \ + IOV_DATA(0x10, 0x27, 0x00, 0xff, 0xff, 0x00, 0x28), \ + IOV_DATA(0x01, 0x10, 0x27, 0x00, 0x0a) /* ATT: Read By Group Type Request (0x10) len 6 * Handle range: 0x0001-0xffff @@ -241,24 +241,28 @@ * * ATT: Read By Group Type Response (0x11) len 7 * Attribute data length: 6 - * Attribute group list: 1 entry + * Attribute group list: 2 entry * Handle range: 0x0001-0x000c * UUID: Volume Offset Control (0x1845) + * Handle range: 0x000d-0x001c + * UUID: Audio Input Control (0x1843) * * ATT: Read By Group Type Request (0x10) len 6 - * Handle range: 0x000d-0xffff + * Handle range: 0x001d-0xffff * Attribute group type: Secondary Service (0x2801) * * ATT: Error Response (0x01) len 4 * Read By Group Type Request (0x10) - * Handle: 0x000d + * Handle: 0x001d * Error: Attribute Not Found (0x0a) */ -#define VOCS_SECONDARY_SERVICE_VOCS \ +#define VOCS_AICS_SECONDARY_SERVICE \ IOV_DATA(0x10, 0x01, 0x00, 0xff, 0xff, 0x01, 0x28), \ - IOV_DATA(0x11, 0x06, 0x01, 0x00, 0x0c, 0x00, 0x45, 0x18), \ - IOV_DATA(0x10, 0x0d, 0x00, 0xff, 0xff, 0x01, 0x28), \ - IOV_DATA(0x01, 0x10, 0x0d, 0x00, 0x0a) + IOV_DATA(0x11, 0x06, \ + 0x01, 0x00, 0x0c, 0x00, 0x45, 0x18, \ + 0x0d, 0x00, 0x1c, 0x00, 0x43, 0x18), \ + IOV_DATA(0x10, 0x1d, 0x00, 0xff, 0xff, 0x01, 0x28), \ + IOV_DATA(0x01, 0x10, 0x1d, 0x00, 0x0a) /* ATT: Read By Type Request (0x08) len 6 * Handle range: 0x0001-0xffff @@ -266,25 +270,28 @@ * * ATT: Read By Type Response (0x09) len 9 * Attribute data length: 8 - * Attribute data list: 1 entry - * Handle: 0x000e + * Attribute data list: 2 entries + * Handle: 0x001e * Value: 01000c004518 + * Handle: 0x001f + * Value: 0d001c004318 * * ATT: Read By Type Request (0x08) len 6 - * Handle range: 0x000f-0xffff + * Handle range: 0x0020-0xffff * Attribute type: Include (0x2802) * * ATT: Error Response (0x01) len 4 * Read By Type Request (0x08) - * Handle: 0x000f + * Handle: 0x0020 * Error: Attribute Not Found (0x0a) */ -#define VOCS_INCLUDED_SERVICE_VOCS \ +#define VOCS_AICS_INCLUDED_SERVICE \ IOV_DATA(0x08, 0x01, 0x00, 0xff, 0xff, 0x02, 0x28), \ IOV_DATA(0x09, 0x08, \ - 0x0e, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x45, 0x18), \ - IOV_DATA(0x08, 0x0f, 0x00, 0xff, 0xff, 0x02, 0x28), \ - IOV_DATA(0x01, 0x08, 0x0f, 0x00, 0x0a) + 0x1e, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x45, 0x18, \ + 0x1f, 0x00, 0x0d, 0x00, 0x1c, 0x00, 0x43, 0x18), \ + IOV_DATA(0x08, 0x20, 0x00, 0xff, 0xff, 0x02, 0x28), \ + IOV_DATA(0x01, 0x08, 0x20, 0x00, 0x0a) /* ATT: Read By Type Request (0x08) len 6 * Handle range: 0x0001-0x000c @@ -321,6 +328,48 @@ IOV_DATA(0x08, 0x0b, 0x00, 0x0c, 0x00, 0x03, 0x28), \ IOV_DATA(0x01, 0x08, 0x0b, 0x00, 0x0a) + /* + * ATT: Read By Type Request (0x08) len 6 + * Handle range: 0x000d-0x001c + * Attribute type: Characteristic (0x2803) + * + * ATT: Read By Type Response (0x09) len 43 + * Attribute data length: 7 + * Attribute data list: 6 entries + * Handle: 0x000e + * Value: 120f00772b + * Handle: 0x0011 + * Value: 021200782b + * Handle: 0x0013 + * Value: 021400792b + * Handle: 0x0015 + * Value: 1216007a2b + * Handle: 0x0018 + * Value: 0819007b2b + * Handle: 0x001a + * Value: 161b007c2b + * + * ATT: Read By Type Request (0x08) len 6 + * Handle range: 0x001b-0x001c + * Attribute type: Characteristic (0x2803) + * + * ATT: Error Response (0x01) len 4 + * Read By Type Request (0x08) + * Handle: 0x001b + * Error: Attribute Not Found (0x0a) + */ + #define AICS_DISC_CHAR \ + IOV_DATA(0x08, 0x0d, 0x00, 0x1c, 0x00, 0x03, 0x28), \ + IOV_DATA(0x09, 0x07, \ + 0x0e, 0x00, 0x12, 0x0f, 0x00, 0x77, 0x2b, \ + 0x11, 0x00, 0x02, 0x12, 0x00, 0x78, 0x2b, \ + 0x13, 0x00, 0x02, 0x14, 0x00, 0x79, 0x2b, \ + 0x15, 0x00, 0x12, 0x16, 0x00, 0x7a, 0x2b, \ + 0x18, 0x00, 0x08, 0x19, 0x00, 0x7b, 0x2b, \ + 0x1a, 0x00, 0x16, 0x1b, 0x00, 0x7c, 0x2b), \ + IOV_DATA(0x08, 0x1b, 0x00, 0x1c, 0x00, 0x03, 0x28), \ + IOV_DATA(0x01, 0x08, 0x1b, 0x00, 0x0a) + /* ATT: Find Information Request (0x04) len 4 * Handle range: 0x0004-0x0004 * @@ -353,6 +402,39 @@ IOV_DATA(0x04, 0x0c, 0x00, 0x0c, 0x00), \ IOV_DATA(0x05, 0x01, 0x0c, 0x00, 0x02, 0x29) + /* + * ATT: Find Information Request (0x04) len 4 + * Handle range: 0x0010-0x0010 + * + * ATT: Find Information Response (0x05) len 5 + * Format: UUID-16 (0x01) + * Handle: 0x0010 + * UUID: Client Characteristic Configuration (0x2902) + * + * ATT: Find Information Request (0x04) len 4 + * Handle range: 0x0017-0x0017 + * + * ATT: Find Information Response (0x05) len 5 + * Format: UUID-16 (0x01) + * Handle: 0x0017 + * UUID: Client Characteristic Configuration (0x2902) + * + * ATT: Find Information Request (0x04) len 4 + * Handle range: 0x001c-0x001c + * + * ATT: Find Information Response (0x05) len 5 + * Format: UUID-16 (0x01) + * Handle: 0x001c + * UUID: Client Characteristic Configuration (0x2902) + */ + #define AICS_DISC_CHAR_DESC \ + IOV_DATA(0x04, 0x10, 0x00, 0x10, 0x00), \ + IOV_DATA(0x05, 0x01, 0x10, 0x00, 0x02, 0x29), \ + IOV_DATA(0x04, 0x17, 0x00, 0x17, 0x00), \ + IOV_DATA(0x05, 0x01, 0x17, 0x00, 0x02, 0x29), \ + IOV_DATA(0x04, 0x1c, 0x00, 0x1c, 0x00), \ + IOV_DATA(0x05, 0x01, 0x1c, 0x00, 0x02, 0x29) + /* ATT: Read Request (0x0a) len 2 * Handle: 0x0004 * @@ -377,6 +459,1119 @@ IOV_DATA(0x0a, 0x0c, 0x00), \ IOV_DATA(0x0b, 0x00, 0x00) + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x0010 + * ATT: Read Response (0x0b) len 2 + * + * ATT: Read Request (0x0a) len 2 + * Handle: 0x0017 + * ATT: Read Response (0x0b) len 2 + * + * ATT: Read Request (0x0a) len 2 + * Handle: 0x001c + * ATT: Read Response (0x0b) len 2 + */ +#define AICS_READ_CHAR_DESC \ + IOV_DATA(0x0a, 0x10, 0x00), \ + IOV_DATA(0x0b, 0x00, 0x00), \ + IOV_DATA(0x0a, 0x17, 0x00), \ + IOV_DATA(0x0b, 0x00, 0x00), \ + IOV_DATA(0x0a, 0x1c, 0x00), \ + IOV_DATA(0x0b, 0x00, 0x00) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x0012 + * + * ATT: Read Response (0x0b) len 3 + */ +#define AICS_READ_CHAR_GAIN_SETTNG_PROP \ + IOV_DATA(0x0a, 0x12, 0x00), \ + IOV_DATA(0x0b, 0x01, 0x80, 0x7f) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x000f + * + * ATT: Read Response (0x0b) len 4 + */ +#define AICS_READ_CHAR_AUD_IP_STATE \ + IOV_DATA(0x0a, 0x0f, 0x00), \ + IOV_DATA(0x0b, 0x58, 0x00, 0x02, 00) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x000f + * + * ATT: Read Response (0x0b) len 4 + */ +#define AICS_READ_CHAR_AUD_IP_STATE_MUT_DIS \ + IOV_DATA(0x0a, 0x0f, 0x00), \ + IOV_DATA(0x0b, 0x58, 0x02, 0x02, 00) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x000f + * + * ATT: Read Response (0x0b) len 4 + */ +#define AICS_READ_CHAR_AUD_IP_STATE_MUTED \ + IOV_DATA(0x0a, 0x0f, 0x00), \ + IOV_DATA(0x0b, 0x58, 0x01, 0x02, 00) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x000f + * + * ATT: Read Response (0x0b) len 4 + */ +#define AICS_READ_CHAR_AUD_IP_STATE_UNMUTED \ + IOV_DATA(0x0a, 0x0f, 0x00), \ + IOV_DATA(0x0b, 0x58, 0x00, 0x02, 00) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x000f + * + * ATT: Read Response (0x0b) len 4 + */ +#define AICS_READ_CHAR_AUD_IP_STATE_AUTOMATIC \ + IOV_DATA(0x0a, 0x0f, 0x00), \ + IOV_DATA(0x0b, 0x58, 0x00, 0x03, 00) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x000f + * + * ATT: Read Response (0x0b) len 4 + */ +#define AICS_READ_CHAR_AUD_IP_STATE_MANUAL \ + IOV_DATA(0x0a, 0x0f, 0x00), \ + IOV_DATA(0x0b, 0x58, 0x00, 0x02, 00) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x0012 + * + * ATT: Read Response (0x0b) len 3 + */ +#define AICS_READ_CHAR_GAIN_SETTING_PROP \ + IOV_DATA(0x0a, 0x12, 0x00), \ + IOV_DATA(0x0b, 0x01, 0x80, 0x7f) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x0014 + * + * ATT: Read Response (0x0b) len 1 + */ +#define AICS_READ_CHAR_AUD_IP_TYPE \ + IOV_DATA(0x0a, 0x14, 0x00), \ + IOV_DATA(0x0b, 0x01) + + /* + * ATT: Read Request (0x0a) len 2 + * Handle: 0x0014 + * + * ATT: Read Response (0x0b) len 1 + */ +#define AICS_READ_CHAR_AUD_IP_STATUS \ + IOV_DATA(0x0a, 0x16, 0x00), \ + IOV_DATA(0x0b, 0x01) + + /* + * ATT: Write Request (0x12) len 5 + * Handle: 0x0019 + * Data: 016401 + * + * ATT: Error Response (0x01) len 4 + * Write Request (0x12) + * Handle: 0x0019 + * Error: Reserved (0x80) + * + * ATT: Write Request (0x12) len 4 + * Handle: 0x0019 + * Data: 0265/0366/0467/0568 + * + * ATT: Error Response (0x01) len 4 + * Write Request (0x12) + * Handle: 0x0019 + * Error: Reserved (0x80) + */ +#define AICS_CP_WR_INVLD_CHG_COUNTER \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x64, 0x01), \ + IOV_DATA(0x01, 0x12, 0x19, 0x00, 0x80), \ + IOV_DATA(0x12, 0x19, 0x00, 0x02, 0x65), \ + IOV_DATA(0x01, 0x12, 0x19, 0x00, 0x80), \ + IOV_DATA(0x12, 0x19, 0x00, 0x03, 0x66), \ + IOV_DATA(0x01, 0x12, 0x19, 0x00, 0x80), \ + IOV_DATA(0x12, 0x19, 0x00, 0x04, 0x67), \ + IOV_DATA(0x01, 0x12, 0x19, 0x00, 0x80), \ + IOV_DATA(0x12, 0x19, 0x00, 0x05, 0x68), \ + IOV_DATA(0x01, 0x12, 0x19, 0x00, 0x80) + + /* + * ATT: Write Request (0x12) len 4 + * Handle: 0x0019 + * Data: 0600/ff00 + * + * ATT: Error Response (0x01) len 4 + * Write Request (0x12) + * Handle: 0x0019 + * Error: Reserved (0x81) + */ +#define AICS_CP_WR_INVLD_OP_CODE \ + IOV_DATA(0x12, 0x19, 0x00, 0x06, 0x00), \ + IOV_DATA(0x01, 0x12, 0x19, 0x00, 0x81), \ + IOV_DATA(0x12, 0x19, 0x00, 0xff, 0x00), \ + IOV_DATA(0x01, 0x12, 0x19, 0x00, 0x81) + + /* + * ATT: Write Request (0x12) len 4 + * Handle: 0x0019 + * Data: 0200 + * + * ATT: Error Response (0x01) len 4 + * Write Request (0x12) + * Handle: 0x0019 + * Error: Reserved (0x82) + */ +#define AICS_CP_WR_UNMUTE \ + IOV_DATA(0x12, 0x19, 0x00, 0x02, 0x00), \ + IOV_DATA(0x01, 0x12, 0x19, 0x00, 0x82) + + /* + * ATT: Write Request (0x12) len 4 + * Handle: 0x0019 + * Data: 0300 + * + * ATT: Error Response (0x01) len 4 + * Write Request (0x12) + * Handle: 0x0019 + * Error: Reserved (0x82) + */ +#define AICS_CP_WR_MUTE \ + IOV_DATA(0x12, 0x19, 0x00, 0x03, 0x00), \ + IOV_DATA(0x01, 0x12, 0x19, 0x00, 0x82) + + /* + * ATT: Write Request (0x12) len 4 + * Handle: 0x0019 + * Data: 0200 + * + * ATT: Write Response (0x13) len 0 + */ +#define AICS_CP_WR_UNMUTE_SUCCESS \ + IOV_DATA(0x12, 0x19, 0x00, 0x02, 0x00), \ + IOV_DATA(0x13) + + /* + * ATT: Write Request (0x12) len 4 + * Handle: 0x0019 + * Data: 0300 + * + * ATT: Write Response (0x13) len 0 + */ +#define AICS_CP_WR_MUTE_SUCCESS \ + IOV_DATA(0x12, 0x19, 0x00, 0x03, 0x00), \ + IOV_DATA(0x13) + + /* + * ATT: Write Request (0x12) len 4 + * Handle: 0x0019 + * Data: 0400 + * + * ATT: Write Response (0x13) len 0 + */ +#define AICS_CP_WR_MANUAL_GAIN \ + IOV_DATA(0x12, 0x19, 0x00, 0x04, 0x00), \ + IOV_DATA(0x13) + + /* + * ATT: Write Request (0x12) len 4 + * Handle: 0x0019 + * Data: 0500 + * + * ATT: Write Response (0x13) len 0 + */ +#define AICS_CP_WR_AUTOMATIC_GAIN \ + IOV_DATA(0x12, 0x19, 0x00, 0x05, 0x00), \ + IOV_DATA(0x13) + + /* + * ATT: Write Request (0x12) len 5 + * Handle: 0x0019 + * Data: 01007f + * + * ATT: Write Response (0x13) len 0 + */ +#define AICS_CP_WR_GAIN_SETTING_MAX \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x00, 0x7f), \ + IOV_DATA(0x13) + + /* + * ATT: Write Request (0x12) len 5 + * Handle: 0x0019 + * Data: 010080 + * + * ATT: Write Response (0x13) len 0 + */ +#define AICS_CP_WR_GAIN_SETTING_MIN \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x01, 0x80), \ + IOV_DATA(0x13) + + /* + * ATT: Write Request (0x12) len 4 + * Handle: 0x0010 + * Data: 0100 + * + * ATT: Write Response (0x13) len 0 + */ +#define AICS_ENABLE_AUD_IP_STATE_CC \ + IOV_DATA(0x12, 0x10, 0x00, 0x01, 0x00), \ + IOV_DATA(0X13) + + /* + * ATT: Handle Value Notification (0x1b) len 6 + * Handle: 0x000f + * Data: 58000201 + */ +#define AICS_AUD_IP_STATE_UNMUTED_NOTIF \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x58, 0x00, 0x02, 0x01) + + /* + * ATT: Handle Value Notification (0x1b) len 6 + * Handle: 0x000f + * Data: 58010201 + */ +#define AICS_AUD_IP_STATE_MUTED_NOTIF \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x58, 0x01, 0x02, 0x01) + + /* + * ATT: Handle Value Notification (0x1b) len 6 + * Handle: 0x000f + * Data: 58000201 + * + */ +#define AICS_AUD_IP_STATE_MANUAL_GAIN_NOTIF \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x58, 0x00, 0x02, 0x01) + + /* + * ATT: Handle Value Notification (0x1b) len 6 + * Handle: 0x000f + * Data: 58000301 + */ +#define AICS_AUD_IP_STATE_AUTOMATIC_GAIN_NOTIF \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x58, 0x00, 0x03, 0x01) + + /* + * ATT: Handle Value Notification (0x1b) len 6 + * Handle: 0x000f + * Data: 7f000201 + */ +#define AICS_AUD_IP_STATE_GAIN_SETTING_MAX_NOTIF \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7f, 0x00, 0x02, 0x01) + + /* + * ATT: Handle Value Notification (0x1b) len 6 + * Handle: 0x000f + * Data: 80000202 + */ +#define AICS_AUD_IP_STATE_GAIN_SETTING_MIN_NOTIF \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x80, 0x00, 0x02, 0x02) + + /* + * AICS/SR/CP/BV-01-C + * Test Procedure: + * 1. The Lower Tester executes the GATT Read Characteristic Value + * sub-procedure for the Audio Input State characteristic. + * 2. The Lower Tester executes the GATT Read Characteristic Value + * sub-procedure for the Gain Setting Properties characteristic. + * Repeat steps 3–5 for (255 – Change_Counter value) + 1 times. + * AICS_CP_WR_GAIN_SETTING_255_LOOP does the above point + * 3. The Lower Tester executes the GATT Write Characteristic Value + * sub-procedure for the Audio Input Control Point characteristic with + * the Set Gain Setting Opcode, Gain Setting parameter set to a random + * value between the Gain_Setting_Minimum field and Gain_Setting_Maximum + * field values and different than the last iteration, and the + * Change_Counter parameter. + * 4. The Lower Tester receives a Write Response indicating that the IUT + * has accepted the Opcode. + * 5. The Lower Tester receives a GATT Characteristic Value Notification + * for the Audio Input State characteristic. + * + */ +#define AICS_CP_WR_GAIN_SETTING_255_LOOP \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x00, 0xc4), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xc4, 0x00, 0x02, 0x01), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x01, 0xaf), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xaf, 0x00, 0x02, 0x02), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x02, 0xcd), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xcd, 0x00, 0x02, 0x03), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x03, 0xd4), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xd4, 0x00, 0x02, 0x04), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x04, 0x08), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x08, 0x00, 0x02, 0x05), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x05, 0x88), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x88, 0x00, 0x02, 0x06), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x06, 0xde), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xde, 0x00, 0x02, 0x07), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x07, 0x21), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x21, 0x00, 0x02, 0x08), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x08, 0x41), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x41, 0x00, 0x02, 0x09), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x09, 0x08), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x08, 0x00, 0x02, 0x0a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x0a, 0x05), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x05, 0x00, 0x02, 0x0b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x0b, 0x18), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x18, 0x00, 0x02, 0x0c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x0c, 0x28), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x28, 0x00, 0x02, 0x0d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x0d, 0xca), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xca, 0x00, 0x02, 0x0e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x0e, 0xa0), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xa0, 0x00, 0x02, 0x0f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x0f, 0xd0), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xd0, 0x00, 0x02, 0x10), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x10, 0xec), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xec, 0x00, 0x02, 0x11), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x11, 0x3c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3c, 0x00, 0x02, 0x12), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x12, 0x09), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x09, 0x00, 0x02, 0x13), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x13, 0x05), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x05, 0x00, 0x02, 0x14), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x14, 0x29), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x29, 0x00, 0x02, 0x15), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x15, 0x28), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x28, 0x00, 0x02, 0x16), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x16, 0x25), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x25, 0x00, 0x02, 0x17), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x17, 0x31), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x31, 0x00, 0x02, 0x18), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x18, 0x49), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x49, 0x00, 0x02, 0x19), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x19, 0x12), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x12, 0x00, 0x02, 0x1a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x1a, 0x09), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x09, 0x00, 0x02, 0x1b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x1b, 0x29), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x29, 0x00, 0x02, 0x1c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x1c, 0x55), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x55, 0x00, 0x02, 0x1d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x1d, 0x35), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x35, 0x00, 0x02, 0x1e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x1e, 0x59), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x59, 0x00, 0x02, 0x1f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x1f, 0x69), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x69, 0x00, 0x02, 0x20), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x20, 0x22), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x22, 0x00, 0x02, 0x21), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x21, 0x79), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x79, 0x00, 0x02, 0x22), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x22, 0x11), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x11, 0x00, 0x02, 0x23), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x23, 0x21), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x21, 0x00, 0x02, 0x24), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x24, 0x0a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x0a, 0x00, 0x02, 0x25), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x25, 0x0b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x0b, 0x00, 0x02, 0x26), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x26, 0x0c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x0c, 0x00, 0x02, 0x27), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x27, 0x0d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x0d, 0x00, 0x02, 0x28), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x28, 0x0e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x0e, 0x00, 0x02, 0x29), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x29, 0x0f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x0f, 0x00, 0x02, 0x2a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x2a, 0x61), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x61, 0x00, 0x02, 0x2b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x2b, 0x63), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x63, 0x00, 0x02, 0x2c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x2c, 0x64), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x64, 0x00, 0x02, 0x2d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x2d, 0x68), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x68, 0x00, 0x02, 0x2e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x2e, 0x14), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x14, 0x00, 0x02, 0x2f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x2f, 0x33), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x33, 0x00, 0x02, 0x30), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x30, 0x31), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x31, 0x00, 0x02, 0x31), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x31, 0x3e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3e, 0x00, 0x02, 0x32), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x32, 0x79), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x79, 0x00, 0x02, 0x33), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x33, 0x99), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x99, 0x00, 0x02, 0x34), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x34, 0x81), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x81, 0x00, 0x02, 0x35), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x35, 0x73), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x73, 0x00, 0x02, 0x36), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x36, 0x75), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x75, 0x00, 0x02, 0x37), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x37, 0x6f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6f, 0x00, 0x02, 0x38), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x38, 0x4e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x4e, 0x00, 0x02, 0x39), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x39, 0x1a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x1a, 0x00, 0x02, 0x3a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x3a, 0x1c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x1c, 0x00, 0x02, 0x3b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x3b, 0x2c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x2c, 0x00, 0x02, 0x3c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x3c, 0x5a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5a, 0x00, 0x02, 0x3d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x3d, 0x3d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3d, 0x00, 0x02, 0x3e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x3e, 0x5f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5f, 0x00, 0x02, 0x3f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x3f, 0x6e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6e, 0x00, 0x02, 0x40), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x40, 0x2c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x2c, 0x00, 0x02, 0x41), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x41, 0x7c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7c, 0x00, 0x02, 0x42), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x42, 0x01), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x01, 0x00, 0x02, 0x43), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x43, 0x2b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x2b, 0x00, 0x02, 0x44), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x44, 0xbc), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xbc, 0x00, 0x02, 0x45), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x45, 0x3b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3b, 0x00, 0x02, 0x46), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x46, 0x4c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x4c, 0x00, 0x02, 0x47), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x47, 0x3d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3d, 0x00, 0x02, 0x48), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x48, 0x7e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7e, 0x00, 0x02, 0x49), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x49, 0x2f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x2f, 0x00, 0x02, 0x4a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x4a, 0x71), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x71, 0x00, 0x02, 0x4b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x4b, 0x93), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x93, 0x00, 0x02, 0x4c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x4c, 0x6c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6c, 0x00, 0x02, 0x4d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x4d, 0x78), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x78, 0x00, 0x02, 0x4e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x4e, 0x44), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x44, 0x00, 0x02, 0x4f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x4f, 0x83), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x83, 0x00, 0x02, 0x50), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x50, 0x2c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x2c, 0x00, 0x02, 0x51), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x51, 0x7e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7e, 0x00, 0x02, 0x52), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x52, 0x61), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x61, 0x00, 0x02, 0x53), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x53, 0xbb), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xbb, 0x00, 0x02, 0x54), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x54, 0xb1), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb1, 0x00, 0x02, 0x55), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x55, 0x3e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3e, 0x00, 0x02, 0x56), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x56, 0xca), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xca, 0x00, 0x02, 0x57), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x57, 0x3f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3f, 0x00, 0x02, 0x58), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x58, 0x3e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3e, 0x00, 0x02, 0x59), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x59, 0xdf), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xdf, 0x00, 0x02, 0x5a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x5a, 0xe1), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xe1, 0x00, 0x02, 0x5b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x5b, 0xd3), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xd3, 0x00, 0x02, 0x5c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x5c, 0x9c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x9c, 0x00, 0x02, 0x5d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x5d, 0x70), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x70, 0x00, 0x02, 0x5e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x5e, 0xa4), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xa4, 0x00, 0x02, 0x5f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x5f, 0x8a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x8a, 0x00, 0x02, 0x60), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x60, 0x7c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7c, 0x00, 0x02, 0x61), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x61, 0x5f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5f, 0x00, 0x02, 0x62), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x62, 0x6a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6a, 0x00, 0x02, 0x63), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x63, 0xb3), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb3, 0x00, 0x02, 0x64), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x64, 0xb7), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb7, 0x00, 0x02, 0x65), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x65, 0x3b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3b, 0x00, 0x02, 0x66), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x66, 0x4a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x4a, 0x00, 0x02, 0x67), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x67, 0x3b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3b, 0x00, 0x02, 0x68), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x68, 0x8e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x8e, 0x00, 0x02, 0x69), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x69, 0xef), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xef, 0x00, 0x02, 0x6a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x6a, 0xe5), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xe5, 0x00, 0x02, 0x6b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x6b, 0xe3), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xe3, 0x00, 0x02, 0x6c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x6c, 0x5c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5c, 0x00, 0x02, 0x6d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x6d, 0x79), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x79, 0x00, 0x02, 0x6e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x6e, 0xa1), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xa1, 0x00, 0x02, 0x6f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x6f, 0x8b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x8b, 0x00, 0x02, 0x70), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x70, 0x5e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5e, 0x00, 0x02, 0x71), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x71, 0x0f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x0f, 0x00, 0x02, 0x72), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x72, 0x6c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6c, 0x00, 0x02, 0x73), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x73, 0xb9), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb9, 0x00, 0x02, 0x74), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x74, 0xb0), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb0, 0x00, 0x02, 0x75), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x75, 0x31), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x31, 0x00, 0x02, 0x76), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x76, 0x4d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x4d, 0x00, 0x02, 0x77), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x77, 0x39), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x39, 0x00, 0x02, 0x78), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x78, 0xde), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xde, 0x00, 0x02, 0x79), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x79, 0xe9), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xe9, 0x00, 0x02, 0x7a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x7a, 0xe8), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xe8, 0x00, 0x02, 0x7b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x7b, 0xa3), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xa3, 0x00, 0x02, 0x7c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x7c, 0xcc), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xcc, 0x00, 0x02, 0x7d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x7d, 0x89), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x89, 0x00, 0x02, 0x7e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x7e, 0xa9), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xa9, 0x00, 0x02, 0x7f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x7f, 0x83), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x83, 0x00, 0x02, 0x80), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x80, 0x4e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x4e, 0x00, 0x02, 0x81), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x81, 0x9f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x9f, 0x00, 0x02, 0x82), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x82, 0x6f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6f, 0x00, 0x02, 0x83), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x83, 0xb5), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb5, 0x00, 0x02, 0x84), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x84, 0xb4), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb4, 0x00, 0x02, 0x85), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x85, 0x21), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x21, 0x00, 0x02, 0x86), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x86, 0x7d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7d, 0x00, 0x02, 0x87), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x87, 0x29), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x29, 0x00, 0x02, 0x88), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x88, 0x9d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x9d, 0x00, 0x02, 0x89), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x89, 0xe1), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xe1, 0x00, 0x02, 0x8a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x8a, 0xa8), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xa8, 0x00, 0x02, 0x8b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x8b, 0xaa), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xaa, 0x00, 0x02, 0x8c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x8c, 0x1c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x1c, 0x00, 0x02, 0x8d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x8d, 0x59), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x59, 0x00, 0x02, 0x8e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x8e, 0xc9), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xc9, 0x00, 0x02, 0x8f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x8f, 0x33), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x33, 0x00, 0x02, 0x90), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x90, 0xe0), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xe0, 0x00, 0x02, 0x91), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x91, 0xf1), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xf1, 0x00, 0x02, 0x92), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x92, 0x6e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6e, 0x00, 0x02, 0x93), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x93, 0xb3), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb3, 0x00, 0x02, 0x94), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x94, 0xb8), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb8, 0x00, 0x02, 0x95), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x95, 0x2f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x2f, 0x00, 0x02, 0x96), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x96, 0x7c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7c, 0x00, 0x02, 0x97), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x97, 0x25), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x25, 0x00, 0x02, 0x98), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x98, 0x9e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x9e, 0x00, 0x02, 0x99), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x99, 0xed), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xed, 0x00, 0x02, 0x9a), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x9a, 0xa5), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xa5, 0x00, 0x02, 0x9b), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x9b, 0xab), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xab, 0x00, 0x02, 0x9c), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x9c, 0x5c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5c, 0x00, 0x02, 0x9d), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x9d, 0x5c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5c, 0x00, 0x02, 0x9e), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x9e, 0xc8), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xc8, 0x00, 0x02, 0x9f), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0x9f, 0x3b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3b, 0x00, 0x02, 0xa0), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa0, 0xed), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xed, 0x00, 0x02, 0xa1), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa1, 0x9a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x9a, 0x00, 0x02, 0xa2), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa2, 0x6b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6b, 0x00, 0x02, 0xa3), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa3, 0xb9), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xb9, 0x00, 0x02, 0xa4), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa4, 0xbe), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xbe, 0x00, 0x02, 0xa5), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa5, 0x2e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x2e, 0x00, 0x02, 0xa6), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa6, 0x7c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7c, 0x00, 0x02, 0xa7), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa7, 0x24), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x24, 0x00, 0x02, 0xa8), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa8, 0x9b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x9b, 0x00, 0x02, 0xa9), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xa9, 0xee), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xee, 0x00, 0x02, 0xaa), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xaa, 0xc2), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xc2, 0x00, 0x02, 0xab), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xab, 0xc0), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xc0, 0x00, 0x02, 0xac), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xac, 0x10), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x10, 0x00, 0x02, 0xad), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xad, 0x58), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x58, 0x00, 0x02, 0xae), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xae, 0xa9), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xa9, 0x00, 0x02, 0xaf), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xaf, 0x30), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x30, 0x00, 0x02, 0xb0), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb0, 0x49), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x49, 0x00, 0x02, 0xb1), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb1, 0x90), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x90, 0x00, 0x02, 0xb2), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb2, 0x60), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x60, 0x00, 0x02, 0xb3), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb3, 0xbf), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xbf, 0x00, 0x02, 0xb4), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb4, 0xbd), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xbd, 0x00, 0x02, 0xb5), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb5, 0x33), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x33, 0x00, 0x02, 0xb6), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb6, 0x77), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x77, 0x00, 0x02, 0xb7), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb7, 0x89), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x89, 0x00, 0x02, 0xb8), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb8, 0x9f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x9f, 0x00, 0x02, 0xb9), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xb9, 0xf1), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xf1, 0x00, 0x02, 0xba), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xba, 0xaa), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xaa, 0x00, 0x02, 0xbb), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xbb, 0xac), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xac, 0x00, 0x02, 0xbc), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xbc, 0x1e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x1e, 0x00, 0x02, 0xbd), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xbd, 0x58), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x58, 0x00, 0x02, 0xbe), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xbe, 0xcd), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xcd, 0x00, 0x02, 0xbf), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xbf, 0x3a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x3a, 0x00, 0x02, 0xc0), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc0, 0x48), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x48, 0x00, 0x02, 0xc1), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc1, 0x9a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x9a, 0x00, 0x02, 0xc2), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc2, 0x6c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6c, 0x00, 0x02, 0xc3), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc3, 0x7a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7a, 0x00, 0x02, 0xc4), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc4, 0x7d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7d, 0x00, 0x02, 0xc5), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc5, 0x7c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7c, 0x00, 0x02, 0xc6), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc6, 0x7d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7d, 0x00, 0x02, 0xc7), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc7, 0x7e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7e, 0x00, 0x02, 0xc8), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc8, 0x7f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x7f, 0x00, 0x02, 0xc9), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xc9, 0xf0), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xf0, 0x00, 0x02, 0xca), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xca, 0xf1), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xf1, 0x00, 0x02, 0xcb), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xcb, 0xf2), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xf2, 0x00, 0x02, 0xcc), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xcc, 0xf3), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xf3, 0x00, 0x02, 0xcd), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xcd, 0xf4), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xf4, 0x00, 0x02, 0xce), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xce, 0xc1), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xc1, 0x00, 0x02, 0xcf), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xcf, 0xc2), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0xc2, 0x00, 0x02, 0xd0), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd0, 0x4f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x4f, 0x00, 0x02, 0xd1), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd1, 0x60), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x60, 0x00, 0x02, 0xd2), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd2, 0x6a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6a, 0x00, 0x02, 0xd3), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd3, 0x6b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6b, 0x00, 0x02, 0xd4), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd4, 0x6c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6c, 0x00, 0x02, 0xd5), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd5, 0x6d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6d, 0x00, 0x02, 0xd6), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd6, 0x6e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6e, 0x00, 0x02, 0xd7), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd7, 0x6f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x6f, 0x00, 0x02, 0xd8), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd8, 0x91), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x91, 0x00, 0x02, 0xd9), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xd9, 0x92), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x92, 0x00, 0x02, 0xda), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xda, 0x93), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x93, 0x00, 0x02, 0xdb), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xdb, 0x94), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x94, 0x00, 0x02, 0xdc), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xdc, 0x95), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x95, 0x00, 0x02, 0xdd), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xdd, 0x96), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x96, 0x00, 0x02, 0xde), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xde, 0x97), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x97, 0x00, 0x02, 0xdf), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xdf, 0x98), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x98, 0x00, 0x02, 0xe0), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe0, 0x59), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x59, 0x00, 0x02, 0xe1), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe1, 0x5a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5a, 0x00, 0x02, 0xe2), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe2, 0x5b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5b, 0x00, 0x02, 0xe3), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe3, 0x5c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5c, 0x00, 0x02, 0xe4), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe4, 0x5d), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5d, 0x00, 0x02, 0xe5), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe5, 0x5e), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5e, 0x00, 0x02, 0xe6), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe6, 0x5f), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x5f, 0x00, 0x02, 0xe7), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe7, 0x70), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x70, 0x00, 0x02, 0xe8), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe8, 0x71), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x71, 0x00, 0x02, 0xe9), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xe9, 0x72), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x72, 0x00, 0x02, 0xea), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xea, 0x73), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x73, 0x00, 0x02, 0xeb), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xeb, 0x74), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x74, 0x00, 0x02, 0xec), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xec, 0x4a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x4a, 0x00, 0x02, 0xed), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xed, 0x4b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x4b, 0x00, 0x02, 0xee), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xee, 0x4c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x4c, 0x00, 0x02, 0xef), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xef, 0x50), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x50, 0x00, 0x02, 0xf0), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf0, 0x40), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x40, 0x00, 0x02, 0xf1), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf1, 0x30), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x30, 0x00, 0x02, 0xf2), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf2, 0x50), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x50, 0x00, 0x02, 0xf3), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf3, 0x60), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x60, 0x00, 0x02, 0xf4), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf4, 0x10), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x10, 0x00, 0x02, 0xf5), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf5, 0x11), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x11, 0x00, 0x02, 0xf6), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf6, 0x12), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x12, 0x00, 0x02, 0xf7), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf7, 0x13), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x13, 0x00, 0x02, 0xf8), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf8, 0x14), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x14, 0x00, 0x02, 0xf9), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xf9, 0x15), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x15, 0x00, 0x02, 0xfa), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xfa, 0x16), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x16, 0x00, 0x02, 0xfb), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xfb, 0x18), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x18, 0x00, 0x02, 0xfc), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xfc, 0x19), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x19, 0x00, 0x02, 0xfd), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xfd, 0x1a), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x1a, 0x00, 0x02, 0xfe), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xfe, 0x1b), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x1b, 0x00, 0x02, 0xff), \ + IOV_DATA(0x12, 0x19, 0x00, 0x01, 0xff, 0x1c), \ + IOV_DATA(0x13), \ + IOV_DATA(0x1b, 0x0f, 0x00, 0x1c, 0x00, 0x02, 0x00) + /* ATT: Read Request (0x0a) len 2 * Handle: 0x0003 * @@ -484,14 +1679,105 @@ IOV_DATA(0x13) #define VOCS_SR_SGGIT_CHA_TST_CMDS \ - VOCS_EXCHANGE_MTU, \ - VOCS_PRIMARY_SERVICE_VCS, \ - VOCS_SECONDARY_SERVICE_VOCS, \ - VOCS_INCLUDED_SERVICE_VOCS, \ + VCS_EXCHANGE_MTU, \ + VOCS_AICS_PRIMARY_SERVICE_VCS, \ + VOCS_AICS_SECONDARY_SERVICE, \ + VOCS_AICS_INCLUDED_SERVICE, \ VOCS_DISC_CHAR, \ VOCS_DISC_CHAR_DESC, \ VOCS_READ_CHAR_DESC +#define AICS_SR_SGGIT_CHA_TST_CMDS \ + VCS_EXCHANGE_MTU, \ + VOCS_AICS_PRIMARY_SERVICE_VCS, \ + VOCS_AICS_SECONDARY_SERVICE, \ + VOCS_AICS_INCLUDED_SERVICE, \ + AICS_DISC_CHAR, \ + AICS_DISC_CHAR_DESC, \ + AICS_READ_CHAR_DESC + +#define AICS_SR_SGGIT_CHA_BV_01_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_READ_CHAR_AUD_IP_STATE + +#define AICS_SR_SGGIT_CHA_BV_02_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_READ_CHAR_GAIN_SETTING_PROP + +#define AICS_SR_SGGIT_CHA_BV_03_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_READ_CHAR_AUD_IP_TYPE + +#define AICS_SR_SGGIT_CHA_BV_04_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_READ_CHAR_AUD_IP_STATUS + +#define AICS_SR_SGGIT_CHA_BV_05_C \ + AICS_SR_SGGIT_CHA_TST_CMDS + +#define AICS_SR_SGGIT_CHA_BV_06_C \ + AICS_SR_SGGIT_CHA_TST_CMDS + +#define AICS_SR_SGGIT_CP_BI_01_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_READ_CHAR_AUD_IP_STATE, \ + AICS_CP_WR_INVLD_CHG_COUNTER + +#define AICS_SR_SGGIT_CP_BI_02_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_CP_WR_INVLD_OP_CODE + +#define AICS_SR_SGGIT_CP_BI_03_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_READ_CHAR_AUD_IP_STATE_MUT_DIS, \ + AICS_CP_WR_UNMUTE, \ + AICS_CP_WR_MUTE + +#define AICS_SR_CP_BV_01_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_ENABLE_AUD_IP_STATE_CC, \ + AICS_READ_CHAR_AUD_IP_STATE, \ + AICS_READ_CHAR_GAIN_SETTNG_PROP, \ + AICS_CP_WR_GAIN_SETTING_255_LOOP + +#define AICS_SR_CP_BV_02_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_ENABLE_AUD_IP_STATE_CC, \ + AICS_READ_CHAR_AUD_IP_STATE_MUTED, \ + AICS_CP_WR_UNMUTE_SUCCESS, \ + AICS_AUD_IP_STATE_UNMUTED_NOTIF + +#define AICS_SR_CP_BV_03_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_ENABLE_AUD_IP_STATE_CC, \ + AICS_READ_CHAR_AUD_IP_STATE_UNMUTED, \ + AICS_CP_WR_MUTE_SUCCESS, \ + AICS_AUD_IP_STATE_MUTED_NOTIF + +#define AICS_SR_CP_BV_04_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_ENABLE_AUD_IP_STATE_CC, \ + AICS_READ_CHAR_AUD_IP_STATE_AUTOMATIC, \ + AICS_CP_WR_MANUAL_GAIN, \ + AICS_AUD_IP_STATE_MANUAL_GAIN_NOTIF + +#define AICS_SR_CP_BV_05_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_ENABLE_AUD_IP_STATE_CC, \ + AICS_READ_CHAR_AUD_IP_STATE_MANUAL, \ + AICS_CP_WR_AUTOMATIC_GAIN, \ + AICS_AUD_IP_STATE_AUTOMATIC_GAIN_NOTIF + +#define AICS_SR_SPE_BI_01_C \ + AICS_SR_SGGIT_CHA_TST_CMDS, \ + AICS_ENABLE_AUD_IP_STATE_CC, \ + AICS_READ_CHAR_AUD_IP_STATE, \ + AICS_READ_CHAR_GAIN_SETTNG_PROP, \ + AICS_CP_WR_GAIN_SETTING_MAX, \ + AICS_AUD_IP_STATE_GAIN_SETTING_MAX_NOTIF, \ + AICS_CP_WR_GAIN_SETTING_MIN, \ + AICS_AUD_IP_STATE_GAIN_SETTING_MIN_NOTIF + #define VOCS_SR_SGGIT_SER_BV_01_C \ VOCS_SR_SGGIT_CHA_TST_CMDS @@ -1315,11 +2601,11 @@ IOV_DATA(0x13), \ IOV_DATA(0x1b, 0x03, 0x00, 0x0c, 0xff, 0x00) -int main(int argc, char *argv) +static void test_vocs_unit_testcases(void) { - tester_init(&argc, &argv); - - /* VOCS Unit Testcases */ + /* + * VOCS Unit Testcases + */ define_test("VOCS/SR/SGGIT/SER/BV-01-C", test_server, NULL, VOCS_SR_SGGIT_SER_BV_01_C); @@ -1344,6 +2630,131 @@ define_test("VOCS/SR/CP/BV-01-C", test_server, NULL, VOCS_SR_CP_BV_01_C); +} + +static void test_aics_unit_testcases(void) +{ + /* + * AICS Unit Testcases + */ + define_test("AICS/SR/SGGIT/CHA/BV-01-C", test_server, NULL, + AICS_SR_SGGIT_CHA_BV_01_C); + + define_test("AICS/SR/SGGIT/CHA/BV-02-C", test_server, NULL, + AICS_SR_SGGIT_CHA_BV_02_C); + + define_test("AICS/SR/SGGIT/CHA/BV-03-C", test_server, NULL, + AICS_SR_SGGIT_CHA_BV_03_C); + + define_test("AICS/SR/SGGIT/CHA/BV-04-C", test_server, NULL, + AICS_SR_SGGIT_CHA_BV_04_C); + + define_test("AICS/SR/SGGIT/CHA/BV-05-C", test_server, NULL, + AICS_SR_SGGIT_CHA_BV_05_C); + + define_test("AICS/SR/SGGIT/CHA/BV-06-C", test_server, NULL, + AICS_SR_SGGIT_CHA_BV_06_C); + + define_test("AICS/SR/SGGIT/CP/BI-01-C", test_server, NULL, + AICS_SR_SGGIT_CP_BI_01_C); + + define_test("AICS/SR/SGGIT/CP/BI-02-C", test_server, NULL, + AICS_SR_SGGIT_CP_BI_02_C); + + /* AICS/SR/SGGIT/CP/BI-03-C: + * In function *aics_new(struct gatt_db *db)src/shared/vcp.c + * by default state of the 'aics_aud_ip_st->mute' is set to + * AICS_NOT_MUTED0x00;. + * As per test specs, Testcase AICS/SR/SGGIT/CP/BI-03-C, Initial + * condition of mute state should be AICS_DISABLED0x02. + * To verify this Unit test case we have to modify the initial + * state of 'aics_aud_ip_st->mute' to AICS_DISABLED in code + * in func aics_new(), build it and run bluetoothd. Then run + * this unit test case and this test case will Pass. + */ + /* define_test("AICS/SR/SGGIT/CP/BI-03-C", test_server, NULL, + * AICS_SR_SGGIT_CP_BI_03_C); + */ + + /* AICS/SR/SGGIT/CP/BI-04-C - TO-DO Need to give two times input + * from user during test case run + */ + + define_test("AICS/SR/CP/BV-01-C", test_server, NULL, + AICS_SR_CP_BV_01_C); + + /* AICS/SR/CP/BV-02-C: + * In function *aics_new(struct gatt_db *db)src/shared/vcp.c + * by default state of the 'aics_aud_ip_st->mute' is set to + * AICS_NOT_MUTED0x00;. + * As per test specs, Testcase AICS/SR/CP/BV-02-C, Initial + * condition of mute state should be AICS_MUTED0x01. + * To verify this Unit test case we have to modify the initial + * state of 'aics_aud_ip_st->mute' to AICS_MUTED in code + * in func aics_new(), build it and run bluetoothd. Then run + * this unit test case and this test case will Pass. + */ + /* define_test("AICS/SR/CP/BV-02-C", test_server, NULL, + * AICS_SR_CP_BV_02_C); + */ + + /* AICS/SR/CP/BV-03-C: + * In function *aics_new(struct gatt_db *db)src/shared/vcp.c + * by default state of the 'aics_aud_ip_st->mute' is set to + * AICS_NOT_MUTED0x00;. + * As per test specs, Testcase AICS/SR/CP/BV-03-C, Initial + * condition of mute state should be AICS_NOT_MUTED0x00. + * If you have changed this value to some other value, then + * To verify this Unit test case you have to modify the initial + * state of 'aics_aud_ip_st->mute' to AICS_NOT_MUTED in code + * in func aics_new(), build it and run bluetoothd. Then run + * this unit test case and this test case will Pass. + */ + /* define_test("AICS/SR/CP/BV-03-C", test_server, NULL, + * AICS_SR_CP_BV_03_C); + */ + + /* AICS/SR/CP/BV-04-C: + * In function *aics_new(struct gatt_db *db)src/shared/vcp.c + * by default state of the 'aics_aud_ip_st->gain_mode' is set to + * AICS_GAIN_MODE_MANUAL0x02;. + * As per test specs, Testcase AICS/SR/CP/BV-04-C, Initial + * value of gain mode field, should be AICS_GAIN_MODE_AUTO0x03. + * To verify this Unit test case you have to modify the initial + * state of 'aics_aud_ip_st->gain_mode' to AICS_GAIN_MODE_AUTO in code + * in func aics_new(), build it and run bluetoothd. Then run + * this unit test case and this test case will Pass. + */ + /* define_test("AICS/SR/CP/BV-04-C", test_server, NULL, + * AICS_SR_CP_BV_04_C); + */ + + /* AICS/SR/CP/BV-05-C: + * In function *aics_new(struct gatt_db *db)src/shared/vcp.c + * by default state of the 'aics_aud_ip_st->gain_mode' is set to + * AICS_GAIN_MODE_MANUAL0x02;. + * As per test specs, Testcase AICS/SR/CP/BV-05-C, Initial + * value of gain mode field, should be AICS_GAIN_MODE_MANUAL0x02. + * If you have changed this value to some other value, then + * To verify this Unit test case you have to modify the initial + * state of 'aics_aud_ip_st->gain_mode' to AICS_GAIN_MODE_MANUAL in code + * in func aics_new(), build it and run bluetoothd. Then run + * this unit test case and this test case will Pass. + */ + /* define_test("AICS/SR/CP/BV-05-C", test_server, NULL, + * AICS_SR_CP_BV_05_C); + */ + define_test("AICS/SR/SPE/BI-01-C", test_server, NULL, + AICS_SR_SPE_BI_01_C); + + +} +int main(int argc, char *argv) +{ + tester_init(&argc, &argv); + + test_vocs_unit_testcases(); + test_aics_unit_testcases(); return tester_run(); }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2