summaryrefslogtreecommitdiff
path: root/PluginRoutingInterfaceDbus
diff options
context:
space:
mode:
authorChristian Mueller <christian@lmuc329619u.(none)>2011-07-26 21:02:37 +0200
committerChristian Mueller <christian@lmuc329619u.(none)>2011-07-26 21:02:37 +0200
commitdf88fefdd7df890aaf2a3206483678851cffc5c5 (patch)
treeb79613020a91ab167ae196469849eb3518fe2de0 /PluginRoutingInterfaceDbus
parent2feaef3bb5f91af43573155106c73143597bdf3e (diff)
downloadaudiomanager-df88fefdd7df890aaf2a3206483678851cffc5c5.tar.gz
- first time synchronisation with EA
- remodelled some interfaces - new plugin structure for CommandInterfaces
Diffstat (limited to 'PluginRoutingInterfaceDbus')
-rw-r--r--PluginRoutingInterfaceDbus/AudiomanagerInterface.cpp5
-rw-r--r--PluginRoutingInterfaceDbus/CMakeLists.txt6
-rw-r--r--PluginRoutingInterfaceDbus/DBUSMessageHandler.h6
-rw-r--r--PluginRoutingInterfaceDbus/DbusInterface.cpp68
-rw-r--r--PluginRoutingInterfaceDbus/DbusInterface.h18
-rw-r--r--PluginRoutingInterfaceDbus/headers.h6
6 files changed, 74 insertions, 35 deletions
diff --git a/PluginRoutingInterfaceDbus/AudiomanagerInterface.cpp b/PluginRoutingInterfaceDbus/AudiomanagerInterface.cpp
index 0cccdb7..4810d89 100644
--- a/PluginRoutingInterfaceDbus/AudiomanagerInterface.cpp
+++ b/PluginRoutingInterfaceDbus/AudiomanagerInterface.cpp
@@ -153,8 +153,6 @@ void AudioManagerInterface::emit_systemReady() {
void* AudioManagerInterface::run(void * arg)
{
DLT_LOG(DBusPlugin, DLT_LOG_INFO, DLT_STRING("Main loop running"));
- // pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL);
- // pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
m_reference = (AudioManagerInterface*) arg;
DBusMessage* msg = 0;
DBusConnection* conn = g_pDbusMessage->getConnection();
@@ -186,10 +184,7 @@ void* AudioManagerInterface::run(void * arg)
}
i++;
}
- } else if (dbus_message_is_signal(msg, DBUS_INTERFACE_DBUS, "NameAcquired")) {
- DLT_LOG(DBusPlugin, DLT_LOG_INFO, DLT_STRING("Got Signal Name Aquired"));
}
-
dbus_connection_flush(conn);
dbus_message_unref(msg);
msg = NULL;
diff --git a/PluginRoutingInterfaceDbus/CMakeLists.txt b/PluginRoutingInterfaceDbus/CMakeLists.txt
index cfac03b..827d309 100644
--- a/PluginRoutingInterfaceDbus/CMakeLists.txt
+++ b/PluginRoutingInterfaceDbus/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 2.6)
-PROJECT(PluginRoutingInterfaceDbus)
+PROJECT(PluginCommandInterfaceDbus)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xlinker -export-dynamic")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
@@ -42,9 +42,9 @@ SET(PLUGINDBUS_SRCS_CXX
DbusSend.cpp
)
-add_library(PluginRoutingInterfaceDbus SHARED ${PLUGINDBUS_SRCS_CXX})
+add_library(PluginCommandInterfaceDbus SHARED ${PLUGINDBUS_SRCS_CXX})
-TARGET_LINK_LIBRARIES(PluginRoutingInterfaceDbus
+TARGET_LINK_LIBRARIES(PluginCommandInterfaceDbus
${DLT_LIBRARIES}
${DBUS_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
diff --git a/PluginRoutingInterfaceDbus/DBUSMessageHandler.h b/PluginRoutingInterfaceDbus/DBUSMessageHandler.h
index 6d0d935..ad685df 100644
--- a/PluginRoutingInterfaceDbus/DBUSMessageHandler.h
+++ b/PluginRoutingInterfaceDbus/DBUSMessageHandler.h
@@ -74,4 +74,10 @@ inline DBusConnection* DBUSMessageHandler::getConnection()
return m_pConnection;
}
+void DBUSMessageHandler::appendArrayOfStringString(std::list<stringString> list)
+{
+}
+
+
+
#endif // _DBUSMESSAGEWRAPPER_H_
diff --git a/PluginRoutingInterfaceDbus/DbusInterface.cpp b/PluginRoutingInterfaceDbus/DbusInterface.cpp
index 878d556..822b35c 100644
--- a/PluginRoutingInterfaceDbus/DbusInterface.cpp
+++ b/PluginRoutingInterfaceDbus/DbusInterface.cpp
@@ -67,14 +67,17 @@ void DbusInterface::return_BusName(char* BusName) {
strcpy(BusName, BUS_NAME);
}
-connection_t DbusInterface::connect(source_t source, sink_t sink, connection_t connID) {
+genError_t DbusInterface::connect(source_t source, sink_t sink, connection_t connID) {
int reply;
DbusSend send = DbusSend(m_conn,"PULSE",(const char*)m_busname,(const char*)m_path, "connect");
send.appendInteger(source);
send.appendInteger(sink);
send.appendInteger(connID);
send.sendReply(&reply);
- return (connection_t) reply;
+ return GEN_OK;
+ /**
+ * \todo always OK...
+ */
}
void DbusInterface::system_ready() {
@@ -82,62 +85,95 @@ void DbusInterface::system_ready() {
m_DbusInterface->emit_systemReady();
}
-bool DbusInterface::disconnect(connection_t connectionID) {
+genError_t DbusInterface::disconnect(connection_t connectionID) {
bool reply;
DbusSend send = DbusSend(m_conn,"PULSE",(const char*)m_busname,(const char*)m_path,"disconnect");
send.appendInteger(connectionID);
send.sendReply(&reply);
- return reply;
+ return GEN_OK;
+ /**
+ * \todo always OK...
+ */
}
-volume_t DbusInterface::setSinkVolume(volume_t volume, sink_t sink) {
+genError_t DbusInterface::setSinkVolume(volume_t volume, sink_t sink) {
int reply;
DbusSend send = DbusSend(m_conn,"PULSE",(const char*)m_busname,(const char*)m_path,"setSinkVolume");
send.appendInteger(volume);
send.appendInteger(sink);
send.sendReply(&reply);
- return (volume_t) reply;
+ return GEN_OK;
+ /**
+ * \todo always OK...
+ */
}
-volume_t DbusInterface::setSourceVolume(volume_t volume, source_t source) {
+genError_t DbusInterface::setSourceVolume(volume_t volume, source_t source) {
int reply;
DbusSend send = DbusSend(m_conn,"PULSE",(const char*)m_busname,(const char*)m_path,"setSourceVolume");
send.appendInteger(volume);
send.appendInteger(source);
send.sendReply(&reply);
- return (volume_t) reply;
+ return GEN_OK;
+ /**
+ * \todo always OK...
+ */
}
-bool DbusInterface::muteSource(source_t sourceID) {
+genError_t DbusInterface::muteSource(source_t sourceID) {
bool reply;
DbusSend send = DbusSend(m_conn,"PULSE",(const char*)m_busname,(const char*)m_path,"muteSource");
send.appendInteger(sourceID);
send.sendReply(&reply);
- return reply;
+ return GEN_OK;
+ /**
+ * \todo always OK...
+ */
}
-bool DbusInterface::muteSink(sink_t sinkID) {
+genError_t DbusInterface::muteSink(sink_t sinkID) {
bool reply;
DbusSend send = DbusSend(m_conn,"PULSE",(const char*)m_busname,(const char*)m_path,"muteSink");
send.appendInteger(sinkID);
send.sendReply(&reply);
- return reply;
+ return GEN_OK;
+ /**
+ * \todo always OK...
+ */
}
-bool DbusInterface::unmuteSource(source_t sourceID) {
+genError_t DbusInterface::unmuteSource(source_t sourceID) {
bool reply;
DbusSend send = DbusSend(m_conn,"PULSE",(const char*)m_busname,(const char*)m_path,"unmuteSource");
send.appendInteger(sourceID);
send.sendReply(&reply);
- return reply;
+ return GEN_OK;
+ /**
+ * \todo always OK...
+ */
}
-bool DbusInterface::unmuteSink(sink_t sinkID) {
+genError_t DbusInterface::unmuteSink(sink_t sinkID) {
bool reply;
DbusSend send = DbusSend(m_conn,"PULSE",(const char*)m_busname,(const char*)m_path,"unmuteSink");
send.appendInteger(sinkID);
send.sendReply(&reply);
- return reply;
+ return GEN_OK;
+ /**
+ * \todo always OK...
+ */
+}
+
+genError_t DbusInterface::asyncConnect(source_t source, sink_t sink, connection_t con_ID) {
+ /**
+ * \todo implement
+ */
+}
+
+genError_t DbusInterface::asyncDisconnect(connection_t connection_ID){
+ /**
+ * \todo implement
+ */
}
//That is the actual implementation of the Factory Class returning the real sendInterface
diff --git a/PluginRoutingInterfaceDbus/DbusInterface.h b/PluginRoutingInterfaceDbus/DbusInterface.h
index 9f7b7f5..7de8cc8 100644
--- a/PluginRoutingInterfaceDbus/DbusInterface.h
+++ b/PluginRoutingInterfaceDbus/DbusInterface.h
@@ -39,14 +39,16 @@ public:
void startup_interface(RoutingReceiveInterface * audioman);
void return_BusName(char * BusName);
- connection_t connect(source_t source, sink_t sink, connection_t connID);
- bool disconnect(connection_t connectionID);
- volume_t setSinkVolume(volume_t volume, sink_t sink);
- volume_t setSourceVolume(volume_t volume, source_t source);
- bool muteSource(source_t sourceID);
- bool muteSink(sink_t sinkID);
- bool unmuteSource(source_t sourceID);
- bool unmuteSink(sink_t sinkID);
+ genError_t connect(source_t source, sink_t sink, connection_t connID);
+ genError_t disconnect(connection_t connectionID);
+ genError_t setSinkVolume(volume_t volume, sink_t sink);
+ genError_t setSourceVolume(volume_t volume, source_t source);
+ genError_t muteSource(source_t sourceID);
+ genError_t muteSink(sink_t sinkID);
+ genError_t unmuteSource(source_t sourceID);
+ genError_t unmuteSink(sink_t sinkID);
+ genError_t asyncConnect(source_t source, sink_t sink, connection_t con_ID);
+ virtual genError_t asyncDisconnect(connection_t connection_ID);
void system_ready();
private:
diff --git a/PluginRoutingInterfaceDbus/headers.h b/PluginRoutingInterfaceDbus/headers.h
index 15652e9..54e3b25 100644
--- a/PluginRoutingInterfaceDbus/headers.h
+++ b/PluginRoutingInterfaceDbus/headers.h
@@ -19,11 +19,11 @@
#define BUS_NAME "DBUS"
-#define DBUS_BUSNAME "org.genivi.pulse"
+#define DBUS_BUSNAME "org.genivi.command"
#define DBUS_PATH "/pulse"
-DLT_IMPORT_CONTEXT(DBusPlugin);
-const char DBUS_SERVICE_PREFIX[] = "org.genivi.audiomanager\0";
+const char DBUS_SERVICE_PREFIX[] = "org.genivi.audiomanagerCommand\0";
+DLT_IMPORT_CONTEXT(DBusPlugin);
#endif /* HEADERS_H_ */