summaryrefslogtreecommitdiff
path: root/AudioManagerUtilities/src
diff options
context:
space:
mode:
Diffstat (limited to 'AudioManagerUtilities/src')
-rw-r--r--AudioManagerUtilities/src/CAmDbusWrapper.cpp18
-rw-r--r--AudioManagerUtilities/src/CAmDltWrapper.cpp9
2 files changed, 18 insertions, 9 deletions
diff --git a/AudioManagerUtilities/src/CAmDbusWrapper.cpp b/AudioManagerUtilities/src/CAmDbusWrapper.cpp
index b87d3a5..1f1d5a6 100644
--- a/AudioManagerUtilities/src/CAmDbusWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmDbusWrapper.cpp
@@ -293,18 +293,18 @@ dbus_bool_t CAmDbusWrapper::addWatchDelegate(DBusWatch * watch, void* userData)
event |= POLLIN;
if (flags & DBUS_WATCH_WRITABLE)
event |= POLLOUT;
- }
- logInfo("DBusWrapper::addWatchDelegate entered new watch, fd=", dbus_watch_get_unix_fd(watch), "event flag=", event);
- am_Error_e error = mpSocketHandler->addFDPoll(dbus_watch_get_unix_fd(watch), event, &pDbusPrepareCallback, &pDbusFireCallback, &pDbusCheckCallback, &pDbusDispatchCallback, watch, handle);
+ logInfo("DBusWrapper::addWatchDelegate entered new watch, fd=", dbus_watch_get_unix_fd(watch), "event flag=", event);
+ am_Error_e error = mpSocketHandler->addFDPoll(dbus_watch_get_unix_fd(watch), event, &pDbusPrepareCallback, &pDbusFireCallback, &pDbusCheckCallback, &pDbusDispatchCallback, watch, handle);
- //if everything is alright, add the watch and the handle to our map so we know this relationship
- if (error == E_OK && handle != 0)
- {
- mMapHandleWatch.insert(std::make_pair(watch, handle));
- return (true);
+ //if everything is alright, add the watch and the handle to our map so we know this relationship
+ if (error == E_OK && handle != 0)
+ {
+ mMapHandleWatch.insert(std::make_pair(watch, handle));
+ return (true);
+ }
+ logError("DBusWrapper::addWatchDelegate entering watch failed");
}
- logError("DBusWrapper::addWatchDelegate entering watch failed");
return (true);
}
diff --git a/AudioManagerUtilities/src/CAmDltWrapper.cpp b/AudioManagerUtilities/src/CAmDltWrapper.cpp
index dc594af..37a5ff0 100644
--- a/AudioManagerUtilities/src/CAmDltWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmDltWrapper.cpp
@@ -157,6 +157,15 @@ CAmDltWrapper* CAmDltWrapper::instanctiateOnce(const char *appid, const char * d
CAmDltWrapper* CAmDltWrapper::instance()
{
+ if (!mpDLTWrapper)
+ {
+ // an application seems not to use our CAmDltWrapper class therefore create default
+ std::ostringstream description;
+ description << "PID=" << getpid() << " _=" << getenv("_");
+ mpDLTWrapper = new CAmDltWrapper("AMDL", description.str().c_str());
+ std::cerr << "Application doesn't call CAmDltWrapper::instanciateOnce!!!" << std::endl;
+ std::cerr << "-> CAmDltWrapper::instance registers DLT application [ AMDL | " << description.str() << " ]" << std::endl;
+ }
return mpDLTWrapper;
}