summaryrefslogtreecommitdiff
path: root/dynamite.c
diff options
context:
space:
mode:
authorLars Hanisch <dvb@flensrocker.de>2011-03-24 23:48:29 +0100
committerLars Hanisch <dvb@flensrocker.de>2011-03-24 23:48:29 +0100
commit2ad4f6c98465577159b3fa07df24dac37ee5a0e6 (patch)
treece71e562044708ba5e6ab5c5574dc0b6c06f3064 /dynamite.c
parente03b81ff043b9e1d29da4d48e8971d7fe7e3eccc (diff)
downloadvdr-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.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/dynamite.c b/dynamite.c
index 6832358..cc27ede 100644
--- a/dynamite.c
+++ b/dynamite.c
@@ -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;