Fix missed scan -> sweep changes

This commit is contained in:
Dominic Spill
2016-07-27 07:59:10 +01:00
committed by Mike Walters
parent 86bde9f4c2
commit dc0b5a5798
3 changed files with 8 additions and 8 deletions

View File

@ -337,7 +337,7 @@ int main(int argc, char** argv) {
} }
/* DGS FIXME: allow upper and lower frequencies to be set */ /* DGS FIXME: allow upper and lower frequencies to be set */
result = hackrf_init_scan(device, 50, 6000, 10); result = hackrf_init_sweep(device, 50, 6000, 10);
if( result != HACKRF_SUCCESS ) { if( result != HACKRF_SUCCESS ) {
fprintf(stderr, "hackrf_init_scan() failed: %s (%d)\n", fprintf(stderr, "hackrf_init_scan() failed: %s (%d)\n",
hackrf_error_name(result), result); hackrf_error_name(result), result);

View File

@ -68,7 +68,7 @@ typedef enum {
HACKRF_VENDOR_REQUEST_ANTENNA_ENABLE = 23, HACKRF_VENDOR_REQUEST_ANTENNA_ENABLE = 23,
HACKRF_VENDOR_REQUEST_SET_FREQ_EXPLICIT = 24, HACKRF_VENDOR_REQUEST_SET_FREQ_EXPLICIT = 24,
// USB_WCID_VENDOR_REQ = 25 // USB_WCID_VENDOR_REQ = 25
HACKRF_VENDOR_REQUEST_INIT_SCAN = 26, HACKRF_VENDOR_REQUEST_INIT_SWEEP = 26,
} hackrf_vendor_request; } hackrf_vendor_request;
typedef enum { typedef enum {
@ -1697,29 +1697,29 @@ uint32_t ADDCALL hackrf_compute_baseband_filter_bw(const uint32_t bandwidth_hz)
return p->bandwidth_hz; return p->bandwidth_hz;
} }
struct init_scan_params { struct init_sweep_params {
uint16_t min_freq_mhz; uint16_t min_freq_mhz;
uint16_t max_freq_mhz; uint16_t max_freq_mhz;
uint16_t step_freq_mhz; uint16_t step_freq_mhz;
}; };
int ADDCALL hackrf_init_scan(hackrf_device* device, int ADDCALL hackrf_init_sweep(hackrf_device* device,
const uint16_t min_freq_mhz, const uint16_t max_freq_mhz, const uint16_t min_freq_mhz, const uint16_t max_freq_mhz,
const uint16_t step_freq_mhz) const uint16_t step_freq_mhz)
{ {
struct init_scan_params params; struct init_sweep_params params;
uint8_t length; uint8_t length;
int result; int result;
params.min_freq_mhz = TO_LE(min_freq_mhz); params.min_freq_mhz = TO_LE(min_freq_mhz);
params.max_freq_mhz = TO_LE(max_freq_mhz); params.max_freq_mhz = TO_LE(max_freq_mhz);
params.step_freq_mhz = TO_LE(step_freq_mhz); params.step_freq_mhz = TO_LE(step_freq_mhz);
length = sizeof(struct init_scan_params); length = sizeof(struct init_sweep_params);
result = libusb_control_transfer( result = libusb_control_transfer(
device->usb_device, device->usb_device,
LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE, LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
HACKRF_VENDOR_REQUEST_INIT_SCAN, HACKRF_VENDOR_REQUEST_INIT_SWEEP,
0, 0,
0, 0,
(unsigned char*)&params, (unsigned char*)&params,

View File

@ -197,7 +197,7 @@ extern ADDAPI uint32_t ADDCALL hackrf_compute_baseband_filter_bw_round_down_lt(c
/* Compute best default value depending on sample rate (auto filter) */ /* Compute best default value depending on sample rate (auto filter) */
extern ADDAPI uint32_t ADDCALL hackrf_compute_baseband_filter_bw(const uint32_t bandwidth_hz); extern ADDAPI uint32_t ADDCALL hackrf_compute_baseband_filter_bw(const uint32_t bandwidth_hz);
/* Start scan mode */ /* Start scan mode */
extern ADDAPI int ADDCALL hackrf_init_scan(hackrf_device* device, extern ADDAPI int ADDCALL hackrf_init_sweep(hackrf_device* device,
const uint16_t min_freq_mhz, const uint16_t max_freq_mhz, const uint16_t min_freq_mhz, const uint16_t max_freq_mhz,
const uint16_t step_freq_mhz); const uint16_t step_freq_mhz);