|
|
|
@ -48,6 +48,7 @@ int fc0013_tune(void *dev, int freq) { |
|
|
|
|
//fc0013_GetBandwidthMode(dev, &bw); // FIXME: missing
|
|
|
|
|
return FC0013_SetFrequency(dev, freq/1000, bw & 0xff); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int fc0013_set_bw(void *dev, int bw) { |
|
|
|
|
/* read frequency to reapply it */ |
|
|
|
|
unsigned long freq = 0; |
|
|
|
@ -82,11 +83,11 @@ struct rtlsdr_device { |
|
|
|
|
uint16_t vid; |
|
|
|
|
uint16_t pid; |
|
|
|
|
} devices[] = { |
|
|
|
|
{ 0x0bda, 0x2832, /*RTLSDR_TUNER_E4000,*/ }, /* default RTL2832U vid/pid (eg. hama nano) */ |
|
|
|
|
{ 0x0bda, 0x2838, /*RTLSDR_TUNER_E4000,*/ }, /* ezcap USB 2.0 DVB-T/DAB/FM stick */ |
|
|
|
|
{ 0x0ccd, 0x00b3, /*RTLSDR_TUNER_FC0013,*/ }, /* Terratec NOXON DAB/DAB+ USB-Stick */ |
|
|
|
|
{ 0x1f4d, 0xb803, /*RTLSDR_TUNER_FC0012,*/ }, /* GTek T803 */ |
|
|
|
|
{ 0x1b80, 0xd3a4, /*RTLSDR_TUNER_FC0013,*/ }, /* Twintech UT-40 */ |
|
|
|
|
{ 0x0bda, 0x2832 }, /* default RTL2832U vid/pid (eg. hama nano) */ |
|
|
|
|
{ 0x0bda, 0x2838 }, /* ezcap USB 2.0 DVB-T/DAB/FM stick */ |
|
|
|
|
{ 0x0ccd, 0x00b3 }, /* Terratec NOXON DAB/DAB+ USB-Stick */ |
|
|
|
|
{ 0x1f4d, 0xb803 }, /* GTek T803 */ |
|
|
|
|
{ 0x1b80, 0xd3a4 }, /* Twintech UT-40 */ |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
typedef struct { |
|
|
|
@ -311,15 +312,10 @@ int rtlsdr_set_center_freq(rtlsdr_dev_t *dev, uint32_t freq) |
|
|
|
|
|
|
|
|
|
if (dev->tuner) { |
|
|
|
|
dev->tuner->freq = freq; |
|
|
|
|
|
|
|
|
|
double f = (double) freq; |
|
|
|
|
|
|
|
|
|
f *= 1.0 + dev->tuner->corr / 1e6; |
|
|
|
|
|
|
|
|
|
dev->tuner->tune((void *)dev, (int) f); |
|
|
|
|
|
|
|
|
|
printf("Tuned to %i Hz\n", freq); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rtlsdr_set_i2c_repeater(dev, 0); |
|
|
|
@ -408,11 +404,10 @@ uint32_t rtlsdr_get_device_count(void) |
|
|
|
|
libusb_get_device_descriptor(list[i], &dd); |
|
|
|
|
|
|
|
|
|
for (j = 0; j < sizeof(devices)/sizeof(struct rtlsdr_device); j++ ) { |
|
|
|
|
if ( devices[j].vid == dd.idVendor && devices[j].pid == dd.idProduct ) { |
|
|
|
|
if (devices[j].vid == dd.idVendor && devices[j].pid == dd.idProduct) |
|
|
|
|
device_count++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
libusb_free_device_list(list, 0); |
|
|
|
|
|
|
|
|
@ -460,7 +455,6 @@ rtlsdr_dev_t *rtlsdr_open(int index) |
|
|
|
|
for (j = 0; j < sizeof(devices)/sizeof(struct rtlsdr_device); j++ ) { |
|
|
|
|
if ( devices[j].vid == dd.idVendor && devices[j].pid == dd.idProduct ) { |
|
|
|
|
device_count++; |
|
|
|
|
|
|
|
|
|
if (index == device_count - 1) |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -514,9 +508,7 @@ err: |
|
|
|
|
int rtlsdr_close(rtlsdr_dev_t *dev) |
|
|
|
|
{ |
|
|
|
|
libusb_release_interface(dev->devh, 0); |
|
|
|
|
|
|
|
|
|
libusb_close(dev->devh); |
|
|
|
|
|
|
|
|
|
free(dev); |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|