diff -Nru bluez-hcidump-2.4/ChangeLog bluez-hcidump-2.5/ChangeLog --- bluez-hcidump-2.4/ChangeLog 2012-04-20 19:28:19.000000000 +0000 +++ bluez-hcidump-2.5/ChangeLog 2012-11-30 08:29:41.000000000 +0000 @@ -1,3 +1,9 @@ +ver 2.5: + Fix issue with maximum packet size for AMP controllers. + Add support for more advanced AMP controller decoding. + Add support for more advanced AVRCP decoding. + Add support for reading new BTSnoop data link type. + ver 2.4: Add support for A2MP decoding. Add support for L2CAP create/move channel decoding. diff -Nru bluez-hcidump-2.4/Makefile.am bluez-hcidump-2.5/Makefile.am --- bluez-hcidump-2.4/Makefile.am 2012-04-20 19:28:19.000000000 +0000 +++ bluez-hcidump-2.5/Makefile.am 2012-11-30 08:29:41.000000000 +0000 @@ -2,7 +2,8 @@ AM_MAKEFLAGS = --no-print-directory library_sources = lib/bluetooth.h lib/bluetooth.c \ - lib/hci_lib.h lib/hci.h lib/hci.c lib/l2cap.h lib/a2mp.h + lib/hci_lib.h lib/hci.h lib/hci.c lib/l2cap.h \ + lib/a2mp.h lib/amp.h parser_sources = parser/parser.h parser/parser.c \ parser/lmp.c \ @@ -26,7 +27,8 @@ parser/tcpip.c \ parser/ericsson.c \ parser/csr.c \ - parser/bpa.c + parser/bpa.c \ + parser/amp.c sbin_PROGRAMS = src/hcidump diff -Nru bluez-hcidump-2.4/Makefile.in bluez-hcidump-2.5/Makefile.in --- bluez-hcidump-2.4/Makefile.in 2012-04-20 19:28:29.000000000 +0000 +++ bluez-hcidump-2.5/Makefile.in 2012-11-30 08:29:54.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,6 +16,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -64,7 +81,7 @@ parser/sap.$(OBJEXT) parser/obex.$(OBJEXT) \ parser/capi.$(OBJEXT) parser/ppp.$(OBJEXT) \ parser/tcpip.$(OBJEXT) parser/ericsson.$(OBJEXT) \ - parser/csr.$(OBJEXT) parser/bpa.$(OBJEXT) + parser/csr.$(OBJEXT) parser/bpa.$(OBJEXT) parser/amp.$(OBJEXT) am_src_bpasniff_OBJECTS = src/bpasniff.$(OBJEXT) $(am__objects_1) \ $(am__objects_2) src_bpasniff_OBJECTS = $(am_src_bpasniff_OBJECTS) @@ -101,6 +118,11 @@ $(src_hcidump_SOURCES) DIST_SOURCES = $(src_bpasniff_SOURCES) $(src_csrsniff_SOURCES) \ $(src_hcidump_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -235,7 +257,8 @@ top_srcdir = @top_srcdir@ AM_MAKEFLAGS = --no-print-directory library_sources = lib/bluetooth.h lib/bluetooth.c \ - lib/hci_lib.h lib/hci.h lib/hci.c lib/l2cap.h lib/a2mp.h + lib/hci_lib.h lib/hci.h lib/hci.c lib/l2cap.h \ + lib/a2mp.h lib/amp.h parser_sources = parser/parser.h parser/parser.c \ parser/lmp.c \ @@ -259,7 +282,8 @@ parser/tcpip.c \ parser/ericsson.c \ parser/csr.c \ - parser/bpa.c + parser/bpa.c \ + parser/amp.c src_hcidump_SOURCES = src/hcidump.c $(library_sources) $(parser_sources) src_bpasniff_SOURCES = src/bpasniff.c $(library_sources) $(parser_sources) @@ -329,8 +353,11 @@ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ + fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ @@ -433,6 +460,8 @@ parser/$(DEPDIR)/$(am__dirstamp) parser/bpa.$(OBJEXT): parser/$(am__dirstamp) \ parser/$(DEPDIR)/$(am__dirstamp) +parser/amp.$(OBJEXT): parser/$(am__dirstamp) \ + parser/$(DEPDIR)/$(am__dirstamp) src/bpasniff$(EXEEXT): $(src_bpasniff_OBJECTS) $(src_bpasniff_DEPENDENCIES) $(EXTRA_src_bpasniff_DEPENDENCIES) src/$(am__dirstamp) @rm -f src/bpasniff$(EXEEXT) $(AM_V_CCLD)$(LINK) $(src_bpasniff_OBJECTS) $(src_bpasniff_LDADD) $(LIBS) @@ -451,6 +480,7 @@ -rm -f *.$(OBJEXT) -rm -f lib/bluetooth.$(OBJEXT) -rm -f lib/hci.$(OBJEXT) + -rm -f parser/amp.$(OBJEXT) -rm -f parser/att.$(OBJEXT) -rm -f parser/avctp.$(OBJEXT) -rm -f parser/avdtp.$(OBJEXT) @@ -483,6 +513,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/bluetooth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hci.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/amp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/att.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/avctp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@parser/$(DEPDIR)/avdtp.Po@am__quote@ @@ -527,11 +558,18 @@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man8: $(dist_man_MANS) @$(NORMAL_INSTALL) - test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" - @list=''; test -n "$(man8dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.8[a-z]*$$/p'; \ + @list1=''; \ + list2='$(dist_man_MANS)'; \ + test -n "$(man8dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man8dir)" || 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 '/\.8[a-z]*$$/p'; \ + fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ @@ -725,7 +763,7 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) diff -Nru bluez-hcidump-2.4/aclocal.m4 bluez-hcidump-2.5/aclocal.m4 --- bluez-hcidump-2.4/aclocal.m4 2012-04-20 19:28:27.000000000 +0000 +++ bluez-hcidump-2.5/aclocal.m4 2012-11-30 08:29:52.000000000 +0000 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, @@ -14,8 +14,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) @@ -38,7 +38,7 @@ [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], +m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -54,7 +54,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl +[AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff -Nru bluez-hcidump-2.4/configure bluez-hcidump-2.5/configure --- bluez-hcidump-2.4/configure 2012-04-20 19:28:30.000000000 +0000 +++ bluez-hcidump-2.5/configure 2012-11-30 08:29:55.000000000 +0000 @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for bluez-hcidump 2.4. +# Generated by GNU Autoconf 2.69 for bluez-hcidump 2.5. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,7 +190,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -211,21 +235,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -327,6 +355,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -448,6 +484,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -482,16 +522,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -503,28 +543,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -556,8 +576,8 @@ # Identity of this package. PACKAGE_NAME='bluez-hcidump' PACKAGE_TARNAME='bluez-hcidump' -PACKAGE_VERSION='2.4' -PACKAGE_STRING='bluez-hcidump 2.4' +PACKAGE_VERSION='2.5' +PACKAGE_STRING='bluez-hcidump 2.5' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1123,8 +1143,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1210,7 +1228,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-hcidump 2.4 to adapt to many kinds of systems. +\`configure' configures bluez-hcidump 2.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1276,7 +1294,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bluez-hcidump 2.4:";; + short | recursive ) echo "Configuration of bluez-hcidump 2.5:";; esac cat <<\_ACEOF @@ -1368,10 +1386,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bluez-hcidump configure 2.4 -generated by GNU Autoconf 2.68 +bluez-hcidump configure 2.5 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1423,8 +1441,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bluez-hcidump $as_me 2.4, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by bluez-hcidump $as_me 2.5, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1840,7 +1858,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2009,7 +2027,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2049,7 +2067,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2100,7 +2118,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2153,7 +2171,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2239,7 +2257,7 @@ # Define the identity of the package. PACKAGE='bluez-hcidump' - VERSION='2.4' + VERSION='2.5' cat >>confdefs.h <<_ACEOF @@ -2392,7 +2410,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2432,7 +2450,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2485,7 +2503,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2526,7 +2544,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2584,7 +2602,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2628,7 +2646,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3074,8 +3092,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3822,16 +3839,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -3891,28 +3908,16 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -3933,8 +3938,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bluez-hcidump $as_me 2.4, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by bluez-hcidump $as_me 2.5, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -3999,11 +4004,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -bluez-hcidump config.status 2.4 -configured by $0, generated by GNU Autoconf 2.68, +bluez-hcidump config.status 2.5 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -4094,7 +4099,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' diff -Nru bluez-hcidump-2.4/configure.ac bluez-hcidump-2.5/configure.ac --- bluez-hcidump-2.4/configure.ac 2012-04-20 19:28:19.000000000 +0000 +++ bluez-hcidump-2.5/configure.ac 2012-11-30 08:29:41.000000000 +0000 @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(bluez-hcidump, 2.4) +AC_INIT(bluez-hcidump, 2.5) AM_INIT_AUTOMAKE([foreign subdir-objects]) AM_CONFIG_HEADER(config.h) diff -Nru bluez-hcidump-2.4/debian/changelog bluez-hcidump-2.5/debian/changelog --- bluez-hcidump-2.4/debian/changelog 2013-07-23 11:37:42.000000000 +0000 +++ bluez-hcidump-2.5/debian/changelog 2013-07-23 03:48:44.000000000 +0000 @@ -1,3 +1,15 @@ +bluez-hcidump (2.5-1) unstable; urgency=low + + * New upstream release. + * Change source format to 3.0 (quilt). + * Update debian/control. + - Update Standards-Version to 3.9.4. + - Update Vcs-Svn and Vcs-Browser field. + * Update debian/rules. + - Enable verbose build. + + -- Nobuhiro Iwamatsu Tue, 23 Jul 2013 10:06:05 +0900 + bluez-hcidump (2.4-1) unstable; urgency=low * New upstream release. diff -Nru bluez-hcidump-2.4/debian/control bluez-hcidump-2.5/debian/control --- bluez-hcidump-2.4/debian/control 2013-07-23 11:37:42.000000000 +0000 +++ bluez-hcidump-2.5/debian/control 2013-07-23 03:44:11.000000000 +0000 @@ -4,10 +4,10 @@ Maintainer: Debian Bluetooth Maintainers Uploaders: Nobuhiro Iwamatsu Build-Depends: debhelper (>= 9), libbluetooth-dev (>= 4.40), autotools-dev, pkg-config -Vcs-Svn: svn://svn.debian.org/svn/pkg-bluetooth/packages/bluez-hcidump/trunk -Vcs-Browser: http://svn.debian.org/viewsvn/pkg-bluetooth/packages/bluez-hcidump/ +Vcs-Svn: svn://anonscm.debian.org/pkg-bluetooth/packages/bluez-hcidump/trunk +Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-bluetooth/packages/bluez-hcidump/trunk Homepage: http://www.bluez.org -Standards-Version: 3.9.3 +Standards-Version: 3.9.4 Package: bluez-hcidump Architecture: any diff -Nru bluez-hcidump-2.4/debian/rules bluez-hcidump-2.5/debian/rules --- bluez-hcidump-2.4/debian/rules 2013-07-23 11:37:42.000000000 +0000 +++ bluez-hcidump-2.5/debian/rules 2013-07-23 03:47:01.000000000 +0000 @@ -1,4 +1,10 @@ #!/usr/bin/make -f +CONFIGURE_FLAGS := --disable-silent-rules + %: dh $@ + +override_dh_auto_configure: + dh_auto_configure -- $(CONFIGURE_FLAGS) + diff -Nru bluez-hcidump-2.4/debian/source/format bluez-hcidump-2.5/debian/source/format --- bluez-hcidump-2.4/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ bluez-hcidump-2.5/debian/source/format 2013-07-23 11:37:42.356465905 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru bluez-hcidump-2.4/debian/source/options bluez-hcidump-2.5/debian/source/options --- bluez-hcidump-2.4/debian/source/options 1970-01-01 00:00:00.000000000 +0000 +++ bluez-hcidump-2.5/debian/source/options 2013-07-23 01:23:20.000000000 +0000 @@ -0,0 +1 @@ +compression = "xz" diff -Nru bluez-hcidump-2.4/debian/watch bluez-hcidump-2.5/debian/watch --- bluez-hcidump-2.4/debian/watch 2013-07-23 11:37:42.000000000 +0000 +++ bluez-hcidump-2.5/debian/watch 2013-07-23 01:23:20.000000000 +0000 @@ -2,4 +2,4 @@ # this is ugly #opts=downloadurlmangle=s@.*download%2F(.*)@http://bluez.sf.net/download/$1@,filenamemangle=s@.*download/(.*)@$1@ \ #http://www.bluez.org/download.html .*bluez-hcidump-(.+)\.tar\.gz -http://www.bluez.org/download/ .*bluez-hcidump-(.+)\.tar\.gz +https://www.kernel.org/pub/linux/bluetooth/bluez-hcidump-(.+)\.tar\.xz diff -Nru bluez-hcidump-2.4/depcomp bluez-hcidump-2.5/depcomp --- bluez-hcidump-2.4/depcomp 2012-04-20 19:28:29.000000000 +0000 +++ bluez-hcidump-2.5/depcomp 2012-11-30 08:29:54.000000000 +0000 @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) @@ -40,8 +40,8 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. @@ -57,6 +57,12 @@ ;; esac +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -102,6 +108,12 @@ depmode=msvc7 fi +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -156,15 +168,14 @@ ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. @@ -203,18 +214,15 @@ # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else @@ -226,10 +234,17 @@ rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` @@ -259,12 +274,11 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. + # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. + # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -275,23 +289,26 @@ ;; icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h - # which is wrong. We want: + # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : @@ -300,15 +317,21 @@ exit $stat fi rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; @@ -344,7 +367,7 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// @@ -359,9 +382,9 @@ tru64) # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. + # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= @@ -407,8 +430,7 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi @@ -443,11 +465,11 @@ p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g -s/\(.*\)/ \1 \\/p +s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { - s/.*/ / + s/.*/'"$tab"'/ G p }' >> "$depfile" @@ -478,7 +500,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -498,15 +520,14 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ + tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -562,8 +583,7 @@ # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -583,7 +603,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -652,8 +672,8 @@ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff -Nru bluez-hcidump-2.4/lib/amp.h bluez-hcidump-2.5/lib/amp.h --- bluez-hcidump-2.4/lib/amp.h 1970-01-01 00:00:00.000000000 +0000 +++ bluez-hcidump-2.5/lib/amp.h 2012-11-30 08:29:41.000000000 +0000 @@ -0,0 +1,174 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2010-2011 Code Aurora Forum. All rights reserved. + * Copyright (C) 2012 Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef __AMP_H +#define __AMP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define AMP_MGR_CID 0x03 + +/* AMP manager codes */ +#define AMP_COMMAND_REJ 0x01 +#define AMP_DISCOVER_REQ 0x02 +#define AMP_DISCOVER_RSP 0x03 +#define AMP_CHANGE_NOTIFY 0x04 +#define AMP_CHANGE_RSP 0x05 +#define AMP_INFO_REQ 0x06 +#define AMP_INFO_RSP 0x07 +#define AMP_ASSOC_REQ 0x08 +#define AMP_ASSOC_RSP 0x09 +#define AMP_LINK_REQ 0x0a +#define AMP_LINK_RSP 0x0b +#define AMP_DISCONN_REQ 0x0c +#define AMP_DISCONN_RSP 0x0d + +typedef struct { + uint8_t code; + uint8_t ident; + uint16_t len; +} __attribute__ ((packed)) amp_mgr_hdr; +#define AMP_MGR_HDR_SIZE 4 + +/* AMP ASSOC structure */ +typedef struct { + uint8_t type_id; + uint16_t len; + uint8_t data[0]; +} __attribute__ ((packed)) amp_assoc_tlv; + +typedef struct { + uint16_t reason; +} __attribute__ ((packed)) amp_cmd_rej_parms; + +typedef struct { + uint16_t mtu; + uint16_t mask; +} __attribute__ ((packed)) amp_discover_req_parms; + +typedef struct { + uint16_t mtu; + uint16_t mask; + uint8_t controller_list[0]; +} __attribute__ ((packed)) amp_discover_rsp_parms; + +typedef struct { + uint8_t id; +} __attribute__ ((packed)) amp_info_req_parms; + +typedef struct { + uint8_t id; + uint8_t status; + uint32_t total_bandwidth; + uint32_t max_bandwidth; + uint32_t min_latency; + uint16_t pal_caps; + uint16_t assoc_size; +} __attribute__ ((packed)) amp_info_rsp_parms; + +typedef struct { + uint8_t id; + uint8_t status; + amp_assoc_tlv assoc; +} __attribute__ ((packed)) amp_assoc_rsp_parms; + +typedef struct { + uint8_t local_id; + uint8_t remote_id; + amp_assoc_tlv assoc; +} __attribute__ ((packed)) amp_link_req_parms; + +typedef struct { + uint8_t local_id; + uint8_t remote_id; + uint8_t status; +} __attribute__ ((packed)) amp_link_rsp_parms; + +typedef struct { + uint8_t local_id; + uint8_t remote_id; +} __attribute__ ((packed)) amp_disconn_req_parms; + +#define A2MP_MAC_ADDR_TYPE 1 +#define A2MP_PREF_CHANLIST_TYPE 2 +#define A2MP_CONNECTED_CHAN 3 +#define A2MP_PAL_CAP_TYPE 4 +#define A2MP_PAL_VER_INFO 5 + +struct amp_tlv { + uint8_t type; + uint16_t len; + uint8_t val[0]; +} __attribute__ ((packed)); + +struct amp_pal_ver { + uint8_t ver; + uint16_t company_id; + uint16_t sub_ver; +} __attribute__ ((packed)); + +struct amp_country_triplet { + union { + struct { + uint8_t first_channel; + uint8_t num_channels; + int8_t max_power; + } __attribute__ ((packed)) chans; + struct { + uint8_t reg_extension_id; + uint8_t reg_class; + uint8_t coverage_class; + } __attribute__ ((packed)) ext; + }; +} __attribute__ ((packed)); + +struct amp_chan_list { + uint8_t country_code[3]; + struct amp_country_triplet triplets[0]; +} __attribute__ ((packed)); + +#define AMP_COMMAND_NOT_RECOGNIZED 0x0000 + +/* AMP controller status */ +#define AMP_CT_POWERED_DOWN 0x00 +#define AMP_CT_BLUETOOTH_ONLY 0x01 +#define AMP_CT_NO_CAPACITY 0x02 +#define AMP_CT_LOW_CAPACITY 0x03 +#define AMP_CT_MEDIUM_CAPACITY 0x04 +#define AMP_CT_HIGH_CAPACITY 0x05 +#define AMP_CT_FULL_CAPACITY 0x06 + +/* AMP response status */ +#define AMP_STATUS_SUCCESS 0x00 +#define AMP_STATUS_INVALID_CTRL_ID 0x01 +#define AMP_STATUS_UNABLE_START_LINK_CREATION 0x02 +#define AMP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02 +#define AMP_STATUS_COLLISION_OCCURED 0x03 +#define AMP_STATUS_DISCONN_REQ_RECVD 0x04 +#define AMP_STATUS_PHYS_LINK_EXISTS 0x05 +#define AMP_STATUS_SECURITY_VIOLATION 0x06 + +void amp_assoc_dump(int level, uint8_t *assoc, uint16_t len); + +#ifdef __cplusplus +} +#endif + +#endif /* __AMP_H */ diff -Nru bluez-hcidump-2.4/lib/hci.h bluez-hcidump-2.5/lib/hci.h --- bluez-hcidump-2.4/lib/hci.h 2012-02-29 18:23:20.000000000 +0000 +++ bluez-hcidump-2.5/lib/hci.h 2012-11-30 08:29:41.000000000 +0000 @@ -34,7 +34,7 @@ #define HCI_MAX_DEV 16 -#define HCI_MAX_ACL_SIZE 1024 +#define HCI_MAX_ACL_SIZE (1492 + 4) #define HCI_MAX_SCO_SIZE 255 #define HCI_MAX_EVENT_SIZE 260 #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) @@ -1316,6 +1316,14 @@ } __attribute__ ((packed)) read_bd_addr_rp; #define READ_BD_ADDR_RP_SIZE 7 +#define OCF_READ_DATA_BLOCK_SIZE 0x000A +typedef struct { + uint8_t status; + uint16_t max_acl_len; + uint16_t data_block_len; + uint16_t num_blocks; +} __attribute__ ((packed)) read_data_block_size_rp; + /* Status params */ #define OGF_STATUS_PARAM 0x05 @@ -1408,7 +1416,7 @@ typedef struct { uint8_t handle; uint16_t length_so_far; - uint16_t assoc_length; + uint16_t remaining_length; uint8_t fragment[HCI_MAX_NAME_LENGTH]; } __attribute__ ((packed)) write_remote_amp_assoc_cp; #define WRITE_REMOTE_AMP_ASSOC_CP_SIZE 253 @@ -1707,7 +1715,7 @@ uint8_t link_type; uint8_t encr_mode; } __attribute__ ((packed)) evt_conn_complete; -#define EVT_CONN_COMPLETE_SIZE 13 +#define EVT_CONN_COMPLETE_SIZE 11 #define EVT_CONN_REQUEST 0x04 typedef struct { @@ -2189,6 +2197,16 @@ #define EVT_FLOW_SPEC_MODIFY_COMPLETE_SIZE 3 #define EVT_NUMBER_COMPLETED_BLOCKS 0x48 +typedef struct { + uint16_t handle; + uint16_t num_cmplt_pkts; + uint16_t num_cmplt_blks; +} __attribute__ ((packed)) cmplt_handle; +typedef struct { + uint16_t total_num_blocks; + uint8_t num_handles; + cmplt_handle handles[0]; +} __attribute__ ((packed)) evt_num_completed_blocks; #define EVT_AMP_STATUS_CHANGE 0x4D typedef struct { diff -Nru bluez-hcidump-2.4/parser/amp.c bluez-hcidump-2.5/parser/amp.c --- bluez-hcidump-2.4/parser/amp.c 1970-01-01 00:00:00.000000000 +0000 +++ bluez-hcidump-2.5/parser/amp.c 2012-11-30 08:29:41.000000000 +0000 @@ -0,0 +1,126 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2012 Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "parser/parser.h" +#include "lib/amp.h" + +static void amp_dump_chanlist(int level, struct amp_tlv *tlv, char *prefix) +{ + struct amp_chan_list *chan_list = (void *) tlv->val; + struct amp_country_triplet *triplet; + int i, num; + + num = (tlv->len - sizeof(*chan_list)) / sizeof(*triplet); + + printf("%s (number of triplets %d)\n", prefix, num); + + p_indent(level+2, 0); + + printf("Country code: %c%c%c\n", chan_list->country_code[0], + chan_list->country_code[1], chan_list->country_code[2]); + + for (i = 0; i < num; i++) { + triplet = &chan_list->triplets[i]; + + p_indent(level+2, 0); + + if (triplet->chans.first_channel >= 201) { + printf("Reg ext id %d reg class %d coverage class %d\n", + triplet->ext.reg_extension_id, + triplet->ext.reg_class, + triplet->ext.coverage_class); + } else { + if (triplet->chans.num_channels == 1) + printf("Channel %d max power %d\n", + triplet->chans.first_channel, + triplet->chans.max_power); + else + printf("Channels %d - %d max power %d\n", + triplet->chans.first_channel, + triplet->chans.first_channel + + triplet->chans.num_channels, + triplet->chans.max_power); + } + } +} + +void amp_assoc_dump(int level, uint8_t *assoc, uint16_t len) +{ + struct amp_tlv *tlv = (void *) assoc; + + p_indent(level, 0); + printf("Assoc data [len %d]:\n", len); + + while (len > sizeof(*tlv)) { + uint16_t tlvlen = btohs(tlv->len); + struct amp_pal_ver *ver; + + p_indent(level+1, 0); + + switch (tlv->type) { + case A2MP_MAC_ADDR_TYPE: + if (tlvlen != 6) + break; + printf("MAC: %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", + tlv->val[0], tlv->val[1], tlv->val[2], + tlv->val[3], tlv->val[4], tlv->val[5]); + break; + + case A2MP_PREF_CHANLIST_TYPE: + amp_dump_chanlist(level, tlv, "Preferred Chan List"); + break; + + case A2MP_CONNECTED_CHAN: + amp_dump_chanlist(level, tlv, "Connected Chan List"); + break; + + case A2MP_PAL_CAP_TYPE: + if (tlvlen != 4) + break; + printf("PAL CAP: %2.2x %2.2x %2.2x %2.2x\n", + tlv->val[0], tlv->val[1], tlv->val[2], + tlv->val[3]); + break; + + case A2MP_PAL_VER_INFO: + if (tlvlen != 5) + break; + ver = (struct amp_pal_ver *) tlv->val; + printf("PAL VER: %2.2x Comp ID: %4.4x SubVer: %4.4x\n", + ver->ver, btohs(ver->company_id), + btohs(ver->sub_ver)); + break; + + default: + printf("Unrecognized type %d\n", tlv->type); + break; + } + + len -= tlvlen + sizeof(*tlv); + assoc += tlvlen + sizeof(*tlv); + tlv = (struct amp_tlv *) assoc; + } +} diff -Nru bluez-hcidump-2.4/parser/avctp.c bluez-hcidump-2.5/parser/avctp.c --- bluez-hcidump-2.4/parser/avctp.c 2011-12-22 00:18:58.000000000 +0000 +++ bluez-hcidump-2.5/parser/avctp.c 2012-11-30 08:29:41.000000000 +0000 @@ -50,7 +50,7 @@ } } -void avctp_dump(int level, struct frame *frm) +void avctp_dump(int level, struct frame *frm, uint16_t psm) { uint8_t hdr; uint16_t pid; @@ -65,7 +65,7 @@ pt2str(hdr), hdr & 0x0c, hdr >> 4, pid); if (pid == SDP_UUID_AV_REMOTE || pid == SDP_UUID_AV_REMOTE_TARGET) - avrcp_dump(level + 1, frm); + avrcp_dump(level + 1, frm, hdr, psm); else raw_dump(level + 1, frm); } diff -Nru bluez-hcidump-2.4/parser/avrcp.c bluez-hcidump-2.5/parser/avrcp.c --- bluez-hcidump-2.4/parser/avrcp.c 2012-04-20 19:28:19.000000000 +0000 +++ bluez-hcidump-2.5/parser/avrcp.c 2012-11-30 08:29:41.000000000 +0000 @@ -31,6 +31,7 @@ #include #include #include +#include #include "parser/parser.h" @@ -114,6 +115,7 @@ #define AVRCP_PLAY_ITEM 0x74 #define AVRCP_SEARCH 0x80 #define AVRCP_ADD_TO_NOW_PLAYING 0x90 +#define AVRCP_GENERAL_REJECT 0xA0 /* notification events */ #define AVRCP_EVENT_PLAYBACK_STATUS_CHANGED 0x01 @@ -179,6 +181,12 @@ #define AVRCP_PLAY_STATUS_REV_SEEK 0x04 #define AVRCP_PLAY_STATUS_ERROR 0xFF +/* media scope */ +#define AVRCP_MEDIA_PLAYER_LIST 0x00 +#define AVRCP_MEDIA_PLAYER_VFS 0x01 +#define AVRCP_MEDIA_SEARCH 0x02 +#define AVRCP_MEDIA_NOW_PLAYING 0x03 + static struct avrcp_continuing { uint16_t num; uint16_t size; @@ -297,6 +305,8 @@ return "Search"; case AVRCP_ADD_TO_NOW_PLAYING: return "AddToNowPlaying"; + case AVRCP_GENERAL_REJECT: + return "GeneralReject"; default: return "Unknown"; } @@ -1107,6 +1117,7 @@ uint8_t ctype, uint16_t len) { uint8_t event, status; + uint16_t uid; uint32_t interval; uint64_t id; @@ -1202,6 +1213,16 @@ status = get_u8(frm) & 0x7F; printf("Volume: %.2f%% (%d/127)\n", status/1.27, status); break; + case AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED: + uid = get_u16(frm); + printf("PlayerID: 0x%04x (%u)\n", uid, uid); + + + p_indent(level, frm); + + uid = get_u16(frm); + printf("UIDCounter: 0x%04x (%u)\n", uid, uid); + break; } } @@ -1222,6 +1243,200 @@ printf("Volume: %.2f%% (%d/127)\n", value/1.27, value); } +static void avrcp_set_addressed_player(int level, struct frame *frm, + uint8_t ctype, uint16_t len) +{ + uint16_t id; + uint8_t status; + + p_indent(level, frm); + + if (ctype > AVC_CTYPE_GENERAL_INQUIRY) + goto response; + + if (len < 2) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + id = get_u16(frm); + printf("PlayerID: 0x%04x (%u)\n", id, id); + return; + +response: + if (len < 1) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + status = get_u8(frm); + printf("Status: 0x%02x (%s)\n", status, error2str(status)); +} + +static void avrcp_set_browsed_player_dump(int level, struct frame *frm, + uint8_t hdr, uint16_t len) +{ + uint32_t items; + uint16_t id, uids, charset; + uint8_t status, folders; + + p_indent(level, frm); + + if (hdr & 0x02) + goto response; + + if (len < 2) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + id = get_u16(frm); + printf("PlayerID: 0x%04x (%u)", id, id); + return; + +response: + if (len != 1 && len < 10) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + status = get_u8(frm); + printf("Status: 0x%02x (%s)\n", status, error2str(status)); + + if (len == 1) + return; + + p_indent(level, frm); + + uids = get_u16(frm); + printf("UIDCounter: 0x%04x (%u)", uids, uids); + + p_indent(level, frm); + + items = get_u32(frm); + printf("Number of Items: 0x%04x (%u)", items, items); + + p_indent(level, frm); + + charset = get_u16(frm); + printf("CharsetID: 0x%04x (%s)\n", charset, charset2str(charset)); + + p_indent(level, frm); + + folders = get_u8(frm); + printf("Folder Depth: 0x%02x (%u)", folders, folders); + + for (; folders > 0; folders--) { + uint16_t len; + + p_indent(level, frm); + + len = get_u8(frm); + printf("Folder: "); + for (; len > 0; len--) { + uint8_t c = get_u8(frm); + printf("%1c", isprint(c) ? c : '.'); + } + printf("\n"); + } +} + +static const char *scope2str(uint8_t scope) +{ + switch (scope) { + case AVRCP_MEDIA_PLAYER_LIST: + return "Media Player List"; + case AVRCP_MEDIA_PLAYER_VFS: + return "Media Player Virtual Filesystem"; + case AVRCP_MEDIA_SEARCH: + return "Search"; + case AVRCP_MEDIA_NOW_PLAYING: + return "Now Playing"; + default: + return "Unknown"; + } +} + +static void avrcp_play_item_dump(int level, struct frame *frm, + uint8_t ctype, uint16_t len) +{ + uint64_t uid; + uint32_t uidcounter; + uint8_t scope, status; + + p_indent(level, frm); + + if (ctype > AVC_CTYPE_GENERAL_INQUIRY) + goto response; + + if (len < 13) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + scope = get_u8(frm); + printf("Scope: 0x%02x (%s)", scope, scope2str(scope)); + + p_indent(level, frm); + + uid = get_u64(frm); + printf("UID: 0x%16" PRIx64 " (%" PRIu64 ")\n", uid, uid); + + p_indent(level, frm); + + uidcounter = get_u16(frm); + printf("UIDCounter: 0x%04x (%u)\n", uidcounter, uidcounter); + + return; + +response: + status = get_u8(frm); + printf("Status: 0x%02x (%s)\n", status, error2str(status)); +} + +static void avrcp_add_to_now_playing_dump(int level, struct frame *frm, + uint8_t ctype, uint16_t len) +{ + uint64_t uid; + uint32_t uidcounter; + uint8_t scope, status; + + p_indent(level, frm); + + if (ctype > AVC_CTYPE_GENERAL_INQUIRY) + goto response; + + if (len < 11) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + scope = get_u8(frm); + printf("Scope: 0x%02x (%s)\n", scope, scope2str(scope)); + + p_indent(level, frm); + + uid = get_u64(frm); + printf("UID: 0x%16" PRIx64 " (%" PRIu64 ")\n", uid, uid); + + p_indent(level, frm); + + uidcounter = get_u16(frm); + printf("UIDCounter: 0x%04x (%u)\n", uidcounter, uidcounter); + + return; + +response: + status = get_u8(frm); + printf("Status: 0x%02x (%s)\n", status, error2str(status)); +} + static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype) { uint8_t pduid, pt; @@ -1291,6 +1506,15 @@ case AVRCP_SET_ABSOLUTE_VOLUME: avrcp_set_absolute_volume_dump(level + 1, frm, ctype, len); break; + case AVRCP_SET_ADDRESSED_PLAYER: + avrcp_set_addressed_player(level + 1, frm, ctype, len); + break; + case AVRCP_PLAY_ITEM: + avrcp_play_item_dump(level + 1, frm, ctype, len); + break; + case AVRCP_ADD_TO_NOW_PLAYING: + avrcp_add_to_now_playing_dump(level + 1, frm, ctype, len); + break; default: raw_dump(level, frm); } @@ -1384,13 +1608,616 @@ } } -void avrcp_dump(int level, struct frame *frm) +static const char *playertype2str(uint8_t type) { - uint8_t ctype, address, subunit, opcode, company[3]; - int i; + switch (type & 0x0F) { + case 0x01: + return "Audio"; + case 0x02: + return "Video"; + case 0x03: + return "Audio, Video"; + case 0x04: + return "Audio Broadcasting"; + case 0x05: + return "Audio, Audio Broadcasting"; + case 0x06: + return "Video, Audio Broadcasting"; + case 0x07: + return "Audio, Video, Audio Broadcasting"; + case 0x08: + return "Video Broadcasting"; + case 0x09: + return "Audio, Video Broadcasting"; + case 0x0A: + return "Video, Video Broadcasting"; + case 0x0B: + return "Audio, Video, Video Broadcasting"; + case 0x0C: + return "Audio Broadcasting, Video Broadcasting"; + case 0x0D: + return "Audio, Audio Broadcasting, Video Broadcasting"; + case 0x0E: + return "Video, Audio Broadcasting, Video Broadcasting"; + case 0x0F: + return "Audio, Video, Audio Broadcasting, Video Broadcasting"; + } + + return "None"; +} + +static const char *playersubtype2str(uint32_t subtype) +{ + switch (subtype & 0x03) { + case 0x01: + return "Audio Book"; + case 0x02: + return "Podcast"; + case 0x03: + return "Audio Book, Podcast"; + } + + return "None"; +} + +static void avrcp_media_player_item_dump(int level, struct frame *frm, + uint16_t len) +{ + uint16_t id, charset; + uint8_t type, status, namelen; + uint32_t subtype; + uint64_t features[2]; + + p_indent(level, frm); + + if (len < 28) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + id = get_u16(frm); + printf("PlayerID: 0x%04x (%u)\n", id, id); + + p_indent(level, frm); + + type = get_u8(frm); + printf("PlayerType: 0x%04x (%s)\n", type, playertype2str(type)); + + p_indent(level, frm); + + subtype = get_u32(frm); + printf("PlayerSubtype: 0x%08x (%s)\n", subtype, + playersubtype2str(subtype)); + + p_indent(level, frm); + + status = get_u8(frm); + printf("PlayStatus: 0x%02x (%s)\n", status, playstatus2str(status)); + + p_indent(level, frm); + + get_u128(frm, &features[0], &features[1]); + printf("Features: 0x%16" PRIx64 "%16" PRIx64 "\n", features[1], + features[0]); + + p_indent(level, frm); + + charset = get_u16(frm); + printf("CharsetID: 0x%04x (%s)\n", charset, charset2str(charset)); + + p_indent(level, frm); + + namelen = get_u8(frm); + printf("NameLength: 0x%02x (%u)\n", namelen, namelen); + + p_indent(level, frm); + + printf("Name: "); + for (; namelen > 0; namelen--) { + uint8_t c = get_u8(frm); + printf("%1c", isprint(c) ? c : '.'); + } + printf("\n"); +} + +static const char *foldertype2str(uint8_t type) +{ + switch (type) { + case 0x00: + return "Mixed"; + case 0x01: + return "Titles"; + case 0x02: + return "Albuns"; + case 0x03: + return "Artists"; + case 0x04: + return "Genres"; + case 0x05: + return "Playlists"; + case 0x06: + return "Years"; + } + + return "Reserved"; +} + +static void avrcp_folder_item_dump(int level, struct frame *frm, uint16_t len) +{ + uint8_t type, playable, namelen; + uint16_t charset; + uint64_t uid; + + p_indent(level, frm); + + if (len < 14) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + uid = get_u64(frm); + printf("FolderUID: 0x%16" PRIx64 " (%" PRIu64 ")\n", uid, uid); + + p_indent(level, frm); + + type = get_u8(frm); + printf("FolderType: 0x%02x (%s)\n", type, foldertype2str(type)); + + p_indent(level, frm); + + playable = get_u8(frm); + printf("IsPlayable: 0x%02x (%s)\n", playable, + playable & 0x01 ? "True" : "False"); + + p_indent(level, frm); + + charset = get_u16(frm); + printf("CharsetID: 0x%04x (%s)\n", charset, charset2str(charset)); + + p_indent(level, frm); + + namelen = get_u8(frm); + printf("NameLength: 0x%02x (%u)\n", namelen, namelen); + + p_indent(level, frm); + + printf("Name: "); + for (; namelen > 0; namelen--) { + uint8_t c = get_u8(frm); + printf("%1c", isprint(c) ? c : '.'); + } + printf("\n"); +} + +static const char *elementtype2str(uint8_t type) +{ + switch (type) { + case 0x00: + return "Audio"; + case 0x01: + return "Video"; + } + + return "Reserved"; +} + +static void avrcp_attribute_entry_list_dump(int level, struct frame *frm, + uint8_t count) +{ + for (; count > 0; count--) { + uint32_t attr; + uint16_t charset; + uint8_t len; + + p_indent(level, frm); + + attr = get_u32(frm); + printf("AttributeID: 0x%08x (%s)\n", attr, mediattr2str(attr)); + + p_indent(level, frm); + + charset = get_u16(frm); + printf("CharsetID: 0x%04x (%s)\n", charset, + charset2str(charset)); + + p_indent(level, frm); + + len = get_u8(frm); + printf("AttributeLength: 0x%02x (%u)\n", len, len); + + p_indent(level, frm); + + printf("AttributeValue: "); + for (; len > 0; len--) { + uint8_t c = get_u8(frm); + printf("%1c", isprint(c) ? c : '.'); + } + printf("\n"); + } +} + +static void avrcp_media_element_item_dump(int level, struct frame *frm, + uint16_t len) +{ + uint64_t uid; + uint16_t charset; + uint8_t type, namelen, count; + + if (len < 14) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + uid = get_u64(frm); + printf("ElementUID: 0x%16" PRIx64 " (%" PRIu64 ")\n", uid, uid); + + p_indent(level, frm); + + type = get_u8(frm); + printf("ElementType: 0x%02x (%s)\n", type, elementtype2str(type)); + + p_indent(level, frm); + + charset = get_u16(frm); + printf("CharsetID: 0x%04x (%s)\n", charset, charset2str(charset)); + + p_indent(level, frm); + + namelen = get_u8(frm); + printf("NameLength: 0x%02x (%u)\n", namelen, namelen); + + p_indent(level, frm); + + printf("Name: "); + for (; namelen > 0; namelen--) { + uint8_t c = get_u8(frm); + printf("%1c", isprint(c) ? c : '.'); + } + printf("\n"); + + p_indent(level, frm); + + count = get_u8(frm); + printf("AttributeCount: 0x%02x (%u)\n", count, count); + + avrcp_attribute_entry_list_dump(level, frm, count); +} + +static void avrcp_get_folder_items_dump(int level, struct frame *frm, + uint8_t hdr, uint16_t len) +{ + uint8_t scope, count, status; + uint32_t start, end; + uint16_t uid, num; + + p_indent(level, frm); + + if (hdr & 0x02) + goto response; + + if (len < 10) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + scope = get_u8(frm); + printf("Scope: 0x%02x (%s)\n", scope, scope2str(scope)); + + p_indent(level, frm); + + start = get_u32(frm); + printf("StartItem: 0x%08x (%u)\n", start, start); + + p_indent(level, frm); + + end = get_u32(frm); + printf("EndItem: 0x%08x (%u)\n", end, end); p_indent(level, frm); + count = get_u8(frm); + printf("AttributeCount: 0x%02x (%u)\n", count, count); + + for (; count > 0; count--) { + uint32_t attr; + + p_indent(level, frm); + + attr = get_u32(frm); + printf("AttributeID: 0x%08x (%s)\n", attr, mediattr2str(attr)); + } + + return; + +response: + status = get_u8(frm); + printf("Status: 0x%02x (%s)\n", status, error2str(status)); + + if (len == 1) + return; + + p_indent(level, frm); + + uid = get_u16(frm); + printf("UIDCounter: 0x%04x (%u)\n", uid, uid); + + p_indent(level, frm); + + num = get_u16(frm); + printf("Number of Items: 0x%04x (%u)\n", num, num); + + for (; num > 0; num--) { + uint8_t type; + uint16_t len; + + p_indent(level, frm); + + type = get_u8(frm); + len = get_u16(frm); + switch (type) { + case 0x01: + printf("Item: 0x01 (Media Player)) "); + printf("Length: 0x%04x (%u)\n", len, len); + avrcp_media_player_item_dump(level, frm, len); + break; + case 0x02: + printf("Item: 0x02 (Folder) "); + printf("Length: 0x%04x (%u)\n", len, len); + avrcp_folder_item_dump(level, frm, len); + break; + case 0x03: + printf("Item: 0x03 (Media Element) "); + printf("Length: 0x%04x (%u)\n", len, len); + avrcp_media_element_item_dump(level, frm, len); + break; + } + } +} + +static const char *dir2str(uint8_t dir) +{ + switch (dir) { + case 0x00: + return "Folder Up"; + case 0x01: + return "Folder Down"; + } + + return "Reserved"; +} + +static void avrcp_change_path_dump(int level, struct frame *frm, uint8_t hdr, + uint16_t len) +{ + uint64_t uid; + uint32_t items; + uint16_t uidcounter; + uint8_t dir, status; + + p_indent(level, frm); + + if (hdr & 0x02) + goto response; + + if (len < 11) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + uidcounter = get_u16(frm); + printf("UIDCounter: 0x%04x (%u)\n", uidcounter, uidcounter); + + p_indent(level, frm); + + dir = get_u8(frm); + printf("Direction: 0x%02x (%s)\n", dir, dir2str(dir)); + + p_indent(level, frm); + + uid = get_u64(frm); + printf("FolderUID: 0x%16" PRIx64 " (%" PRIu64 ")\n", uid, uid); + + return; + +response: + status = get_u8(frm); + printf("Status: 0x%02x (%s)\n", status, error2str(status)); + + if (len == 1) + return; + + p_indent(level, frm); + + items = get_u32(frm); + printf("Number of Items: 0x%04x (%u)", items, items); +} + +static void avrcp_get_item_attributes_dump(int level, struct frame *frm, + uint8_t hdr, uint16_t len) +{ + uint64_t uid; + uint32_t uidcounter; + uint8_t scope, count, status; + + p_indent(level, frm); + + if (hdr & 0x02) + goto response; + + if (len < 12) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + scope = get_u8(frm); + printf("Scope: 0x%02x (%s)\n", scope, scope2str(scope)); + + p_indent(level, frm); + + uid = get_u64(frm); + printf("UID: 0x%16" PRIx64 " (%" PRIu64 ")\n", uid, uid); + + p_indent(level, frm); + + uidcounter = get_u16(frm); + printf("UIDCounter: 0x%04x (%u)\n", uidcounter, uidcounter); + + p_indent(level, frm); + + count = get_u32(frm); + printf("AttributeCount: 0x%04x (%u)", count, count); + + for (; count > 0; count--) { + uint32_t attr; + + p_indent(level, frm); + + attr = get_u32(frm); + printf("AttributeID: 0x%08x (%s)\n", attr, mediattr2str(attr)); + } + + return; + +response: + status = get_u8(frm); + printf("Status: 0x%02x (%s)\n", status, error2str(status)); + + if (len == 1) + return; + + p_indent(level, frm); + + count = get_u32(frm); + printf("AttributeCount: 0x%04x (%u)", count, count); + + avrcp_attribute_entry_list_dump(level, frm, count); +} + +static void avrcp_search_dump(int level, struct frame *frm, uint8_t hdr, + uint16_t len) +{ + uint32_t uidcounter, items; + uint16_t charset; + uint8_t namelen, status; + + p_indent(level, frm); + + if (hdr & 0x02) + goto response; + + if (len < 3) { + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + charset = get_u16(frm); + printf("CharsetID: 0x%04x (%s)\n", charset, charset2str(charset)); + + p_indent(level, frm); + + namelen = get_u8(frm); + printf("Length: 0x%02x (%u)\n", namelen, namelen); + + p_indent(level, frm); + + printf("String: "); + for (; namelen > 0; namelen--) { + uint8_t c = get_u8(frm); + printf("%1c", isprint(c) ? c : '.'); + } + + return; + +response: + status = get_u8(frm); + printf("Status: 0x%02x (%s)\n", status, error2str(status)); + + if (len == 1) + return; + + p_indent(level, frm); + + uidcounter = get_u16(frm); + printf("UIDCounter: 0x%04x (%u)\n", uidcounter, uidcounter); + + p_indent(level, frm); + + items = get_u32(frm); + printf("Number of Items: 0x%04x (%u)", items, items); +} + +static void avrcp_general_reject_dump(int level, struct frame *frm, + uint8_t hdr, uint16_t len) +{ + uint8_t status; + + p_indent(level, frm); + + if (hdr & 0x02) + goto response; + + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + +response: + status = get_u8(frm); + printf("Status: 0x%02x (%s)\n", status, error2str(status)); +} + +static void avrcp_browsing_dump(int level, struct frame *frm, uint8_t hdr) +{ + uint8_t pduid; + uint16_t len; + + pduid = get_u8(frm); + len = get_u16(frm); + + printf("AVRCP: %s: len 0x%04x\n", pdu2str(pduid), len); + + if (len != frm->len) { + p_indent(level, frm); + printf("PDU Malformed\n"); + raw_dump(level, frm); + return; + } + + switch (pduid) { + case AVRCP_SET_BROWSED_PLAYER: + avrcp_set_browsed_player_dump(level + 1, frm, hdr, len); + break; + case AVRCP_GET_FOLDER_ITEMS: + avrcp_get_folder_items_dump(level + 1, frm, hdr, len); + break; + case AVRCP_CHANGE_PATH: + avrcp_change_path_dump(level + 1, frm, hdr, len); + break; + case AVRCP_GET_ITEM_ATTRIBUTES: + avrcp_get_item_attributes_dump(level + 1, frm, hdr, len); + break; + case AVRCP_SEARCH: + avrcp_search_dump(level + 1, frm, hdr, len); + break; + case AVRCP_GENERAL_REJECT: + avrcp_general_reject_dump(level + 1, frm, hdr, len); + break; + default: + raw_dump(level, frm); + } +} + +static void avrcp_control_dump(int level, struct frame *frm) +{ + uint8_t ctype, address, subunit, opcode, company[3]; + int i; + ctype = get_u8(frm); address = get_u8(frm); opcode = get_u8(frm); @@ -1439,3 +2266,19 @@ raw_dump(level, frm); } } + +void avrcp_dump(int level, struct frame *frm, uint8_t hdr, uint16_t psm) +{ + p_indent(level, frm); + + switch (psm) { + case 0x17: + avrcp_control_dump(level, frm); + break; + case 0x1B: + avrcp_browsing_dump(level, frm, hdr); + break; + default: + raw_dump(level, frm); + } +} diff -Nru bluez-hcidump-2.4/parser/hci.c bluez-hcidump-2.5/parser/hci.c --- bluez-hcidump-2.4/parser/hci.c 2012-04-20 19:28:19.000000000 +0000 +++ bluez-hcidump-2.5/parser/hci.c 2012-11-30 08:29:41.000000000 +0000 @@ -36,6 +36,7 @@ #include "parser/parser.h" #include "lib/hci.h" #include "lib/hci_lib.h" +#include "lib/amp.h" static uint16_t manufacturer = DEFAULT_COMPID; @@ -337,7 +338,7 @@ "Write LE Host Supported", }; -#define CMD_INFO_NUM 9 +#define CMD_INFO_NUM 10 static char *cmd_info_str[CMD_INFO_NUM + 1] = { "Unknown", "Read Local Version Information", @@ -349,6 +350,7 @@ "Read Country Code", "Unknown", "Read BD ADDR", + "Read Data Block Size", }; #define CMD_STATUS_NUM 11 @@ -830,16 +832,19 @@ { void *ptr = frm->ptr; uint32_t len = frm->len; + uint8_t *data; uint8_t length; + data = frm->ptr; length = get_u8(frm); while (length > 0) { - ext_inquiry_data_dump(level, frm, frm->ptr); + ext_inquiry_data_dump(level, frm, data); frm->ptr += length; frm->len -= length; + data = frm->ptr; length = get_u8(frm); } @@ -1124,7 +1129,7 @@ int i; p_indent(level, frm); - printf("handle %d key length %d key type %d\n", + printf("phy handle 0x%2.2x key length %d key type %d\n", cp->handle, cp->key_length, cp->key_type); p_indent(level, frm); printf("key "); @@ -1139,7 +1144,7 @@ int i; p_indent(level, frm); - printf("handle %d\n", cp->handle); + printf("phy handle 0x%2.2x\n", cp->handle); p_indent(level, frm); printf("tx_flow "); @@ -1573,6 +1578,17 @@ p_indent(level, frm); p_ba2str(&cp->peer_bdaddr, addr); printf("bdaddr %s type %d\n", addr, cp->peer_bdaddr_type); + p_indent(level, frm); + printf("interval %u window %u initiator_filter %u\n", + btohs(cp->interval), btohs(cp->window), cp->initiator_filter); + p_indent(level, frm); + printf("own_bdaddr_type %u min_interval %u max_interval %u\n", + cp->own_bdaddr_type, btohs(cp->min_interval), + btohs(cp->max_interval)); + p_indent(level, frm); + printf("latency %u supervision_to %u min_ce %u max_ce %u\n", + btohs(cp->latency), btohs(cp->supervision_timeout), + btohs(cp->min_ce_length), btohs(cp->max_ce_length)); } static inline void le_set_event_mask_dump(int level, struct frame *frm) @@ -1656,6 +1672,18 @@ (cp->filter_dup == 0x00 ? "disabled" : "enabled")); } +static inline void write_remote_amp_assoc_cmd_dump(int level, + struct frame *frm) +{ + write_remote_amp_assoc_cp *cp = frm->ptr; + + p_indent(level, frm); + printf("handle 0x%2.2x len_so_far %d remaining_len %d\n", cp->handle, + cp->length_so_far, cp->remaining_length); + + amp_assoc_dump(level + 1, cp->fragment, frm->len - 5); +} + static inline void command_dump(int level, struct frame *frm) { hci_command_hdr *hdr = frm->ptr; @@ -1933,6 +1961,9 @@ case OCF_READ_CLOCK: request_clock_dump(level + 1, frm); return; + case OCF_WRITE_REMOTE_AMP_ASSOC: + write_remote_amp_assoc_cmd_dump(level + 1, frm); + return; } break; @@ -2022,6 +2053,24 @@ raw_dump(level, frm); } +static inline void read_data_block_size_dump(int level, struct frame *frm) +{ + read_data_block_size_rp *rp = frm->ptr; + + p_indent(level, frm); + printf("status 0x%2.2x\n", rp->status); + + if (rp->status > 0) { + p_indent(level, frm); + printf("Error: %s\n", status2str(rp->status)); + } else { + p_indent(level, frm); + printf("Max ACL %d Block len %d Num blocks %d\n", + btohs(rp->max_acl_len), btohs(rp->data_block_len), + btohs(rp->num_blocks)); + } +} + static inline void generic_response_dump(int level, struct frame *frm) { uint8_t status = get_u8(frm); @@ -2599,25 +2648,15 @@ { read_local_amp_assoc_rp *rp = frm->ptr; uint16_t len = btohs(rp->length); - int i; p_indent(level, frm); - printf("status 0x%2.2x handle 0x%2.2x length %d\n", + printf("status 0x%2.2x handle 0x%2.2x remaining len %d\n", rp->status, rp->handle, len); if (rp->status > 0) { p_indent(level, frm); printf("Error: %s\n", status2str(rp->status)); } else { - p_indent(level, frm); - printf("assoc data"); - for (i = 0; i < len; i++) { - if (!(i % 16)) { - printf("\n"); - p_indent(level, frm); - } - printf("%2.2x ", rp->fragment[i]); - } - printf("\n"); + amp_assoc_dump(level + 1, rp->fragment, len); } } @@ -2877,6 +2916,9 @@ case OCF_READ_BD_ADDR: bdaddr_response_dump(level, frm); return; + case OCF_READ_DATA_BLOCK_SIZE: + read_data_block_size_dump(level, frm); + return; } break; @@ -3308,7 +3350,7 @@ evt_flow_spec_complete *evt = frm->ptr; p_indent(level, frm); - printf("status 0x%2.2x handle %d flags %d %s\n", + printf("status 0x%2.2x handle 0x%4.4x flags %d %s\n", evt->status, btohs(evt->handle), evt->flags, evt->direction == 0 ? "outgoing" : "incoming"); @@ -3641,7 +3683,7 @@ evt_physical_link_complete *evt = frm->ptr; p_indent(level, frm); - printf("status 0x%2.2x handle %d\n", evt->status, evt->handle); + printf("status 0x%2.2x phy handle 0x%2.2x\n", evt->status, evt->handle); if (evt->status > 0) { p_indent(level, frm); @@ -3654,7 +3696,7 @@ evt_disconn_physical_link_complete *evt = frm->ptr; p_indent(level, frm); - printf("status 0x%2.2x handle %d reason 0x%2.2x\n", + printf("status 0x%2.2x handle 0x%2.2x reason 0x%2.2x\n", evt->status, evt->handle, evt->reason); if (evt->status > 0) { @@ -3671,7 +3713,7 @@ evt_physical_link_loss_warning *evt = frm->ptr; p_indent(level, frm); - printf("handle %d reason 0x%2.2x\n", evt->handle, evt->reason); + printf("phy handle 0x%2.2x reason 0x%2.2x\n", evt->handle, evt->reason); } static inline void phys_link_handle_dump(int level, struct frame *frm) @@ -3679,7 +3721,7 @@ evt_physical_link_recovery *evt = frm->ptr; p_indent(level, frm); - printf("handle %d\n", evt->handle); + printf("phy handle 0x%2.2x\n", evt->handle); } static inline void logical_link_complete_dump(int level, struct frame *frm) @@ -3687,7 +3729,8 @@ evt_logical_link_complete *evt = frm->ptr; p_indent(level, frm); - printf("status 0x%2.2x log_handle %d handle %d tx_flow_id %d\n", + printf("status 0x%2.2x log handle 0x%4.4x phy handle 0x%2.2x" + " tx_flow_id %d\n", evt->status, btohs(evt->log_handle), evt->handle, evt->tx_flow_id); @@ -3702,7 +3745,8 @@ evt_flow_spec_modify_complete *evt = frm->ptr; p_indent(level, frm); - printf("status 0x%2.2x handle %d\n", evt->status, btohs(evt->handle)); + printf("status 0x%2.2x handle 0x%4.4x\n", + evt->status, btohs(evt->handle)); if (evt->status > 0) { p_indent(level, frm); @@ -3710,6 +3754,25 @@ } } +static inline void num_completed_blocks_dump(int level, struct frame *frm) +{ + evt_num_completed_blocks *evt = frm->ptr; + int i; + + p_indent(level, frm); + printf("Total num blocks %d Num handles %d\n", + btohs(evt->total_num_blocks), evt->num_handles); + + for (i = 0; i < evt->num_handles; i++) { + cmplt_handle *h = &evt->handles[i]; + + p_indent(level + 1, frm); + printf("Handle 0x%4.4x: Num complt pkts %d Num complt blks %d\n", + btohs(h->handle), btohs(h->num_cmplt_pkts), + btohs(h->num_cmplt_blks)); + } +} + static inline void event_dump(int level, struct frame *frm) { hci_event_hdr *hdr = frm->ptr; @@ -3936,6 +3999,9 @@ case EVT_FLOW_SPEC_MODIFY_COMPLETE: flow_spec_modify_dump(level + 1, frm); break; + case EVT_NUMBER_COMPLETED_BLOCKS: + num_completed_blocks_dump(level + 1, frm); + break; default: raw_dump(level, frm); break; diff -Nru bluez-hcidump-2.4/parser/l2cap.c bluez-hcidump-2.5/parser/l2cap.c --- bluez-hcidump-2.4/parser/l2cap.c 2012-04-20 19:28:19.000000000 +0000 +++ bluez-hcidump-2.5/parser/l2cap.c 2012-11-30 08:29:41.000000000 +0000 @@ -38,6 +38,7 @@ #include "lib/hci.h" #include "lib/l2cap.h" #include "lib/a2mp.h" +#include "lib/amp.h" typedef struct { uint16_t handle; @@ -971,7 +972,8 @@ if (p_filter(FILT_L2CAP)) return; - printf("Create req: psm %d scid 0x%4.4x id %d\n", psm, scid, h->id); + printf("Create chan req: psm 0x%4.4x scid 0x%4.4x ctrl id %d\n", + psm, scid, h->id); } static inline void create_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm) @@ -985,7 +987,8 @@ if (p_filter(FILT_L2CAP)) return; - printf("Create rsp: dcid 0x%4.4x scid 0x%4.4x result %d status %d\n", dcid, scid, result, status); + printf("Create chan rsp: dcid 0x%4.4x scid 0x%4.4x result %d status %d\n", + dcid, scid, result, status); } static inline void move_req(int level, l2cap_cmd_hdr *cmd, struct frame *frm) @@ -996,7 +999,7 @@ if (p_filter(FILT_L2CAP)) return; - printf("Move req: icid 0x%4.4x id %d\n", icid, h->id); + printf("Move chan req: icid 0x%4.4x ctrl id %d\n", icid, h->id); } static inline void move_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm) @@ -1008,7 +1011,7 @@ if (p_filter(FILT_L2CAP)) return; - printf("Move rsp: icid 0x%4.4x result %d\n", icid, result); + printf("Move chan rsp: icid 0x%4.4x result %d\n", icid, result); } static inline void move_cfm(int level, l2cap_cmd_hdr *cmd, struct frame *frm) @@ -1020,7 +1023,7 @@ if (p_filter(FILT_L2CAP)) return; - printf("Move cfm: icid 0x%4.4x result %d\n", icid, result); + printf("Move chan cfm: icid 0x%4.4x result %d\n", icid, result); } static inline void move_cfm_rsp(int level, l2cap_cmd_hdr *cmd, struct frame *frm) @@ -1031,7 +1034,7 @@ if (p_filter(FILT_L2CAP)) return; - printf("Move cfm rsp: icid 0x%4.4x\n", icid); + printf("Move chan cfm rsp: icid 0x%4.4x\n", icid); } static inline void a2mp_command_rej(int level, struct frame *frm) @@ -1162,29 +1165,13 @@ printf("Get AMP Assoc req: id %d\n", h->id); } -static inline void a2mp_assoc_dump(int level, uint8_t *assoc, uint16_t len) -{ - int i; - - p_indent(level, 0); - printf("Assoc data:"); - for (i = 0; i < len; i++) { - if (!(i%16)) { - printf("\n"); - p_indent(level+1, 0); - } - printf("%2.2x ",*assoc++); - } - printf("\n"); -} - static inline void a2mp_assoc_rsp(int level, struct frame *frm, uint16_t len) { struct a2mp_assoc_rsp *h = frm->ptr; - printf("Get AMP Assoc rsp: id %d status (%d) %s \n", - h->id, h->status, a2mpstatus2str(h->status)); - a2mp_assoc_dump(level + 1, (uint8_t *) &h->assoc_data, len - 2); + printf("Get AMP Assoc rsp: id %d status (%d) %s\n", + h->id, h->status, a2mpstatus2str(h->status)); + amp_assoc_dump(level + 1, h->assoc_data, len - sizeof(*h)); } static inline void a2mp_create_req(int level, struct frame *frm, uint16_t len) @@ -1193,7 +1180,7 @@ printf("Create Physical Link req: local id %d remote id %d\n", h->local_id, h->remote_id); - a2mp_assoc_dump(level + 1, (uint8_t *) &h->assoc_data, len - 2); + amp_assoc_dump(level + 1, h->assoc_data, len - sizeof(*h)); } static inline void a2mp_create_rsp(int level, struct frame *frm) @@ -1502,8 +1489,9 @@ break; case 0x17: + case 0x1B: if (!p_filter(FILT_AVCTP)) - avctp_dump(level, frm); + avctp_dump(level, frm, psm); else raw_dump(level + 1, frm); break; diff -Nru bluez-hcidump-2.4/parser/parser.h bluez-hcidump-2.5/parser/parser.h --- bluez-hcidump-2.4/parser/parser.h 2012-04-20 19:28:19.000000000 +0000 +++ bluez-hcidump-2.5/parser/parser.h 2012-11-30 08:29:41.000000000 +0000 @@ -233,8 +233,8 @@ void hidp_dump(int level, struct frame *frm); void hcrp_dump(int level, struct frame *frm); void avdtp_dump(int level, struct frame *frm); -void avctp_dump(int level, struct frame *frm); -void avrcp_dump(int level, struct frame *frm); +void avctp_dump(int level, struct frame *frm, uint16_t psm); +void avrcp_dump(int level, struct frame *frm, uint8_t hdr, uint16_t psm); void att_dump(int level, struct frame *frm); void smp_dump(int level, struct frame *frm); void sap_dump(int level, struct frame *frm); diff -Nru bluez-hcidump-2.4/src/hcidump.c bluez-hcidump-2.5/src/hcidump.c --- bluez-hcidump-2.4/src/hcidump.c 2012-04-20 19:28:19.000000000 +0000 +++ bluez-hcidump-2.5/src/hcidump.c 2012-11-30 08:29:41.000000000 +0000 @@ -341,7 +341,6 @@ struct btsnoop_pkt dp; struct pktlog_hdr ph; struct frame frm; - uint8_t pkt_type; int err; frm.data = malloc(HCI_MAX_FRAME_SIZE); @@ -389,6 +388,9 @@ frm.data_len = ntohl(ph.len) - 8; err = read_n(fd, frm.data + 1, frm.data_len - 1); } else if (parser.flags & DUMP_BTSNOOP) { + uint32_t opcode; + uint8_t pkt_type; + switch (btsnoop_type) { case 1001: if (ntohl(dp.flags) & 0x02) { @@ -409,6 +411,44 @@ frm.data_len = ntohl(dp.len); err = read_n(fd, frm.data, frm.data_len); break; + + case 2001: + opcode = ntohl(dp.flags) & 0xffff; + + switch (opcode) { + case 2: + pkt_type = HCI_COMMAND_PKT; + frm.in = 0; + break; + case 3: + pkt_type = HCI_EVENT_PKT; + frm.in = 1; + break; + case 4: + pkt_type = HCI_ACLDATA_PKT; + frm.in = 0; + break; + case 5: + pkt_type = HCI_ACLDATA_PKT; + frm.in = 1; + break; + case 6: + pkt_type = HCI_SCODATA_PKT; + frm.in = 0; + break; + case 7: + pkt_type = HCI_SCODATA_PKT; + frm.in = 1; + break; + default: + pkt_type = 0xff; + break; + } + + ((uint8_t *) frm.data)[0] = pkt_type; + + frm.data_len = ntohl(dp.len) + 1; + err = read_n(fd, frm.data + 1, frm.data_len - 1); } } else { frm.data_len = btohs(dh.len); @@ -486,7 +526,8 @@ exit(1); } - if (btsnoop_type != 1001 && btsnoop_type != 1002) { + if (btsnoop_type != 1001 && btsnoop_type != 1002 && + btsnoop_type != 2001) { fprintf(stderr, "Unsupported BTSnoop datalink type\n"); exit(1); }