libhackrf: The usb firmware reports board type as USB product id. Provide hackrf_usb_board_id_name() to decode that.

This commit is contained in:
Heikki Hannikainen
2015-02-24 12:15:05 +02:00
parent c0b3638cce
commit 9b9466f02a
2 changed files with 25 additions and 0 deletions

View File

@ -1519,6 +1519,24 @@ const char* ADDCALL hackrf_board_id_name(enum hackrf_board_id board_id)
} }
} }
extern ADDAPI const char* ADDCALL hackrf_usb_board_id_name(enum hackrf_usb_board_id usb_board_id)
{
switch(usb_board_id)
{
case USB_BOARD_ID_JAWBREAKER:
return "Jawbreaker";
case USB_BOARD_ID_HACKRF_ONE:
return "HackRF One";
case USB_BOARD_ID_INVALID:
return "Invalid Board ID";
default:
return "Unknown Board ID";
}
}
const char* ADDCALL hackrf_filter_path_name(const enum rf_path_filter path) const char* ADDCALL hackrf_filter_path_name(const enum rf_path_filter path)
{ {
switch(path) { switch(path) {

View File

@ -69,6 +69,12 @@ enum hackrf_board_id {
BOARD_ID_INVALID = 0xFF, BOARD_ID_INVALID = 0xFF,
}; };
enum hackrf_usb_board_id {
USB_BOARD_ID_JAWBREAKER = 0x604B,
USB_BOARD_ID_HACKRF_ONE = 0x6089,
USB_BOARD_ID_INVALID = 0xFFFF,
};
enum rf_path_filter { enum rf_path_filter {
RF_PATH_FILTER_BYPASS = 0, RF_PATH_FILTER_BYPASS = 0,
RF_PATH_FILTER_LOW_PASS = 1, RF_PATH_FILTER_LOW_PASS = 1,
@ -181,6 +187,7 @@ extern ADDAPI int ADDCALL hackrf_set_antenna_enable(hackrf_device* device, const
extern ADDAPI const char* ADDCALL hackrf_error_name(enum hackrf_error errcode); extern ADDAPI const char* ADDCALL hackrf_error_name(enum hackrf_error errcode);
extern ADDAPI const char* ADDCALL hackrf_board_id_name(enum hackrf_board_id board_id); extern ADDAPI const char* ADDCALL hackrf_board_id_name(enum hackrf_board_id board_id);
extern ADDAPI const char* ADDCALL hackrf_usb_board_id_name(enum hackrf_usb_board_id usb_board_id);
extern ADDAPI const char* ADDCALL hackrf_filter_path_name(const enum rf_path_filter path); extern ADDAPI const char* ADDCALL hackrf_filter_path_name(const enum rf_path_filter path);
/* Compute nearest freq for bw filter (manual filter) */ /* Compute nearest freq for bw filter (manual filter) */