From 346ebc85cd43fbf778a200e912bcb6079b611e64 Mon Sep 17 00:00:00 2001 From: Lars Hanisch Date: Thu, 17 Mar 2011 18:37:24 +0100 Subject: - use getopt_long on commandline argument processing, look at README for new arguments - raise event via cPlugin::Service if a device is attached/detached so other plugins can react on it ("dynamite-event-DeviceAttached-v0.1", "dynamite-event-DeviceDetached-v0.1") --- dynamicdevice.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dynamicdevice.c') diff --git a/dynamicdevice.c b/dynamicdevice.c index bf675e7..bfd06af 100644 --- a/dynamicdevice.c +++ b/dynamicdevice.c @@ -161,6 +161,7 @@ attach: dynamicdevice[freeIndex]->devpath = new cString(DevPath); isyslog("dynamite: attached device %s to dynamic device slot %d", DevPath, freeIndex + 1); dynamicdevice[freeIndex]->ReadUdevProperties(); + cPluginManager::CallAllServices("dynamite-event-DeviceAttached-v0.1", (void*)DevPath); return ddrcSuccess; } @@ -267,7 +268,7 @@ void cDynamicDevice::SetDefaultGetTSTimeout(int Seconds) { if (Seconds >= 0) { defaultGetTSTimeout = Seconds; - isyslog("dynamite: set default GetTSTimeout to %d seconds", Seconds); + isyslog("dynamite: set default GetTS-Timeout to %d seconds", Seconds); cMutexLock lock(&arrayMutex); for (int i = 0; i < numDynamicDevices; i++) dynamicdevice[i]->InternSetGetTSTimeout(Seconds); @@ -386,6 +387,8 @@ void cDynamicDevice::DeleteSubDevice() delete subDevice; subDevice = NULL; isyslog("dynamite: deleted device for %s", (devpath ? **devpath : "(unknown)")); + if (devpath) + cPluginManager::CallAllServices("dynamite-event-DeviceDetached-v0.1", (void*)**devpath); } if (devpath) { delete devpath; -- cgit v1.2.3