summaryrefslogtreecommitdiff
path: root/dynamite.c
diff options
context:
space:
mode:
authorLars Hanisch <dvb@flensrocker.de>2011-03-18 00:08:18 +0100
committerLars Hanisch <dvb@flensrocker.de>2011-03-18 00:08:18 +0100
commit064797c1d6bdf08dcc0bc9c1195cb765431cca6b (patch)
tree32a6fb5822fff734eba34c9c2491945fa15a6b4c /dynamite.c
parent346ebc85cd43fbf778a200e912bcb6079b611e64 (diff)
downloadvdr-plugin-dynamite-064797c1d6bdf08dcc0bc9c1195cb765431cca6b.tar.gz
vdr-plugin-dynamite-064797c1d6bdf08dcc0bc9c1195cb765431cca6b.tar.bz2
add new command ForceDetachDevice, the device will be detached regardless of any receivers or locks
Diffstat (limited to 'dynamite.c')
-rw-r--r--dynamite.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/dynamite.c b/dynamite.c
index 60f0180..49a814e 100644
--- a/dynamite.c
+++ b/dynamite.c
@@ -9,7 +9,7 @@
#include "dynamicdevice.h"
#include "monitor.h"
-static const char *VERSION = "0.0.5m";
+static const char *VERSION = "0.0.5n";
static const char *DESCRIPTION = "attach/detach devices on the fly";
static const char *MAINMENUENTRY = NULL;
@@ -268,6 +268,11 @@ bool cPluginDynamite::Service(const char *Id, void *Data)
cDynamicDeviceProbe::QueueDynamicDeviceCommand(ddpcDetach, (const char*)Data);
return true;
}
+ if (strcmp(Id, "dynamite-ForceDetachDevice-v0.1") == 0) {
+ if (Data != NULL)
+ cDynamicDevice::DetachDevice((const char*)Data, true);
+ return true;
+ }
if (strcmp(Id, "dynamite-DetachAllDevices-v0.1") == 0) {
if (Data != NULL)
cDynamicDevice::DetachAllDevices((strcasecmp((const char*)Data, "force") == 0));
@@ -345,6 +350,12 @@ const char **cPluginDynamite::SVDRPHelpPages(void)
" device if found. Case is important!\n"
" Any timeouts or locks set to this slot will be reset to its defaults\n"
" alternate command: DetachDevice",
+ "FDTD devpath\n"
+ " Looks through its remembered devicepaths and deletes the attached\n"
+ " device if found. Case is important!\n"
+ " The device will be detached regardless of recordings or other locks!\n"
+ " This is useful for unplugged usb-sticks etc.\n"
+ " alternate command: ForceDetachDevice",
"DTAD [force]\n"
" detachs all attached devices\n"
" \"force\" will ignore recordings and other receivers\n"
@@ -410,6 +421,11 @@ cString cPluginDynamite::SVDRPCommand(const char *Command, const char *Option, i
return cString::sprintf("queued command for detaching %s", Option);
}
+ if ((strcasecmp(Command, "FDTD") == 0) || (strcasecmp(Command, "ForceDetachDevice") == 0)) {
+ cDynamicDevice::DetachDevice(Option, true);
+ return cString::sprintf("forced detaching of %s", Option);
+ }
+
if ((strcasecmp(Command, "DTAD") == 0) || (strcasecmp(Command, "DetachAllDevices") == 0)) {
bool force = false;
if (Option && (strcasecmp(Option, "force") == 0))