From a858478bafbc01c197c6a3ca00a7b8a980cc9ee2 Mon Sep 17 00:00:00 2001 From: Dennis Mantz Date: Sun, 5 Oct 2014 23:54:00 -0700 Subject: [PATCH] Added Readme and clarified License Texts --- Readme.md | 63 +++++++++++++++++++ src/com/mantz_it/hackrf_android/Hackrf.java | 26 ++++++-- .../HackrfCallbackInterface.java | 11 ++-- .../hackrf_android/HackrfUsbException.java | 11 ++-- 4 files changed, 99 insertions(+), 12 deletions(-) create mode 100644 Readme.md diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..9d2dbdf --- /dev/null +++ b/Readme.md @@ -0,0 +1,63 @@ +HackRF Library for Android +========================== + +This repository is a ported version of Michael Ossmann's libhackrf +([https://github.com/mossmann/hackrf/tree/master/host/libhackrf] +(https://github.com/mossmann/hackrf/tree/master/host/libhackrf)) +library to work with Android 3.1+. + + + +![hackrf_android](https://pbs.twimg.com/media/BzHt03EIIAEXTvN.jpg) + +(photo by Dennis Mantz) + +See [http://tech.mantz-it.com](http://tech.mantz-it.com) and @dennismantz for updates. + + +Implemented Features +-------------------- +* Open HackRF (including the USB permission request) +* Reading Board ID from HackRF +* Reading Version from HackRF +* Reading Part ID and Serial Number from HackRF +* Setting Sample Rate of HackRF +* Setting Frequency of HackRF +* Setting Baseband Filter Width of HackRF +* Compute Baseband Filter Width for given Sample Rate +* Setting VGA Gain (Rx/Tx) of HackRF +* Setting LNA Gain of HackRF +* Setting Amplifier of HackRF +* Setting Antenna Port Power of HackRF +* Setting Transceiver Mode of HackRF +* Receiving from the HackRF using a BlockingQueue +* Get Transmission statistics +* Example App that shows how to use the library + + +Known Issues +------------ +* USB connection is too slow for Sample Rates >15 Msps (testet on Nexus 7) +* Tx not implemented yet +* FileWriter in example app is too slow. Only works for ~ 2 Msps. +* Not much testing so far... + + +Installation / Usage +-------------------- +If you want to use the library in your own app, just copy the bin/hackrf_android.jar +file into your project and include it as a library. See the example project to +learn how to use the library. + + +License +------- +This library 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. +[http://www.gnu.org/licenses/gpl.html](http://www.gnu.org/licenses/gpl.html) GPL version 2 or higher + +principal author: Dennis Mantz + +principal author of libhackrf: Michael Ossmann diff --git a/src/com/mantz_it/hackrf_android/Hackrf.java b/src/com/mantz_it/hackrf_android/Hackrf.java index c6ecb28..74290e9 100644 --- a/src/com/mantz_it/hackrf_android/Hackrf.java +++ b/src/com/mantz_it/hackrf_android/Hackrf.java @@ -31,17 +31,35 @@ import android.widget.Toast; * * @author Dennis Mantz * + * Copyright (C) 2014 Dennis Mantz + * based on code of libhackrf [https://github.com/mossmann/hackrf/tree/master/host/libhackrf]: + * 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. + * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher + * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public + * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * version 2 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. + * General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public + * You should have received a copy of the GNU General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/com/mantz_it/hackrf_android/HackrfCallbackInterface.java b/src/com/mantz_it/hackrf_android/HackrfCallbackInterface.java index 4833183..2f37e60 100644 --- a/src/com/mantz_it/hackrf_android/HackrfCallbackInterface.java +++ b/src/com/mantz_it/hackrf_android/HackrfCallbackInterface.java @@ -11,17 +11,20 @@ package com.mantz_it.hackrf_android; * * @author Dennis Mantz * + * Copyright (C) 2014 Dennis Mantz + * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher + * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public + * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * version 2 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. + * General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public + * You should have received a copy of the GNU General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/src/com/mantz_it/hackrf_android/HackrfUsbException.java b/src/com/mantz_it/hackrf_android/HackrfUsbException.java index eef12a0..a3bc386 100644 --- a/src/com/mantz_it/hackrf_android/HackrfUsbException.java +++ b/src/com/mantz_it/hackrf_android/HackrfUsbException.java @@ -9,17 +9,20 @@ package com.mantz_it.hackrf_android; * * @author Dennis Mantz * + * Copyright (C) 2014 Dennis Mantz + * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher + * * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public + * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * version 2 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. + * General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public + * You should have received a copy of the GNU General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */