* adoption of RoutinInterfaceAsync to testHMI
authorchristian mueller <christian.ei.mueller@bmw.de>
Thu, 9 Feb 2012 11:38:18 +0000 (12:38 +0100)
committerchristian mueller <christian.ei.mueller@bmw.de>
Thu, 9 Feb 2012 11:38:18 +0000 (12:38 +0100)
* adoption of projekttypes.h to HMI
* comment out wrapper dlt messages because too much pollution

AudioManagerDaemon/src/DBusWrapper.cpp
CHANGELOG
PluginControlInterface/include/ControlSender.h
PluginControlInterface/src/ControlSender.cpp
PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
includes/config.h
includes/projecttypes.h

index 830dd39..ac073a5 100644 (file)
@@ -404,7 +404,7 @@ bool am::DBusWrapper::dbusDispatchCallback(const sh_pollHandle_t handle, void *u
     if (dbus_connection_dispatch(mDbusConnection) == DBUS_DISPATCH_COMPLETE)
         returnVal = false;
     dbus_connection_unref(mDbusConnection);
-    logInfo("DBusWrapper::dbusDispatchCallback was called");
+//    logInfo("DBusWrapper::dbusDispatchCallback was called");
     return returnVal;
 }
 
@@ -417,7 +417,7 @@ bool am::DBusWrapper::dbusCheckCallback(const sh_pollHandle_t handle, void *user
     if (dbus_connection_get_dispatch_status(mDbusConnection) == DBUS_DISPATCH_DATA_REMAINS)
         returnVal = true;
     dbus_connection_unref(mDbusConnection);
-    logInfo("DBusWrapper::dbusCheckCallback was called");
+//    logInfo("DBusWrapper::dbusCheckCallback was called");
     return returnVal;
 }
 
@@ -442,7 +442,7 @@ void am::DBusWrapper::dbusFireCallback(const pollfd pollfd, const sh_pollHandle_
     dbus_connection_ref(mDbusConnection);
     dbus_watch_handle(watch, flags);
     dbus_connection_unref(mDbusConnection);
-    logInfo("DBusWrapper::dbusFireCallback was called");
+//    logInfo("DBusWrapper::dbusFireCallback was called");
 }
 
 void DBusWrapper::toggleTimeoutDelegate(DBusTimeout *timeout, void* userData)
index c8b28e1..7eb874e 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,15 @@
+commit 8d3ad577f57e0a45ef9c0e2f1ce99957445f0eb8
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+    * more changes regarding test controller. Now a very basic connect is supported
+
+commit e924eb3ec4717647d61e9ec4d5cc74f81ea749b9
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+    * changed main to register observer (thanks TGO)
+    * changed command DBUSplugin to register Connection at 2nd DBUSMessageHandler Instance (thanks TGO)
+    * Expanded dummyController functionality
+
 commit 9f9f6fc7d283c60166431c5175b6bbaa53a23c9c
 Author: christian mueller <christian.ei.mueller@bmw.de>
 
index 834c432..d21856b 100644 (file)
@@ -82,13 +82,34 @@ public:
 
 private:
     ControlReceiveInterface * mControlReceiveInterface;
-    struct handleStack
+    struct handleStatus
     {
-        bool ok;
+        bool status;
         am_Handle_s handle;
     };
-    std::list<handleStack> mListOpenHandles;
-    am_mainConnectionID_t mCurrentID;
+
+    struct mainConnectionSet
+    {
+        am_mainConnectionID_t connectionID;
+        std::vector<handleStatus> listHandleStaus;
+    };
+
+    class findHandle
+    {
+        am_Handle_s mHandle;
+    public:
+        explicit findHandle(am_Handle_s handle) :
+                mHandle(handle)
+        {
+        }
+        bool operator()(handleStatus* handle) const
+        {
+            return (handle->handle.handle == mHandle.handle);
+        }
+    };
+
+    std::vector<mainConnectionSet> mListOpenConnections;
+    ;
 };
 
 #endif /* CONTROLSENDER_H_ */
index be750fe..c65059d 100644 (file)
@@ -40,7 +40,8 @@ extern "C" void destroyControlPluginInterface(ControlSendInterface* controlSendI
 }
 
 ControlSenderPlugin::ControlSenderPlugin() :
-        mControlReceiveInterface(NULL)
+        mControlReceiveInterface(NULL),
+        mListOpenConnections()
 {
 }
 
@@ -76,15 +77,17 @@ am_Error_e ControlSenderPlugin::hookUserConnectionRequest(const am_sourceID_t so
     mControlReceiveInterface->getRoute(true, sourceID, sinkID, listRoutes);
     if (listRoutes.empty())
         return E_NOT_POSSIBLE;
+
+    std::vector<handleStatus> listHandleStaus;
     std::vector<am_RoutingElement_s>::iterator it(listRoutes[0].route.begin());
     for (; it != listRoutes[0].route.end(); ++it)
     {
         mControlReceiveInterface->connect(handle, connectionID, it->connectionFormat, it->sourceID, it->sinkID);
         //this is primitive and works only for one connect at a time... otherwise the handles get mixed up!
-        handleStack stack;
-        stack.handle=handle;
-        stack.ok=false;
-        mListOpenHandles.push_back(stack);
+        handleStatus status;
+        status.handle=handle;
+        status.status=false;
+        listHandleStaus.push_back(status);
     }
     am_MainConnection_s mainConnectionData;
     mainConnectionData.connectionID=0;
@@ -92,7 +95,10 @@ am_Error_e ControlSenderPlugin::hookUserConnectionRequest(const am_sourceID_t so
     mainConnectionData.delay=0;
     mainConnectionData.route=listRoutes[0];
     mControlReceiveInterface->enterMainConnectionDB(mainConnectionData,mainConnectionID);
-    mCurrentID=mainConnectionID;
+    mainConnectionSet set;
+    set.connectionID=mainConnectionID;
+    set.listHandleStaus=listHandleStaus;
+    mListOpenConnections.push_back(set);
     return E_OK;
 }
 
@@ -268,20 +274,27 @@ void ControlSenderPlugin::cbAckConnect(const am_Handle_s handle, const am_Error_
     //here is no error check !!!!
     //\todo: add error check here
     //\todo: algorith can be much better written here
-    bool allOk = true;
-    std::list<handleStack>::iterator it(mListOpenHandles.begin());
-
-    for (; it != mListOpenHandles.end(); ++it)
-    {
-        if (it->handle.handle == handle.handle)
-            it->ok = true;
-        allOk = allOk && it->ok;
-    }
-
-    if (allOk)
-    {
-        mControlReceiveInterface->changeMainConnectionStateDB(mCurrentID,CS_CONNECTED);
-    }
+    std::vector<mainConnectionSet>::iterator it(mListOpenConnections.begin());
+//    for(;it!=mListOpenConnections.end();++it)
+//    {
+//        std::vector<handleStatus>::iterator hit;
+//        hit=std::find_if(it->listHandleStaus.begin(),it->listHandleStaus.end(),findHandle);
+//    }
+//
+//    bool allOk = true;
+//    std::list<handleStack>::iterator it(mListOpenHandles.begin());
+//
+//    for (; it != mListOpenHandles.end(); ++it)
+//    {
+//        if (it->handle.handle == handle.handle)
+//            it->ok = true;
+//        allOk = allOk && it->ok;
+//    }
+//
+//    if (allOk)
+//    {
+//        mControlReceiveInterface->changeMainConnectionStateDB(mCurrentID,CS_CONNECTED);
+//    }
 }
 
 void ControlSenderPlugin::cbAckDisconnect(const am_Handle_s handle, const am_Error_e errorID)
index 7594260..0b0b027 100644 (file)
@@ -765,6 +765,16 @@ std::vector<am_Sink_s> AsyncRoutingSender::createSinkTable()
     am_SoundProperty_s sp;
     sp.type = SP_BASS;
     sp.value = 0;
+
+    std::vector<am_MainSoundProperty_s> listMainSoundProperties;
+    am_MainSoundProperty_s msp;
+    msp.type=MSP_BASS;
+    msp.value=5;
+    listMainSoundProperties.push_back(msp);
+    msp.type=MSP_MID;
+    listMainSoundProperties.push_back(msp);
+    msp.type=MSP_TREBLE;
+    listMainSoundProperties.push_back(msp);
     for (int16_t i = 0; i <= 10; i++)
     {
         std::stringstream temp;
@@ -777,9 +787,11 @@ std::vector<am_Sink_s> AsyncRoutingSender::createSinkTable()
         item.available.availability = A_AVAILABLE;
         item.available.availabilityReason = AR_UNKNOWN;
         item.listSoundProperties.push_back(sp);
+        item.listMainSoundProperties=listMainSoundProperties;
         item.visible = true;
         item.listConnectionFormats.push_back(CF_ANALOG);
         item.muteState=MS_MUTED;
+        item.mainVolume=0;
         table.push_back(item);
     }
     return (table);
index 9268d98..67879cc 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _CONFIG_H
 #define _CONFIG_H
 
-#define DAEMONVERSION "ver-0.0.9-5-g9f9f6fc"
+#define DAEMONVERSION "ver-0.0.9-7-g8d3ad57"
 
 #define WITH_DBUS_WRAPPER
 #define WITH_SOCKETHANDLER_LOOP 
index 8ad8bfa..2f84f4c 100644 (file)
@@ -129,8 +129,11 @@ namespace am {
                 * gives the navigation offset in percent
                 */
                MSP_NAVIGATION_OFFSET = 0,
-               MSP_TEST = 1,
-               MSP_MAX = 2,
+               MSP_TEST = 1,\r
+               MSP_BASS = 2,\r
+               MSP_TREBLE = 3,\r
+               MSP_MID = 4,
+               MSP_MAX = 5,
                MSP_MIN = MSP_NAVIGATION_OFFSET
        };