From 2ad4f6c98465577159b3fa07df24dac37ee5a0e6 Mon Sep 17 00:00:00 2001 From: Lars Hanisch Date: Thu, 24 Mar 2011 23:48:29 +0100 Subject: 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. --- dynamite.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'dynamite.c') 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 *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; -- cgit v1.2.3