Created
March 10, 2025 05:21
-
-
Save cjheath/4b77449859048c6ee67d6029d804c24f to your computer and use it in GitHub Desktop.
HackRF version detection enhancement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git i/host/hackrf-tools/src/hackrf_info.c w/host/hackrf-tools/src/hackrf_info.c | |
index 68c95938..fc7c1cc4 100644 | |
--- i/host/hackrf-tools/src/hackrf_info.c | |
+++ w/host/hackrf-tools/src/hackrf_info.c | |
@@ -30,13 +30,13 @@ void print_board_rev(uint8_t board_rev) | |
{ | |
switch (board_rev) { | |
case BOARD_REV_UNDETECTED: | |
- printf("Error: Hardware revision not yet detected by firmware.\n"); | |
+ printf("Error: Hardware revision not yet detected by firmware (board_rev=0x%02X).\n", board_rev); | |
return; | |
case BOARD_REV_UNRECOGNIZED: | |
printf("Warning: Hardware revision not recognized by firmware.\n"); | |
return; | |
} | |
- printf("Hardware Revision: %s\n", hackrf_board_rev_name(board_rev)); | |
+ printf("Hardware Revision: %s (board_rev=0x%02X)\n", hackrf_board_rev_name(board_rev), board_rev); | |
if (board_rev > BOARD_REV_HACKRF1_OLD) { | |
if (board_rev & HACKRF_BOARD_REV_GSG) { | |
printf("Hardware appears to have been manufactured by Great Scott Gadgets.\n"); | |
@@ -62,7 +62,7 @@ void print_supported_platform(uint32_t platform, uint8_t board_id) | |
switch (board_id) { | |
case BOARD_ID_HACKRF1_OG: | |
if (!(platform & HACKRF_PLATFORM_HACKRF1_OG)) { | |
- printf("Error: Firmware does not support HackRF One revisions older than r9.\n"); | |
+ printf("Error: Firmware does not support HackRF One revisions older than r9 (board_id=0x%02X).\n", board_id); | |
} | |
break; | |
case BOARD_ID_HACKRF1_R9: | |
diff --git i/host/libhackrf/src/hackrf.c w/host/libhackrf/src/hackrf.c | |
index 728f8961..e8f6f10e 100644 | |
--- i/host/libhackrf/src/hackrf.c | |
+++ w/host/libhackrf/src/hackrf.c | |
@@ -2923,6 +2923,8 @@ extern ADDAPI const char* ADDCALL hackrf_board_rev_name(enum hackrf_board_rev bo | |
case BOARD_ID_UNDETECTED: | |
return "undetected"; | |
+ /* Add new board revisions here */ | |
+ | |
default: | |
return "unknown"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment