summaryrefslogtreecommitdiff
path: root/dynamicdevice.c
diff options
context:
space:
mode:
authorLars Hanisch <dvb@flensrocker.de>2011-02-17 03:41:25 +0100
committerLars Hanisch <dvb@flensrocker.de>2011-02-17 03:41:25 +0100
commit43df82e98abfdbc0ed36bace8ed1fd2ec3fc821d (patch)
treebf4d7c5bc367ff6e723356fa59d9742210bddc3d /dynamicdevice.c
parentb59fef0e72038d8f7f9576ceb0cfd2a49983a00b (diff)
downloadvdr-plugin-dynamite-43df82e98abfdbc0ed36bace8ed1fd2ec3fc821d.tar.gz
vdr-plugin-dynamite-43df82e98abfdbc0ed36bace8ed1fd2ec3fc821d.tar.bz2
add manual option to set a device into idle mode
dvbdevices should close all their handles and can't be used for epg-scan. So be careful to not disable all devices or you won't get epg. A timer or channel-switch should reactivate the device (hopefully).
Diffstat (limited to 'dynamicdevice.c')
-rw-r--r--dynamicdevice.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/dynamicdevice.c b/dynamicdevice.c
index b808fe9..bde3806 100644
--- a/dynamicdevice.c
+++ b/dynamicdevice.c
@@ -216,6 +216,27 @@ eDynamicDeviceReturnCode cDynamicDevice::SetLockDevice(const char *DevPath, bool
return ddrcSuccess;
}
+eDynamicDeviceReturnCode cDynamicDevice::SetIdle(const char *DevPath, bool Idle)
+{
+ if (!DevPath)
+ return ddrcNotSupported;
+
+ cMutexLock lock(&arrayMutex);
+ int freeIndex = -1;
+ int index = -1;
+ if (isnumber(DevPath))
+ index = strtol(DevPath, NULL, 10) - 1;
+ else
+ index = IndexOf(DevPath, freeIndex);
+
+ if ((index < 0) || (index >= numDynamicDevices))
+ return ddrcNotFound;
+
+ ((cDevice*)dynamicdevice[index])->SetIdle(Idle);
+ isyslog("dynamite: set device %s to %s", DevPath, (Idle ? "idle" : "not idle"));
+ return ddrcSuccess;
+}
+
eDynamicDeviceReturnCode cDynamicDevice::SetGetTSTimeout(const char *DevPath, int Seconds)
{
if (!DevPath || (Seconds < 0))