summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Hanisch <dvb@flensrocker.de>2012-02-05 13:09:24 +0100
committerLars Hanisch <dvb@flensrocker.de>2012-02-05 13:09:24 +0100
commite1e34f97b97f51cd724cc44b41bfb160f1867d18 (patch)
tree3cc55a01637565fee4a0f8eb0cd0bd6153c1558a
parent27d7bed52e5e9a9913de84170d8521c9dfd7fc03 (diff)
downloadvdr-plugin-dynamite-e1e34f97b97f51cd724cc44b41bfb160f1867d18.tar.gz
vdr-plugin-dynamite-e1e34f97b97f51cd724cc44b41bfb160f1867d18.tar.bz2
add udev attribute dynamite_sources which will limit the reception of the device to the given sources
-rw-r--r--HISTORY4
-rw-r--r--README10
-rw-r--r--dynamicdevice.c20
-rw-r--r--dynamicdevice.h1
-rw-r--r--dynamite.c2
5 files changed, 36 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index 429ebc7..39e9af9 100644
--- a/HISTORY
+++ b/HISTORY
@@ -244,3 +244,7 @@ VDR Plugin 'dynamite' Revision History
2011-12-21: Version 0.0.9a
- reset CAMs if device will not get ready on attach
+
+2012-02-05: Version 0.0.9b
+
+- add udev attribute "dynamite_sources" which will limit the reception of the device to the given sources
diff --git a/README b/README
index bfe6947..930d7c7 100644
--- a/README
+++ b/README
@@ -298,6 +298,7 @@ ACTION=="add", SUBSYSTEM=="dvb", ENV{DVB_DEVICE_TYPE}=="frontend" \
, ENV{dynamite_attach_delay}="10" \
, ENV{dynamite_instanceid}="0" \
, ENV{dynamite_cardindex}="5" \
+ , ENV{dynamite_sources}="C,T" \
, ENV{dynamite_timeout}="10" \
, ENV{dynamite_timeout_handler_arg}="%k" \
, ENV{dynamite_disable_autoidle}="no"
@@ -329,6 +330,15 @@ dynamite_disable_autoidle
string or missing of this property will activate the
auto-idle feature if configured
+dynamite_sources
+ comma separated list of strings from sources.conf
+ dynamite will deny all channels from other sources for the subdevice.
+ If this variable is missing the subdevice is asked as usual.
+ This is useful for hybrid devices which supports multiple delivery systems
+ but only one is connected. Or if you have to dishes to different satellites
+ connected to two cards.
+ It will NOT switch the delivery system on dvb-cards, this is up to the device itself!
+
dynamite_timeout
n: set GetTS timeout in seconds on this device
diff --git a/dynamicdevice.c b/dynamicdevice.c
index ae0cab3..a594438 100644
--- a/dynamicdevice.c
+++ b/dynamicdevice.c
@@ -562,6 +562,7 @@ cDynamicDevice::cDynamicDevice()
,subDeviceIsReady(false)
,devpath(NULL)
,udevRemoveSyspath(NULL)
+,udevProvidesSources(NULL)
,getTSTimeoutHandlerArg(NULL)
,isDetachable(true)
,getTSTimeout(defaultGetTSTimeout)
@@ -612,6 +613,13 @@ void cDynamicDevice::ReadUdevProperties(void)
|| (strcmp(disableAutoIdleArg, "1") == 0)))
disableAutoIdle = true;
+ const char *providesSources = dev->GetPropertyValue("dynamite_sources");
+ if (providesSources) {
+ if (udevProvidesSources)
+ delete udevProvidesSources;
+ udevProvidesSources = new cString(cString::sprintf(",%s,", providesSources));
+ }
+
cUdevDevice *p = dev->GetParent();
if (p) {
const char *subsystem = p->GetSubsystem();
@@ -672,6 +680,10 @@ void cDynamicDevice::DeleteSubDevice()
delete udevRemoveSyspath;
udevRemoveSyspath = NULL;
}
+ if (udevProvidesSources) {
+ delete udevProvidesSources;
+ udevProvidesSources = NULL;
+ }
if (devpath) {
delete devpath;
devpath = NULL;
@@ -795,6 +807,14 @@ void cDynamicDevice::CloseFilter(int Handle)
bool cDynamicDevice::ProvidesSource(int Source) const
{
+ if (udevProvidesSources) {
+ cString source = cSource::ToString(Source);
+ cString search = cString::sprintf(",%s,", *source);
+ if (strstr(**udevProvidesSources, *search) == NULL) {
+ isyslog("dynamite: device %s shall not provide source %s", GetDevPath(), *source);
+ return false;
+ }
+ }
if (subDevice)
return subDevice->ProvidesSource(Source);
return cDevice::ProvidesSource(Source);
diff --git a/dynamicdevice.h b/dynamicdevice.h
index 881a1ce..efb44cc 100644
--- a/dynamicdevice.h
+++ b/dynamicdevice.h
@@ -72,6 +72,7 @@ private:
bool subDeviceIsReady;
cString *devpath;
cString *udevRemoveSyspath;
+ cString *udevProvidesSources;
cString *getTSTimeoutHandlerArg;
bool isDetachable;
time_t getTSWatchdog;
diff --git a/dynamite.c b/dynamite.c
index bcfb5c4..9b15363 100644
--- a/dynamite.c
+++ b/dynamite.c
@@ -11,7 +11,7 @@
#include "monitor.h"
#include "status.h"
-static const char *VERSION = "0.0.9a";
+static const char *VERSION = "0.0.9b";
static const char *DESCRIPTION = tr("attach/detach devices on the fly");
static const char *MAINMENUENTRY = NULL;