diff options
author | Lars Hanisch <dvb@flensrocker.de> | 2011-03-24 23:48:29 +0100 |
---|---|---|
committer | Lars Hanisch <dvb@flensrocker.de> | 2011-03-24 23:48:29 +0100 |
commit | 2ad4f6c98465577159b3fa07df24dac37ee5a0e6 (patch) | |
tree | ce71e562044708ba5e6ab5c5574dc0b6c06f3064 /dynamite.c | |
parent | e03b81ff043b9e1d29da4d48e8971d7fe7e3eccc (diff) | |
download | vdr-plugin-dynamite-2ad4f6c98465577159b3fa07df24dac37ee5a0e6.tar.gz vdr-plugin-dynamite-2ad4f6c98465577159b3fa07df24dac37ee5a0e6.tar.bz2 |
enumerate dvb devices with udev so every adapter is found even if not "in a row"
You can use the udev property "dynamite_ignore" to preserve a device from being attached.
With the udev property "dynamite_instanceid" the devices can be associated with different vdr instances.
Diffstat (limited to 'dynamite.c')
-rw-r--r-- | dynamite.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -9,7 +9,7 @@ #include "dynamicdevice.h" #include "monitor.h" -static const char *VERSION = "0.0.5o"; +static const char *VERSION = "0.0.6"; static const char *DESCRIPTION = "attach/detach devices on the fly"; static const char *MAINMENUENTRY = NULL; @@ -178,6 +178,20 @@ bool cPluginDynamite::Initialize(void) while (cDevice::NumDevices() < MAXDEVICES) new cDynamicDevice; } + // look for all dvb devices + cList<cUdevDevice> *devices = cUdev::EnumDevices("dvb", "DVB_DEVICE_TYPE", "frontend"); + if (devices != NULL) { + int dummy = 0; + for (cUdevDevice *d = devices->First(); d; d = devices->Next(d)) { + const char *devpath = d->GetDevnode(); + if ((devpath != NULL) && (cDynamicDevice::IndexOf(devpath, dummy) < 0)) { + isyslog("dynamite: probing %s", devpath); + cDynamicDeviceProbe::QueueDynamicDeviceCommand(ddpcAttach, devpath); + } + } + delete devices; + } + if (!cDynamicDevice::ProcessQueuedCommands()) esyslog("dynamite: can't process all queued commands"); return true; |