diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-12 11:42:15 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-12 11:42:15 +0100 |
commit | 6514649439e7a0209945c70b7da10d6f0e4cb0ae (patch) | |
tree | 18548fcacb883481c78a6a8b7c160e6755aab9c8 /dvbdevice.c | |
parent | 77340e92732b250a20e875f16bad2f85f2e3483b (diff) | |
download | vdr-6514649439e7a0209945c70b7da10d6f0e4cb0ae.tar.gz vdr-6514649439e7a0209945c70b7da10d6f0e4cb0ae.tar.bz2 |
Added subsystem id support for DVB devices connected via USB
Diffstat (limited to 'dvbdevice.c')
-rw-r--r-- | dvbdevice.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/dvbdevice.c b/dvbdevice.c index fb406f1a..da97567a 100644 --- a/dvbdevice.c +++ b/dvbdevice.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbdevice.c 3.11 2014/03/16 10:38:31 kls Exp $ + * $Id: dvbdevice.c 3.12 2015/01/12 11:24:51 kls Exp $ */ #include "dvbdevice.h" @@ -1751,12 +1751,28 @@ uint32_t cDvbDeviceProbe::GetSubsystemId(int Adapter, int Frontend) SubsystemId = strtoul(s, NULL, 0) << 16; fclose(f); } + else { + FileName = cString::sprintf("/sys/class/dvb/%s/device/idVendor", e->d_name); + if ((f = fopen(FileName, "r")) != NULL) { + if (char *s = ReadLine.Read(f)) + SubsystemId = strtoul(s, NULL, 16) << 16; + fclose(f); + } + } FileName = cString::sprintf("/sys/class/dvb/%s/device/subsystem_device", e->d_name); if ((f = fopen(FileName, "r")) != NULL) { if (char *s = ReadLine.Read(f)) SubsystemId |= strtoul(s, NULL, 0); fclose(f); } + else { + FileName = cString::sprintf("/sys/class/dvb/%s/device/idProduct", e->d_name); + if ((f = fopen(FileName, "r")) != NULL) { + if (char *s = ReadLine.Read(f)) + SubsystemId |= strtoul(s, NULL, 16); + fclose(f); + } + } break; } } |