diff --git a/host/hackrf-tools/CMakeLists.txt b/host/hackrf-tools/CMakeLists.txt new file mode 100644 index 00000000..c970f1c4 --- /dev/null +++ b/host/hackrf-tools/CMakeLists.txt @@ -0,0 +1,43 @@ +# Copyright 2012 Jared Boone +# +# This file is part of HackRF. +# +# 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, 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; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +# Based heavily upon the libftdi cmake setup. + +project(hackrf-tools) +set(MAJOR_VERSION 0) +set(MINOR_VERSION 1) +set(PACKAGE hackrf-tools) +set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}) +set(VERSION ${VERSION_STRING}) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") + +cmake_minimum_required(VERSION 2.8) + +add_definitions(-Wall) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") + +find_package(USB1 REQUIRED) +include_directories(${LIBUSB_INCLUDE_DIR}) + +include_directories(${CMAKE_SOURCE_DIR}/../libhackrf/src) +link_directories(${CMAKE_SOURCE_DIR}/../libhackrf/src) + +add_subdirectory(src) diff --git a/host/hackrf-tools/FindUSB1.cmake b/host/hackrf-tools/FindUSB1.cmake new file mode 100644 index 00000000..0cbf8022 --- /dev/null +++ b/host/hackrf-tools/FindUSB1.cmake @@ -0,0 +1,38 @@ +# - Try to find the freetype library +# Once done this defines +# +# LIBUSB_FOUND - system has libusb +# LIBUSB_INCLUDE_DIR - the libusb include directory +# LIBUSB_LIBRARIES - Link these to use libusb + +# Copyright (c) 2006, 2008 Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + + # in cache already + set(LIBUSB_FOUND TRUE) + +else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_LIBUSB libusb-1.0) + ENDIF(NOT WIN32) + + FIND_PATH(LIBUSB_INCLUDE_DIR libusb.h + PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS}) + + FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 + PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS}) + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) + + MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES) + +endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) \ No newline at end of file diff --git a/host/hackrf-tools/Readme.md b/host/hackrf-tools/Readme.md new file mode 100644 index 00000000..beb0c947 --- /dev/null +++ b/host/hackrf-tools/Readme.md @@ -0,0 +1,34 @@ +This repository contains hardware designs and software for HackRF, a project to +produce a low cost, open source software radio platform. + +![Jawbreaker](https://raw.github.com/mossmann/hackrf/master/doc/jawbreaker.jpeg) + +How to build host software on Windows: +prerequisite for cygwin or mingw: +* cmake-2.8.10.2 or more see http://www.cmake.org/cmake/resources/software.html +* libusbx-1.0.14 or more see http://sourceforge.net/projects/libusbx/files/latest/download?source=files +* Install Windows driver for HackRF hardware or use Zadig see http://sourceforge.net/projects/libwdi/files/zadig + - If you want to use Zadig select HackRF USB device and just install/replace it with WinUSB driver. +* Build libhackrf before to build this library, see host/libhackrf/Readme.md. + +For Cygwin: +cmake -G "Unix Makefiles" -DCMAKE_LEGACY_CYGWIN_WIN32=1 -DLIBUSB_INCLUDE_DIR=/usr/local/include/libusb-1.0/ +make +make install + +For Mingw: +#normal version +cmake -G "MSYS Makefiles" -DLIBUSB_INCLUDE_DIR=/usr/local/include/libusb-1.0/ +#debug version +cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug -DLIBUSB_INCLUDE_DIR=/usr/local/include/libusb-1.0/ +make +make install + +How to build host software on Linux: +cmake ./ +make +make install + +principal author: Michael Ossmann + +http://greatscottgadgets.com/hackrf/ diff --git a/host/libhackrf/examples/CMakeLists.txt b/host/hackrf-tools/src/CMakeLists.txt similarity index 94% rename from host/libhackrf/examples/CMakeLists.txt rename to host/hackrf-tools/src/CMakeLists.txt index 09f0acd2..097a8ad2 100644 --- a/host/libhackrf/examples/CMakeLists.txt +++ b/host/hackrf-tools/src/CMakeLists.txt @@ -1,44 +1,44 @@ -# Copyright 2012 Jared Boone -# Copyright 2013 Benjamin Vernoux -# -# This file is part of HackRF. -# -# 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, 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; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -# Based heavily upon the libftdi cmake setup. - -option(EXAMPLES "Build example programs" ON) - -IF( EXAMPLES ) - add_executable(hackrf_max2837 hackrf_max2837.c) - add_executable(hackrf_si5351c hackrf_si5351c.c) - add_executable(hackrf_transfer hackrf_transfer.c) - add_executable(hackrf_rffc5071 hackrf_rffc5071.c) - add_executable(hackrf_spiflash hackrf_spiflash.c) - add_executable(hackrf_cpldjtag hackrf_cpldjtag.c) - add_executable(hackrf_info hackrf_info.c) - - target_link_libraries(hackrf_max2837 hackrf) - target_link_libraries(hackrf_si5351c hackrf) - target_link_libraries(hackrf_transfer hackrf) - target_link_libraries(hackrf_rffc5071 hackrf) - target_link_libraries(hackrf_spiflash hackrf) - target_link_libraries(hackrf_cpldjtag hackrf) - target_link_libraries(hackrf_info hackrf) - - include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src) -endif(EXAMPLES) +# Copyright 2012 Jared Boone +# Copyright 2013 Benjamin Vernoux +# +# This file is part of HackRF. +# +# 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, 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; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +# Based heavily upon the libftdi cmake setup. + +option(EXAMPLES "Build example programs" ON) + +IF( EXAMPLES ) + add_executable(hackrf_max2837 hackrf_max2837.c) + add_executable(hackrf_si5351c hackrf_si5351c.c) + add_executable(hackrf_transfer hackrf_transfer.c) + add_executable(hackrf_rffc5071 hackrf_rffc5071.c) + add_executable(hackrf_spiflash hackrf_spiflash.c) + add_executable(hackrf_cpldjtag hackrf_cpldjtag.c) + add_executable(hackrf_info hackrf_info.c) + + target_link_libraries(hackrf_max2837 hackrf) + target_link_libraries(hackrf_si5351c hackrf) + target_link_libraries(hackrf_transfer hackrf) + target_link_libraries(hackrf_rffc5071 hackrf) + target_link_libraries(hackrf_spiflash hackrf) + target_link_libraries(hackrf_cpldjtag hackrf) + target_link_libraries(hackrf_info hackrf) + + include_directories(BEFORE ${CMAKE_SOURCE_DIR}/../libhackrf/src) +endif(EXAMPLES) diff --git a/host/libhackrf/examples/hackrf_cpldjtag.c b/host/hackrf-tools/src/hackrf_cpldjtag.c similarity index 100% rename from host/libhackrf/examples/hackrf_cpldjtag.c rename to host/hackrf-tools/src/hackrf_cpldjtag.c diff --git a/host/libhackrf/examples/hackrf_info.c b/host/hackrf-tools/src/hackrf_info.c similarity index 100% rename from host/libhackrf/examples/hackrf_info.c rename to host/hackrf-tools/src/hackrf_info.c diff --git a/host/libhackrf/examples/hackrf_max2837.c b/host/hackrf-tools/src/hackrf_max2837.c similarity index 100% rename from host/libhackrf/examples/hackrf_max2837.c rename to host/hackrf-tools/src/hackrf_max2837.c diff --git a/host/libhackrf/examples/hackrf_rffc5071.c b/host/hackrf-tools/src/hackrf_rffc5071.c similarity index 96% rename from host/libhackrf/examples/hackrf_rffc5071.c rename to host/hackrf-tools/src/hackrf_rffc5071.c index 15ca6e71..f3d5fdcd 100644 --- a/host/libhackrf/examples/hackrf_rffc5071.c +++ b/host/hackrf-tools/src/hackrf_rffc5071.c @@ -1,178 +1,178 @@ -/* - * Copyright 2012 Jared Boone - * Copyright 2013 Benjamin Vernoux - * - * This file is part of HackRF. - * - * 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, 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; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include - -#include -#include -#include -#include - -static void usage() { - printf("\nUsage:\n"); - printf("\t-n, --register : set register number for subsequent read/write operations\n"); - printf("\t-r, --read: read register specified by last -n argument, or all registers\n"); - printf("\t-w, --write : write register specified by last -n argument with value \n"); - printf("\nExamples:\n"); - printf("\t -n 12 -r # reads from register 12\n"); - printf("\t -r # reads all registers\n"); - printf("\t -n 10 -w 514 # writes register 10 with 514 decimal\n"); -} - -static struct option long_options[] = { - { "register", required_argument, 0, 'n' }, - { "write", required_argument, 0, 'w' }, - { "read", no_argument, 0, 'r' }, - { 0, 0, 0, 0 }, -}; - -int parse_int(char* s, uint16_t* const value) { - uint_fast8_t base = 10; - if( strlen(s) > 2 ) { - if( s[0] == '0' ) { - if( (s[1] == 'x') || (s[1] == 'X') ) { - base = 16; - s += 2; - } else if( (s[1] == 'b') || (s[1] == 'B') ) { - base = 2; - s += 2; - } - } - } - - char* s_end = s; - const long long_value = strtol(s, &s_end, base); - if( (s != s_end) && (*s_end == 0) ) { - *value = long_value; - return HACKRF_SUCCESS; - } else { - return HACKRF_ERROR_INVALID_PARAM; - } -} - -int dump_register(hackrf_device* device, const uint16_t register_number) { - uint16_t register_value; - int result = hackrf_rffc5071_read(device, register_number, ®ister_value); - - if( result == HACKRF_SUCCESS ) { - printf("[%2d] -> 0x%03x\n", register_number, register_value); - } else { - printf("hackrf_rffc5071_read() failed: %s (%d)\n", hackrf_error_name(result), result); - } - - return result; -} - -int dump_registers(hackrf_device* device) { - uint16_t register_number; - int result = HACKRF_SUCCESS; - - for(register_number=0; register_number<31; register_number++) { - result = dump_register(device, register_number); - if( result != HACKRF_SUCCESS ) { - break; - } - } - - return result; -} - -int write_register( - hackrf_device* device, - const uint16_t register_number, - const uint16_t register_value -) { - int result = HACKRF_SUCCESS; - result = hackrf_rffc5071_write(device, register_number, register_value); - - if( result == HACKRF_SUCCESS ) { - printf("0x%03x -> [%2d]\n", register_value, register_number); - } else { - printf("hackrf_rffc5071_write() failed: %s (%d)\n", hackrf_error_name(result), result); - } - - return result; -} - -#define REGISTER_INVALID 32767 - -int main(int argc, char** argv) { - int opt; - uint16_t register_number = REGISTER_INVALID; - uint16_t register_value; - - int result = hackrf_init(); - if( result ) { - printf("hackrf_init() failed: %s (%d)\n", hackrf_error_name(result), result); - return -1; - } - - hackrf_device* device = NULL; - result = hackrf_open(&device); - if( result ) { - printf("hackrf_open() failed: %s (%d)\n", hackrf_error_name(result), result); - return -1; - } - - int option_index = 0; - while( (opt = getopt_long(argc, argv, "n:rw:", long_options, &option_index)) != EOF ) { - switch( opt ) { - case 'n': - result = parse_int(optarg, ®ister_number); - break; - - case 'w': - result = parse_int(optarg, ®ister_value); - if( result == HACKRF_SUCCESS ) { - result = write_register(device, register_number, register_value); - } - break; - - case 'r': - if( register_number == REGISTER_INVALID ) { - result = dump_registers(device); - } else { - result = dump_register(device, register_number); - } - break; - - default: - usage(); - } - - if( result != HACKRF_SUCCESS ) { - printf("argument error: %s (%d)\n", hackrf_error_name(result), result); - usage(); - break; - } - } - - result = hackrf_close(device); - if( result ) { - printf("hackrf_close() failed: %s (%d)\n", hackrf_error_name(result), result); - return -1; - } - - hackrf_exit(); - - return 0; -} +/* + * Copyright 2012 Jared Boone + * Copyright 2013 Benjamin Vernoux + * + * This file is part of HackRF. + * + * 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, 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; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include + +#include +#include +#include +#include + +static void usage() { + printf("\nUsage:\n"); + printf("\t-n, --register : set register number for subsequent read/write operations\n"); + printf("\t-r, --read: read register specified by last -n argument, or all registers\n"); + printf("\t-w, --write : write register specified by last -n argument with value \n"); + printf("\nExamples:\n"); + printf("\t -n 12 -r # reads from register 12\n"); + printf("\t -r # reads all registers\n"); + printf("\t -n 10 -w 514 # writes register 10 with 514 decimal\n"); +} + +static struct option long_options[] = { + { "register", required_argument, 0, 'n' }, + { "write", required_argument, 0, 'w' }, + { "read", no_argument, 0, 'r' }, + { 0, 0, 0, 0 }, +}; + +int parse_int(char* s, uint16_t* const value) { + uint_fast8_t base = 10; + if( strlen(s) > 2 ) { + if( s[0] == '0' ) { + if( (s[1] == 'x') || (s[1] == 'X') ) { + base = 16; + s += 2; + } else if( (s[1] == 'b') || (s[1] == 'B') ) { + base = 2; + s += 2; + } + } + } + + char* s_end = s; + const long long_value = strtol(s, &s_end, base); + if( (s != s_end) && (*s_end == 0) ) { + *value = long_value; + return HACKRF_SUCCESS; + } else { + return HACKRF_ERROR_INVALID_PARAM; + } +} + +int dump_register(hackrf_device* device, const uint16_t register_number) { + uint16_t register_value; + int result = hackrf_rffc5071_read(device, register_number, ®ister_value); + + if( result == HACKRF_SUCCESS ) { + printf("[%2d] -> 0x%03x\n", register_number, register_value); + } else { + printf("hackrf_rffc5071_read() failed: %s (%d)\n", hackrf_error_name(result), result); + } + + return result; +} + +int dump_registers(hackrf_device* device) { + uint16_t register_number; + int result = HACKRF_SUCCESS; + + for(register_number=0; register_number<31; register_number++) { + result = dump_register(device, register_number); + if( result != HACKRF_SUCCESS ) { + break; + } + } + + return result; +} + +int write_register( + hackrf_device* device, + const uint16_t register_number, + const uint16_t register_value +) { + int result = HACKRF_SUCCESS; + result = hackrf_rffc5071_write(device, register_number, register_value); + + if( result == HACKRF_SUCCESS ) { + printf("0x%03x -> [%2d]\n", register_value, register_number); + } else { + printf("hackrf_rffc5071_write() failed: %s (%d)\n", hackrf_error_name(result), result); + } + + return result; +} + +#define REGISTER_INVALID 32767 + +int main(int argc, char** argv) { + int opt; + uint16_t register_number = REGISTER_INVALID; + uint16_t register_value; + + int result = hackrf_init(); + if( result ) { + printf("hackrf_init() failed: %s (%d)\n", hackrf_error_name(result), result); + return -1; + } + + hackrf_device* device = NULL; + result = hackrf_open(&device); + if( result ) { + printf("hackrf_open() failed: %s (%d)\n", hackrf_error_name(result), result); + return -1; + } + + int option_index = 0; + while( (opt = getopt_long(argc, argv, "n:rw:", long_options, &option_index)) != EOF ) { + switch( opt ) { + case 'n': + result = parse_int(optarg, ®ister_number); + break; + + case 'w': + result = parse_int(optarg, ®ister_value); + if( result == HACKRF_SUCCESS ) { + result = write_register(device, register_number, register_value); + } + break; + + case 'r': + if( register_number == REGISTER_INVALID ) { + result = dump_registers(device); + } else { + result = dump_register(device, register_number); + } + break; + + default: + usage(); + } + + if( result != HACKRF_SUCCESS ) { + printf("argument error: %s (%d)\n", hackrf_error_name(result), result); + usage(); + break; + } + } + + result = hackrf_close(device); + if( result ) { + printf("hackrf_close() failed: %s (%d)\n", hackrf_error_name(result), result); + return -1; + } + + hackrf_exit(); + + return 0; +} diff --git a/host/libhackrf/examples/hackrf_si5351c.c b/host/hackrf-tools/src/hackrf_si5351c.c similarity index 100% rename from host/libhackrf/examples/hackrf_si5351c.c rename to host/hackrf-tools/src/hackrf_si5351c.c diff --git a/host/libhackrf/examples/hackrf_spiflash.c b/host/hackrf-tools/src/hackrf_spiflash.c similarity index 100% rename from host/libhackrf/examples/hackrf_spiflash.c rename to host/hackrf-tools/src/hackrf_spiflash.c diff --git a/host/libhackrf/examples/hackrf_transfer.c b/host/hackrf-tools/src/hackrf_transfer.c similarity index 100% rename from host/libhackrf/examples/hackrf_transfer.c rename to host/hackrf-tools/src/hackrf_transfer.c diff --git a/host/libhackrf/CMakeLists.txt b/host/libhackrf/CMakeLists.txt index 000a4326..ec3dd39e 100644 --- a/host/libhackrf/CMakeLists.txt +++ b/host/libhackrf/CMakeLists.txt @@ -1,42 +1,41 @@ -# Copyright 2012 Jared Boone -# -# This file is part of HackRF. -# -# 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, 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; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -# Based heavily upon the libftdi cmake setup. - -project(libhackrf) -set(MAJOR_VERSION 0) -set(MINOR_VERSION 1) -set(PACKAGE libhackrf) -set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}) -set(VERSION ${VERSION_STRING}) -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") - -cmake_minimum_required(VERSION 2.8) - -add_definitions(-Wall) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") - -find_package(USB1 REQUIRED) -include_directories(${LIBUSB_INCLUDE_DIR}) - -add_subdirectory(src) -add_subdirectory(examples) - +# Copyright 2012 Jared Boone +# +# This file is part of HackRF. +# +# 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, 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; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +# Based heavily upon the libftdi cmake setup. + +project(libhackrf) +set(MAJOR_VERSION 0) +set(MINOR_VERSION 1) +set(PACKAGE libhackrf) +set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}) +set(VERSION ${VERSION_STRING}) +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") + +cmake_minimum_required(VERSION 2.8) + +add_definitions(-Wall) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") + +find_package(USB1 REQUIRED) +include_directories(${LIBUSB_INCLUDE_DIR}) + +add_subdirectory(src) + diff --git a/host/libhackrf/src/CMakeLists.txt b/host/libhackrf/src/CMakeLists.txt index 8e15b8b0..56fb50ef 100644 --- a/host/libhackrf/src/CMakeLists.txt +++ b/host/libhackrf/src/CMakeLists.txt @@ -1,24 +1,25 @@ -# Copyright 2012 Jared Boone -# Copyright 2013 Benjamin Vernoux # -# This file is part of HackRF. +# Copyright (c) 2012, Jared Boone +# Copyright (c) 2013, Benjamin Vernoux +# Copyright (c) 2013, Michael Ossmann +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +# 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. +# Neither the name of Great Scott Gadgets nor the names of its contributors may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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. # -# 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, 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; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - # Based heavily upon the libftdi cmake setup. # Targets diff --git a/host/libhackrf/src/hackrf.c b/host/libhackrf/src/hackrf.c index 610ad301..c520e63e 100644 --- a/host/libhackrf/src/hackrf.c +++ b/host/libhackrf/src/hackrf.c @@ -1,24 +1,25 @@ /* - * Copyright 2012 Jared Boone - * Copyright 2013 Benjamin Vernoux - * - * This file is part of HackRF. - * - * 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, 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; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ +Copyright (c) 2012, Jared Boone +Copyright (c) 2013, Benjamin Vernoux +Copyright (c) 2013, Michael Ossmann + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 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. + Neither the name of Great Scott Gadgets nor the names of its contributors may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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. +*/ #include "hackrf.h" diff --git a/host/libhackrf/src/hackrf.h b/host/libhackrf/src/hackrf.h index 64320d7c..b05a555e 100644 --- a/host/libhackrf/src/hackrf.h +++ b/host/libhackrf/src/hackrf.h @@ -1,24 +1,25 @@ /* - * Copyright 2012 Jared Boone - * Copyright 2013 Benjamin Vernoux - * - * This file is part of HackRF. - * - * 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, 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; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ +Copyright (c) 2012, Jared Boone +Copyright (c) 2013, Benjamin Vernoux +Copyright (c) 2013, Michael Ossmann + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 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. + Neither the name of Great Scott Gadgets nor the names of its contributors may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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. +*/ #ifndef __HACKRF_H__ #define __HACKRF_H__