diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..59a55097 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,238 @@ +ubertooth (2020-12-R1) unstable; urgency=low + * Bluetooth classic sniffing and link layer support (see btbr) + * Upgraded to Python 3 + * Christmas lights! + * Bugfix: ubertooth-btle will no longer freeze in high traffic environments + * Bugfix: time discontinuities in PCAP files + * Bugfix: BLE faux slave can now transmit more than 32 bytes + * USB API version bumped to 1.07 + + -- Mike Ryan 25 Dec 2020 13:30:00 -0800 + +ubertooth (2018.12.R1-5) unstable; urgency=medium + + * Fix build with GCC-10 by removing unused extra definition of variable + (Closes: #957891) + + -- Ruben Undheim Tue, 13 Oct 2020 10:30:08 +0200 + +ubertooth (2018.12.R1-4) unstable; urgency=medium + + * Bring pack ubertooth-specan-ui in package by running it in Python3 instead + of Python2 (Closes: #954976) + + -- Ruben Undheim Thu, 26 Mar 2020 11:49:06 +0100 + +ubertooth (2018.12.R1-3) unstable; urgency=medium + + * Drop Python 2 dependency (Closes: #938738) ubertooth-specan-ui removed from + package until it has been ported. + * debian/control: + - New standards version 4.4.1 - no changes + - Debhelper compat level 12 + - Depend on specific newer version of libbtbb + * debian/compat: deleted file + + -- Ruben Undheim Mon, 23 Dec 2019 09:22:35 +0100 + +ubertooth (2018.12.R1-2) unstable; urgency=medium + + * debian/control: + - Fix dependencies ("Recommends") for ubertooth-specan-ui (Closes: #919388) + Replaced: python-pyside.qtcore and python-pyside.qtgui with + python-pyside2.qtgui, python-pyside2.qtwidgets and python-pyside2.qtcore. + (upstream has migrated the code to work with PySide2) + - New standards version 4.3.0 - no changes + + -- Ruben Undheim Sat, 19 Jan 2019 08:56:02 +0100 + +ubertooth (2018.12.R1-1) unstable; urgency=medium + + * New upstream release + * debian/control: + - Move Vcs from github to salsa + * debian/libubertooth1.symbols: + - Added new symbol in symbols file + * debian/gitlab-ci.yml: + - Enable CI on salsa.debian.org + + -- Ruben Undheim Thu, 20 Dec 2018 10:36:18 +0100 + +ubertooth (2018.08.R1-4) unstable; urgency=medium + + [ Helmut Grohne ] + * Fix FTCBFS: Annotate python-all with :any. (Closes: #912757) + + -- Ruben Undheim Tue, 27 Nov 2018 22:33:34 +0100 + +ubertooth (2018.08.R1-3) unstable; urgency=medium + + [ Helmut Grohne ] + * Demote Build-Depends: python-all-dev to python-all. (Closes: #909553) + + [ Ruben Undheim ] + * debian/control: + - New standards version 4.2.1 - no changes + + -- Ruben Undheim Tue, 25 Sep 2018 10:40:00 +0200 + +ubertooth (2018.08.R1-2) unstable; urgency=medium + + * Move python-pyside.qtcore and python-pyside.qtgui from Depends to + Recommends since core functionality is not broken when they are not + present. + + -- Ruben Undheim Fri, 10 Aug 2018 13:32:26 +0200 + +ubertooth (2018.08.R1-1) unstable; urgency=medium + + * New upstream release + - Refreshed patches + * Simplify handling of revision patch so that it does not need + to be updated for every new upstream release. + * debian/source/lintian-overrides deleted since it is not needed anymore + * debian/compat: level 11 + * debian/control: + - debhelper >= 11 + - New standards version 4.2.0 - no changes + * debain/rules: + - Pass --no-parallel to dh_auto_build for firmware since it does not build + reliably with multiple threads. + + -- Ruben Undheim Fri, 10 Aug 2018 12:24:01 +0200 + +ubertooth (2018.06.R1-2) unstable; urgency=medium + + * debian/upstream/metadata added + * debian/patches/04_no_git_for_debian.patch: + - Fix setting GIT_REVISION in patch + + -- Ruben Undheim Thu, 09 Aug 2018 10:48:40 +0200 + +ubertooth (2018.06.R1-1) unstable; urgency=medium + + * New upstream release + * Refreshed patches. Using gbp-pq + * debian/control: + - Depend on newer version of libbtbb: 2018.06.R1 + * debian/com.greatscottgadgets.ubertooth.metainfo.xml + - Fix formatting of vendor and product IDs + * debian/copyright: + - Copyright information for some new files + - Use https protocol in Format field + * debian/libubertooth1.symbols: + - Two new symbols + * debian/rules: + - Replace dpkg-parsechangelog with include /usr/share/dpkg/pkg-info.mk + * debian/source/lintian-overrides: + - ignore lintian for patch file which is used in debian/rules + * debian/ubertooth-firmware.lintian-overrides: + - ignore lintian for package name "-firmware", since it is firmware + for external USB device, and not for the Linux kernel. + + -- Ruben Undheim Fri, 13 Jul 2018 20:06:07 +0200 + +ubertooth (2017.03.R2-3) unstable; urgency=medium + + [ Helmut Grohne ] + * Demote firmware dependencies to Build-Depends-Indep. (Closes: #893906) + + [ Ruben Undheim + * debian/control: + - Remove 'Testsuite: autopkgtest' since it is handled automatically now + - New standards version 4.1.5 - no changes + * Added debian/com.greatscottgadgets.ubertooth.metainfo.xml to announce + the hardware via AppStream + + -- Ruben Undheim Wed, 11 Jul 2018 22:26:41 +0200 + +ubertooth (2017.03.R2-2) unstable; urgency=low + + * debian/control: + - Add "Multi-Arch: foreign" to ubertooth-firmware + * debian/tests/buildfirmware: + - Pipe stderr to stdout for "make" invocation to prevent the CI test + from failing due to some build warnings. + * debian/tests/control: + - Explicitly include all test dependencies + + -- Ruben Undheim Sun, 16 Jul 2017 18:40:08 +0000 + +ubertooth (2017.03.R2-1) unstable; urgency=low + + * Upload to unstable + * debian/control: + - New standards version 4.0.0 - no changes + + -- Ruben Undheim Thu, 13 Jul 2017 23:03:25 +0200 + +ubertooth (2017.03.R2-1~exp2) experimental; urgency=low + + * debian/control: + - Updated long description for binary package ubertooth + * debian/tests/*: + - Added autopkgtest for building firmware from ubertooth-firmware-source. + + -- Ruben Undheim Sat, 01 Apr 2017 07:07:10 +0000 + +ubertooth (2017.03.R2-1~exp1) experimental; urgency=medium + + * New upstream version (Closes: #852141) + * libubertooth0 -> libubertooth1 + * debian/libubertooth1.symbols: + - Added new symbols and removed some symbols + * debian/ubertooth.manpages: Use new upstream man pages instead + * debian/control: + - New standards version: 3.9.8 + - Removed -dbg package (now handled automatically) + - Set versioned build-dependency on libbtbb-dev + * debian/copyright: + - Updated copyright information + * debian/man/ubertooth-tx.txt: + - New dummy man page for ubertooth-tx not yet + included in package + * debian/patches/0006-Try-fixing-two-lintians.patch + - Some of the upstream man pages needed to be patch to not + cause lintians + * debian/patches/*: All other patches refreshed + * debian/rules: + - No need to explicitly override dh_strip anymore + - Skip installing ubertooth-tx, since it does not do anything yet. + + -- Ruben Undheim Tue, 14 Mar 2017 20:35:32 +0100 + +ubertooth (2015.09.R2-4) unstable; urgency=medium + + * debian/copyright: Updated copyright year for Debian packaging + * debian/rules: + - Use UTC for the timestamp to firmware build as well + - Use --mode= for tar command to make tarball reproducible + + -- Ruben Undheim Tue, 23 Feb 2016 17:41:54 +0100 + +ubertooth (2015.09.R2-3) unstable; urgency=medium + + * debian/rules: + - Fix order in tarball to make it reproducible + - Make COMPILE_BY and COMPILE_HOST also deterministic when building + bluetooth_rxtx.dfu + + -- Ruben Undheim Tue, 23 Feb 2016 00:13:13 +0100 + +ubertooth (2015.09.R2-2) unstable; urgency=medium + + * Set changelog date to UTC with LC_ALL=C to make man pages reproducible. + * Add --mtime to tar command to make tar-ball reproducible. + * Set TIMESTAMP to "", to make firmware reproducible + * New standards version (3.9.7). No needed updates. + * Run "cme fix dpkg-control": + - Changed Vcs-Git to use secure URL. + - Various other ordering changes for fields in d/control + + -- Ruben Undheim Fri, 19 Feb 2016 17:52:46 +0100 + +ubertooth (2015.09.R2-1) unstable; urgency=low + + * Initial release (Closes: #772509) + + -- Ruben Undheim Wed, 09 Sep 2015 20:21:57 +0200 diff --git a/debian/com.greatscottgadgets.ubertooth.metainfo.xml b/debian/com.greatscottgadgets.ubertooth.metainfo.xml new file mode 100644 index 00000000..c9939d61 --- /dev/null +++ b/debian/com.greatscottgadgets.ubertooth.metainfo.xml @@ -0,0 +1,20 @@ + + + com.greatscottgadgets.ubertooth + MIT + ubertooth + Software for the ubertooth device + +

+ Ubertooth is a USB 'dongle' for sniffing Bluetooth traffic. + This package contains everything needed to use the dongle. +

+
+ + usb:vFFFFp0004d* + usb:v1D50p6000d* + usb:v1D50p6001d* + usb:v1D50p6002d* + usb:v1D50p6003d* + +
diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..206baa0c --- /dev/null +++ b/debian/control @@ -0,0 +1,109 @@ +Source: ubertooth +Maintainer: Ruben Undheim +Section: science +Priority: optional +Build-Depends: debhelper-compat (= 12), + libusb-1.0-0-dev, + libpcap-dev, + cmake, + pkg-config, + libbluetooth-dev, + python3-all:any, + libbtbb-dev (>= 2018.12.R1), + txt2man +Build-Depends-Indep: gcc-arm-none-eabi, + libnewlib-arm-none-eabi, + libstdc++-arm-none-eabi-newlib +Standards-Version: 4.4.1 +Vcs-Browser: https://salsa.debian.org/rubund/ubertooth +Vcs-Git: https://salsa.debian.org/rubund/ubertooth.git +Homepage: http://ubertooth.sourceforge.net/ + +Package: libubertooth1 +Architecture: any +Multi-Arch: same +Section: libs +Depends: ${shlibs:Depends}, + ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: Shared library for Bluetooth experimentation + Project Ubertooth is an open source wireless development platform suitable for + Bluetooth experimentation. Ubertooth ships with a capable BLE (Bluetooth Smart) + sniffer and can sniff some data from Basic Rate (BR) Bluetooth Classic + connections. + . + This package provides the shared library needed by Ubertooth. + +Package: libubertooth-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Depends: libubertooth1 (= ${binary:Version}), + libusb-1.0-0-dev, + libpcap-dev, + libbluetooth-dev, + libbtbb-dev, + ${misc:Depends} +Description: Shared library for Bluetooth experimentation - development files + Project Ubertooth is an open source wireless development platform suitable for + Bluetooth experimentation. Ubertooth ships with a capable BLE (Bluetooth Smart) + sniffer and can sniff some data from Basic Rate (BR) Bluetooth Classic + connections. + . + This package provides the development files for using the ubertooth library. + +Package: ubertooth-firmware +Architecture: all +Multi-Arch: foreign +Depends: ${misc:Depends} +Recommends: ubertooth +Suggests: ubertooth-firmware-source +Description: Firmware for Ubertooth + The Ubertooth hardware needs some firmware to run. The firmware is built with + arm-none-eabi-gcc. This package contains a number of firmware images that + may be programmed into the Ubertooth hardware using the 'ubertooth-dfu' + command. + . + The firmware images are installed in /usr/share/ubertooth/firmware/ + +Package: ubertooth-firmware-source +Architecture: all +Depends: ${misc:Depends}, + ubertooth, + libubertooth-dev +Recommends: gcc-arm-none-eabi, + libnewlib-arm-none-eabi, + libstdc++-arm-none-eabi-newlib +Suggests: ubertooth-firmware +Description: Source code for the Ubertooth firmware + The Ubertooth hardware needs some firmware to run. The firmware is built with + arm-none-eabi-gcc. This package contains the source code for the firmware that + is found in the ubertooth-firmware package. + . + The firmware source may be found in /usr/src/ubertooth-firmware-source.tar.gz + after installing this package. + +Package: ubertooth +Architecture: any +Depends: libubertooth1 (= ${binary:Version}), + ${shlibs:Depends}, + ${misc:Depends}, + python3, + python3-numpy +Recommends: ubertooth-firmware, + python3-pyside2.qtgui, + python3-pyside2.qtwidgets, + python3-pyside2.qtcore +Suggests: ubertooth-firmware-source +Description: 2.4 GHz wireless development platform for Bluetooth experimentation + Project Ubertooth is an open source wireless development platform suitable for + Bluetooth experimentation. This package contains everything necessary to use + the hardware dongle. + . + Ubertooth is capable of sniffing BLE (Bluetooth Smart) connections and it also + has some ability to sniff some data from Basic Rate (BR) Bluetooth Classic + connections. + . + In addition to the Bluetooth specific capabilities, there is also a simple + spectrum analyzer for the 2.4 GHz band included (ubertooth-specan-ui) which + can be used to also observe other things in this frequency band. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..fb8ea0d1 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,274 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: ubertooth +Source: https://github.com/greatscottgadgets/ubertooth + +Files: * +Copyright: 2010-2015 Jared Boone + 2010-2017 Mike Ossmann, Dominic Spill + 2012-2015 Will Code, Christopher Kilgour + 2012-2018 Mike Ryan +License: GPL-2+ + +Files: firmware/common/lpcusb/target/usbhw_lpc.c + firmware/common/lpcusb/target/usbstruct.h + firmware/common/lpcusb/target/usbapi.h + firmware/common/lpcusb/target/usbcontrol.c + firmware/common/lpcusb/target/debug.h + firmware/common/lpcusb/target/usbstdreq.c + firmware/common/lpcusb/target/type.h + firmware/common/lpcusb/target/usbhw_lpc.h + firmware/common/lpcusb/target/usbinit.c + firmware/common/serial_fifo.c + firmware/common/serial_fifo.h +Copyright: 2006 Bertrik Sikken (bertrik@sikken.nl) +License: BSD-3-clause + +Files: firmware/bootloader/bootloader.cpp + firmware/assembly_test/assembly_test.c + firmware/bluetooth_rxtx/ubertooth_usb.h + firmware/common/usb_serial.h + firmware/common/usb_serial.c +Copyright: 2006 Bertrik Sikken (bertrik@sikken.nl) + 2010-2011 Michael Ossman +License: GPL-2+ and BSD-3-clause + +Files: firmware/bluetooth_rxtx/ubertooth_usb.c +Copyright: 2006 Bertrik Sikken (bertrik@sikken.nl) + 2010 Michael Ossman + 2013 Dominic Spill +License: GPL-2+ and BSD-3-clause + +Files: firmware/common/sections.ld +Copyright: 2007 CodeSourcery +License: CodeSourcery-license + +Files: firmware/common/LPC17xx_Interrupts.c +Copyright: 2010 Opendous Inc. (www.MicropendousX.org) +License: Opendous-License + +Files: firmware/tc13badge/Makefile + firmware/tc13badge/ivects.S + firmware/tc13badge/init.S +Copyright: 2010 DJ Delorie + 2011 Michael Ossmann +License: GPL-3+ + +Files: firmware/tc13badge/mkports +Copyright: 2010 DJ Delorie +License: GPL-3+ + +Files: firmware/bluetooth_rxtx/ubertooth_clock.c + firmware/bluetooth_rxtx/ubertooth_clock.h + firmware/bluetooth_rxtx/ubertooth_cs.c + firmware/bluetooth_rxtx/ubertooth_cs.h + firmware/bluetooth_rxtx/ubertooth_dma.c + firmware/bluetooth_rxtx/ubertooth_dma.h + firmware/bluetooth_rxtx/ubertooth_rssi.c + firmware/bluetooth_rxtx/ubertooth_rssi.h + host/libubertooth/src/ubertooth_callback.c + host/libubertooth/src/ubertooth_callback.h + host/libubertooth/src/ubertooth_fifo.c + host/libubertooth/src/ubertooth_fifo.h + host/ubertooth-tools/src/ubertooth-afh.c +Copyright: 2015 Hannes Ellinger +License: GPL-2+ + +Files: host/cmake/modules/FindUSB1.cmake +Copyright: 2006,2008 Laurent Montel +License: BSD-3-clause + +Files: host/cmake/modules/FindBLUETOOTH.cmake +Copyright: 2006,2008 Laurent Montel + 2013 Dominic Spill +License: BSD-3-clause + +Files: host/cmake/modules/GetGitRevisionDescription.cmake.in + host/cmake/modules/GetGitRevisionDescription.cmake +Copyright: 2009-2010 Iowa State University +License: Boost-1.0 + +Files: host/cmake/modules/FindPythonInterp.cmake +Copyright: 2005-2010 Kitware, Inc. + 2011 Bjoern Ricks + 2012 Rolf Eike Beer +License: BSD-3-clause + +Files: host/cmake/modules/FindPackageHandleStandardArgs.cmake +Copyright: 2007-2009 Kitware, Inc. +License: BSD-3-clause + +Files: host/kismet/plugin-ubertooth/ubertooth_ui.cc + host/kismet/plugin-ubertooth/packet_btbb.h + host/kismet/plugin-ubertooth/kismet_ubertooth.cc + host/kismet/plugin-ubertooth/packet_btbb.cc + host/kismet/plugin-ubertooth/packetsource_ubertooth.h + host/kismet/plugin-ubertooth/packetsource_ubertooth.cc + host/kismet/plugin-ubertooth/tracker_btbb.h + host/kismet/plugin-ubertooth-phyneutral/packet_btbb.h + host/kismet/plugin-ubertooth-phyneutral/kismet_ubertooth.cc + host/kismet/plugin-ubertooth-phyneutral/packet_btbb.cc + host/kismet/plugin-ubertooth-phyneutral/packetsource_ubertooth.h + host/kismet/plugin-ubertooth-phyneutral/packetsource_ubertooth.cc +Copyright: 2009,2010 Mike Kershaw + 2010,2011 Michael Ossmann +License: GPL-2+ + +Files: host/kismet/plugin-ubertooth-phyneutral/phy_btbb.h +Copyright: 2009-2011 Mike Kershaw + 2010,2011 Michael Ossmann +License: GPL-2+ + +Files: host/kismet/plugin-ubertooth-phyneutral/phy_btbb.cc +Copyright: 2009,2010 Mike Kershaw + 2010,2011 Michael Ossmann + 2012,2013 Dominic Spill +License: GPL-2+ + +Files: host/ubertooth-tools/getopt/getopt.c host/ubertooth-tools/getopt/getopt.h +Copyright: 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 Free Software Foundation, Inc. +License: LGPL-2.1+ + +Files: firmware/bluetooth_rxtx/tinyprintf.c + firmware/bluetooth_rxtx/tinyprintf.h +Copyright: 2004 Kustaa Nyholm +License: LGPL-2.1+ + +Files: debian/* +Copyright: 2014-2018 Ruben Undheim +License: GPL-2+ + + +License: GPL-2+ + This package 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, see . + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + + +License: GPL-3+ + This package 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 3 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, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + + +License: LGPL-2.1+ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + . + This library 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 + Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see + . + On Debian systems, the complete text of the GNU Lesser General + Public License version 2.1 can be found in + "/usr/share/common-licenses/LGPL-2.1". + + +License: BSD-3-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +License: CodeSourcery-license + The authors hereby grant permission to use, copy, modify, distribute, + and license this software and its documentation for any purpose, provided + that existing copyright notices are retained in all copies and that this + notice is included verbatim in any distributions. No written agreement, + license, or royalty fee is required for any of the authorized uses. + Modifications to this software may be copyrighted by their authors + and need not follow the licensing terms described here, provided that + the new terms are clearly indicated on the first page of each file where + they apply. + + +License: Opendous-License + Permission to use, copy, modify, and distribute this software + and its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + . + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. + + +License: Boost-1.0 + Permission is hereby granted, free of charge, to any person or organization + obtaining a copy of the software and accompanying documentation covered by + this license (the "Software") to use, reproduce, display, distribute, + execute, and transmit the Software, and to prepare derivative works of the + Software, and to permit third-parties to whom the Software is furnished to + do so, all subject to the following: + . + The copyright notices in the Software and this entire statement, including + the above license grant, this restriction and the following disclaimer, + must be included in all copies of the Software, in whole or in part, and + all derivative works of the Software, unless such copies or derivative + works are solely in the form of machine-executable object code generated by + a source language processor. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT + SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE + FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 00000000..cec628c7 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,2 @@ +[DEFAULT] +pristine-tar = True diff --git a/debian/gitlab-ci.yml b/debian/gitlab-ci.yml new file mode 100644 index 00000000..d9acd286 --- /dev/null +++ b/debian/gitlab-ci.yml @@ -0,0 +1,9 @@ +image: registry.salsa.debian.org/salsa-ci-team/ci-image-git-buildpackage:latest + +build: + artifacts: + paths: + - "*.deb" + expire_in: 1 day + script: + - gitlab-ci-git-buildpackage-all diff --git a/debian/libubertooth-dev.install b/debian/libubertooth-dev.install new file mode 100644 index 00000000..4dad9d39 --- /dev/null +++ b/debian/libubertooth-dev.install @@ -0,0 +1,3 @@ +usr/include/ubertooth/* +usr/lib/*/lib*.so +usr/lib/*/pkgconfig/* diff --git a/debian/libubertooth1.install b/debian/libubertooth1.install new file mode 100644 index 00000000..3ddde584 --- /dev/null +++ b/debian/libubertooth1.install @@ -0,0 +1 @@ +usr/lib/*/lib*.so.* diff --git a/debian/libubertooth1.symbols b/debian/libubertooth1.symbols new file mode 100644 index 00000000..992fd279 --- /dev/null +++ b/debian/libubertooth1.symbols @@ -0,0 +1,109 @@ +libubertooth.so.1 libubertooth1 #MINVER# + cb_btle@Base 2015.09.R2 + cb_ego@Base 2015.09.R2 + cleanup_devh@Base 2015.09.R2 + cmd_btle_promisc@Base 2015.09.R2 + cmd_btle_set_target@Base 2015.09.R2 + cmd_btle_slave@Base 2015.09.R2 + cmd_btle_sniffing@Base 2015.09.R2 + cmd_cancel_follow@Base 2018.06.R1 + cmd_clear_afh_map@Base 2015.09.R2 + cmd_do_something@Base 2015.09.R2 + cmd_do_something_reply@Base 2015.09.R2 + cmd_ego@Base 2015.09.R2 + cmd_flash@Base 2015.09.R2 + cmd_get_access_address@Base 2015.09.R2 + cmd_get_board_id@Base 2015.09.R2 + cmd_get_channel@Base 2015.09.R2 + cmd_get_clock@Base 2015.09.R2 + cmd_get_compile_info@Base 2015.09.R2 + cmd_get_crc_verify@Base 2015.09.R2 + cmd_get_modulation@Base 2015.09.R2 + cmd_get_palevel@Base 2015.09.R2 + cmd_get_partnum@Base 2015.09.R2 + cmd_get_rangeresult@Base 2015.09.R2 + cmd_get_rev_num@Base 2015.09.R2 + cmd_get_rxled@Base 2015.09.R2 + cmd_get_serial@Base 2015.09.R2 + cmd_get_squelch@Base 2015.09.R2 + cmd_get_txled@Base 2015.09.R2 + cmd_get_usrled@Base 2015.09.R2 + cmd_led_specan@Base 2015.09.R2 + cmd_ping@Base 2015.09.R2 + cmd_poll@Base 2015.09.R2 + cmd_range_test@Base 2015.09.R2 + cmd_read_register@Base 2015.09.R2 + cmd_repeater@Base 2015.09.R2 + cmd_reset@Base 2015.09.R2 + cmd_rx_syms@Base 2015.09.R2 + cmd_set_access_address@Base 2015.09.R2 + cmd_set_afh_map@Base 2015.09.R2 + cmd_set_bdaddr@Base 2015.09.R2 + cmd_set_channel@Base 2015.09.R2 + cmd_set_clock@Base 2015.09.R2 + cmd_set_crc_verify@Base 2015.09.R2 + cmd_set_hgm@Base 2015.09.R2 + cmd_set_isp@Base 2015.09.R2 + cmd_set_jam_mode@Base 2015.09.R2 + cmd_set_modulation@Base 2015.09.R2 + cmd_set_paen@Base 2015.09.R2 + cmd_set_palevel@Base 2015.09.R2 + cmd_set_rxled@Base 2015.09.R2 + cmd_set_squelch@Base 2015.09.R2 + cmd_set_txled@Base 2015.09.R2 + cmd_set_usrled@Base 2015.09.R2 + cmd_specan@Base 2015.09.R2 + cmd_start_hopping@Base 2015.09.R2 + cmd_stop@Base 2015.09.R2 + cmd_tx_test@Base 2015.09.R2 + dumpfile@Base 2015.09.R2 + infile@Base 2015.09.R2 + max_ac_errors@Base 2015.09.R2 + print_serial@Base 2015.09.R2 + print_version@Base 2015.09.R2 + register_cleanup_handler@Base 2015.09.R2 + rx_btle_file@Base 2015.09.R2 + rx_dump@Base 2015.09.R2 + show_libusb_error@Base 2015.09.R2 + stop_transfers@Base 2015.09.R2 + stream_rx_file@Base 2015.09.R2 + ubertooth_start@Base 2015.09.R2 + ubertooth_stop@Base 2015.09.R2 + cb_afh_initial@Base 2015.10.R1+20161126gitf85a6a2 + cb_afh_monitor@Base 2015.10.R1+20161126gitf85a6a2 + cb_afh_r@Base 2015.10.R1+20161126gitf85a6a2 + cb_rx@Base 2015.10.R1+20161126gitf85a6a2 + cb_scan@Base 2015.10.R1+20161126gitf85a6a2 + cmd_afh@Base 2015.10.R1+20161126gitf85a6a2 + cmd_fix_clock_drift@Base 2015.10.R1+20161126gitf85a6a2 + cmd_hop@Base 2015.10.R1+20161126gitf85a6a2 + cmd_le_set_adv_data@Base 2018.12.R1 + cmd_trim_clock@Base 2015.10.R1+20161126gitf85a6a2 + cmd_tx_syms@Base 2015.10.R1+20161126gitf85a6a2 + do_exit@Base 2015.10.R1+20161126gitf85a6a2 + fifo_empty@Base 2015.10.R1+20161126gitf85a6a2 + fifo_get_write_element@Base 2015.10.R1+20161126gitf85a6a2 + fifo_inc_write_ptr@Base 2015.10.R1+20161126gitf85a6a2 + fifo_init@Base 2015.10.R1+20161126gitf85a6a2 + fifo_pop@Base 2015.10.R1+20161126gitf85a6a2 + fifo_push@Base 2015.10.R1+20161126gitf85a6a2 + packet_counter_max@Base 2015.10.R1+20161126gitf85a6a2 + poll_thread@Base 2015.10.R1+20161126gitf85a6a2 + rx_afh@Base 2015.10.R1+20161126gitf85a6a2 + rx_afh_r@Base 2015.10.R1+20161126gitf85a6a2 + systime@Base 2015.10.R1+20161126gitf85a6a2 + timeout_dev@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_bulk_init@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_bulk_receive@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_bulk_thread_start@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_bulk_thread_stop@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_bulk_wait@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_check_api@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_cmd_async@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_cmd_sync@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_count@Base 2018.06.R1 + ubertooth_connect@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_get_api@Base 2017.03.R2 + ubertooth_init@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_set_timeout@Base 2015.10.R1+20161126gitf85a6a2 + ubertooth_unpack_symbols@Base 2015.10.R1+20161126gitf85a6a2 diff --git a/debian/man/genmanpages.sh b/debian/man/genmanpages.sh new file mode 100755 index 00000000..485008fa --- /dev/null +++ b/debian/man/genmanpages.sh @@ -0,0 +1,15 @@ +#!/bin/bash + + +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-RX -s 1 ubertooth-rx.txt > ubertooth-rx.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-BTLE -s 1 ubertooth-btle.txt > ubertooth-btle.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-DEBUG -s 1 ubertooth-debug.txt > ubertooth-debug.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-SPECAN-UI -s 1 ubertooth-specan-ui.txt > ubertooth-specan-ui.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-DFU -s 1 ubertooth-dfu.txt > ubertooth-dfu.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-SCAN -s 1 ubertooth-scan.txt > ubertooth-scan.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-FOLLOW -s 1 ubertooth-follow.txt > ubertooth-follow.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-DUMP -s 1 ubertooth-dump.txt > ubertooth-dump.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-UTIL -s 1 ubertooth-util.txt > ubertooth-util.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-EGO -s 1 ubertooth-ego.txt > ubertooth-ego.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-SPECAN -s 1 ubertooth-specan.txt > ubertooth-specan.1 +txt2man -d "${CHANGELOG_DATE}" -t UBERTOOTH-TX -s 1 ubertooth-tx.txt > ubertooth-tx.1 diff --git a/debian/man/ubertooth-btle.txt b/debian/man/ubertooth-btle.txt new file mode 100644 index 00000000..66c949ce --- /dev/null +++ b/debian/man/ubertooth-btle.txt @@ -0,0 +1,40 @@ +NAME + ubertooth-btle - passive Bluetooth Low Energy monitoring + +SYNOPSIS + ubertooth-btle [options] + + +OPTIONS + -h help + +Major modes: + -f follow connections + -p promiscuous: sniff active connections + -a[address] get/set access address (example: -a8e89bed6) + -s
faux slave mode, using MAC addr (example: -s22:44:66:88:aa:cc) + -t
set connection following target (example: -t22:44:66:88:aa:cc) + +Interference (use with -f or -p): + -i interfere with one connection and return to idle + -I interfere continuously + +Data source: + -U<0-7> set ubertooth device to use + +Misc: + -r capture packets to PCAPNG file + -q capture packets to PCAP file (DLT_BLUETOOTH_LE_LL_WITH_PHDR) + -c capture packets to PCAP file (DLT_PPI) + -d dump packets to binary file + -A advertising channel index (default 37) + -v[01] verify CRC mode, get status or enable/disable + -x allow n access address offenses (default 32) + + + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-debug.txt b/debian/man/ubertooth-debug.txt new file mode 100644 index 00000000..df31e5c7 --- /dev/null +++ b/debian/man/ubertooth-debug.txt @@ -0,0 +1,19 @@ +NAME + ubertooth-debug - command line utility for debugging Ubertooth Zero and Ubertooth One + +SYNOPSIS + ubertooth-debug [options] + + +OPTIONS + -h help + -r read the contents of a 16 bit CC2400 register + -r read the contents of a 16 bit CC2400 register(s) + -U<0-7> set ubertooth device to use + -v<0-2> verbosity (default=1) + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-dfu.txt b/debian/man/ubertooth-dfu.txt new file mode 100644 index 00000000..96d3ec56 --- /dev/null +++ b/debian/man/ubertooth-dfu.txt @@ -0,0 +1,24 @@ +NAME + ubertooth-dfu - Ubertooth firmware update tool + + +SYNOPSIS + ubertooth-dfu [options] + + + +OPTIONS + + -h Show help + -s add DFU suffix to binary firmware file + -u upload - read firmware from device + -d download - write DFU file to device + -r reset Ubertooth after other operations complete + -U <0-7> set ubertooth device to use + + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-dump.txt b/debian/man/ubertooth-dump.txt new file mode 100644 index 00000000..d014e496 --- /dev/null +++ b/debian/man/ubertooth-dump.txt @@ -0,0 +1,21 @@ +NAME + ubertooth-dump - output a continuous stream of received bits + +SYNOPSIS + ubertooth-dump [options] + + +OPTIONS + -h help + -b only dump received bitstream (GnuRadio style) + -c classic modulation + -l LE modulation + -U<0-7> set ubertooth device to use + -d filename + + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-ego.txt b/debian/man/ubertooth-ego.txt new file mode 100644 index 00000000..843d3a54 --- /dev/null +++ b/debian/man/ubertooth-ego.txt @@ -0,0 +1,24 @@ +NAME + ubertooth-ego - Yuneec E-GO skateboard sniffing + +SYNOPSIS + ubertooth-ego [options] + + +OPTIONS + + + -h show help + -c <2402-2480> set channel in MHz (for continuous RX) + +Modes: + -f follow connections + -r continuous rx on a single channel + -i interfere + + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-follow.txt b/debian/man/ubertooth-follow.txt new file mode 100644 index 00000000..8bc7d142 --- /dev/null +++ b/debian/man/ubertooth-follow.txt @@ -0,0 +1,26 @@ +NAME + ubertooth-follow - CLK discovery and follow for a particular UAP/LAP + +SYNOPSIS + ubertooth-follow [options] + + +OPTIONS + -h help + -l (in hexadecimal) + -u (in hexadecimal) + -U<0-7> set ubertooth device to use + -r capture packets to PCAPNG file + -q capture packets to PCAP file + -e max_ac_errors + -d filename + -a Enable AFH + -b Bluetooth device (hci0) + -w USB delay in 625us timeslots (default:5) + + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-rx.txt b/debian/man/ubertooth-rx.txt new file mode 100644 index 00000000..cab3709b --- /dev/null +++ b/debian/man/ubertooth-rx.txt @@ -0,0 +1,26 @@ +NAME + ubertooth-rx - passive Bluetooth discovery/decode + +SYNOPSIS + ubertooth-rx [options] + + +OPTIONS + -h help + -V print version information + -i filename + -l to decode (6 hex), otherwise sniff all LAPs + -u to decode (2 hex), otherwise try to calculate (requires LAP) + -U <0-7> set ubertooth device to use + -r capture packets to PCAPNG file + -q capture packets to PCAP file + -d dump packets to binary file + -e <0-4> max_ac_errors (default: 2, range: 0-4) + -s reset channel scanning + -t sniff timeout - 0 means no timeout [Default: 0] + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-scan.txt b/debian/man/ubertooth-scan.txt new file mode 100644 index 00000000..11e5fcac --- /dev/null +++ b/debian/man/ubertooth-scan.txt @@ -0,0 +1,21 @@ +NAME + ubertooth-scan - device scan and inquiry supported by Ubertooth + +SYNOPSIS + ubertooth-scan [options] + + +OPTIONS + -h help + -U<0-7> set ubertooth device to use + -s hci Scan - perform HCI scan + -t scan Time (seconds) - length of time to sniff packets. [Default: 20s] + -x eXtended scan - retrieve additional information about target devices + -b Bluetooth device (hci0) + + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-specan-ui.txt b/debian/man/ubertooth-specan-ui.txt new file mode 100644 index 00000000..4b5b562e --- /dev/null +++ b/debian/man/ubertooth-specan-ui.txt @@ -0,0 +1,21 @@ +NAME + ubertooth-specan-ui - spectrum analyzer for the 2.4 GHz ISM band + +SYNOPSIS + ubertooth-specan-ui + +DESCRIPTION + This shows a GUI window with a spectrum analyzer for the 2.4 GHz band. It is very useful to see at what frequencies + there are signals. + +OPTIONS + There are no command line options. + +SEE ALSO + ubertooth-specan(1) + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-specan.txt b/debian/man/ubertooth-specan.txt new file mode 100644 index 00000000..2930f22c --- /dev/null +++ b/debian/man/ubertooth-specan.txt @@ -0,0 +1,27 @@ +NAME + ubertooth-specan - output a continuous stream of signal strengths + +SYNOPSIS + ubertooth-specan [options] + + +OPTIONS + + -h this help + -v verbose (print debug information to stderr) + -g output suitable for feedgnuplot + -G output suitable for 3D feedgnuplot + -d output to file + -l lower frequency (default 2402) + -u upper frequency (default 2480) + -U<0-7> set ubertooth device to use + + +SEE ALSO + ubertooth-specan-ui(1) + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-tx.txt b/debian/man/ubertooth-tx.txt new file mode 100644 index 00000000..efa2119f --- /dev/null +++ b/debian/man/ubertooth-tx.txt @@ -0,0 +1,22 @@ +NAME + ubertooth-tx - transmit packets received by ubertooth-dump + +SYNOPSIS + ubertooth-tx [options] + +DESCRIPTION + This tool currently does nothing. It has not been completely implemented + TODO: Fix + + +OPTIONS + -h help + + + + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/man/ubertooth-util.txt b/debian/man/ubertooth-util.txt new file mode 100644 index 00000000..d25812ec --- /dev/null +++ b/debian/man/ubertooth-util.txt @@ -0,0 +1,37 @@ +NAME + ubertooth-util - command line utility for Ubertooth Zero and Ubertooth One + +SYNOPSIS + ubertooth-util [options] + + +OPTIONS + -a[0-7] get/set power amplifier level + -b get hardware board id number + -c[2400-2483] get/set channel in MHz + -C[0-78] get/set channel + -d[0-1] get/set all LEDs + -e start repeater mode + -f activate flash programming (DFU) mode + -h display help message + -i activate In-System Programming (ISP) mode + -I identify ubertooth device by flashing all LEDs + -l[0-1] get/set USR LED + -m display range test result + -n initiate range test + -p get microcontroller Part ID + -q[1-225 (RSSI threshold)] start LED spectrum analyzer + -r full reset + -s get microcontroller serial number + -S stop current operation + -t intitiate continuous transmit test + -U<0-7> set ubertooth device to use + -v get firmware revision number + -V get compile info + -z set squelch level + +AUTHOR + This manual page was written by Ruben Undheim for the Debian project (and may be used by others). + + + diff --git a/debian/patches/0006-Try-fixing-two-lintians.patch b/debian/patches/0006-Try-fixing-two-lintians.patch new file mode 100644 index 00000000..111a4575 --- /dev/null +++ b/debian/patches/0006-Try-fixing-two-lintians.patch @@ -0,0 +1,177 @@ +From: Ruben Undheim +Date: Tue, 14 Mar 2017 19:41:53 +0000 +Subject: Try fixing two lintians + +--- + host/doc/man/ubertooth-afh.1 | 4 +--- + host/doc/man/ubertooth-btle.1 | 5 ++--- + host/doc/man/ubertooth-debug.1 | 4 +--- + host/doc/man/ubertooth-dfu.1 | 4 +--- + host/doc/man/ubertooth-dump.1 | 4 +--- + host/doc/man/ubertooth-ego.1 | 4 +--- + host/doc/man/ubertooth-rx.1 | 4 +--- + host/doc/man/ubertooth-scan.1 | 4 +--- + host/doc/man/ubertooth-specan.1 | 4 +--- + host/doc/man/ubertooth-util.1 | 4 +--- + host/doc/man/ubertooth.7 | 4 +--- + 11 files changed, 12 insertions(+), 33 deletions(-) + +diff --git a/host/doc/man/ubertooth-afh.1 b/host/doc/man/ubertooth-afh.1 +index b90fed6..a2cdec9 100644 +--- a/host/doc/man/ubertooth-afh.1 ++++ b/host/doc/man/ubertooth-afh.1 +@@ -1,8 +1,6 @@ + .TH UBERTOOTH\-AFH 1 "March 2017" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-.BR ubertooth-afh (1) +-\- passive detection of AFH channel map ++ubertooth-afh \- passive detection of AFH channel map + .SH SYNOPSIS + .PP + .RS +diff --git a/host/doc/man/ubertooth-btle.1 b/host/doc/man/ubertooth-btle.1 +index 110bd00..bd22f01 100644 +--- a/host/doc/man/ubertooth-btle.1 ++++ b/host/doc/man/ubertooth-btle.1 +@@ -1,7 +1,6 @@ + .TH UBERTOOTH\-BTLE 1 "July 2018" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-ubertooth\-btle \-\- Bluetooth Low Energy (BLE) sniffing and more ++ubertooth-btle \- Bluetooth Low Energy (BLE) sniffing and more + .SH SYNOPSIS + .PP + .RS +@@ -235,4 +234,4 @@ Refer to \fB\fCcrackle\fR documentation for further details. + .SH COPYRIGHT + .PP + \fB\fCubertooth\-btle\fR is Copyright (C) 2012\-2018 Mike Ryan. This tool is +-released under the GPLv2. Refer to COPYING for futher details. ++released under the GPLv2. Refer to COPYING for further details. +diff --git a/host/doc/man/ubertooth-debug.1 b/host/doc/man/ubertooth-debug.1 +index 391080e..856cb73 100644 +--- a/host/doc/man/ubertooth-debug.1 ++++ b/host/doc/man/ubertooth-debug.1 +@@ -1,8 +1,6 @@ + .TH ubertooth\-debug 1 "March 2017" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-ubertooth\-debug(1) \- Classic Bluetooth discovery, sniffing, and decoding +- ++ubertooth-debug \- Classic Bluetooth discovery, sniffing, and decoding + .SH SYNOPSIS + .PP + .RS +diff --git a/host/doc/man/ubertooth-dfu.1 b/host/doc/man/ubertooth-dfu.1 +index 2f72a53..5324d78 100644 +--- a/host/doc/man/ubertooth-dfu.1 ++++ b/host/doc/man/ubertooth-dfu.1 +@@ -1,8 +1,6 @@ + .TH UBERTOOTH\-DFU 1 "March 2017" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-.BR ubertooth-dfu (1) +-\- Device firmware update for Ubertooth ++ubertooth-dfu \- Device firmware update for Ubertooth + .SH SYNOPSIS + .PP + To update firmware, run: +diff --git a/host/doc/man/ubertooth-dump.1 b/host/doc/man/ubertooth-dump.1 +index 0d76152..ddf27e6 100644 +--- a/host/doc/man/ubertooth-dump.1 ++++ b/host/doc/man/ubertooth-dump.1 +@@ -1,8 +1,6 @@ + .TH UBERTOOTH\-DUMP 1 "March 2017" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-.BR ubertooth-dump (1) +-\- output a continuous stream of received bits ++ubertooth-dump \- output a continuous stream of received bits + .SH SYNOPSIS + .PP + .RS +diff --git a/host/doc/man/ubertooth-ego.1 b/host/doc/man/ubertooth-ego.1 +index e6a2c82..d9e0212 100644 +--- a/host/doc/man/ubertooth-ego.1 ++++ b/host/doc/man/ubertooth-ego.1 +@@ -1,8 +1,6 @@ + .TH UBERTOOTH\-EGO 1 "March 2017" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-.BR ubertooth-ego (1) +-\- Yuneec E\-Go sniffing ++ubertooth-ego \- Yuneec E-Go sniffing + .SH SYNOPSIS + .PP + .RS +diff --git a/host/doc/man/ubertooth-rx.1 b/host/doc/man/ubertooth-rx.1 +index e95515e..54ed6c8 100644 +--- a/host/doc/man/ubertooth-rx.1 ++++ b/host/doc/man/ubertooth-rx.1 +@@ -1,8 +1,6 @@ + .TH UBERTOOTH\-RX 1 "March 2017" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-ubertooth\-rx(1) \- Classic Bluetooth discovery, sniffing, and decoding +- ++ubertooth-rx \- Classic Bluetooth discovery, sniffing, and decoding + .SH SYNOPSIS + .PP + .RS +diff --git a/host/doc/man/ubertooth-scan.1 b/host/doc/man/ubertooth-scan.1 +index 0235689..67e2e6e 100644 +--- a/host/doc/man/ubertooth-scan.1 ++++ b/host/doc/man/ubertooth-scan.1 +@@ -1,8 +1,6 @@ + .TH UBERTOOTH\-SCAN 1 "March 2017" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-.BR ubertooth-scan (1) +-\- ++ubertooth-scan \- Scan frequency band + .BR active (Bluez) + device scan and inquiry supported by Ubertooth + .SH SYNOPSIS +diff --git a/host/doc/man/ubertooth-specan.1 b/host/doc/man/ubertooth-specan.1 +index edbf0fa..b9b6a08 100644 +--- a/host/doc/man/ubertooth-specan.1 ++++ b/host/doc/man/ubertooth-specan.1 +@@ -1,8 +1,6 @@ + .TH UBERTOOTH\-SPECAN 1 "March 2017" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-ubertooth\-specan(1) \- a spectrum analyzer for Ubertooth +- ++ubertooth-specan \- a spectrum analyzer for Ubertooth + .SH SYNOPSIS + .PP + ubertooth\-specan [\-l ] [\-u ] [\-g|G] +diff --git a/host/doc/man/ubertooth-util.1 b/host/doc/man/ubertooth-util.1 +index 95c8297..a0752c8 100644 +--- a/host/doc/man/ubertooth-util.1 ++++ b/host/doc/man/ubertooth-util.1 +@@ -1,8 +1,6 @@ + .TH UBERTOOTH\-UTIL 1 "March 2017" "Project Ubertooth" "User Commands" + .SH NAME +-.PP +-.BR ubertooth-util (1) +-\- general purpose Ubertooth utility ++ubertooth-util \- general purpose Ubertooth utility + .SH SYNOPSIS + .PP + ubertooth\-util [\-abcdefghijk\-ellemenop\-qrstuvwxyZ] +diff --git a/host/doc/man/ubertooth.7 b/host/doc/man/ubertooth.7 +index a3cb73c..dff7a5a 100644 +--- a/host/doc/man/ubertooth.7 ++++ b/host/doc/man/ubertooth.7 +@@ -1,8 +1,6 @@ + .TH UBERTOOTH 7 "March 2017" "Project Ubertooth" "Project Ubertooth Overview" + .SH NAME +-.PP +-.BR ubertooth (7) +-\- Project Ubertooth ++ubertooth \- Project Ubertooth + .SH OVERVIEW + .PP + Ubertooth is a platform for Bluetooth experimentation. It is able to diff --git a/debian/patches/01_fixpythoninstall.patch b/debian/patches/01_fixpythoninstall.patch new file mode 100644 index 00000000..040858c5 --- /dev/null +++ b/debian/patches/01_fixpythoninstall.patch @@ -0,0 +1,21 @@ +From: Ruben Undheim +Date: Fri, 13 Jul 2018 16:36:06 +0200 +Subject: Fixes install location of python package + +--- + host/python/specan_ui/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/host/python/specan_ui/CMakeLists.txt b/host/python/specan_ui/CMakeLists.txt +index c365bd5..21b206d 100644 +--- a/host/python/specan_ui/CMakeLists.txt ++++ b/host/python/specan_ui/CMakeLists.txt +@@ -31,7 +31,7 @@ add_custom_command(OUTPUT ${OUTPUT}/timestamp + DEPENDS ${DEPS}) + + add_custom_target(specan ALL DEPENDS ${OUTPUT}/timestamp) +-install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${SETUP_PY} build -b ${OUTPUT} install)") ++install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${SETUP_PY} build -b ${OUTPUT} install --root=${CMAKE_SOURCE_DIR}/../debian/tmp --install-layout=deb)") + + add_custom_target(ubertooth-specan-ui ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ubertooth-specan-ui) + install(PROGRAMS ubertooth-specan-ui DESTINATION ${INSTALL_DEFAULT_BINDIR}) diff --git a/debian/patches/02_fix_missing_dfu.patch b/debian/patches/02_fix_missing_dfu.patch new file mode 100644 index 00000000..00e6c7e2 --- /dev/null +++ b/debian/patches/02_fix_missing_dfu.patch @@ -0,0 +1,25 @@ +From: Ruben Undheim +Date: Fri, 13 Jul 2018 16:36:06 +0200 +Subject: Fixes problem with ubertooth-dfu not found. The install script + assumes that ubertooth-dfu is already in the path. It is not when building + the deb package, + but it is available from a relative path since it has already been built. + +--- + firmware/common.mk | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/firmware/common.mk b/firmware/common.mk +index f3deef4..e6b6245 100644 +--- a/firmware/common.mk ++++ b/firmware/common.mk +@@ -261,7 +261,8 @@ NM = $(CROSS_COMPILE)nm + REMOVE = rm -f + + # DFU tool should be ubertooth-dfu +-DFU_TOOL ?= $(strip $(shell which ubertooth-dfu)) ++#DFU_TOOL ?= $(strip $(shell which ubertooth-dfu)) ++DFU_TOOL = ../../obj-$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)/ubertooth-tools/src/ubertooth-dfu + + # Define Messages + # English diff --git a/debian/patches/03_also_build_bootloader.patch b/debian/patches/03_also_build_bootloader.patch new file mode 100644 index 00000000..01b5d216 --- /dev/null +++ b/debian/patches/03_also_build_bootloader.patch @@ -0,0 +1,21 @@ +From: Ruben Undheim +Date: Fri, 13 Jul 2018 16:36:06 +0200 +Subject: Also build bootloader + +--- + firmware/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/firmware/Makefile b/firmware/Makefile +index f600529..247b9e4 100644 +--- a/firmware/Makefile ++++ b/firmware/Makefile +@@ -19,7 +19,7 @@ + # the Free Software Foundation, Inc., 51 Franklin Street, + # Boston, MA 02110-1301, USA. + +-DIRS = blinky bluetooth_rxtx cc2400_test clock_test usb_test assembly_test btbr ++DIRS = blinky bluetooth_rxtx cc2400_test clock_test usb_test assembly_test btbr bootloader + + all: $(DIRS) + diff --git a/debian/patches/04_no_git_for_debian.patch b/debian/patches/04_no_git_for_debian.patch new file mode 100644 index 00000000..2d324ced --- /dev/null +++ b/debian/patches/04_no_git_for_debian.patch @@ -0,0 +1,34 @@ +From: Ruben Undheim +Date: Fri, 13 Jul 2018 16:36:06 +0200 +Subject: When building the package, + the source is not necessarily part of a git repository. This patch removes + all git command executions. Additionally it replaces GIT_REVISION with the + current Debian version number. This will go into some of the firmware files. + +--- + firmware/common.mk | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/firmware/common.mk b/firmware/common.mk +index e6b6245..44a5e00 100644 +--- a/firmware/common.mk ++++ b/firmware/common.mk +@@ -52,13 +52,13 @@ ifeq ($(DISABLE_TX), ) + UBERTOOTH_OPTS += -DTX_ENABLE + endif + +-DIRTY = $(shell git status -s --untracked-files=no) +-ifneq ($(DIRTY), ) +- DIRTY_FLAG = * +-endif ++#DIRTY = $(shell git status -s --untracked-files=no) ++#ifneq ($(DIRTY), ) ++# DIRTY_FLAG = * ++#endif + + # automatic git version when working out of git +-GIT_REVISION ?= -D'GIT_REVISION="git-$(shell git log --pretty=format:'%h' -n 1)$(DIRTY_FLAG)"' ++GIT_REVISION ?= -D'GIT_REVISION="REPLACE_ME_WITH_VERSION"' + + # compile info + COMPILE_BY ?= -D'COMPILE_BY="$(shell whoami)"' diff --git a/debian/patches/05_move_headers_to_subdir.patch b/debian/patches/05_move_headers_to_subdir.patch new file mode 100644 index 00000000..867efa04 --- /dev/null +++ b/debian/patches/05_move_headers_to_subdir.patch @@ -0,0 +1,20 @@ +From: Ruben Undheim +Date: Fri, 13 Jul 2018 16:36:06 +0200 +Subject: Install header files to /usr/incude/ubertooth to make it easier to + build firmware from source using the ubertooth-firmware-source package. + +--- + host/libubertooth/src/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/host/libubertooth/src/CMakeLists.txt b/host/libubertooth/src/CMakeLists.txt +index cd131bf..dfe050c 100644 +--- a/host/libubertooth/src/CMakeLists.txt ++++ b/host/libubertooth/src/CMakeLists.txt +@@ -67,5 +67,5 @@ if( ${BUILD_STATIC_LIB} ) + endif( ${BUILD_STATIC_LIB} ) + + install(FILES ${c_headers} +- DESTINATION include ++ DESTINATION include/ubertooth + COMPONENT headers) diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 00000000..5ede8e2a --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,6 @@ +01_fixpythoninstall.patch +02_fix_missing_dfu.patch +03_also_build_bootloader.patch +04_no_git_for_debian.patch +05_move_headers_to_subdir.patch +0006-Try-fixing-two-lintians.patch diff --git a/debian/patches_extra/patch_include_source.patch b/debian/patches_extra/patch_include_source.patch new file mode 100644 index 00000000..d08e5a73 --- /dev/null +++ b/debian/patches_extra/patch_include_source.patch @@ -0,0 +1,26 @@ +diff --git a/firmware.orig/bootloader/Makefile b/firmware/bootloader/Makefile +index bb71fad..0f2e301 100644 +--- a/firmware.orig/bootloader/Makefile ++++ b/firmware/bootloader/Makefile +@@ -115,7 +115,7 @@ LINKER_SCRIPT = LPC17xx_Linker_Script_bootloader.ld + # Each directory must be seperated by a space. + # Use forward slashes for directory separators. + # For a directory that has spaces, enclose it in quotes. +-EXTRAINCDIRS = $(LIBS_PATH) $(LPCUSB_PATH) ../../host/libubertooth/src ++EXTRAINCDIRS = $(LIBS_PATH) $(LPCUSB_PATH) ../../host/libubertooth/src /usr/include/ubertooth + + # Compiler flag to set the C Standard level. + # c89 = "ANSI" C +diff --git a/firmware.orig/common.mk b/firmware/common.mk +index 9ad4287..4812fc0 100644 +--- a/firmware.orig/common.mk ++++ b/firmware/common.mk +@@ -117,7 +117,7 @@ LINKER_SCRIPT ?= LPC17xx_Linker_Script_with_bootloader.ld + # Each directory must be seperated by a space. + # Use forward slashes for directory separators. + # For a directory that has spaces, enclose it in quotes. +-EXTRAINCDIRS = $(LIBS_PATH) $(LPCUSB_PATH) ../../host/libubertooth/src ++EXTRAINCDIRS = $(LIBS_PATH) $(LPCUSB_PATH) ../../host/libubertooth/src /usr/include/ubertooth + + # Compiler flag to set the C Standard level. + # c89 = "ANSI" C diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..2e82bc8d --- /dev/null +++ b/debian/rules @@ -0,0 +1,74 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +include /usr/share/dpkg/pkg-info.mk + +export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +SOURCE_DATE_UTC ?= $(shell LC_ALL=C date -u -d @$(SOURCE_DATE_EPOCH)) +CHANGELOG_DATE ?= $(shell LC_ALL=C date -u -d @$(SOURCE_DATE_EPOCH) +"%d %B %Y") +DOPACKAGES = $(shell dh_listpackages) + +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +UPSTREAM_PACKAGE_VERSION ?= $(shell echo $(DEB_VERSION) | sed 's/-[^-]*$$//') + +UPSTREAM_PACKAGE_VERSION_ORIGINAL = $(shell echo $(UPSTREAM_PACKAGE_VERSION) | sed 's/\./-/g') + +%: + dh $@ + +override_dh_auto_clean: + dh_auto_clean --sourcedirectory=host + dh_auto_clean --sourcedirectory=firmware + $(RM) debian/man/*.1 + $(RM) -r ubertooth-firmware-source + $(RM) ubertooth-firmware-source.tar.gz + $(RM) debian/ubertooth.pc + +override_dh_auto_configure: + # Creating ubertooth-firmare-source.tar.gz: + cp -rf firmware ubertooth-firmware-source + cd ubertooth-firmware-source ; patch -R -Np2 < ../debian/patches/02_fix_missing_dfu.patch ; \ + patch -Np2 < ../debian/patches_extra/patch_include_source.patch + cd ubertooth-firmware-source ; sed -i 's/REPLACE_ME_WITH_VERSION/$(UPSTREAM_PACKAGE_VERSION_ORIGINAL)/' common.mk + GZIP=-9n tar --mtime='$(SOURCE_DATE_UTC)' --sort=name --owner=root --group=root \ + --mode=go=rX,u+rw,a-s -czvf ubertooth-firmware-source.tar.gz \ + ubertooth-firmware-source/ + # + + dh_auto_configure --sourcedirectory=host -- -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) \ + -DUBERTOOTH_GROUP=plugdev -DUDEV_RULES_PATH=/lib/udev/rules.d +ifneq ($(filter ubertooth-firmware,$(DOPACKAGES)),) + dh_auto_configure --sourcedirectory=firmware +endif + +override_dh_auto_build: + dh_auto_build --sourcedirectory=host +ifneq ($(filter ubertooth-firmware,$(DOPACKAGES)),) + dh_auto_build --sourcedirectory=firmware --no-parallel -- \ + TIMESTAMP="-DTIMESTAMP=''" COMPILE_BY="-D'COMPILE_BY=\"user\"'" \ + COMPILE_HOST="-D'COMPILE_HOST=\"localhost\"'" \ + GIT_REVISION="-D'GIT_REVISION=\"$(UPSTREAM_PACKAGE_VERSION_ORIGINAL)\"'" +endif + cat debian/ubertooth.pc.in | sed 's/DEB_HOST_MULTIARCH/$(DEB_HOST_MULTIARCH)/' | \ + sed 's/UPSTREAM_PACKAGE_VERSION/$(UPSTREAM_PACKAGE_VERSION)/' > debian/ubertooth.pc + +override_dh_auto_install: + dh_auto_install --sourcedirectory=host +ifneq ($(filter ubertooth-firmware,$(DOPACKAGES)),) + chmod a-x firmware/*/*.bin + dh_auto_install --sourcedirectory=firmware +endif + mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig + cp debian/ubertooth.pc debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/ + rm debian/tmp/usr/bin/ubertooth-tx # The tool does nothing - not fully implemented. Skip installing + # TODO: remove line when tool has been implemented + +override_dh_installman: + cd debian/man ; CHANGELOG_DATE="$(CHANGELOG_DATE)" ./genmanpages.sh + dh_installman diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100644 index 00000000..1d7293f9 --- /dev/null +++ b/debian/source/include-binaries @@ -0,0 +1,7 @@ +docs/images/kismet.png +docs/images/pogoprog-placement.jpeg +docs/images/specan_ui.png +docs/images/u1_roadmap.png +docs/images/ubertooth-lap.png +docs/images/ubertooth-one.jpeg +docs/images/ubertooth-zero.jpeg diff --git a/debian/tests/buildfirmware b/debian/tests/buildfirmware new file mode 100755 index 00000000..cf1d1add --- /dev/null +++ b/debian/tests/buildfirmware @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +rm -rf /tmp/test_build_firmware +mkdir -p /tmp/test_build_firmware +cd /tmp/test_build_firmware +tar -xvf /usr/src/ubertooth-firmware-source.tar.gz +cd ubertooth-firmware-source/ +make 2>&1 +echo "run: OK" diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 00000000..ab62124f --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,2 @@ +Tests: buildfirmware +Depends: ubertooth-firmware-source, gcc-arm-none-eabi, libnewlib-arm-none-eabi, libstdc++-arm-none-eabi-newlib diff --git a/debian/ubertooth-firmware-source.install b/debian/ubertooth-firmware-source.install new file mode 100644 index 00000000..7d8d34ed --- /dev/null +++ b/debian/ubertooth-firmware-source.install @@ -0,0 +1 @@ +ubertooth-firmware-source.tar.gz usr/src/ diff --git a/debian/ubertooth-firmware.install b/debian/ubertooth-firmware.install new file mode 100644 index 00000000..2da371c6 --- /dev/null +++ b/debian/ubertooth-firmware.install @@ -0,0 +1,8 @@ +firmware/bootloader/bootloader.bin usr/share/ubertooth/firmware + +firmware/bluetooth_rxtx/bluetooth_rxtx.dfu usr/share/ubertooth/firmware +firmware/assembly_test/assembly_test.dfu usr/share/ubertooth/firmware +firmware/clock_test/clock_test.dfu usr/share/ubertooth/firmware +firmware/blinky/blinky.dfu usr/share/ubertooth/firmware +firmware/cc2400_test/cc2400_test.dfu usr/share/ubertooth/firmware +firmware/usb_test/usb_test.dfu usr/share/ubertooth/firmware diff --git a/debian/ubertooth-firmware.lintian-overrides b/debian/ubertooth-firmware.lintian-overrides new file mode 100644 index 00000000..d4545f0b --- /dev/null +++ b/debian/ubertooth-firmware.lintian-overrides @@ -0,0 +1,2 @@ +# This is firmware for external hardware and not the kernel +ubertooth-firmware: wrong-section-according-to-package-name ubertooth-firmware => kernel diff --git a/debian/ubertooth.docs b/debian/ubertooth.docs new file mode 100644 index 00000000..56eff2b2 --- /dev/null +++ b/debian/ubertooth.docs @@ -0,0 +1,2 @@ +README.md +TRADEMARK diff --git a/debian/ubertooth.install b/debian/ubertooth.install new file mode 100644 index 00000000..c472c482 --- /dev/null +++ b/debian/ubertooth.install @@ -0,0 +1,6 @@ +usr/bin/* +usr/lib/python3/dist-packages/*/*.py +usr/lib/python3/dist-packages/*-info +lib/udev/rules.d/40-ubertooth.rules +debian/com.greatscottgadgets.ubertooth.metainfo.xml usr/share/metainfo + diff --git a/debian/ubertooth.manpages b/debian/ubertooth.manpages new file mode 100644 index 00000000..7d211a2f --- /dev/null +++ b/debian/ubertooth.manpages @@ -0,0 +1,13 @@ +host/doc/man/ubertooth.7 +host/doc/man/ubertooth-afh.1 +host/doc/man/ubertooth-btle.1 +host/doc/man/ubertooth-debug.1 +host/doc/man/ubertooth-dfu.1 +host/doc/man/ubertooth-dump.1 +debian/man/ubertooth-follow.1 +host/doc/man/ubertooth-rx.1 +host/doc/man/ubertooth-scan.1 +debian/man/ubertooth-specan-ui.1 +host/doc/man/ubertooth-util.1 +debian/man/ubertooth-ego.1 +host/doc/man/ubertooth-specan.1 diff --git a/debian/ubertooth.pc.in b/debian/ubertooth.pc.in new file mode 100644 index 00000000..784d9940 --- /dev/null +++ b/debian/ubertooth.pc.in @@ -0,0 +1,10 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${prefix}/lib/DEB_HOST_MULTIARCH +includedir=${prefix}/include/ubertooth + +Name: ubertooth +Description: Shared library for Bluetooth experimentation +Version: UPSTREAM_PACKAGE_VERSION +Libs: -L${libdir} -lubertooth +Cflags: -I${includedir} diff --git a/debian/upstream/metadata b/debian/upstream/metadata new file mode 100644 index 00000000..e838f7a6 --- /dev/null +++ b/debian/upstream/metadata @@ -0,0 +1,6 @@ +--- +Bug-Database: https://github.com/greatscottgadgets/ubertooth/issues +Bug-Submit: https://github.com/greatscottgadgets/ubertooth/issues/new +Name: ubertooth +Repository: https://github.com/greatscottgadgets/ubertooth.git +Repository-Browse: https://github.com/greatscottgadgets/ubertooth diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000..f6c05674 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +https://github.com/greatscottgadgets/ubertooth/releases /greatscottgadgets/ubertooth/archive/(\w+?)-(\w+?)-(\w+?)\.tar\.(?:bz2|gz|xz) diff --git a/firmware/Makefile b/firmware/Makefile index 28aaf394..ba8b2c18 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -19,7 +19,7 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -DIRS = blinky bluetooth_rxtx cc2400_test clock_test usb_test assembly_test btbr +DIRS = blinky bluetooth_rxtx cc2400_test clock_test usb_test assembly_test btbr bootloader all: $(DIRS) diff --git a/host/libubertooth/src/CMakeLists.txt b/host/libubertooth/src/CMakeLists.txt index cd131bf1..dfe050c9 100644 --- a/host/libubertooth/src/CMakeLists.txt +++ b/host/libubertooth/src/CMakeLists.txt @@ -67,5 +67,5 @@ if( ${BUILD_STATIC_LIB} ) endif( ${BUILD_STATIC_LIB} ) install(FILES ${c_headers} - DESTINATION include + DESTINATION include/ubertooth COMPONENT headers) diff --git a/host/libubertooth/src/ubertooth.c b/host/libubertooth/src/ubertooth.c index b86989c3..b49f0dc3 100644 --- a/host/libubertooth/src/ubertooth.c +++ b/host/libubertooth/src/ubertooth.c @@ -131,6 +131,65 @@ unsigned ubertooth_count(void) { return uberteeth; } + +static struct libusb_device_handle *find_ubertooth_device_serial(char *serial_number) +{ + struct libusb_device **usb_list = NULL; + struct libusb_context *ctx = NULL; + struct libusb_device_handle *devh = NULL; + struct libusb_device_descriptor desc; + int usb_devs, i, r, ret, uberteeth = 0; + int *ubertooth_devs = NULL; + + usb_devs = libusb_get_device_list(ctx, &usb_list); + ubertooth_devs = calloc(usb_devs, sizeof(int)); + + for (i = 0; i < usb_devs; ++i) { + r = libusb_get_device_descriptor(usb_list[i], &desc); + if (r < 0) { + fprintf(stderr, "couldn't get usb descriptor for dev #%d!\n", i); + continue; + } + if ((desc.idVendor == TC13_VENDORID && desc.idProduct == TC13_PRODUCTID) + || (desc.idVendor == U0_VENDORID && desc.idProduct == U0_PRODUCTID) + || (desc.idVendor == U1_VENDORID && desc.idProduct == U1_PRODUCTID)) + { + ubertooth_devs[uberteeth] = i; + uberteeth++; + } + } + for (i = 0; i < uberteeth; ++i) { + libusb_get_device_descriptor(usb_list[ubertooth_devs[i]], &desc); + ret = libusb_open(usb_list[ubertooth_devs[i]], &devh); + if (ret) { + fprintf(stderr, "Device %d: ", i); + show_libusb_error(ret); + devh = NULL; + } else { + uint8_t serial[17] = {0}, r; + char serial_c[34] = {0}; + libusb_get_device_descriptor(usb_list[i], &desc); + r = cmd_get_serial(devh, serial); + if (r == 0) { + for (int j = 1; j < 17; j++) { + sprintf(&serial_c[(j - 1) * 2], "%02x", serial[j]); + } + /* compare desired sn to device's */ + if (!strncmp(serial_number, serial_c, strlen(serial_c))) { + fprintf(stderr, "Device %d: ", ubertooth_devs[i]); + print_serial(serial, stderr); + break; + } + } + libusb_close(devh); + devh = NULL; + } + } + libusb_free_device_list(usb_list, 1); + return devh; +} + + static struct libusb_device_handle* find_ubertooth_device(int ubertooth_device) { struct libusb_device **usb_list = NULL; @@ -191,7 +250,7 @@ static struct libusb_device_handle* find_ubertooth_device(int ubertooth_device) } } } -libusb_free_device_list(usb_list,1); + libusb_free_device_list(usb_list,1); return devh; } @@ -580,6 +639,31 @@ ubertooth_t* ubertooth_init() return ut; } +int ubertooth_connect_serial(ubertooth_t *ut, char *serial_number) +{ + int r = libusb_init(NULL); + if (r < 0) { + fprintf(stderr, "libusb_init failed (got 1.0?)\n"); + return -1; + } + + ut->devh = find_ubertooth_device_serial(serial_number); + if (ut->devh == NULL) { + fprintf(stderr, "could not open Ubertooth device\n"); + ubertooth_stop(ut); + return -1; + } + + r = libusb_claim_interface(ut->devh, 0); + if (r < 0) { + fprintf(stderr, "usb_claim_interface error %d\n", r); + ubertooth_stop(ut); + return -1; + } + + return 1; +} + int ubertooth_connect(ubertooth_t* ut, int ubertooth_device) { int r = libusb_init(NULL); @@ -605,6 +689,17 @@ int ubertooth_connect(ubertooth_t* ut, int ubertooth_device) return 1; } +ubertooth_t *ubertooth_start_serial(char *serial_number) +{ + ubertooth_t *ut = ubertooth_init(); + + int r = ubertooth_connect_serial(ut, serial_number); + if (r < 0) + return NULL; + + return ut; +} + ubertooth_t* ubertooth_start(int ubertooth_device) { ubertooth_t* ut = ubertooth_init(); diff --git a/host/libubertooth/src/ubertooth.h b/host/libubertooth/src/ubertooth.h index 163d848d..7f88dac0 100644 --- a/host/libubertooth/src/ubertooth.h +++ b/host/libubertooth/src/ubertooth.h @@ -75,7 +75,9 @@ void print_version(); void register_cleanup_handler(ubertooth_t* ut, int do_exit); ubertooth_t* ubertooth_init(); unsigned ubertooth_count(void); +int ubertooth_connect_serial(ubertooth_t* ut, char *serial_number); int ubertooth_connect(ubertooth_t* ut, int ubertooth_device); +ubertooth_t* ubertooth_start_serial(char *serial_number); ubertooth_t* ubertooth_start(int ubertooth_device); void ubertooth_stop(ubertooth_t* ut); int ubertooth_get_api(ubertooth_t *ut, uint16_t *version); diff --git a/host/python/specan_ui/CMakeLists.txt b/host/python/specan_ui/CMakeLists.txt index d3de2537..8f064eb6 100644 --- a/host/python/specan_ui/CMakeLists.txt +++ b/host/python/specan_ui/CMakeLists.txt @@ -31,7 +31,7 @@ add_custom_command(OUTPUT ${OUTPUT}/timestamp DEPENDS ${DEPS}) add_custom_target(specan ALL DEPENDS ${OUTPUT}/timestamp) -install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${SETUP_PY} build -b ${OUTPUT} install)") +install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} ${SETUP_PY} build -b ${OUTPUT} install --root=${CMAKE_SOURCE_DIR}/../debian/tmp --install-layout=deb)") add_custom_target(ubertooth-specan-ui ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ubertooth-specan-ui) install(PROGRAMS ubertooth-specan-ui DESTINATION ${INSTALL_DEFAULT_BINDIR}) diff --git a/host/ubertooth-tools/src/dfu.h b/host/ubertooth-tools/src/dfu.h index de871621..c40e4b79 100644 --- a/host/ubertooth-tools/src/dfu.h +++ b/host/ubertooth-tools/src/dfu.h @@ -20,6 +20,8 @@ * Boston, MA 02110-1301, USA. */ +#include + #define REQ_DETACH 0 #define REQ_DNLOAD 1 #define REQ_UPLOAD 2 diff --git a/host/ubertooth-tools/src/ubertooth-afh.c b/host/ubertooth-tools/src/ubertooth-afh.c index 710fbc39..09fd2b92 100644 --- a/host/ubertooth-tools/src/ubertooth-afh.c +++ b/host/ubertooth-tools/src/ubertooth-afh.c @@ -46,7 +46,8 @@ static void usage() printf("\t-t timeout for initial AFH map detection (not required)\n"); printf("\t-e maximum access code errors (default: %d, range: 0-4)\n", max_ac_errors); printf("\t-V print version information\n"); - printf("\t-U <0-7> set ubertooth device to use\n"); + printf("\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + printf("\t-D set ubertooth serial to use (cannot be used with -U)\n"); } int main(int argc, char* argv[]) @@ -55,6 +56,8 @@ int main(int argc, char* argv[]) // uint8_t initial_afh[10]; char* end; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; btbb_piconet* pn = NULL; uint32_t lap = 0; uint8_t uap = 0; @@ -66,7 +69,7 @@ int main(int argc, char* argv[]) // default value for '-m' channel timeout packet_counter_max = 5; - while ((opt=getopt(argc,argv,"rhVl:u:U:e:a:t:m:")) != EOF) { + while ((opt=getopt(argc,argv,"rhVl:u:U:D:e:a:t:m:")) != EOF) { switch(opt) { case 'l': lap = strtol(optarg, &end, 16); @@ -85,8 +88,13 @@ int main(int argc, char* argv[]) case 't': timeout = atoi(optarg); break; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'e': max_ac_errors = atoi(optarg); @@ -126,7 +134,17 @@ int main(int argc, char* argv[]) return 1; } - ut = ubertooth_start(ubertooth_device); + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + + if (device_serial) + ut = ubertooth_start_serial(serial_c); + else + ut = ubertooth_start(ubertooth_device); + if (ut->devh == NULL) { usage(); return 1; diff --git a/host/ubertooth-tools/src/ubertooth-btle.c b/host/ubertooth-tools/src/ubertooth-btle.c index 1a41370b..74183146 100644 --- a/host/ubertooth-tools/src/ubertooth-btle.c +++ b/host/ubertooth-tools/src/ubertooth-btle.c @@ -125,7 +125,8 @@ static void usage(void) printf("\t-I interfere continuously\n"); printf("\n"); printf(" Data source:\n"); - printf("\t-U<0-7> set ubertooth device to use\n"); + printf("\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + printf("\t-D set ubertooth serial to use (cannot be used with -U)\n"); printf("\n"); printf(" Misc:\n"); printf("\t-r capture packets to PCAPNG file\n"); @@ -150,6 +151,8 @@ int main(int argc, char *argv[]) int do_target; enum jam_modes jam_mode = JAM_NONE; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; ubertooth_t* ut = ubertooth_init(); btle_options cb_opts = { .allowed_access_address_errors = 32 }; @@ -165,7 +168,7 @@ int main(int argc, char *argv[]) do_adv_index = 37; do_slave_mode = do_target = 0; - while ((opt=getopt(argc,argv,"a::r:hfnpU:v::A:s:t:x:c:q:jJiI")) != EOF) { + while ((opt=getopt(argc,argv,"a::r:hfnpU:D:v::A:s:t:x:c:q:jJiI")) != EOF) { switch(opt) { case 'a': if (optarg == NULL) { @@ -184,8 +187,13 @@ int main(int argc, char *argv[]) case 'p': do_promisc = 1; break; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'r': if (!ut->h_pcapng_le) { @@ -270,8 +278,17 @@ int main(int argc, char *argv[]) } } + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + + if (device_serial) + r = ubertooth_connect_serial(ut, serial_c); + else + r = ubertooth_connect(ut, ubertooth_device); - r = ubertooth_connect(ut, ubertooth_device); if (r < 0) { usage(); return 1; diff --git a/host/ubertooth-tools/src/ubertooth-debug.c b/host/ubertooth-tools/src/ubertooth-debug.c index 3f6bddb1..48491f12 100644 --- a/host/ubertooth-tools/src/ubertooth-debug.c +++ b/host/ubertooth-tools/src/ubertooth-debug.c @@ -40,7 +40,8 @@ static void usage() printf("\t-h this message\n"); printf("\t-r [,[,...]] read the contents of CC2400 register(s)\n"); printf("\t-r - read a consecutive set of CC2400 register(s)\n"); - printf("\t-U<0-7> set ubertooth device to use\n"); + printf("\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + printf("\t-D set ubertooth serial to use (cannot be used with -U)\n"); printf("\t-v<0-2> verbosity (default=1)\n"); } @@ -65,6 +66,8 @@ int main(int argc, char *argv[]) ubertooth_t* ut = NULL; int do_read_register; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; int *regList = NULL; int regListN = 0; int i; @@ -73,13 +76,18 @@ int main(int argc, char *argv[]) * setting to positive is value of specified argument */ do_read_register = -1; - while ((opt = getopt(argc, argv, "hU:r:v:")) != EOF) { + while ((opt = getopt(argc, argv, "hU:D:r:v:")) != EOF) { switch (opt) { case 'h': usage(); return 0; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'v': verbose = atoi(optarg); @@ -109,13 +117,24 @@ int main(int argc, char *argv[]) } } - if(regListN == 0) { - fprintf(stderr, "At least one register must be provided\n"); - usage(); - return 1; - } + if (regListN == 0) { + fprintf(stderr, "At least one register must be provided\n"); + usage(); + return 1; + } + + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + /* initialise device */ - ut = ubertooth_start(ubertooth_device); + if (device_serial) + ut = ubertooth_start_serial(serial_c); + else + ut = ubertooth_start(ubertooth_device); + if (ut == NULL) { usage(); return 1; diff --git a/host/ubertooth-tools/src/ubertooth-dfu.c b/host/ubertooth-tools/src/ubertooth-dfu.c index dc91dfff..7f76c75c 100644 --- a/host/ubertooth-tools/src/ubertooth-dfu.c +++ b/host/ubertooth-tools/src/ubertooth-dfu.c @@ -400,7 +400,8 @@ static void usage() printf("\n"); printf("Miscellaneous:\n"); printf("\t-s add DFU suffix to binary firmware file\n"); - printf("\t-U <0-7> set ubertooth device to use\n"); + printf("\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + printf("\t-D set ubertooth serial to use (cannot be used with -U)\n"); } #define FUNC_DOWNLOAD (1<<0) @@ -417,10 +418,12 @@ int main(int argc, char **argv) { libusb_device_handle* devh = NULL; uint8_t functions = 0; int opt, ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; int r; ubertooth_t* ut = NULL; - while ((opt=getopt(argc,argv,"hd:u:s:rU:")) != EOF) { + while ((opt=getopt(argc,argv,"hd:u:s:rU:D:")) != EOF) { switch(opt) { case 'd': downfile = fopen(optarg, "r+b"); @@ -460,8 +463,13 @@ int main(int argc, char **argv) { case 'r': functions |= FUNC_RESET; break; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; default: case 'h': @@ -470,6 +478,12 @@ int main(int argc, char **argv) { } } + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + if(functions & FUNC_SIGN) { sign(infile, outfile, U1_DFU_VENDORID, U1_DFU_PRODUCTID); fclose(infile); @@ -481,7 +495,11 @@ int main(int argc, char **argv) { int rv, count= 0; devh = find_ubertooth_dfu_device(); if(devh == NULL) { - ut = ubertooth_start(ubertooth_device); + if (device_serial) + ut = ubertooth_start_serial(serial_c); + else + ut = ubertooth_start(ubertooth_device); + if(ut == NULL) { fprintf(stderr, "Unable to find Ubertooth\n"); return 1; diff --git a/host/ubertooth-tools/src/ubertooth-dump.c b/host/ubertooth-tools/src/ubertooth-dump.c index 2366a000..301d0bc0 100644 --- a/host/ubertooth-tools/src/ubertooth-dump.c +++ b/host/ubertooth-tools/src/ubertooth-dump.c @@ -20,6 +20,7 @@ */ #include "ubertooth.h" +#include #include #include @@ -31,7 +32,8 @@ static void usage(void) printf("\t-b only dump received bitstream (GnuRadio style)\n"); printf("\t-c classic modulation\n"); printf("\t-l LE modulation\n"); - printf("\t-U<0-7> set ubertooth device to use\n"); + printf("\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + printf("\t-D set ubertooth serial to use (cannot be used with -U)\n"); printf("\t-d filename\n"); printf("\nThis program sends binary data to stdout. You probably don't want to\n"); printf("run it from a terminal without redirecting the output.\n"); @@ -51,11 +53,13 @@ int main(int argc, char *argv[]) int bitstream = 0; int modulation = MOD_BT_BASIC_RATE; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; ubertooth_t* ut = NULL; int r; - while ((opt=getopt(argc,argv,"bhclU:d:")) != EOF) { + while ((opt=getopt(argc,argv,"bhclU:D:d:")) != EOF) { switch(opt) { case 'b': bitstream = 1; @@ -66,8 +70,13 @@ int main(int argc, char *argv[]) case 'l': modulation = MOD_BT_LOW_ENERGY; break; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'd': dumpfile = fopen(optarg, "w"); @@ -83,7 +92,16 @@ int main(int argc, char *argv[]) } } - ut = ubertooth_start(ubertooth_device); + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + + if (device_serial) + ut = ubertooth_start_serial(serial_c); + else + ut = ubertooth_start(ubertooth_device); if (ut == NULL) { usage(); diff --git a/host/ubertooth-tools/src/ubertooth-ego.c b/host/ubertooth-tools/src/ubertooth-ego.c index 901d203a..7e029254 100644 --- a/host/ubertooth-tools/src/ubertooth-ego.c +++ b/host/ubertooth-tools/src/ubertooth-ego.c @@ -47,6 +47,8 @@ static void usage(void) printf("\t-f follow connections\n"); printf("\t-r continuous rx on a single channel\n"); printf("\t-i interfere\n"); + printf("\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + printf("\t-D set ubertooth serial to use (cannot be used with -U)\n"); printf("\n"); printf(" Options:\n"); printf("\t-c <2402-2480> set channel in MHz (for continuous rx)\n"); @@ -60,13 +62,15 @@ int main(int argc, char *argv[]) int do_mode = -1; int do_channel = 2418; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; uint8_t len = 18; char *access_code_str = NULL; uint8_t access_code[4]; int access_code_len; int r; - while ((opt=getopt(argc,argv,"frijc:U:a:l:h")) != EOF) { + while ((opt=getopt(argc,argv,"frijc:U:D:a:l:h")) != EOF) { switch(opt) { case 'f': do_mode = 0; @@ -81,8 +85,13 @@ int main(int argc, char *argv[]) case 'c': do_channel = atoi(optarg); break; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'a': access_code_str = strdup(optarg); @@ -102,6 +111,12 @@ int main(int argc, char *argv[]) usage(); } + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + // access code if (access_code_str != NULL) { int i; @@ -117,7 +132,11 @@ int main(int argc, char *argv[]) access_code[i] = ac[i]; } - ut = ubertooth_start(ubertooth_device); + if (device_serial) + ut = ubertooth_start_serial(serial_c); + else + ut = ubertooth_start(ubertooth_device); + if (ut == NULL) { usage(); return 1; diff --git a/host/ubertooth-tools/src/ubertooth-follow.c b/host/ubertooth-tools/src/ubertooth-follow.c index 4ffc182f..58634288 100644 --- a/host/ubertooth-tools/src/ubertooth-follow.c +++ b/host/ubertooth-tools/src/ubertooth-follow.c @@ -59,8 +59,11 @@ int main(int argc, char *argv[]) int have_uap = 0; int afh_enabled = 0; uint8_t mode, afh_map[10]; + int r; char *end; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; char *bt_dev = "hci0"; char addr[19] = { 0 }; uint32_t clock; @@ -73,7 +76,7 @@ int main(int argc, char *argv[]) pn = btbb_piconet_new(); ubertooth_t* ut = ubertooth_init(); - while ((opt=getopt(argc,argv,"hl:u:U:e:d:ab:w:r:q:")) != EOF) { + while ((opt=getopt(argc,argv,"hl:u:U:D:e:d:ab:w:r:q:")) != EOF) { switch(opt) { case 'l': lap = strtol(optarg, &end, 16); @@ -87,8 +90,13 @@ int main(int argc, char *argv[]) ++have_uap; } break; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'r': if (!ut->h_pcapng_bredr) { @@ -208,13 +216,24 @@ int main(int argc, char *argv[]) /* Clean up on exit. */ register_cleanup_handler(ut, 0); - ubertooth_connect(ut, ubertooth_device); - if (ut == NULL) { + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + + /* initialise device */ + if (device_serial) + r = ubertooth_connect_serial(ut, serial_c); + else + r = ubertooth_connect(ut, ubertooth_device); + + if (r < 0) { usage(); return 1; } - int r = ubertooth_check_api(ut); + r = ubertooth_check_api(ut); if (r < 0) return 1; @@ -235,15 +254,15 @@ int main(int argc, char *argv[]) cmd_set_clock(ut->devh, 0); if(afh_enabled) cmd_set_afh_map(ut->devh, afh_map); - - // Read clocks here to ensure clock is closest to real value - hci_read_clock(sock, 0, 0, &clock, &accuracy, 0); - if (cc) { - if (hci_read_clock_offset(sock, handle, &offset, 1000) < 0) { - perror("Reading clock offset failed\n"); - } - clock += (offset<<2); // Correct offset - } + + // Read clocks here to ensure clock is closest to real value + hci_read_clock(sock, 0, 0, &clock, &accuracy, 0); + if (cc) { + if (hci_read_clock_offset(sock, handle, &offset, 1000) < 0) { + perror("Reading clock offset failed\n"); + } + clock += (offset<<2); // Correct offset + } btbb_piconet_set_clk_offset(pn, clock+delay); btbb_piconet_set_flag(pn, BTBB_FOLLOWING, 1); btbb_piconet_set_flag(pn, BTBB_CLK27_VALID, 1); @@ -253,7 +272,7 @@ int main(int argc, char *argv[]) if (r < 0) return r; - if (cc) { + if (cc) { hci_disconnect(sock, handle, HCI_OE_USER_ENDED_CONNECTION, 10000); } diff --git a/host/ubertooth-tools/src/ubertooth-rx.c b/host/ubertooth-tools/src/ubertooth-rx.c index 718fbf6b..f7e8b075 100644 --- a/host/ubertooth-tools/src/ubertooth-rx.c +++ b/host/ubertooth-tools/src/ubertooth-rx.c @@ -54,7 +54,9 @@ static void usage() printf("\n"); printf("Miscellaneous:\n"); printf("\t-V print version information\n"); - printf("\t-U <0-7> set ubertooth device to use\n"); + printf("\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + printf("\t-D set ubertooth serial to use (cannot be used with -U)\n"); + } int main(int argc, char* argv[]) @@ -65,6 +67,8 @@ int main(int argc, char* argv[]) int timeout = 0; char* end; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; btbb_piconet* pn = NULL; uint32_t lap = 0; uint8_t uap = 0; @@ -72,7 +76,7 @@ int main(int argc, char* argv[]) ubertooth_t* ut = ubertooth_init(); - while ((opt=getopt(argc,argv,"hVi:l:u:U:d:e:r:sq:t:zc:")) != EOF) { + while ((opt=getopt(argc,argv,"hVi:l:u:U:D:d:e:r:sq:t:zc:")) != EOF) { switch(opt) { case 'i': infile = fopen(optarg, "r"); @@ -90,8 +94,13 @@ int main(int argc, char* argv[]) uap = strtol(optarg, &end, 16); have_uap++; break; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'r': if (!ut->h_pcapng_bredr) { @@ -151,8 +160,19 @@ int main(int argc, char* argv[]) return 1; } + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + if (infile == NULL) { - r = ubertooth_connect(ut, ubertooth_device); + /* initialise device */ + if (device_serial) + r = ubertooth_connect_serial(ut, serial_c); + else + r = ubertooth_connect(ut, ubertooth_device); + if (r < 0) { usage(); return 1; diff --git a/host/ubertooth-tools/src/ubertooth-scan.c b/host/ubertooth-tools/src/ubertooth-scan.c index 7b14cdaf..bc75f55a 100644 --- a/host/ubertooth-tools/src/ubertooth-scan.c +++ b/host/ubertooth-tools/src/ubertooth-scan.c @@ -59,10 +59,10 @@ static void usage() printf("\t-t scan Time (seconds) - length of time to sniff packets. [Default: 20s]\n"); printf("\t-e max_ac_errors (default: %d, range: 0-4)\n", max_ac_errors); printf("\t-b Bluetooth device (hci0)\n"); - printf("\t-U<0-7> set Ubertooth device to use\n"); + printf("\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + printf("\t-D set ubertooth serial to use (cannot be used with -U)\n"); } - void extra_info(int dd, int dev_id, bdaddr_t* bdaddr) { uint16_t handle, offset; @@ -190,7 +190,6 @@ void print_name_and_class(int dev_handle, int dev_id, bdaddr_t *bdaddr, extra_info(dev_handle, dev_id, bdaddr); } - int main(int argc, char *argv[]) { inquiry_info *ii = NULL; @@ -199,16 +198,23 @@ int main(int argc, char *argv[]) uint8_t uap, extended = 0; uint8_t scan = 0; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; char *bt_dev = "hci0"; char addr[19] = { 0 }; ubertooth_t* ut = NULL; btbb_piconet* pn; bdaddr_t bdaddr; - while ((opt=getopt(argc,argv,"hU:t:e:xsb:")) != EOF) { + while ((opt=getopt(argc,argv,"hU:D:t:e:xsb:")) != EOF) { switch(opt) { + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'b': bt_dev = optarg; @@ -236,6 +242,12 @@ int main(int argc, char *argv[]) } } + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + dev_id = hci_devid(bt_dev); if (dev_id < 0) { printf("error: Unable to find %s (%d)\n", bt_dev, dev_id); @@ -248,7 +260,11 @@ int main(int argc, char *argv[]) return 1; } - ut = ubertooth_start(ubertooth_device); + if (device_serial) + ut = ubertooth_start_serial(serial_c); + else + ut = ubertooth_start(ubertooth_device); + if (ut == NULL) { usage(); return 1; diff --git a/host/ubertooth-tools/src/ubertooth-specan.c b/host/ubertooth-tools/src/ubertooth-specan.c index 1b17c6fc..9a2e6b21 100644 --- a/host/ubertooth-tools/src/ubertooth-specan.c +++ b/host/ubertooth-tools/src/ubertooth-specan.c @@ -19,6 +19,7 @@ * Boston, MA 02110-1301, USA. */ +#include #include #include #include "ubertooth.h" @@ -89,7 +90,8 @@ static void usage(FILE *file) fprintf(file, "\t-d output to file\n"); fprintf(file, "\t-l lower frequency (default 2402)\n"); fprintf(file, "\t-u upper frequency (default 2480)\n"); - fprintf(file, "\t-U<0-7> set ubertooth device to use\n"); + fprintf(file, "\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + fprintf(file, "\t-D set ubertooth serial to use (cannot be used with -U)\n"); } int main(int argc, char *argv[]) @@ -97,10 +99,12 @@ int main(int argc, char *argv[]) int opt, r = 0, output_mode = SPECAN_STDOUT; int lower= 2402, upper= 2480; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; ubertooth_t* ut = NULL; - while ((opt=getopt(argc,argv,"vhgGd:l::u::U:")) != EOF) { + while ((opt=getopt(argc,argv,"vhgGd:l::u::U:D:")) != EOF) { switch(opt) { case 'v': debug++; @@ -135,8 +139,13 @@ int main(int argc, char *argv[]) else printf("upper: %d\n", upper); break; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'h': usage(stdout); @@ -147,7 +156,16 @@ int main(int argc, char *argv[]) } } - ut = ubertooth_start(ubertooth_device); + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(stderr); + return 1; + } + + if (device_serial) + ut = ubertooth_start_serial(serial_c); + else + ut = ubertooth_start(ubertooth_device); if (ut == NULL) { usage(stderr); diff --git a/host/ubertooth-tools/src/ubertooth-tx.c b/host/ubertooth-tools/src/ubertooth-tx.c index 0239a3d4..31889bcd 100644 --- a/host/ubertooth-tools/src/ubertooth-tx.c +++ b/host/ubertooth-tools/src/ubertooth-tx.c @@ -51,12 +51,14 @@ int main(int argc, char* argv[]) int timeout = 0; char* end; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; uint32_t lap = 0; uint8_t uap = 0; ubertooth_t* ut = ubertooth_init(); - while ((opt=getopt(argc,argv,"hVl:u:U:t:")) != EOF) { + while ((opt=getopt(argc,argv,"hVl:u:U:D:t:")) != EOF) { switch(opt) { case 'l': lap = strtol(optarg, &end, 16); @@ -66,8 +68,13 @@ int main(int argc, char* argv[]) uap = strtol(optarg, &end, 16); have_uap++; break; + case 'D': + snprintf(serial_c, strlen(optarg), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 't': timeout = atoi(optarg); @@ -82,7 +89,18 @@ int main(int argc, char* argv[]) } } - r = ubertooth_connect(ut, ubertooth_device); + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(); + return 1; + } + + + if (device_serial) + r = ubertooth_connect_serial(ut, serial_c); + else + r = ubertooth_connect(ut, ubertooth_device); + if (r < 0) { usage(); return 1; diff --git a/host/ubertooth-tools/src/ubertooth-util.c b/host/ubertooth-tools/src/ubertooth-util.c index fba0168f..a454c26c 100644 --- a/host/ubertooth-tools/src/ubertooth-util.c +++ b/host/ubertooth-tools/src/ubertooth-util.c @@ -20,6 +20,7 @@ */ #include "ubertooth.h" +#include #include #include #include @@ -43,7 +44,8 @@ static void usage(FILE *output) fprintf(output, "\t-l[0-1] get/set USR LED\n"); fprintf(output, "\t-S stop current operation\n"); fprintf(output, "\t-r full reset\n"); - fprintf(output, "\t-U<0-7> set ubertooth device to use\n"); + fprintf(output, "\t-U <0-7> set ubertooth device to use (cannot be used with -D)\n"); + fprintf(output, "\t-D set ubertooth serial to use (cannot be used with -U)\n"); fprintf(output, "\t-N print total number of Uberteeth and exit\n"); fprintf(output, "\n"); fprintf(output, "Radio options:\n"); @@ -84,6 +86,9 @@ int main(int argc, char *argv[]) int do_something, do_compile_info; int do_number, do_xmas; int ubertooth_device = -1; + char serial_c[34] = {0}; + int device_index = 0, device_serial = 0; + char version_string[MAX_VERSION_STRING_LEN]; /* set command states to negative as a starter @@ -97,10 +102,15 @@ int main(int argc, char *argv[]) do_something= 0; do_compile_info= -1; do_number= 0; do_xmas= 0; - while ((opt=getopt(argc,argv,"U:hnmefiIprsStvbl::a::C::c::d::q::z::9VNx")) != EOF) { + while ((opt=getopt(argc,argv,"U:D:hnmefiIprsStvbl::a::C::c::d::q::z::9VNx")) != EOF) { switch(opt) { + case 'D': + snprintf(serial_c, sizeof(serial_c), "%s", optarg); + device_serial = 1; + break; case 'U': ubertooth_device = atoi(optarg); + device_index = 1; break; case 'f': fprintf(stderr, "ubertooth-util -f is no longer required - use ubertooth-dfu instead\n"); @@ -214,18 +224,33 @@ int main(int argc, char *argv[]) return 0; } + if (device_serial && device_index) { + printf("Error: Cannot use both index and serial simultaneously\n"); + usage(stderr); + return 1; + } + /* initialise device */ - ut = ubertooth_start(ubertooth_device); + if (device_serial) + ut = ubertooth_start_serial(serial_c); + else + ut = ubertooth_start(ubertooth_device); + if (ut == NULL) { usage(stderr); return 1; } + if(do_reset == 0) { fprintf(stdout, "Resetting ubertooth device number %d\n", (ubertooth_device >= 0) ? ubertooth_device : 0); r = cmd_reset(ut->devh); sleep(2); - ut = ubertooth_start(ubertooth_device); + if (device_serial) + ut = ubertooth_start_serial(serial_c); + else + ut = ubertooth_start(ubertooth_device); } + if(do_stop == 0) { fprintf(stdout, "Stopping ubertooth device number %d\n", (ubertooth_device >= 0) ? ubertooth_device : 0); r = cmd_stop(ut->devh); @@ -238,6 +263,7 @@ int main(int argc, char *argv[]) r= cmd_set_txled(ut->devh, do_all_leds); r = (r >= 0) ? 0 : r; } + if(do_channel > 0) r= cmd_set_channel(ut->devh, do_channel); if(do_leds == 0 || do_leds == 1) @@ -269,7 +295,6 @@ int main(int argc, char *argv[]) fprintf(stdout, " (API:%x.%02x)\n", (usb_version>>8)&0xFF, usb_version&0xFF); else fprintf(stdout, "\n"); - } if(do_compile_info == 0) { cmd_get_compile_info(ut->devh, version_string, MAX_VERSION_STRING_LEN);