summaryrefslogtreecommitdiff
path: root/dynamite.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 /dynamite.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 'dynamite.c')
-rw-r--r--dynamite.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/dynamite.c b/dynamite.c
index 9e8bc6e..504987f 100644
--- a/dynamite.c
+++ b/dynamite.c
@@ -219,6 +219,16 @@ bool cPluginDynamite::Service(const char *Id, void *Data)
cDynamicDevice::SetLockDevice((const char*)Data, false);
return true;
}
+ if (strcmp(Id, "dynamite-SetIdle-v0.1") == 0) {
+ if (Data != NULL)
+ cDynamicDevice::SetIdle((const char*)Data, true);
+ return true;
+ }
+ if (strcmp(Id, "dynamite-SetNotIdle-v0.1") == 0) {
+ if (Data != NULL)
+ cDynamicDevice::SetIdle((const char*)Data, false);
+ return true;
+ }
if (strcmp(Id, "dynamite-SetGetTSTimeout-v0.1") == 0) {
if (Data != NULL) {
int replyCode;
@@ -277,12 +287,16 @@ const char **cPluginDynamite::SVDRPHelpPages(void)
" e.g. SCND '/dev/dvb/adapter*/frontend*'\n"
" alternate command: ScanDevices",
"LCKD /dev/path/to/device\n"
- " alternate command: LockDevice",
" Lock the device so it can't be detached\n"
" alternate command: LockDevice",
"UNLD /dev/path/to/device\n"
" Remove the lock of the device so it can be detached\n"
" alternate command: UnlockDevice",
+ "SetIdle /dev/path/to/device\n"
+ " Try to set the device to idle so it won't be used by epg-scan\n"
+ " and can close all its handles",
+ "SetNotIdle /dev/path/to/device\n"
+ " Revoke the idle state of the device",
"LSTD\n"
" Lists all devices managed by this plugin. The first column is an id,\n"
" the second column is the devicepath passed with ATTD\n"
@@ -356,6 +370,28 @@ cString cPluginDynamite::SVDRPCommand(const char *Command, const char *Option, i
}
}
+ int idle = 0;
+ if (strcasecmp(Command, "SetIdle") == 0)
+ idle = 1;
+ else if (strcasecmp(Command, "SetNotIdle") == 0)
+ idle = 2;
+ if (idle > 0) {
+ switch (cDynamicDevice::SetIdle(Option, (idle == 1))) {
+ case ddrcSuccess:
+ return cString::sprintf("device %s is %s", Option, (idle == 1 ? "idle" : "not idle"));
+ case ddrcNotFound:
+ {
+ ReplyCode = 550;
+ return cString::sprintf("device %s not found", Option);
+ }
+ default:
+ {
+ ReplyCode = 550;
+ return cString::sprintf("can't set device %s to %s and I don't know why...", Option, (idle == 1 ? "idle" : "not idle"));
+ }
+ }
+ }
+
if ((strcasecmp(Command, "SGTT") == 0) || (strcasecmp(Command, "SetGetTSTimeout") == 0)) {
cString ret;
int len = strlen(Option);