Skip to content

Commit 3b60de6

Browse files
committed
added USB vendor/device ID for use with and without dvb drivers
* added vendor/manufacturer id 0x1209 and product id 0x2832, see http://pid.codes/howto/ idea is to use modified rtl-dongle for SDR - without having to blacklist dvb_usb_rtl28xxu, that another unmodified device could be used with dvb * added options -M and -P to rtl_eeprom for modification of USB IDs Signed-off-by: hayati ayguen <[email protected]>
1 parent fd36226 commit 3b60de6

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

rtl-sdr.rules

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
# original RTL2832U vid/pid (hama nano, for example)
1919
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2832", MODE:="0666"
2020

21+
# modified RTL2832U vid/pid .. not known to dvb modules
22+
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="2832", MODE:="0666"
23+
2124
# RTL2832U OEM vid/pid, e.g. ezcap EzTV668 (E4000), Newsky TV28T (E4000/R820T) etc.
2225
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0666"
2326

src/librtlsdr.c

+1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ static rtlsdr_dongle_t known_devices[] = {
349349
{ 0x0ccd, 0x00d3, "Terratec Cinergy T Stick RC (Rev.3)" },
350350
{ 0x0ccd, 0x00d7, "Terratec T Stick PLUS" },
351351
{ 0x0ccd, 0x00e0, "Terratec NOXON DAB/DAB+ USB dongle (rev 2)" },
352+
{ 0x1209, 0x2832, "Generic RTL2832U" },
352353
{ 0x1554, 0x5020, "PixelView PV-DT235U(RN)" },
353354
{ 0x15f4, 0x0131, "Astrometa DVB-T/DVB-T2" },
354355
{ 0x15f4, 0x0133, "HanfTek DAB+FM+DVB-T" },

src/rtl_eeprom.c

+20-2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ void usage(void)
7373
"\t[-d device_index (default: 0)]\n"
7474
"\t[-m <str> set manufacturer string]\n"
7575
"\t[-p <str> set product string]\n"
76+
"\t[-M <id> set manufacturer ID (aka vendor ID) in hexadecimal]\n"
77+
"\t[-P <id> set product ID in hexadecimal]\n"
7678
"\t[-s <str> set serial number string]\n"
7779
"\t[-i <0,1> disable/enable IR-endpoint]\n"
7880
"\t[-g <conf> generate default config and write to device]\n"
@@ -85,7 +87,7 @@ void usage(void)
8587
"\t[-w <filename> write dumped file to device]\n"
8688
"\t[-r <filename> dump EEPROM to file]\n"
8789
"\t[-h display this help text]\n"
88-
"\nUse on your own risk, especially -w!\n");
90+
"\nUse on your own risk, especially -w, -M and -P!\n");
8991
exit(1);
9092
}
9193

@@ -255,6 +257,8 @@ int main(int argc, char **argv)
255257
FILE *file = NULL;
256258
char *manuf_str = NULL;
257259
char *product_str = NULL;
260+
int manuf_id = 0;
261+
int product_id = 0;
258262
char *serial_str = NULL;
259263
uint8_t buf[EEPROM_SIZE];
260264
rtlsdr_config_t conf;
@@ -264,7 +268,7 @@ int main(int argc, char **argv)
264268
int ir_endpoint = 0;
265269
char ch;
266270

267-
while ((opt = getopt(argc, argv, "d:m:p:s:i:g:w:r:h?")) != -1) {
271+
while ((opt = getopt(argc, argv, "d:m:p:M:P:s:i:g:w:r:h?")) != -1) {
268272
switch (opt) {
269273
case 'd':
270274
dev_index = atoi(optarg);
@@ -277,6 +281,14 @@ int main(int argc, char **argv)
277281
product_str = optarg;
278282
change = 1;
279283
break;
284+
case 'M':
285+
manuf_id = (int)strtol(optarg, NULL, 16);
286+
change = 1;
287+
break;
288+
case 'P':
289+
product_id = (int)strtol(optarg, NULL, 16);
290+
change = 1;
291+
break;
280292
case 's':
281293
serial_str = optarg;
282294
change = 1;
@@ -375,6 +387,12 @@ int main(int argc, char **argv)
375387
if (product_str)
376388
strncpy((char*)&conf.product, product_str, MAX_STR_SIZE);
377389

390+
if (manuf_id > 0)
391+
conf.vendor_id = manuf_id;
392+
393+
if (product_id > 0)
394+
conf.product_id = product_id;
395+
378396
if (serial_str) {
379397
conf.have_serial = 1;
380398
strncpy((char*)&conf.serial, serial_str, MAX_STR_SIZE);

0 commit comments

Comments
 (0)