Skip to content

Commit

Permalink
Updated hackrf library to v2023.01.1
Browse files Browse the repository at this point in the history
hackrf library is now a submodule with patch applied to hackrf_sweep.c
for easier future updates.

Requires firmware on the hackrf to be updated as well to run now.
  • Loading branch information
pavsa committed Mar 5, 2023
1 parent 257e737 commit 4984b6f
Show file tree
Hide file tree
Showing 337 changed files with 428 additions and 554,301 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "src/hackrf-sweep/lib/hackrf"]
path = src/hackrf-sweep/lib/hackrf
url = https://github.com/greatscottgadgets/hackrf.git
ignore = dirty
5 changes: 3 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Linux: read Installation section below
- hackrf_sweep integrated as a shared library

### Requirements:
* HackRF One with [Firmware 2017.02.1](https://github.com/mossmann/hackrf/releases/tag/v2017.02.1) or newer (use linux inside virtual machine to [update the firmware](https://github.com/mossmann/hackrf/wiki/Updating-Firmware))
* HackRF One with [Firmware 2023.01.1](https://github.com/mossmann/hackrf/releases/tag/v2023.01.1) or newer
(use linux inside VM and [update the firmware](https://hackrf.readthedocs.io/en/latest/updating_firmware.html))

### Installation:
Make sure HackRF is using at least the minimum firmware version (see above)
Expand All @@ -27,7 +28,7 @@ Windows:
1. Install Java JRE 64bit v1.8+
1. [Download the latest version of Spectrum Analyzer](https://github.com/pavsa/hackrf-spectrum-analyzer/releases) and unzip
1. Install HackRF as a libusb device
1. [Download Zadig](src/hackrf-sweep/lib/zadig_2.2.exe) and run
1. [Download Zadig](https://zadig.akeo.ie/) and install
2. Goto Options and check List All Devices
3. Find "HackRF One" and select Driver "WinUSB" and click install
1. Install (if you don't have one installed) [Java JRE for Windows x64](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)
Expand Down
2 changes: 1 addition & 1 deletion src/hackrf-sweep/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<classpathentry kind="lib" path="miglayout15-swing.jar" sourcepath="miglayout-src.zip"/>
<classpathentry kind="lib" path="lib/jcommon-1.0.17.jar"/>
<classpathentry kind="lib" path="lib/jfreechart-1.0.14.jar"/>
<classpathentry kind="lib" path="lib/jna/jna-4.5.1.jar"/>
<classpathentry kind="lib" path="lib/hackrf-sweep-jna.jar"/>
<classpathentry kind="lib" path="lib/jna/jna-5.13.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
8 changes: 6 additions & 2 deletions src/hackrf-sweep/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ ZIP_FILE_PATH = $(OUTPUT_DLL_DIR)/../../$(ZIP_FILE)
.NOTPARALLEL: all
.PHONY: all

all: prepare $(MAIN_JAR) $(DLL_LIB) $(ZIP_FILE_PATH)
all: patch_hackrf prepare $(MAIN_JAR) $(DLL_LIB) $(ZIP_FILE_PATH)

.PHONY: dirs
dirs:
Expand All @@ -99,6 +99,11 @@ $(ZIP_FILE_PATH): $(DLL_LIB) $(DLL_LIB_WIN)
cd $(OUTPUT_DLL_DIR)/../../ && rm -rf $(ZIP_FILE) && zip -r $(ZIP_FILE) *
yes | cp -rf $(ZIP_FILE_PATH) $(RELEASE_DIR)

.PHONY: patch_hackrf
patch_hackrf:
# format the src # clang-format --style=file:../../../.clang-format -i hackrf_sweep.c
(cd lib/hackrf/ && git reset --hard v2023.01.1 && git apply < ../../src-c/0001-hackrf_sweep-to-library-conversion.patch)

.PHONY: prepare
prepare: dirs $(OBJECTS) $(OBJECTS_WIN) $(DLL_LIB_FFTW)
mkdir -p $(OUTPUT_DLL_DIR) $(OUTPUT_DLL_DIR_WIN)
Expand All @@ -107,7 +112,6 @@ prepare: dirs $(OBJECTS) $(OBJECTS_WIN) $(DLL_LIB_FFTW)
cp lib/launchers/hackrf_sweep_spectrum_analyzer_windows.cmd $(OUTPUT_PATH)
chmod +x $(OUTPUT_PATH)/hackrf_sweep_spectrum_analyzer_linux.sh #linux launcher
cp -f $(DLL_LIB_FFTW) $(DLL_LIB_PTHREAD) $(DLL_LIB_USB) $(OUTPUT_DLL_DIR_WIN)
cp -f lib/zadig-2.5.exe $(OUTPUT_DLL_DIR_WIN)/../

# if native header in hackrf lib changes, rebuild with "make jnabridge" - but openjdk-8 is required - jnaerator does not work with jdk9+
.PHONY: jnabridge
Expand Down
1 change: 1 addition & 0 deletions src/hackrf-sweep/lib/hackrf
Submodule hackrf added at b42a18
70 changes: 0 additions & 70 deletions src/hackrf-sweep/lib/hackrf/.gitignore

This file was deleted.

62 changes: 0 additions & 62 deletions src/hackrf-sweep/lib/hackrf/.travis.yml

This file was deleted.

Loading

0 comments on commit 4984b6f

Please sign in to comment.