summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-01-10 15:58:38 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-01-12 00:09:34 +0100
commit472d0762b68ce0f2a755b4215515a3e031831495 (patch)
tree276e811f00dfe17cba15c56092b33d67ba2793f6
parent6ebae8c4d3a340c135ed2f5f611a0e1c31994164 (diff)
downloadaudiomanager-472d0762b68ce0f2a755b4215515a3e031831495.tar.gz
* recreated the header files out of the model. Added versioning support in the headerfiles generated
* ensured compatibility with 64 bit systems while compiling dbus [ changed FindDBUS.cmake] * updated the README to better support building * updated typo in introspectable string of DBusWrapper * reworked including strategie * added getInterfafeVersion method on all interfaces * added Interface Versioning support * added version as part of .so ending * it is no possible to set a vector of source and sink sound properties at a time * added interface to ask for all loaded plugins on RoutingSender * added first version of telnet server (not yet productive) - set to not active in CMakeLists.txt * added changelog (created out of git commit log) * added default values for all enum types to be save even on other if communication is on other domain
-rw-r--r--AudioManagerDaemon/CMakeLists.txt3
-rw-r--r--AudioManagerDaemon/include/CommandReceiver.h14
-rw-r--r--AudioManagerDaemon/include/CommandSender.h1
-rw-r--r--AudioManagerDaemon/include/ControlReceiver.h16
-rw-r--r--AudioManagerDaemon/include/ControlSender.h3
-rw-r--r--AudioManagerDaemon/include/DatabaseHandler.h4
-rw-r--r--AudioManagerDaemon/include/DatabaseObserver.h8
-rw-r--r--AudioManagerDaemon/include/RoutingReceiver.h18
-rw-r--r--AudioManagerDaemon/include/RoutingSender.h7
-rw-r--r--AudioManagerDaemon/include/TelnetServer.h89
-rw-r--r--AudioManagerDaemon/src/CommandReceiver.cpp11
-rw-r--r--AudioManagerDaemon/src/CommandSender.cpp19
-rw-r--r--AudioManagerDaemon/src/ControlReceiver.cpp41
-rw-r--r--AudioManagerDaemon/src/ControlSender.cpp51
-rw-r--r--AudioManagerDaemon/src/DBusWrapper.cpp2
-rw-r--r--AudioManagerDaemon/src/DatabaseHandler.cpp1
-rw-r--r--AudioManagerDaemon/src/DatabaseObserver.cpp16
-rw-r--r--AudioManagerDaemon/src/RoutingReceiver.cpp50
-rw-r--r--AudioManagerDaemon/src/RoutingSender.cpp83
-rw-r--r--AudioManagerDaemon/src/TelnetServer.cpp270
-rw-r--r--AudioManagerDaemon/src/main.cpp67
-rw-r--r--AudioManagerDaemon/test/controlInterface/MockInterfaces.h42
-rw-r--r--AudioManagerDaemon/test/database/MockInterfaces.h6
-rw-r--r--AudioManagerDaemon/test/database/databaseTest.cpp8
-rw-r--r--AudioManagerDaemon/test/database/databaseTest.h2
-rw-r--r--AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h68
-rw-r--r--AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp2
-rw-r--r--CHANGELOG269
-rw-r--r--CMakeLists.txt16
-rw-r--r--PluginCommandInterfaceDbus/CMakeLists.txt11
-rw-r--r--PluginCommandInterfaceDbus/include/DBusCommandSender.h3
-rw-r--r--PluginCommandInterfaceDbus/src/DBusCommandSender.cpp17
-rw-r--r--PluginCommandInterfaceDbus/test/MockInterfaces.h4
-rw-r--r--PluginControlInterface/CMakeLists.txt10
-rw-r--r--PluginControlInterface/include/ControlSender.h4
-rw-r--r--PluginControlInterface/src/ControlSender.cpp15
-rw-r--r--PluginRoutingInterfaceAsync/CMakeLists.txt9
-rw-r--r--PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h3
-rw-r--r--PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp15
-rw-r--r--PluginRoutingInterfaceAsync/test/mocklnterfaces.h6
-rw-r--r--PluginRoutingInterfaceDbus/CMakeLists.txt9
-rw-r--r--PluginRoutingInterfaceDbus/include/RoutingSender.h3
-rw-r--r--PluginRoutingInterfaceDbus/src/RoutingSender.cpp17
-rw-r--r--README69
-rw-r--r--cmake/FindDBUS.cmake1
-rw-r--r--cmake/config.cmake4
-rw-r--r--includes/audiomanagertypes.cpp0
-rw-r--r--includes/audiomanagertypes.h190
-rw-r--r--includes/command/CommandReceiveInterface.h13
-rw-r--r--includes/command/CommandSendInterface.h27
-rw-r--r--includes/config.h6
-rw-r--r--includes/control/ControlReceiveInterface.h31
-rw-r--r--includes/control/ControlSendInterface.h33
-rw-r--r--includes/projecttypes.h62
-rw-r--r--includes/routing/RoutingReceiveInterface.h28
-rw-r--r--includes/routing/RoutingSendInterface.h36
56 files changed, 1517 insertions, 296 deletions
diff --git a/AudioManagerDaemon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt
index c1e09eb..69d9b81 100644
--- a/AudioManagerDaemon/CMakeLists.txt
+++ b/AudioManagerDaemon/CMakeLists.txt
@@ -26,16 +26,17 @@ IF(WITH_DBUS_WRAPPER)
ENDIF(WITH_DBUS_WRAPPER)
SET(AUDIOMAN_SRCS_CXX
+ src/main.cpp
src/CommandReceiver.cpp
src/CommandSender.cpp
src/ControlReceiver.cpp
src/ControlSender.cpp
src/DatabaseHandler.cpp
src/DatabaseObserver.cpp
- src/main.cpp
src/RoutingReceiver.cpp
src/RoutingSender.cpp
src/SocketHandler.cpp
+ src/TelnetServer.cpp
)
IF(WITH_DBUS_WRAPPER)
diff --git a/AudioManagerDaemon/include/CommandReceiver.h b/AudioManagerDaemon/include/CommandReceiver.h
index 6d9201f..114d075 100644
--- a/AudioManagerDaemon/include/CommandReceiver.h
+++ b/AudioManagerDaemon/include/CommandReceiver.h
@@ -27,15 +27,14 @@
#include <command/CommandReceiveInterface.h>
#include <config.h>
-#ifdef WITH_DBUS_WRAPPER
-#include <dbus/DBusWrapper.h>
-#endif
-#include <SocketHandler.h>
-#include "DatabaseHandler.h"
-#include "ControlSender.h"
namespace am {
+class DatabaseHandler;
+class ControlSender;
+class DBusWrapper;
+class SocketHandler;
+
/**
* This class realizes the command Interface
*/
@@ -64,11 +63,12 @@ public:
am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const ;
am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const ;
am_Error_e getSocketHandler(SocketHandler*& socketHandler) const;
+ uint16_t getInterfaceVersion() const;
private:
DatabaseHandler* mDatabaseHandler; //!< pointer to the databasehandler
- DBusWrapper* mDBusWrapper; //!< pointer to the dbuswrapper
ControlSender* mControlSender; //!< pointer to the control sender
+ DBusWrapper* mDBusWrapper; //!< pointer to the dbuswrapper
SocketHandler* mSocketHandler; //!< pointer to the SocketHandler
};
diff --git a/AudioManagerDaemon/include/CommandSender.h b/AudioManagerDaemon/include/CommandSender.h
index df83e7c..5a412f3 100644
--- a/AudioManagerDaemon/include/CommandSender.h
+++ b/AudioManagerDaemon/include/CommandSender.h
@@ -59,6 +59,7 @@ public:
void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState) ;
void cbSystemPropertyChanged(const am_SystemProperty_s& SystemProperty) ;
void cbTimingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time) ;
+ uint16_t getInterfaceVersion() const;
#ifdef UNIT_TEST
friend class CommandInterfaceBackdoor; //this is to get access to the loaded plugins and be able to exchange the interfaces
#endif
diff --git a/AudioManagerDaemon/include/ControlReceiver.h b/AudioManagerDaemon/include/ControlReceiver.h
index 303d675..a8afb79 100644
--- a/AudioManagerDaemon/include/ControlReceiver.h
+++ b/AudioManagerDaemon/include/ControlReceiver.h
@@ -26,17 +26,16 @@
#define CONTRONLRECEIVER_H_
#include <control/ControlReceiveInterface.h>
-#include <SocketHandler.h>
#include <config.h>
-#ifdef WITH_DBUS_WRAPPER
-#include <dbus/DBusWrapper.h>
-#endif
-#include "DatabaseHandler.h"
-#include "RoutingSender.h"
-#include "CommandSender.h"
+
namespace am {
+class SocketHandler;
+class DatabaseHandler;
+class RoutingSender;
+class CommandSender;
+
/**
* This class is used to receive all commands from the control interface
*/
@@ -53,7 +52,9 @@ public:
am_Error_e setSinkVolume(am_Handle_s& handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) ;
am_Error_e setSourceVolume(am_Handle_s& handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e rampType, const am_time_t time) ;
am_Error_e setSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e setSinkSoundProperties(am_Handle_s& handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& soundProperty) ;
am_Error_e setSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e setSourceSoundProperties(am_Handle_s& handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& soundProperty) ;
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) ;
am_Error_e abortAction(const am_Handle_s handle) ;
am_Error_e enterDomainDB(const am_Domain_s& domainData, am_domainID_t& domainID) ;
@@ -107,6 +108,7 @@ public:
void setRoutingReady() ;
void setCommandReady() ;
am_Error_e getSocketHandler(SocketHandler*& socketHandler);
+ uint16_t getInterfaceVersion() const;
private:
DatabaseHandler* mDatabaseHandler; //!< pointer tto the databasehandler
diff --git a/AudioManagerDaemon/include/ControlSender.h b/AudioManagerDaemon/include/ControlSender.h
index 9550595..2134fa6 100644
--- a/AudioManagerDaemon/include/ControlSender.h
+++ b/AudioManagerDaemon/include/ControlSender.h
@@ -78,7 +78,10 @@ public:
void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) ;
void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error) ;
void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
+ uint16_t getInterfaceVersion() const;
#ifdef UNIT_TEST
friend class ControlInterfaceBackdoor;
diff --git a/AudioManagerDaemon/include/DatabaseHandler.h b/AudioManagerDaemon/include/DatabaseHandler.h
index c4b6dd4..05fd237 100644
--- a/AudioManagerDaemon/include/DatabaseHandler.h
+++ b/AudioManagerDaemon/include/DatabaseHandler.h
@@ -26,11 +26,13 @@
#define DATABASEHANDLER_H_
#include "audiomanagertypes.h"
-#include "DatabaseObserver.h"
#include <sqlite3.h>
+#include <map>
namespace am {
+class DatabaseObserver;
+
#define DYNAMIC_ID_BOUNDARY 100 //!< the value below is reserved for staticIDs, the value above will be assigned to dynamically registered items
//todo: we do not have to create MainSoundProperty tables if visible = false.
diff --git a/AudioManagerDaemon/include/DatabaseObserver.h b/AudioManagerDaemon/include/DatabaseObserver.h
index 21959a8..f35defe 100644
--- a/AudioManagerDaemon/include/DatabaseObserver.h
+++ b/AudioManagerDaemon/include/DatabaseObserver.h
@@ -25,17 +25,20 @@
#ifndef DATABASEOBSERVER_H_
#define DATABASEOBSERVER_H_
-#include "CommandSender.h"
-#include "RoutingSender.h"
+#include <audiomanagertypes.h>
namespace am {
+class TelnetServer;
+class CommandSender;
+class RoutingSender;
/**
* This class observes the Database and notifies other classes about important events, mainly the CommandSender.
*/
class DatabaseObserver {
public:
DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender);
+ DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender,TelnetServer *iTelnetServer);
virtual ~DatabaseObserver();
void numberOfMainConnectionsChanged() ;
void numberOfSinkClassesChanged() ;
@@ -62,6 +65,7 @@ public:
private:
CommandSender *mCommandSender; //!< pointer to the comandSender
RoutingSender* mRoutingSender; //!< pointer to the routingSender
+ TelnetServer* mTelnetServer; //!< pointer to the telnetserver
};
}
diff --git a/AudioManagerDaemon/include/RoutingReceiver.h b/AudioManagerDaemon/include/RoutingReceiver.h
index f3ba2fe..a53a4ea 100644
--- a/AudioManagerDaemon/include/RoutingReceiver.h
+++ b/AudioManagerDaemon/include/RoutingReceiver.h
@@ -26,17 +26,16 @@
#define ROUTINGRECEIVER_H_
#include <routing/RoutingReceiveInterface.h>
-#include <SocketHandler.h>
#include <config.h>
-#ifdef WITH_DBUS_WRAPPER
-#include <dbus/DBusWrapper.h>
-#endif
-#include "DatabaseHandler.h"
-#include "RoutingSender.h"
-#include "ControlSender.h"
namespace am {
+class SocketHandler;
+class DBusWrapper;
+class DatabaseHandler;
+class RoutingSender;
+class ControlSender;
+
/**
* Implements the Receiving side of the RoutingPlugins.
*/
@@ -52,7 +51,9 @@ public:
void ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) ;
void ackSetSourceState(const am_Handle_s handle, const am_Error_e error) ;
void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
void ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error) ;
void ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume) ;
void ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume) ;
@@ -80,13 +81,14 @@ public:
am_Error_e sendChangedData(const std::vector<am_EarlyData_s>& earlyData) ;
am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const ;
am_Error_e getSocketHandler(SocketHandler*& socketHandler) const;
+ uint16_t getInterfaceVersion() const;
private:
DatabaseHandler *mDatabaseHandler; //!< pointer to the databaseHandler
RoutingSender *mRoutingSender; //!< pointer to the routingSender
ControlSender *mControlSender; //!< pointer to the controlSender
- DBusWrapper *mDBusWrapper; //!< pointer to dbuswrapper
SocketHandler *mSocketHandler; //!< pointer to sockethandler
+ DBusWrapper *mDBusWrapper; //!< pointer to dbuswrapper
};
diff --git a/AudioManagerDaemon/include/RoutingSender.h b/AudioManagerDaemon/include/RoutingSender.h
index 5f5967e..459fe84 100644
--- a/AudioManagerDaemon/include/RoutingSender.h
+++ b/AudioManagerDaemon/include/RoutingSender.h
@@ -103,10 +103,14 @@ public:
am_Error_e asyncSetSourceVolume(am_Handle_s& handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) ;
am_Error_e asyncSetSourceState(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SourceState_e state) ;
am_Error_e asyncSetSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e asyncSetSourceSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID) ;
+ am_Error_e asyncSetSinkSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID) ;
am_Error_e asyncSetSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) ;
am_Error_e asyncCrossFade(am_Handle_s& handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time) ;
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) ;
am_Error_e getListHandles(std::vector<am_Handle_s> & listHandles) const ;
+ am_Error_e getListPlugins(std::vector<std::string>& interfaces) const;
+ uint16_t getInterfaceVersion() const;
//!< is used to pair interfaces with busnames
struct InterfaceNamePairs
@@ -132,6 +136,7 @@ public:
am_SourceState_e sourceState;
am_volume_t volume;
am_HotSink_e hotSink;
+ std::vector<am_SoundProperty_s>* soundProperties;
};
};
@@ -146,7 +151,7 @@ public:
* @param handle the handle
* @return a class holding the handle data
*/
- am_handleData_c returnHandleData(am_Handle_s handle);
+ am_handleData_c returnHandleData(const am_Handle_s handle) const;
private:
diff --git a/AudioManagerDaemon/include/TelnetServer.h b/AudioManagerDaemon/include/TelnetServer.h
new file mode 100644
index 0000000..9b7d097
--- /dev/null
+++ b/AudioManagerDaemon/include/TelnetServer.h
@@ -0,0 +1,89 @@
+/**
+* Copyright (C) 2011, BMW AG
+*
+* GeniviAudioMananger AudioManagerDaemon
+*
+* \file TelnetServer.h
+*
+* \date 20-Oct-2011 3:42:04 PM
+* \author Christian Mueller (christian.ei.mueller@bmw.de)
+*
+* \section License
+* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+*
+* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+*
+*/
+
+
+#ifndef TELNETSERVER_H_
+#define TELNETSERVER_H_
+
+#include "SocketHandler.h"
+#include <queue>
+#include <map>
+
+namespace am {
+
+class DatabaseHandler;
+class CommandSender;
+class RoutingSender;
+class ControlSender;
+class CommandReceiver;
+class RoutingReceiver;
+class ControlReceiver;
+
+class TelnetServer
+{
+public:
+ TelnetServer(SocketHandler *iSocketHandler,CommandSender *iCommandSender,CommandReceiver *iCommandReceiver, RoutingSender *iRoutingSender,RoutingReceiver *iRoutingReceiver,ControlSender *iControlSender, ControlReceiver *iControlReceiver,DatabaseHandler *iDatabasehandler,unsigned int servPort, unsigned int maxConnections);
+ virtual ~TelnetServer();
+ void connectSocket(const pollfd pfd,const sh_pollHandle_t handle, void* userData);
+ void receiveData(const pollfd pfd,const sh_pollHandle_t handle, void* userData);
+ bool dispatchData(const sh_pollHandle_t handle, void* userData);
+ bool check(const sh_pollHandle_t handle, void* userData);
+ shPollFired_T<TelnetServer> telnetConnectFiredCB;
+ shPollFired_T<TelnetServer> telnetReceiveFiredCB;
+ shPollDispatch_T<TelnetServer> telnetDispatchCB;
+ shPollCheck_T<TelnetServer> telnetCheckCB;
+private:
+ typedef void (*CommandPrototype)(std::vector<std::string>& msg,int filedescriptor);
+ typedef std::map<std::string,CommandPrototype> mMapCommand_t;
+ static void listCommand(std::vector<std::string>& msg,int filedescriptor);
+ void listCommandShadow(std::vector<std::string>& msg,int filedescriptor);
+ void sliceCommand(const std::string& string,std::string& command,std::vector<std::string>& msg);
+ mMapCommand_t createCommandMap();
+ struct connection_s
+ {
+ int filedescriptor;
+ sh_pollHandle_t handle;
+ };
+
+ static TelnetServer* instance;
+ SocketHandler *mSocketHandler;
+ CommandSender *mCommandSender;
+ CommandReceiver *mCommandReceiver;
+ RoutingSender *mRoutingSender;
+ RoutingReceiver *mRoutingReceiver;
+ ControlSender *mControlSender;
+ ControlReceiver *mControlReceiver;
+ DatabaseHandler *mDatabasehandler;
+ sh_pollHandle_t mConnecthandle;
+ std::queue<std::string> msgList;
+ std::vector<connection_s> mListConnections;
+ int mConnectFD;
+ unsigned int mServerPort;
+ unsigned int mMaxConnections;
+ mMapCommand_t mMapCommands;
+
+};
+
+} /* namespace am */
+#endif /* TELNETSERVER_H_ */
diff --git a/AudioManagerDaemon/src/CommandReceiver.cpp b/AudioManagerDaemon/src/CommandReceiver.cpp
index 6cee4ad..15d2430 100644
--- a/AudioManagerDaemon/src/CommandReceiver.cpp
+++ b/AudioManagerDaemon/src/CommandReceiver.cpp
@@ -23,6 +23,8 @@
*/
#include "CommandReceiver.h"
+#include "DatabaseHandler.h"
+#include "ControlSender.h"
#include <SocketHandler.h>
#include <config.h>
#include <assert.h>
@@ -204,7 +206,7 @@ am_Error_e CommandReceiver::getDBusConnectionWrapper(DBusWrapper*& dbusConnectio
#endif /*WITH_DBUS_WRAPPER*/
}
-am_Error_e am::CommandReceiver::getSocketHandler(SocketHandler *& socketHandler) const
+am_Error_e CommandReceiver::getSocketHandler(SocketHandler *& socketHandler) const
{
#ifdef WITH_SOCKETHANDLER_LOOP
socketHandler=mSocketHandler;
@@ -214,6 +216,13 @@ am_Error_e am::CommandReceiver::getSocketHandler(SocketHandler *& socketHandler)
#endif /*WITH_SOCKETHANDLER_LOOP*/
}
+uint16_t CommandReceiver::getInterfaceVersion() const
+{
+ return CommandReceiveVersion;
+}
+
+
+
diff --git a/AudioManagerDaemon/src/CommandSender.cpp b/AudioManagerDaemon/src/CommandSender.cpp
index 7ea9ee8..92734c4 100644
--- a/AudioManagerDaemon/src/CommandSender.cpp
+++ b/AudioManagerDaemon/src/CommandSender.cpp
@@ -24,11 +24,14 @@
#include "CommandSender.h"
+#include "command/CommandReceiveInterface.h"
#include <dirent.h>
#include <dlt/dlt.h>
#include "PluginTemplate.h"
using namespace am;
+#define REQUIRED_INTERFACE_VERSION 1
+
DLT_IMPORT_CONTEXT(AudioManager)
//!< macro to call all interfaces
@@ -67,7 +70,7 @@ CommandSender::CommandSender(const std::vector<std::string>& listOfPluginDirecto
unsigned char entryType = itemInDirectory->d_type;
std::string entryName = itemInDirectory->d_name;
- bool regularFile = (entryType == DT_REG);
+ bool regularFile = (entryType == DT_REG || entryType== DT_LNK);
bool sharedLibExtension = ("so" == entryName.substr(entryName.find_last_of(".") + 1));
if (regularFile && sharedLibExtension)
@@ -104,6 +107,13 @@ CommandSender::CommandSender(const std::vector<std::string>& listOfPluginDirecto
continue;
}
+ //check libversion
+ if (commander->getInterfaceVersion()<REQUIRED_INTERFACE_VERSION)
+ {
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("RoutingPlugin initialization failed. Version of Interface to old"));
+ continue;
+ }
+
mListInterfaces.push_back(commander);
mListLibraryHandles.push_back(tempLibHandle);
}
@@ -258,6 +268,13 @@ void CommandSender::unloadLibraries(void)
mListLibraryHandles.clear();
}
+uint16_t CommandSender::getInterfaceVersion() const
+{
+ return CommandSendVersion;
+}
+
+
+
diff --git a/AudioManagerDaemon/src/ControlReceiver.cpp b/AudioManagerDaemon/src/ControlReceiver.cpp
index 3a88c84..763bf2c 100644
--- a/AudioManagerDaemon/src/ControlReceiver.cpp
+++ b/AudioManagerDaemon/src/ControlReceiver.cpp
@@ -23,7 +23,11 @@
*/
#include <config.h>
+#include <SocketHandler.h>
#include "ControlReceiver.h"
+#include "DatabaseHandler.h"
+#include "RoutingSender.h"
+#include "CommandSender.h"
#include <assert.h>
#include <dlt/dlt.h>
@@ -151,7 +155,21 @@ am_Error_e ControlReceiver::setSinkSoundProperty(am_Handle_s & handle, const am_
return mRoutingSender->asyncSetSinkSoundProperty(handle,sinkID,soundProperty);
}
+am_Error_e am::ControlReceiver::setSinkSoundProperties(am_Handle_s & handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s> & listSoundProperties)
+{
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSinkSoundProperties got called, sinkID="),DLT_INT(sinkID));
+ uint16_t value;
+ bool noChange=true;
+ std::vector<am_SoundProperty_s>::const_iterator it=listSoundProperties.begin();
+ for(;it!=listSoundProperties.end();++it)
+ {
+ if(mDatabaseHandler->getSinkSoundPropertyValue(sinkID,it->type,value)!=E_OK) return (E_UNKNOWN);
+ if(value!=it->value) noChange=false;
+ }
+ if (noChange) return (E_NO_CHANGE);
+ return (mRoutingSender->asyncSetSinkSoundProperties(handle,listSoundProperties,sinkID));
+}
am_Error_e ControlReceiver::setSourceSoundProperty(am_Handle_s & handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
{
@@ -163,6 +181,21 @@ am_Error_e ControlReceiver::setSourceSoundProperty(am_Handle_s & handle, const a
return mRoutingSender->asyncSetSourceSoundProperty(handle,sourceID,soundProperty);
}
+am_Error_e am::ControlReceiver::setSourceSoundProperties(am_Handle_s & handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s> & listSoundProperties)
+{
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("ControlReceiver::setSourceSoundProperties got called, sourceID="),DLT_INT(sourceID));
+
+ uint16_t value;
+ bool noChange=true;
+ std::vector<am_SoundProperty_s>::const_iterator it=listSoundProperties.begin();
+ for(;it!=listSoundProperties.end();++it)
+ {
+ if(mDatabaseHandler->getSourceSoundPropertyValue(sourceID,it->type,value)!=E_OK) return (E_UNKNOWN);
+ if(value!=it->value) noChange=false;
+ }
+ if (noChange) return (E_NO_CHANGE);
+ return (mRoutingSender->asyncSetSourceSoundProperties(handle,listSoundProperties,sourceID));
+}
am_Error_e ControlReceiver::setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState)
@@ -528,6 +561,14 @@ am_Error_e am::ControlReceiver::getSocketHandler(SocketHandler *& socketHandler)
}
+uint16_t ControlReceiver::getInterfaceVersion() const
+{
+ return ControlReceiveVersion;
+}
+
+
+
+
diff --git a/AudioManagerDaemon/src/ControlSender.cpp b/AudioManagerDaemon/src/ControlSender.cpp
index cc0c6bb..a9e9220 100644
--- a/AudioManagerDaemon/src/ControlSender.cpp
+++ b/AudioManagerDaemon/src/ControlSender.cpp
@@ -1,9 +1,26 @@
-/*
- * ControlSender.cpp
- *
- * Created on: Dec 9, 2011
- * Author: christian
- */
+/**
+* Copyright (C) 2011, BMW AG
+*
+* GeniviAudioMananger AudioManagerDaemon
+*
+* \file ControlSender.cpp
+*
+* \date 20-Oct-2011 3:42:04 PM
+* \author Christian Mueller (christian.ei.mueller@bmw.de)
+*
+* \section License
+* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+*
+* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+*
+*/
#include "ControlSender.h"
#include <assert.h>
@@ -14,6 +31,8 @@ DLT_IMPORT_CONTEXT(AudioManager)
using namespace am;
+#define REQUIRED_MIN_INTERFACE_VERSION 1
+
ControlSender::ControlSender(std::string controlPluginFile)
:mlibHandle(NULL),
mController(NULL)
@@ -24,6 +43,9 @@ ControlSender::ControlSender(std::string controlPluginFile)
createFunc = getCreateFunction<ControlSendInterface*()>(controlPluginFile,mlibHandle);
assert(createFunc!=NULL);
mController = createFunc();
+
+ //check libversion
+ assert(REQUIRED_MIN_INTERFACE_VERSION<=mController->getInterfaceVersion());
}
else
{
@@ -303,5 +325,22 @@ void ControlSender::cbAckSetSinkSoundProperty(const am_Handle_s handle, const am
return mController->cbAckSetSinkSoundProperty(handle,error);
}
+void ControlSender::cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error)
+{
+ return mController->cbAckSetSinkSoundProperties(handle,error);
+}
+
+void ControlSender::cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)
+{
+ return mController->cbAckSetSourceSoundProperties(handle,error);
+}
+
+uint16_t ControlSender::getInterfaceVersion() const
+{
+ return ControlSendVersion;
+}
+
+
+
diff --git a/AudioManagerDaemon/src/DBusWrapper.cpp b/AudioManagerDaemon/src/DBusWrapper.cpp
index 66a135a..cb332ef 100644
--- a/AudioManagerDaemon/src/DBusWrapper.cpp
+++ b/AudioManagerDaemon/src/DBusWrapper.cpp
@@ -39,7 +39,7 @@ DLT_IMPORT_CONTEXT(AudioManager)
#define ROOT_INTROSPECT_XML \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>" \
-"<interface name='orAudioManagerg.freedesktop.DBus.Introspectable'>" \
+"<interface name='org.AudioManager.freedesktop.DBus.Introspectable'>" \
"<method name='Introspect'>" \
" <arg name='xml_data' type='s' direction='out'/>" \
"</method>" \
diff --git a/AudioManagerDaemon/src/DatabaseHandler.cpp b/AudioManagerDaemon/src/DatabaseHandler.cpp
index 021868c..76aadf8 100644
--- a/AudioManagerDaemon/src/DatabaseHandler.cpp
+++ b/AudioManagerDaemon/src/DatabaseHandler.cpp
@@ -23,6 +23,7 @@
*/
#include "DatabaseHandler.h"
+#include "DatabaseObserver.h"
#include <assert.h>
#include <vector>
#include <fstream>
diff --git a/AudioManagerDaemon/src/DatabaseObserver.cpp b/AudioManagerDaemon/src/DatabaseObserver.cpp
index f6b1930..63f3b02 100644
--- a/AudioManagerDaemon/src/DatabaseObserver.cpp
+++ b/AudioManagerDaemon/src/DatabaseObserver.cpp
@@ -23,9 +23,10 @@
*/
#include "DatabaseObserver.h"
-#include <assert.h>
#include "CommandSender.h"
#include "RoutingSender.h"
+#include "TelnetServer.h"
+#include <assert.h>
using namespace am;
@@ -37,6 +38,16 @@ DatabaseObserver::DatabaseObserver(CommandSender *iCommandSender, RoutingSender
assert(mRoutingSender!=0);
}
+DatabaseObserver::DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender, TelnetServer *iTelnetServer)
+ :mCommandSender(iCommandSender),
+ mRoutingSender(iRoutingSender),
+ mTelnetServer(iTelnetServer)
+{
+ assert(mCommandSender!=0);
+ assert(mRoutingSender!=0);
+ assert(mTelnetServer!=0);
+}
+
DatabaseObserver::~DatabaseObserver() {
// TODO Auto-generated destructor stub
}
@@ -206,3 +217,6 @@ void DatabaseObserver::timingInformationChanged(const am_mainConnectionID_t main
+
+
+
diff --git a/AudioManagerDaemon/src/RoutingReceiver.cpp b/AudioManagerDaemon/src/RoutingReceiver.cpp
index 5629e67..93fd925 100644
--- a/AudioManagerDaemon/src/RoutingReceiver.cpp
+++ b/AudioManagerDaemon/src/RoutingReceiver.cpp
@@ -24,6 +24,13 @@
*/
#include "RoutingReceiver.h"
+#include <SocketHandler.h>
+#ifdef WITH_DBUS_WRAPPER
+#include <dbus/DBusWrapper.h>
+#endif
+#include "DatabaseHandler.h"
+#include "RoutingSender.h"
+#include "ControlSender.h"
#include <assert.h>
using namespace am;
@@ -149,7 +156,6 @@ void RoutingReceiver::ackSetSinkSoundProperty(const am_Handle_s handle, const am
RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
if(error==E_OK && handleData.sinkID!=0)
{
- //todo: check if volume in handleData is same than volume. React to it.
mDatabaseHandler->changeSinkSoundPropertyDB(handleData.soundPropery,handleData.sinkID);
}
mRoutingSender->removeHandle(handle);
@@ -157,6 +163,21 @@ void RoutingReceiver::ackSetSinkSoundProperty(const am_Handle_s handle, const am
}
+void am::RoutingReceiver::ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error)
+{
+ RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
+ if(error==E_OK && handleData.sinkID!=0)
+ {
+ std::vector<am_SoundProperty_s>::const_iterator it=handleData.soundProperties->begin();
+ for(;it!=handleData.soundProperties->end();++it)
+ {
+ mDatabaseHandler->changeSinkSoundPropertyDB(*it,handleData.sinkID);
+ }
+ delete handleData.soundProperties;
+ }
+ mRoutingSender->removeHandle(handle);
+ mControlSender->cbAckSetSinkSoundProperties(handle,error);
+}
void RoutingReceiver::ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error)
@@ -164,7 +185,6 @@ void RoutingReceiver::ackSetSourceSoundProperty(const am_Handle_s handle, const
RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
if(error==E_OK && handleData.sourceID!=0)
{
- //todo: check if volume in handleData is same than volume. React to it.
mDatabaseHandler->changeSourceSoundPropertyDB(handleData.soundPropery,handleData.sourceID);
}
mRoutingSender->removeHandle(handle);
@@ -172,6 +192,21 @@ void RoutingReceiver::ackSetSourceSoundProperty(const am_Handle_s handle, const
}
+void am::RoutingReceiver::ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)
+{
+ RoutingSender::am_handleData_c handleData=mRoutingSender->returnHandleData(handle);
+ if(error==E_OK && handleData.sourceID!=0)
+ {
+ std::vector<am_SoundProperty_s>::const_iterator it=handleData.soundProperties->begin();
+ for(;it!=handleData.soundProperties->end();++it)
+ {
+ mDatabaseHandler->changeSourceSoundPropertyDB(*it,handleData.sourceID);
+ }
+ delete handleData.soundProperties;
+ }
+ mRoutingSender->removeHandle(handle);
+ mControlSender->cbAckSetSourceSoundProperties(handle,error);
+}
void RoutingReceiver::ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error)
{
@@ -355,7 +390,7 @@ am_Error_e RoutingReceiver::peekSourceClassID(const std::string name, const am_s
return E_NOT_USED;
}
-am_Error_e am::RoutingReceiver::getDBusConnectionWrapper(DBusWrapper *& dbusConnectionWrapper) const
+am_Error_e RoutingReceiver::getDBusConnectionWrapper(DBusWrapper *& dbusConnectionWrapper) const
{
#ifdef WITH_DBUS_WRAPPER
dbusConnectionWrapper=mDBusWrapper;
@@ -366,7 +401,7 @@ am_Error_e am::RoutingReceiver::getDBusConnectionWrapper(DBusWrapper *& dbusConn
}
-am_Error_e am::RoutingReceiver::getSocketHandler(SocketHandler *& socketHandler) const
+am_Error_e RoutingReceiver::getSocketHandler(SocketHandler *& socketHandler) const
{
#ifdef WITH_SOCKETHANDLER_LOOP
socketHandler=mSocketHandler;
@@ -376,5 +411,12 @@ am_Error_e am::RoutingReceiver::getSocketHandler(SocketHandler *& socketHandler)
#endif
}
+uint16_t RoutingReceiver::getInterfaceVersion() const
+{
+ return RoutingReceiveVersion;
+}
+
+
+
diff --git a/AudioManagerDaemon/src/RoutingSender.cpp b/AudioManagerDaemon/src/RoutingSender.cpp
index 3b5bdad..2b2adb5 100644
--- a/AudioManagerDaemon/src/RoutingSender.cpp
+++ b/AudioManagerDaemon/src/RoutingSender.cpp
@@ -32,6 +32,8 @@
using namespace am;
+#define REQUIRED_INTERFACE_VERSION 1
+
#define CALL_ALL_INTERFACES(...) \
std::vector<InterfaceNamePairs>::iterator iter = mListInterfaces.begin(); \
std::vector<InterfaceNamePairs>::iterator iterEnd = mListInterfaces.end(); \
@@ -99,7 +101,7 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
for (; iter != iterEnd; ++iter)
{
- //DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Loading Hook plugin"),DLT_STRING(iter->c_str()));
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("RoutingPlugin: "),DLT_STRING(iter->c_str()));
RoutingSendInterface* (*createFunc)();
void* tempLibHandle=NULL;
@@ -107,7 +109,7 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
if (!createFunc)
{
- // DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Entry point of Communicator not found"));
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Entry point of RoutingPlugin not found"));
continue;
}
@@ -115,13 +117,21 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
if (!router)
{
- //DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("HookPlugin initialization failed. Entry Function not callable"));
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("RoutingPlugin initialization failed. Entry Function not callable"));
continue;
}
InterfaceNamePairs routerInterface;
routerInterface.routingInterface = router;
+ //check libversion
+ if (router->getInterfaceVersion()<REQUIRED_INTERFACE_VERSION)
+ {
+ DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("RoutingPlugin initialization failed. Version of Interface to old"));
+ continue;
+ }
+
+
//here, the busname is saved together with the interface. Later The domains will register with the name and sinks, sources etc with the domain....
router->returnBusName(routerInterface.busName);
assert(!routerInterface.busName.empty());
@@ -134,6 +144,16 @@ RoutingSender::RoutingSender(const std::vector<std::string>& listOfPluginDirecto
RoutingSender::~RoutingSender()
{
unloadLibraries();
+ HandlesMap::iterator it=mlistActiveHandles.begin();
+
+ //clean up heap if existent
+ for(;it!=mlistActiveHandles.end();++it)
+ {
+ if (it->first.handleType==H_SETSINKSOUNDPROPERTIES || it->first.handleType==H_SETSOURCESOUNDPROPERTIES)
+ {
+ delete it->second.soundProperties;
+ }
+ }
}
void RoutingSender::routingInterfacesReady()
@@ -263,11 +283,10 @@ am_Error_e RoutingSender::asyncSetSinkSoundProperty(am_Handle_s& handle, const a
handle=createHandle(handleData,H_SETSINKSOUNDPROPERTY);
mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
return iter->second->asyncSetSinkSoundProperty(handle,soundProperty,sinkID);
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
-
am_Error_e RoutingSender::asyncSetSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s & soundProperty)
{
am_handleData_c handleData;
@@ -279,11 +298,39 @@ am_Error_e RoutingSender::asyncSetSourceSoundProperty(am_Handle_s& handle, const
handle=createHandle(handleData,H_SETSOURCESOUNDPROPERTY);
mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
return iter->second->asyncSetSourceSoundProperty(handle,soundProperty,sourceID);
- return E_NON_EXISTENT;
+ return (E_NON_EXISTENT);
}
+am_Error_e am::RoutingSender::asyncSetSourceSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sourceID_t sourceID)
+{
+ am_handleData_c handleData;
+ SourceInterfaceMap::iterator iter = mMapSourceInterface.begin();
+ iter=mMapSourceInterface.find(sourceID);
+ if (iter != mMapSourceInterface.end())
+ handleData.sourceID=sourceID;
+ handleData.soundProperties=new std::vector<am_SoundProperty_s>(listSoundProperties);
+ handle=createHandle(handleData,H_SETSOURCESOUNDPROPERTIES);
+ mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
+ return iter->second->asyncSetSourceSoundProperties(handle,listSoundProperties,sourceID);
+ return (E_NON_EXISTENT);
+}
+am_Error_e am::RoutingSender::asyncSetSinkSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sinkID_t sinkID)
+{
+ am_handleData_c handleData;
+ SinkInterfaceMap::iterator iter = mMapSinkInterface.begin();
+ iter=mMapSinkInterface.find(sinkID);
+ if (iter != mMapSinkInterface.end())
+ handleData.sinkID=sinkID;
+ handleData.soundProperties=new std::vector<am_SoundProperty_s>(listSoundProperties);
+ handle=createHandle(handleData,H_SETSINKSOUNDPROPERTIES);
+ mMapHandleInterface.insert(std::make_pair(handle.handle,iter->second));
+ return iter->second->asyncSetSinkSoundProperties(handle,listSoundProperties,sinkID);
+ return (E_NON_EXISTENT);
+
+}
+
am_Error_e RoutingSender::asyncCrossFade(am_Handle_s& handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time)
{
am_handleData_c handleData;
@@ -455,9 +502,9 @@ am_Handle_s RoutingSender::createHandle(const am_handleData_c& handleData, const
return handle;
}
-RoutingSender::am_handleData_c RoutingSender::returnHandleData(am_Handle_s handle)
+RoutingSender::am_handleData_c RoutingSender::returnHandleData(const am_Handle_s handle) const
{
- HandlesMap::iterator it=mlistActiveHandles.begin();
+ HandlesMap::const_iterator it=mlistActiveHandles.begin();
it=mlistActiveHandles.find(handle);
return (it->second);
}
@@ -472,6 +519,26 @@ void RoutingSender::unloadLibraries(void)
mListLibraryHandles.clear();
}
+am_Error_e am::RoutingSender::getListPlugins(std::vector<std::string>& interfaces) const
+{
+ std::vector<InterfaceNamePairs>::const_iterator it=mListInterfaces.begin();
+ for(;it!=mListInterfaces.end();++it)
+ {
+ interfaces.push_back(it->busName);
+ }
+ return E_OK;
+}
+
+
+uint16_t RoutingSender::getInterfaceVersion() const
+{
+ return (RoutingSendVersion);
+}
+
+
+
+
+
diff --git a/AudioManagerDaemon/src/TelnetServer.cpp b/AudioManagerDaemon/src/TelnetServer.cpp
new file mode 100644
index 0000000..3e77b0b
--- /dev/null
+++ b/AudioManagerDaemon/src/TelnetServer.cpp
@@ -0,0 +1,270 @@
+/**
+* Copyright (C) 2011, BMW AG
+*
+* GeniviAudioMananger AudioManagerDaemon
+*
+* \file TelnetServer.cpp
+*
+* \date 20-Oct-2011 3:42:04 PM
+* \author Christian Mueller (christian.ei.mueller@bmw.de)
+*
+* \section License
+* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+*
+* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+*
+*/
+
+#include "TelnetServer.h"
+#include <assert.h>
+#include <sys/socket.h> /* for socket(), connect(), (), and recv() */
+#include <arpa/inet.h> /* for sockaddr_in and inet_addr() */
+#include <sys/ioctl.h>
+#include <string.h>
+#include <netdb.h>
+#include <dlt/dlt.h>
+#include <config.h>
+#include <errno.h>
+#include <sstream>
+#include <istream>
+#include <iostream>
+#include <iterator>
+#include "DatabaseHandler.h"
+#include "RoutingSender.h"
+
+using namespace am;
+
+DLT_IMPORT_CONTEXT(AudioManager)
+
+TelnetServer* TelnetServer::instance=NULL;
+
+#define PRINT_BOOL(var) var ? output+="true\t\t" : output+="false\t\t";
+
+TelnetServer::TelnetServer(SocketHandler *iSocketHandler, CommandSender *iCommandSender, CommandReceiver *iCommandReceiver, RoutingSender *iRoutingSender, RoutingReceiver *iRoutingReceiver, ControlSender *iControlSender, ControlReceiver *iControlReceiver, DatabaseHandler *iDatabasehandler, unsigned int servPort, unsigned int maxConnections)
+ :telnetConnectFiredCB(this,&TelnetServer::connectSocket),
+ telnetReceiveFiredCB(this,&TelnetServer::receiveData),
+ telnetDispatchCB(this,&TelnetServer::dispatchData),
+ telnetCheckCB(this,&TelnetServer::check),
+ mSocketHandler(iSocketHandler),
+ mCommandSender(iCommandSender),
+ mCommandReceiver(iCommandReceiver),
+ mRoutingSender(iRoutingSender),
+ mRoutingReceiver(iRoutingReceiver),
+ mControlSender(iControlSender),
+ mControlReceiver(iControlReceiver),
+ mDatabasehandler(iDatabasehandler),
+ mConnecthandle(),
+ msgList(),
+ mListConnections(),
+ mConnectFD(NULL),
+ mServerPort(servPort),
+ mMaxConnections(maxConnections),
+ mMapCommands(createCommandMap())
+{
+ assert(mSocketHandler!=NULL);
+ assert(mCommandReceiver!=NULL);
+ assert(mCommandSender!=NULL);
+ assert(mControlSender!=NULL);
+ assert(mControlReceiver!=NULL);
+ assert(mRoutingSender!=NULL);
+ assert(mRoutingReceiver!=NULL);
+ assert(mDatabasehandler!=NULL);
+ assert(servPort!=0);
+ assert(mMaxConnections!=0);
+
+ instance=this;
+
+ int yes =1;
+ struct sockaddr_in servAddr;
+
+ //setup the port Listener
+ mConnectFD = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+ setsockopt(mConnectFD, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int));
+ memset(&servAddr, 0, sizeof(servAddr));
+ servAddr.sin_family = AF_INET;
+ servAddr.sin_addr.s_addr = INADDR_ANY;
+ servAddr.sin_port = htons(servPort);
+ bind(mConnectFD, (struct sockaddr *) &servAddr, sizeof(servAddr));
+
+ if (listen(mConnectFD,mMaxConnections) < 0)
+ {
+ DLT_LOG(AudioManager, DLT_LOG_ERROR, DLT_STRING("TelnetServer::TelnetServerk cannot listen "),DLT_INT(errno));
+ }
+ DLT_LOG(AudioManager, DLT_LOG_INFO, DLT_STRING("TelnetServer::TelnetServerk started listening on port"),DLT_INT(mServerPort));
+
+ int a=1;
+ ioctl (mConnectFD, FIONBIO, (char *) &a);
+ setsockopt (mConnectFD, SOL_SOCKET, SO_KEEPALIVE, (char *) &a, sizeof (a));
+
+ short events=0;
+ events |= POLLIN;
+ mSocketHandler->addFDPoll(mConnectFD,events,NULL,&telnetConnectFiredCB,NULL,NULL,NULL,mConnecthandle);
+}
+
+TelnetServer::~TelnetServer()
+{
+}
+
+void TelnetServer::connectSocket(const pollfd pfd, const sh_pollHandle_t handle, void *userData)
+{
+ //first, accept the connection, create a new filedescriptor
+ struct sockaddr answer;
+ socklen_t len=sizeof(answer);
+ connection_s connection;
+ connection.filedescriptor = accept(pfd.fd, (struct sockaddr*)&answer, &len);
+
+ mListConnections.push_back(connection);
+
+ //set the correct event:
+ short event = 0;
+ event |=POLLIN;
+
+ //aded the filedescriptor to the sockethandler and register the callbacks for receiving the data
+ mSocketHandler->addFDPoll(mListConnections.back().filedescriptor,event,NULL,&telnetReceiveFiredCB,&telnetCheckCB,&telnetDispatchCB,NULL,mListConnections.back().handle);
+}
+
+
+
+void TelnetServer::receiveData(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)
+{
+ //initialize buffer
+ char buffer[100];
+ //read until buffer is full or no more data is there
+ int read=recv(pollfd.fd,buffer,100,NULL);
+ if (read>1)
+ {
+ //read the message and store it in a queue - its a telnet connection so data will be sent on enter !
+ std::string msg=std::string(buffer,read);
+ msgList.push(msg);
+ }
+}
+
+
+
+bool TelnetServer::dispatchData(const sh_pollHandle_t handle, void *userData)
+{
+ std::vector<connection_s>::iterator iterator=mListConnections.begin();
+ for(;iterator!=mListConnections.end();++iterator)
+ {
+ if(iterator->handle==handle) break;
+ }
+ if (iterator==mListConnections.end()) return false;
+
+ std::string command;
+ std::vector<std::string> msg;
+ sliceCommand(msgList.front(),command,msg);
+ msgList.pop();
+ mMapCommand_t::iterator commandIter=mMapCommands.find(command);
+ if (commandIter==mMapCommands.end())
+ {
+ send(iterator->filedescriptor,"Command not found!\n",20,0);
+ }
+ else
+ {
+ (*commandIter).second(msg,iterator->filedescriptor);
+ }
+
+ //remove the message from the queue and return false if there is no more message to read.
+ if (msgList.size()!=0) return true;
+ return false;
+}
+
+
+
+
+bool TelnetServer::check(const sh_pollHandle_t handle, void *userData)
+{
+ if (msgList.size()!=0) return true;
+ return false;
+}
+
+void TelnetServer::listCommand(std::vector<std::string>& msg, int filedescriptor)
+{
+ instance->listCommandShadow(msg,filedescriptor);
+}
+
+void am::TelnetServer::listCommandShadow(std::vector<std::string> & msg, int filedescriptor)
+{
+ std::string output;
+ if(msg.empty())
+ {
+ output+="No second parameter given after list, please enter\n";
+ }
+ else if(msg.front().compare("plugins")==0)
+ {
+ std::vector<std::string> plugins;
+ mRoutingSender->getListPlugins(plugins);
+ std::vector<std::string>::iterator it=plugins.begin();
+ output="\n\nrouting plugins:\n-------------------------\n";
+ for(;it!=plugins.end();++it)
+ {
+ output+=*it+"\n";
+ }
+ }
+ else if(msg.front().compare("domains")==0)
+ {
+ output="domainID\t\tdomainName\t\tbusName\t\tnodeName\t\tearly\t\tstate\t\tcomplete\n";
+ output+="-------------------------------------------------------------------------------------\n";
+ std::vector<am_Domain_s> domainList;
+ mDatabasehandler->getListDomains(domainList);
+ std::vector<am_Domain_s>::iterator it=domainList.begin();
+ for(;it!=domainList.end();++it)
+ {
+ output+=it->domainID + "\t\t";
+ output+=it->name + "\t\t";
+ output+=it->busname + "\t\t";
+ output+=it->nodename + "\t\t";
+ PRINT_BOOL(it->early);
+ switch (it->state)
+ {
+ case DS_CONTROLLED:
+ output+="DS_CONTROLLED\t\t";
+ break;
+ case DS_INDEPENDENT_STARTUP:
+ output+="DS_INDEPENDENT_STARTUP\t\t";
+ break;
+ case DS_INDEPENDENT_RUNDOWN:
+ output+="DS_INDEPENDENT_RUNDOWN\t\t";
+ break;
+ default:
+ output+="undefined\t\t";
+ break;
+ }
+ PRINT_BOOL(it->complete);
+ }
+ }
+ else
+ {
+ output="did not recognize parameter: " + msg.front()+"\n";
+ }
+ send(filedescriptor,output.c_str(),output.size(),0);
+}
+
+
+void am::TelnetServer::sliceCommand(const std::string & string, std::string & command, std::vector<std::string> & msg)
+{
+ std::stringstream stream(string);
+ std::istream_iterator<std::string> begin(stream);
+ std::istream_iterator<std::string> end;
+ command=*begin++;
+ msg=std::vector<std::string>(begin, end);
+}
+
+TelnetServer::mMapCommand_t TelnetServer::createCommandMap()
+{
+ mMapCommand_t commands;
+ commands.insert(std::make_pair("list",&TelnetServer::listCommand));
+ return commands;
+}
+
+
+
+
+
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index 5d840a9..d5c447d 100644
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -36,19 +36,21 @@
//todo: make sure all configurations are tested
#include <config.h>
+#include <SocketHandler.h>
#ifdef WITH_DBUS_WRAPPER
#include <dbus/DBusWrapper.h>
#endif
#include "DatabaseHandler.h"
-#include "DatabaseObserver.h"
-#include "RoutingReceiver.h"
-#include "CommandReceiver.h"
-#include "ControlReceiver.h"
#include "ControlSender.h"
#include "CommandSender.h"
#include "RoutingSender.h"
-#include <SocketHandler.h>
+#include "RoutingReceiver.h"
+#include "CommandReceiver.h"
+#include "ControlReceiver.h"
+#include "DatabaseObserver.h"
+#include "TelnetServer.h"
#include <sys/resource.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <cstdlib>
@@ -58,8 +60,6 @@
#include <string.h>
#include <stdio.h>
-
-
#include <dlt/dlt.h>
DLT_DECLARE_CONTEXT(AudioManager)
@@ -69,19 +69,24 @@ using namespace am;
const char* USAGE_DESCRIPTION = "Usage:\tAudioManagerDaemon [options]\n"
"options:\t\n"
"\t-h: print this message\t\n"
+ "\t-i: info about current settings \t\n"
"\t-v: print version\t\n"
"\t-d: daemonize AudioManager \t\n"
- "\t-p: path for sqlite database (default is in memory)\t\n"
- "\t-c: <Name> use controllerPlugin <Name> (full path with .so ending)\t\n"
- "\t-l: <Name> replace command plugin directory with <Name> (full path)\t\n"
- "\t-r: <Name> replace routing plugin directory with <Name> (full path)\t\n"
- "\t-L: <Name> add command plugin directory with <Name> (full path)\t\n"
- "\t-R: <Name> add routing plugin directory with <Name> (full path)\t\n";
+ "\t-p<path> path for sqlite database (default is in memory)\t\n"
+ "\t-t<port> port for telnetconnection\t\n"
+ "\t-m<max> number of max telnetconnections\t\n"
+ "\t-c<Name> use controllerPlugin <Name> (full path with .so ending)\t\n"
+ "\t-l<Name> replace command plugin directory with <Name> (full path)\t\n"
+ "\t-r<Name> replace routing plugin directory with <Name> (full path)\t\n"
+ "\t-L<Name> add command plugin directory with <Name> (full path)\t\n"
+ "\t-R<Name> add routing plugin directory with <Name> (full path)\t\n";
std::string controllerPlugin=std::string(CONTROLLER_PLUGIN);
std::vector<std::string> listCommandPluginDirs;
std::vector<std::string> listRoutingPluginDirs;
std::string databasePath=std::string(":memory:");
+unsigned int telnetport=DEFAULT_TELNETPORT;
+unsigned int maxConnections=MAX_TELNETCONNECTIONS;
void daemonize ()
{
@@ -136,10 +141,29 @@ void parseCommandLine(int argc, char **argv)
{
while (optind < argc)
{
- int option = getopt (argc, argv, "h::v::c::l::r::L::R::d");
+ int option = getopt (argc, argv, "h::v::c::l::r::L::R::d::t::m::i::");
switch (option)
{
+ case 'i':
+ printf("Current settings:\n");
+ printf("\tAudioManagerDaemon Version:\t\t%s\n",DAEMONVERSION);
+ printf("\tTelnet portNumber:\t\t\t%i\n",telnetport);
+ printf("\tTelnet maxConnections:\t\t\t%i\n",maxConnections);
+ printf("\tSqlite Database path:\t\t\t%s\n",databasePath.c_str());
+ printf("\tControllerPlugin: \t\t\t%s\n",controllerPlugin.c_str());
+ printf("\tDirectory of CommandPlugins: \t\t%s\n",listCommandPluginDirs.front().c_str());
+ printf("\tDirectory of RoutingPlugins: \t\t%s\n",listRoutingPluginDirs.front().c_str());
+ exit(0);
+ break;
+ case 't':
+ assert(atoi(optarg)!=0);
+ telnetport=atoi(optarg);
+ break;
+ case 'm':
+ assert(atoi(optarg)!=0);
+ maxConnections=atoi(optarg);
+ break;
case 'p':
assert(!controllerPlugin.empty());
databasePath=std::string(optarg);
@@ -215,7 +239,6 @@ int main(int argc, char *argv[])
signalChildAction.sa_flags = SA_NOCLDWAIT;
sigaction (SIGCHLD, &signalChildAction, NULL);
-
//Instantiate all classes. Keep in same order !
#ifdef WITH_SOCKETHANDLER_LOOP
SocketHandler iSocketHandler;
@@ -233,13 +256,15 @@ int main(int argc, char *argv[])
RoutingSender iRoutingSender(listRoutingPluginDirs);
CommandSender iCommandSender(listCommandPluginDirs);
ControlSender iControlSender(controllerPlugin);
- DatabaseObserver iObserver(&iCommandSender, &iRoutingSender);
#ifdef WITH_DBUS_WRAPPER
#ifdef WITH_SOCKETHANDLER_LOOP
CommandReceiver iCommandReceiver(&iDatabaseHandler,&iControlSender,&iSocketHandler,&iDBusWrapper);
RoutingReceiver iRoutingReceiver(&iDatabaseHandler,&iRoutingSender,&iControlSender,&iSocketHandler,&iDBusWrapper);
ControlReceiver iControlReceiver(&iDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler);
+#ifdef WITH_TELNET
+ TelnetServer iTelnetServer(&iSocketHandler,&iCommandSender,&iCommandReceiver,&iRoutingSender,&iRoutingReceiver,&iControlSender,&iControlReceiver,&iDatabaseHandler,telnetport,maxConnections);
+#endif
#else /*WITH_SOCKETHANDLER_LOOP */
CommandReceiver iCommandReceiver(&iDatabaseHandler,&iControlSender,&iDBusWrapper);
RoutingReceiver iRoutingReceiver(&iDatabaseHandler,&iRoutingSender,&iControlSender,&iDBusWrapper);
@@ -249,8 +274,18 @@ int main(int argc, char *argv[])
CommandReceiver iCommandReceiver(&iDatabaseHandler,&iControlSender,&iSocketHandler);
RoutingReceiver iRoutingReceiver(&iDatabaseHandler,&iRoutingSender,&iControlSender,&iSocketHandler);
ControlReceiver iControlReceiver(&iDatabaseHandler,&iRoutingSender,&iCommandSender,&iSocketHandler);
+#ifdef WITH_TELNET
+ TelnetServer iTelnetServer(&iSocketHandler,telnetport,maxConnections);
+#endif
#endif /*WITH_DBUS_WRAPPER*/
+#ifdef WITH_TELNET
+ DatabaseObserver iObserver(&iCommandSender, &iRoutingSender,&iTelnetServer);
+#else
+ DatabaseObserver iObserver(&iCommandSender, &iRoutingSender);
+#endif
+
+
//since the plugins have been loaded by the *Senders before, we can tell the Controller this:
iControlSender.hookAllPluginsLoaded();
diff --git a/AudioManagerDaemon/test/controlInterface/MockInterfaces.h b/AudioManagerDaemon/test/controlInterface/MockInterfaces.h
index 2e6122b..b4a4eec 100644
--- a/AudioManagerDaemon/test/controlInterface/MockInterfaces.h
+++ b/AudioManagerDaemon/test/controlInterface/MockInterfaces.h
@@ -35,33 +35,39 @@ namespace am {
class MockRoutingSendInterface : public RoutingSendInterface {
public:
MOCK_METHOD1(startupRoutingInterface,
- void(RoutingReceiveInterface* routingreceiveinterface));
+ void(RoutingReceiveInterface* routingreceiveinterface));
MOCK_METHOD0(routingInterfacesReady,
- void());
+ void());
MOCK_METHOD0(routingInterfacesRundown,
- void());
+ void());
MOCK_METHOD1(asyncAbort,
- am_Error_e(const am_Handle_s handle));
+ am_Error_e(const am_Handle_s handle));
MOCK_METHOD5(asyncConnect,
- am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat));
+ am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat));
MOCK_METHOD2(asyncDisconnect,
- am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID));
+ am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID));
MOCK_METHOD5(asyncSetSinkVolume,
- am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
+ am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
MOCK_METHOD5(asyncSetSourceVolume,
- am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
+ am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
MOCK_METHOD3(asyncSetSourceState,
- am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
+ am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
+ MOCK_METHOD3(asyncSetSinkSoundProperties,
+ am_Error_e(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID));
MOCK_METHOD3(asyncSetSinkSoundProperty,
- am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
+ am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
+ MOCK_METHOD3(asyncSetSourceSoundProperties,
+ am_Error_e(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID));
MOCK_METHOD3(asyncSetSourceSoundProperty,
- am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
+ am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
MOCK_METHOD5(asyncCrossFade,
- am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
+ am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
MOCK_METHOD2(setDomainState,
- am_Error_e(const am_domainID_t domainID, const am_DomainState_e domainState));
+ am_Error_e(const am_domainID_t domainID, const am_DomainState_e domainState));
MOCK_CONST_METHOD1(returnBusName,
- am_Error_e(std::string& BusName));
+ am_Error_e(std::string& BusName));
+ MOCK_CONST_METHOD0(getInterfaceVersion,
+ uint16_t());
};
@@ -141,12 +147,20 @@ class MockControlSendInterface : public ControlSendInterface {
void(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error));
MOCK_METHOD2(cbAckSetSourceState,
void(const am_Handle_s handle, const am_Error_e error));
+ MOCK_METHOD2(cbAckSetSourceSoundProperties,
+ void(const am_Handle_s handle, const am_Error_e error));
MOCK_METHOD2(cbAckSetSourceSoundProperty,
void(const am_Handle_s handle, const am_Error_e error));
+ MOCK_METHOD2(cbAckSetSinkSoundProperties,
+ void(const am_Handle_s handle, const am_Error_e error));
MOCK_METHOD2(cbAckSetSinkSoundProperty,
void(const am_Handle_s handle, const am_Error_e error));
+ MOCK_CONST_METHOD0(getInterfaceVersion,
+ uint16_t());
};
+
+
} // namespace am
diff --git a/AudioManagerDaemon/test/database/MockInterfaces.h b/AudioManagerDaemon/test/database/MockInterfaces.h
index e774c32..514c7cf 100644
--- a/AudioManagerDaemon/test/database/MockInterfaces.h
+++ b/AudioManagerDaemon/test/database/MockInterfaces.h
@@ -70,11 +70,15 @@ class MockCommandSendInterface : public CommandSendInterface {
MOCK_METHOD1(cbSystemPropertyChanged,
void(const am_SystemProperty_s& systemProperty));
MOCK_METHOD2(cbTimingInformationChanged,
- void(const am_mainConnectionID_t mainConnection, const am_timeSync_t time));
+ void (const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID));
+ MOCK_CONST_METHOD0(getInterfaceVersion,
+ uint16_t());
+
};
+
class MockControlSendInterface : public ControlSendInterface {
public:
MOCK_METHOD1(startupController,
diff --git a/AudioManagerDaemon/test/database/databaseTest.cpp b/AudioManagerDaemon/test/database/databaseTest.cpp
index fc74f89..1a0075c 100644
--- a/AudioManagerDaemon/test/database/databaseTest.cpp
+++ b/AudioManagerDaemon/test/database/databaseTest.cpp
@@ -24,6 +24,14 @@
*/
#include "databaseTest.h"
+#include "MockInterfaces.h"
+#include "DatabaseHandler.h"
+#include "ControlReceiver.h"
+#include "ControlSender.h"
+#include "DatabaseObserver.h"
+#include "../ControlInterfaceBackdoor.h"
+#include "../CommandInterfaceBackdoor.h"
+#include "../CommonFunctions.h"
using namespace am;
using namespace testing;
diff --git a/AudioManagerDaemon/test/database/databaseTest.h b/AudioManagerDaemon/test/database/databaseTest.h
index fd91487..4098dc0 100644
--- a/AudioManagerDaemon/test/database/databaseTest.h
+++ b/AudioManagerDaemon/test/database/databaseTest.h
@@ -40,12 +40,14 @@
#include "ControlReceiver.h"
#include "ControlSender.h"
#include "DatabaseObserver.h"
+#include "RoutingSender.h"
#include "../ControlInterfaceBackdoor.h"
#include "../CommandInterfaceBackdoor.h"
#include "../CommonFunctions.h"
namespace am {
+
class databaseTest : public ::testing::Test {
public:
databaseTest();
diff --git a/AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h b/AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h
index c0eada7..850d90c 100644
--- a/AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h
+++ b/AudioManagerDaemon/test/routingInterface/MockRoutingInterface.h
@@ -32,37 +32,43 @@
namespace am {
- class MockRoutingSendInterface : public RoutingSendInterface {
- public:
- MOCK_METHOD1(startupRoutingInterface,
- void(RoutingReceiveInterface* routingreceiveinterface));
- MOCK_METHOD0(routingInterfacesReady,
- void());
- MOCK_METHOD0(routingInterfacesRundown,
- void());
- MOCK_METHOD1(asyncAbort,
- am_Error_e(const am_Handle_s handle));
- MOCK_METHOD5(asyncConnect,
- am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat));
- MOCK_METHOD2(asyncDisconnect,
- am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID));
- MOCK_METHOD5(asyncSetSinkVolume,
- am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
- MOCK_METHOD5(asyncSetSourceVolume,
- am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
- MOCK_METHOD3(asyncSetSourceState,
- am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
- MOCK_METHOD3(asyncSetSinkSoundProperty,
- am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
- MOCK_METHOD3(asyncSetSourceSoundProperty,
- am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
- MOCK_METHOD5(asyncCrossFade,
- am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
- MOCK_METHOD2(setDomainState,
- am_Error_e(const am_domainID_t domainID, const am_DomainState_e domainState));
- MOCK_CONST_METHOD1(returnBusName,
- am_Error_e(std::string& BusName));
- };
+class MockRoutingSendInterface : public RoutingSendInterface {
+ public:
+ MOCK_METHOD1(startupRoutingInterface,
+ void(RoutingReceiveInterface* routingreceiveinterface));
+ MOCK_METHOD0(routingInterfacesReady,
+ void());
+ MOCK_METHOD0(routingInterfacesRundown,
+ void());
+ MOCK_METHOD1(asyncAbort,
+ am_Error_e(const am_Handle_s handle));
+ MOCK_METHOD5(asyncConnect,
+ am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_ConnectionFormat_e connectionFormat));
+ MOCK_METHOD2(asyncDisconnect,
+ am_Error_e(const am_Handle_s handle, const am_connectionID_t connectionID));
+ MOCK_METHOD5(asyncSetSinkVolume,
+ am_Error_e(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
+ MOCK_METHOD5(asyncSetSourceVolume,
+ am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time));
+ MOCK_METHOD3(asyncSetSourceState,
+ am_Error_e(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state));
+ MOCK_METHOD3(asyncSetSinkSoundProperties,
+ am_Error_e(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID));
+ MOCK_METHOD3(asyncSetSinkSoundProperty,
+ am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID));
+ MOCK_METHOD3(asyncSetSourceSoundProperties,
+ am_Error_e(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID));
+ MOCK_METHOD3(asyncSetSourceSoundProperty,
+ am_Error_e(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID));
+ MOCK_METHOD5(asyncCrossFade,
+ am_Error_e(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time));
+ MOCK_METHOD2(setDomainState,
+ am_Error_e(const am_domainID_t domainID, const am_DomainState_e domainState));
+ MOCK_CONST_METHOD1(returnBusName,
+ am_Error_e(std::string& BusName));
+ MOCK_CONST_METHOD0(getInterfaceVersion,
+ uint16_t());
+};
} // namespace am
diff --git a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp
index ff67912..8a66d57 100644
--- a/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp
+++ b/AudioManagerDaemon/test/routingInterface/routingInterfaceTest.cpp
@@ -28,7 +28,7 @@
using namespace am;
using namespace testing;
-DLT_DECLARE_CONTEXT(DLT_CONTEXT)
+DLT_DECLARE_CONTEXT(DLT_CONTEXT);
routingInterfaceTest::routingInterfaceTest()
:plistRoutingPluginDirs(),
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 0000000..3b5e04f
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,269 @@
+commit e7af3cd4dc7f2b19fcd0b5a9e22bd9f55103d4d4
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * recreated the header files out of the model. Added versioning support in the headerfiles generated
+ * ensured compatibility with 64 bit systems while compiling dbus [ changed FindDBUS.cmake]
+ * updated the README to better support building
+ * updated typo in introspectable string of DBusWrapper
+ * reworked including strategie
+ * added getInterfafeVersion method on all interfaces
+ * added Interface Versioning support
+ * added version as part of .so ending
+ * it is no possible to set a vector of source and sink sound properties at a time
+ * added interface to ask for all loaded plugins on RoutingSender
+ * added first version of telnet server (not yet productive) - set to not active in CMakeLists.txt
+ * added changelog (created out of git commit log)
+ * added default values for all enum types to be save even on other if communication is on other domain
+
+commit 6ebae8c4d3a340c135ed2f5f611a0e1c31994164
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * fixed sockethandler timespec issues
+
+commit d2033f10762c1b39b7755f067cb614228336aec8
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ changed README, added correct header in files
+
+commit 93d7610b460c6212a3098a3eccb127fd45ada345
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ *added versioning support automatically out of git
+ *added commandline parser
+ *changed DLT_CONTEXT for AudioManager to AudioManager
+ *added signalhandler
+ *TODO: make signalhandler not only call but correctly rundown the daemon
+
+commit b7e748007bbe0b16fa8a8a089c6cc8fe43bc7aac
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * assert on empty busname (routinginterface)
+ * added busname for DbusroutingSender
+ * rework of sockethandlertests
+ * small changes on compilerflags
+ * new default error messages on dummy controller plugin
+ * new plugin Asynchronous including tests
+
+commit 6b583365d1f0f5c7ff613ecfc323c4d1eba1699d
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * finally, first socket test work
+
+commit cd23bf5e1d2e1d134df91f23ebfd761d770a99db
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * fixed no compile bug
+ * fixed sockethandler loop
+
+commit 4f74d6e303c58326fe75ee75e1c92cf9263f800d
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * rework of buildsystem
+ * now everything depends on a toplevel CMakefile
+ * cleanup of makefiles and compiler options
+
+commit 4618280b6d777ac7bf3bb5cf5b0ea3f0d9e4b2b7
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * new run of code generation by EA
+ * removed audiomanagertypes.cpp it's creadted by EA, but empty
+ * get rid of dbusincludes, dbus files are now in the includes folder
+
+commit b9b9e9ace5c6c7c493438ecf9a4b33b47543e8e3
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * first version of SocketHandler working with DBus
+ * currently Sockethandler test not working
+
+commit f8a41c140abbd1d193ed19f6c2be598adc01292a
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * fixed bug in database handler connected to delay calculation
+
+commit 18d1c7ee814993ae3fbee5635650e55472dac587
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ * first version of the sockethandler with test
+
+commit 1c992fd131eab06ee4f5a7090377031975092aba
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ - changed header comment - entered correct licence
+
+commit 2cefc51e7bb2b3810f57e7c340c0c8857de1a05a
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ - adds dbus test for command plugin
+
+commit 18b59afe6cda90607ad0b193088000d4f9749a97
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ - added comments in XML description
+ - fixed bug in Dbus signal sending
+ - corrected namespace usage
+
+commit 392d090c63dcb03df8a044abbc6cc84807e341e5
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ changes to make controlSender compile & loadable
+
+commit 281cb0d875832bb56c82bad3516fc4021f8be4b0
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ added README
+
+commit cad108114630deebde684267d67a5b648479679e
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ first release !
+
+commit 68678bed2dc3d4a5849d283bec84a01e2836603f
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ update in headers, small things
+
+commit 92c8b837306ff1dcd889f9c075435aec50e9aea3
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ .
+
+commit 205595e3d3e6a1d55be3c462ef02c9f828a77feb
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ some updates, new tests
+
+commit d85e69bbf6d8ec6e087c7af579686923c76079cd
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ Some changes, renaming...
+
+commit 5773404eb801e27179b7c3c7803a990145d6e94a
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ total rework
+
+commit 9826492b0066d47cfa9ba68d6efe737cc3c317a3
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ update on dbus
+
+commit 2d849dd0b5b1558e92cd0f2cd6dbc556950d631d
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ Dbus restructured
+
+commit df88fefdd7df890aaf2a3206483678851cffc5c5
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ - first time synchronisation with EA
+ - remodelled some interfaces
+ - new plugin structure for CommandInterfaces
+
+commit 2feaef3bb5f91af43573155106c73143597bdf3e
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ - daily commit
+ - dbus working smooth now, implemented signal handling
+ - changed worker thread for dbus to wait for dbus events not to wakeup every 50 ms
+
+commit a34ffa9cf03c0685ee4751efb16eca8267e533c3
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ - next part of getting rid of QT
+ - plugin handling for routing plugins work
+ - dbus communication works but nof finalized
+
+commit 4bcad418c039cad5690e62ed63e2b4260c12a517
+Author: Christian Mueller <christian@lmuc329619u.(none)>
+
+ make it compile on 10.04
+
+commit 4a67d4c668148dd8b0cd9c818ab45c7c6ac9841a
+Author: blacky <blacky@kiwi.(none)>
+
+ added layermanager plugin mechanism
+
+commit 6d7c17a9ab1bccbf0bc656c87818338de28f408d
+Author: blacky <blacky@kiwi.(none)>
+
+ - first attempt to remove QT
+ - this compiles but does not provide the same functionality
+ - hookplugin compiles
+ - other plugins do not
+
+commit 8da33c909cfce7370ef8e53acb2e3a00464edf37
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ - track StructuralPlugins via list
+ - use this list to deinit the plugins upon destructor call of the hookhandler
+
+commit 8329c1baf99ece0e93feda1331e089bc0aced52e
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ adding feature in the compile script:
+ by adding document to the cmaker call , the documentation will be created. By default the documentation will not be created
+
+commit 958ff9a0907602f359028261de5d822ac995aede
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ - just typos in AudioManagerCore
+ - fixed a bug only updating and showing the first connection
+ - change in gitignore
+
+commit 9eb2402884c520a4d7eaa8ce041618bfaa6930b3
+Merge: 0108869 5394c6f
+Author: blacky <blacky@kiwi.(none)>
+
+ Merge branch 'master' of https://git.genivi.org/srv/git/AudioManager
+
+commit 0108869db26775b5e30028b0956adb2007020a10
+Author: blacky <blacky@kiwi.(none)>
+
+ merge due to non empty Repo on genivi git server. Resolving conflics in the READMEFILE
+
+commit 4a32aebe3776323c176e0fe57298c1220ecc6d2c
+Author: blacky <blacky@kiwi.(none)>
+
+ small change on CMakelist in player gui
+
+commit 9d723d9b3918d8c9227b806aa9f016699e234a15
+Merge: d61f9cb e6ad5d8
+Author: Simon Brandner <simon.brandner@partner.bmw.de>
+
+ Merge branch 'master' of 10.250.89.137:audiomangenivi
+
+commit e6ad5d883663688d0e36e9d506aa9a1f1190c47f
+Author: christian mueller <christian.ei.mueller@bmw.de>
+
+ changed daemon directory name
+ changed absolute path for doxygen to relative path
+
+commit d61f9cbeeb25c02d73fc99170b1bdf0cc802002f
+Author: Simon Brandner <simon.brandner@partner.bmw.de>
+
+ listInterrruptedSources -> listInterruptedSources
+
+commit fa4da60f971f55bafe157da87ae9d3bce07389b0
+Author: Simon Brandner <simon.brandner@partner.bmw.de>
+
+ corrected speeling of sourceID
+
+commit 246e009c14ccec699d9fbb92fde61bba5ebb8221
+Author: Simon Brandner <simon.brandner@partner.bmw.de>
+
+ corrected spelling error in README file
+
+commit 02acf3cebd9ec61193f63415590929ef40c504c1
+Author: blacky <blacky@kiwi.(none)>
+
+ update & cleanup
+
+commit 4a33862456def70049364761b2035a536b3c5881
+Author: blacky <blacky@kiwi.(none)>
+
+ Initial submission
+
+commit 5394c6fa5bf40d9bc8619026cbc4c306211a8499
+Author: Jeremiah C. Foster <jeremiah.foster@pelagicore.com>
+
+ Initial import of TEMPLATE.git dir.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 655a8bf..8c0fcf4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,9 @@ execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_CURRENT_SO
message(STATUS "Build Version ${DAEMONVERSION}")
+execute_process(COMMAND git log --pretty=short WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG)
+
PROJECT(AudioManagerDeamon)
OPTION( WITH_DBUS_WRAPPER
@@ -49,6 +52,9 @@ OPTION( WITH_MAIN
OPTION( WITH_PPOLL
"libc supports ppoll" ON)
+OPTION( WITH_TELNET
+ "build with Telnetserver" OFF)
+
#Can be changed via passing -DDBUS_SERVICE_PREFIX="XXX" to cmake
IF(NOT DEFINED DBUS_SERVICE_PREFIX)
SET( DBUS_SERVICE_PREFIX "org.genivi.audiomanager\0" )
@@ -59,6 +65,16 @@ IF(NOT DEFINED DBUS_SERVICE_OBJECT_PATH)
SET( DBUS_SERVICE_OBJECT_PATH "/org/genivi/audiomanager\0" )
ENDIF(NOT DEFINED DBUS_SERVICE_OBJECT_PATH)
+#Can be changed via passing -DDEFAULT_TELNETPORT="XXX" to cmake
+IF(NOT DEFINED DEFAULT_TELNETPORT)
+ SET( DEFAULT_TELNETPORT 6060 )
+ENDIF(NOT DEFINED DEFAULT_TELNETPORT)
+
+#Can be changed via passing -DMAX_TELNETCONNECTIONS="XXX" to cmake
+IF(NOT DEFINED MAX_TELNETCONNECTIONS)
+ SET( MAX_TELNETCONNECTIONS 3 )
+ENDIF(NOT DEFINED MAX_TELNETCONNECTIONS)
+
SET(DLT_CONTEXT AudioManager)
SET(PLUGINS_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/plugins)
diff --git a/PluginCommandInterfaceDbus/CMakeLists.txt b/PluginCommandInterfaceDbus/CMakeLists.txt
index 732fd34..2b78169 100644
--- a/PluginCommandInterfaceDbus/CMakeLists.txt
+++ b/PluginCommandInterfaceDbus/CMakeLists.txt
@@ -8,6 +8,11 @@ set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/command)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/CommandDBusPlugin)
set(INCLUDES_FOLDER "include")
+FILE(READ "${AUDIO_INCLUDES_FOLDER}/command/CommandSendInterface.h" VERSION_BUFFER LIMIT 6000)
+STRING(REGEX MATCH "CommandSendVersion*.[^0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
+STRING(REGEX REPLACE "[^0-9]" "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
+MESSAGE(STATUS "Building against command interface version ${LIB_INTERFACE_VERSION}")
+
FIND_PACKAGE(DBUS REQUIRED)
INCLUDE_DIRECTORIES(
@@ -16,6 +21,7 @@ INCLUDE_DIRECTORIES(
${DBUS_INCLUDE_DIR}
${DBUS_ARCH_INCLUDE_DIR}
${AUDIO_INCLUDES_FOLDER}
+ ${DLT_INCLUDE_DIRS}
${INCLUDES_FOLDER}
)
@@ -24,6 +30,11 @@ file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp")
add_library(PluginCommandInterfaceDbus SHARED ${PLUGINDBUS_SRCS_CXX})
+SET_TARGET_PROPERTIES(PluginCommandInterfaceDbus PROPERTIES
+ SOVERSION "${LIB_INTERFACE_VERSION}"
+)
+
+
TARGET_LINK_LIBRARIES(PluginCommandInterfaceDbus
${DLT_LIBRARIES}
${DBUS_LIBRARY}
diff --git a/PluginCommandInterfaceDbus/include/DBusCommandSender.h b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
index bcbeade..4e73c66 100644
--- a/PluginCommandInterfaceDbus/include/DBusCommandSender.h
+++ b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
@@ -66,7 +66,8 @@ public:
void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume) ;
void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState) ;
void cbSystemPropertyChanged(const am_SystemProperty_s& SystemProperty) ;
- void cbTimingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time) ;
+ void cbTimingInformationChanged(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID) ;
+ uint16_t getInterfaceVersion() const;
#ifdef UNIT_TEST
friend class DbusCommandInterfaceBackdoor;
diff --git a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
index fde72c0..1387779 100644
--- a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
+++ b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
@@ -302,20 +302,27 @@ void DbusCommandSender::cbSystemPropertyChanged(const am_SystemProperty_s & Syst
mDBUSMessageHandler.sendMessage();
}
-
-
-void DbusCommandSender::cbTimingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time)
+void am::DbusCommandSender::cbTimingInformationChanged(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbTimingInformationChanged called, mainConnectionID"),DLT_INT16(mainConnection),DLT_STRING("time"),DLT_INT16(time));
+ DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbTimingInformationChanged called, mainConnectionID"),DLT_INT16(mainConnectionID),DLT_STRING("time"),DLT_INT16(time));
mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("TimingInformationChanged"));
- mDBUSMessageHandler.append((dbus_uint16_t)mainConnection);
+ mDBUSMessageHandler.append((dbus_uint16_t)mainConnectionID);
mDBUSMessageHandler.append((dbus_int16_t)time);
mDBUSMessageHandler.sendMessage();
}
+uint16_t DbusCommandSender::getInterfaceVersion() const
+{
+ return (CommandSendVersion);
+}
+
+
+
+
+
diff --git a/PluginCommandInterfaceDbus/test/MockInterfaces.h b/PluginCommandInterfaceDbus/test/MockInterfaces.h
index 0a1004c..509ee5c 100644
--- a/PluginCommandInterfaceDbus/test/MockInterfaces.h
+++ b/PluginCommandInterfaceDbus/test/MockInterfaces.h
@@ -68,8 +68,10 @@ class MockCommandReceiveInterface : public CommandReceiveInterface {
am_Error_e(DBusWrapper*& dbusConnectionWrapper));
MOCK_CONST_METHOD1(getSocketHandler,
am_Error_e(SocketHandler*& socketHandler));
-
+ MOCK_CONST_METHOD0(getInterfaceVersion,
+ uint16_t());
};
+
} // namespace am
diff --git a/PluginControlInterface/CMakeLists.txt b/PluginControlInterface/CMakeLists.txt
index 4ccb6ac..46d818a 100644
--- a/PluginControlInterface/CMakeLists.txt
+++ b/PluginControlInterface/CMakeLists.txt
@@ -4,11 +4,15 @@ PROJECT(PluginControlInterface)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -DDLT_CONTEXT=ControlPluginDbus")
-
set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/control)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/ControlPlugin)
set(INCLUDES_FOLDER "include")
+FILE(READ "${AUDIO_INCLUDES_FOLDER}/control/ControlSendInterface.h" VERSION_BUFFER LIMIT 6000)
+STRING(REGEX MATCH "ControlSendVersion*.[^0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
+STRING(REGEX REPLACE "[^0-9]" "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
+MESSAGE(STATUS "Building against control interface version ${LIB_INTERFACE_VERSION}")
+
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${STD_INCLUDE_DIRS}
@@ -22,6 +26,10 @@ file(GLOB PLUGIN_CONTROL_SRCS_CXX "src/*.cpp")
add_library(PluginControlInterface SHARED ${PLUGIN_CONTROL_SRCS_CXX})
+SET_TARGET_PROPERTIES(PluginControlInterface PROPERTIES
+ SOVERSION "${LIB_INTERFACE_VERSION}"
+)
+
TARGET_LINK_LIBRARIES(PluginControlInterface
${DLT_LIBRARIES})
diff --git a/PluginControlInterface/include/ControlSender.h b/PluginControlInterface/include/ControlSender.h
index 8945d39..d0014a4 100644
--- a/PluginControlInterface/include/ControlSender.h
+++ b/PluginControlInterface/include/ControlSender.h
@@ -28,7 +28,6 @@
#define CONTROLSENDER_H_
#include <control/ControlSendInterface.h>
-#include <control/ControlReceiveInterface.h>
using namespace am;
@@ -74,7 +73,10 @@ public:
void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t voulme, const am_Error_e error) ;
void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error) ;
void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
+ uint16_t getInterfaceVersion() const;
};
#endif /* CONTROLSENDER_H_ */
diff --git a/PluginControlInterface/src/ControlSender.cpp b/PluginControlInterface/src/ControlSender.cpp
index f5d1720..fb54c8c 100644
--- a/PluginControlInterface/src/ControlSender.cpp
+++ b/PluginControlInterface/src/ControlSender.cpp
@@ -300,5 +300,20 @@ void ControlSenderPlugin::cbAckSetSinkSoundProperty(const am_Handle_s handle, co
{
}
+void ControlSenderPlugin::cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error)
+{
+}
+
+void ControlSenderPlugin::cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error)
+{
+}
+
+uint16_t ControlSenderPlugin::getInterfaceVersion() const
+{
+ return (ControlSendVersion);
+}
+
+
+
diff --git a/PluginRoutingInterfaceAsync/CMakeLists.txt b/PluginRoutingInterfaceAsync/CMakeLists.txt
index 4aff03a..f2d6403 100644
--- a/PluginRoutingInterfaceAsync/CMakeLists.txt
+++ b/PluginRoutingInterfaceAsync/CMakeLists.txt
@@ -28,6 +28,11 @@ set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/RoutingAsync)
set(INCLUDES_FOLDER "include")
+FILE(READ "${AUDIO_INCLUDES_FOLDER}/routing/RoutingSendInterface.h" VERSION_BUFFER LIMIT 6000)
+STRING(REGEX MATCH "RoutingSendVersion*.[^0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
+STRING(REGEX REPLACE "[^0-9]" "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
+MESSAGE(STATUS "Building against routing interface version ${LIB_INTERFACE_VERSION}")
+
find_package( Threads )
FIND_PACKAGE(DBUS REQUIRED)
@@ -46,6 +51,10 @@ file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp")
add_library(PluginRoutingInterfaceAsync SHARED ${PLUGINDBUS_SRCS_CXX})
+SET_TARGET_PROPERTIES(PluginRoutingInterfaceAsync PROPERTIES
+ SOVERSION "${LIB_INTERFACE_VERSION}"
+)
+
TARGET_LINK_LIBRARIES(PluginRoutingInterfaceAsync
${DLT_LIBRARIES}
${DBUS_LIBRARY}
diff --git a/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h b/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h
index 1c6e85e..ad76d52 100644
--- a/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h
+++ b/PluginRoutingInterfaceAsync/include/RoutingSenderAsyn.h
@@ -136,10 +136,13 @@ public:
am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) ;
am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) ;
am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID) ;
+ am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID) ;
am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID) ;
+ am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID) ;
am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time) ;
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) ;
am_Error_e returnBusName(std::string& BusName) const ;
+ uint16_t getInterfaceVersion() const;
/**
* threadafe insert of route and connectionID
diff --git a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
index fcf017e..c8d648e 100644
--- a/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
+++ b/PluginRoutingInterfaceAsync/src/RoutingSenderAsync.cpp
@@ -961,6 +961,21 @@ void am::AsyncRoutingSender::updateDomainstateSafe(am_domainID_t domainID, am_Do
pthread_mutex_unlock(&mDomainsMutex);
}
+uint16_t AsyncRoutingSender::getInterfaceVersion() const
+{
+ return (RoutingSendVersion);
+}
+
+am_Error_e am::AsyncRoutingSender::asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sinkID_t sinkID)
+{
+ //todo: implement
+}
+
+am_Error_e am::AsyncRoutingSender::asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sourceID_t sourceID)
+{
+ //todo: implement
+}
+
std::vector<am_Gateway_s> AsyncRoutingSender::createGatewayTable()
{
std::vector<am_Gateway_s> table;
diff --git a/PluginRoutingInterfaceAsync/test/mocklnterfaces.h b/PluginRoutingInterfaceAsync/test/mocklnterfaces.h
index 55f0603..9241dc0 100644
--- a/PluginRoutingInterfaceAsync/test/mocklnterfaces.h
+++ b/PluginRoutingInterfaceAsync/test/mocklnterfaces.h
@@ -41,8 +41,12 @@ class MockRoutingReceiveInterface : public RoutingReceiveInterface {
void(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error));
MOCK_METHOD2(ackSetSourceState,
void(const am_Handle_s handle, const am_Error_e error));
+ MOCK_METHOD2(ackSetSinkSoundProperties,
+ void(const am_Handle_s handle, const am_Error_e error));
MOCK_METHOD2(ackSetSinkSoundProperty,
void(const am_Handle_s handle, const am_Error_e error));
+ MOCK_METHOD2(ackSetSourceSoundProperties,
+ void(const am_Handle_s handle, const am_Error_e error));
MOCK_METHOD2(ackSetSourceSoundProperty,
void(const am_Handle_s handle, const am_Error_e error));
MOCK_METHOD3(ackCrossFading,
@@ -99,6 +103,8 @@ class MockRoutingReceiveInterface : public RoutingReceiveInterface {
am_Error_e(DBusWrapper*& dbusConnectionWrapper));
MOCK_CONST_METHOD1(getSocketHandler,
am_Error_e(SocketHandler*& socketHandler));
+ MOCK_CONST_METHOD0(getInterfaceVersion,
+ uint16_t());
};
} // namespace am
diff --git a/PluginRoutingInterfaceDbus/CMakeLists.txt b/PluginRoutingInterfaceDbus/CMakeLists.txt
index a50936c..6f36ff1 100644
--- a/PluginRoutingInterfaceDbus/CMakeLists.txt
+++ b/PluginRoutingInterfaceDbus/CMakeLists.txt
@@ -8,6 +8,11 @@ set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/routing)
set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/RoutingPlugin)
set(INCLUDES_FOLDER "include")
+FILE(READ "${AUDIO_INCLUDES_FOLDER}/routing/RoutingSendInterface.h" VERSION_BUFFER LIMIT 6000)
+STRING(REGEX MATCH "RoutingSendVersion*.[^0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER})
+STRING(REGEX REPLACE "[^0-9]" "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING})
+MESSAGE(STATUS "Building against routing interface version ${LIB_INTERFACE_VERSION}")
+
FIND_PACKAGE(DBUS REQUIRED)
INCLUDE_DIRECTORIES(
@@ -25,6 +30,10 @@ file(GLOB PLUGINDBUS_SRCS_CXX "src/*.cpp")
add_library(PluginRoutingInterfaceDbus SHARED ${PLUGINDBUS_SRCS_CXX})
+SET_TARGET_PROPERTIES(PluginRoutingInterfaceDbus PROPERTIES
+ SOVERSION "${LIB_INTERFACE_VERSION}"
+)
+
TARGET_LINK_LIBRARIES(PluginRoutingInterfaceDbus
${DLT_LIBRARIES}
${DBUS_LIBRARY}
diff --git a/PluginRoutingInterfaceDbus/include/RoutingSender.h b/PluginRoutingInterfaceDbus/include/RoutingSender.h
index f394644..e8dd9ba 100644
--- a/PluginRoutingInterfaceDbus/include/RoutingSender.h
+++ b/PluginRoutingInterfaceDbus/include/RoutingSender.h
@@ -44,10 +44,13 @@ public:
am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) ;
am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state) ;
am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sinkID_t sinkID) ;
+ am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID) ;
am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_SoundProperty_s& soundProperty, const am_sourceID_t sourceID) ;
+ am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID) ;
am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time) ;
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) ;
am_Error_e returnBusName(std::string& BusName) const ;
+ uint16_t getInterfaceVersion() const ;
};
#endif /* ROUTINGSENDER_H_ */
diff --git a/PluginRoutingInterfaceDbus/src/RoutingSender.cpp b/PluginRoutingInterfaceDbus/src/RoutingSender.cpp
index e477997..e93d921 100644
--- a/PluginRoutingInterfaceDbus/src/RoutingSender.cpp
+++ b/PluginRoutingInterfaceDbus/src/RoutingSender.cpp
@@ -129,6 +129,23 @@ am_Error_e DbusRoutingSender::returnBusName(std::string & BusName) const
return (E_OK);
}
+am_Error_e DbusRoutingSender::asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sinkID_t sinkID)
+{
+
+}
+
+am_Error_e DbusRoutingSender::asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s> & listSoundProperties, const am_sourceID_t sourceID)
+{
+
+}
+
+uint16_t DbusRoutingSender::getInterfaceVersion() const
+{
+ return (RoutingSendVersion);
+}
+
+
+
diff --git a/README b/README
index b77b526..954fc1e 100644
--- a/README
+++ b/README
@@ -20,7 +20,7 @@ Linking AudioManager statically or dynamically with other modules is making a co
As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-Version 0.3
+Version 0.0.1
***********************************************************************************************************
CURRENT STATUS
@@ -31,29 +31,64 @@ It should be sufficient to start working on a POC around it.
***********************************************************************************************************
COMPILE PROGRAMS
***********************************************************************************************************
-
-You will need some packages in order to comile the GENIVI AudioManager Proof of Concept, these are:
--dbus
--sqlite
--automotive-dlt
--google mock & google test (for the test - if you do not want them, use the options of cmake to disable them)
--doxygen (only for documentation)
-
-More details in the CMake Files CmakeList.txt in the projects
+- compile options with default values:
+
+ CMAKE_BUILD_TYPE
+ CMAKE_INSTALL_PREFIX /usr/local
+ WITH_DBUS_WRAPPER ON
+ WITH_DOCUMENTATION OFF
+ WITH_MAIN ON
+ WITH_PLUGIN_COMMAND ON
+ WITH_PLUGIN_CONTROL ON
+ WITH_PLUGIN_ROUTING ON
+ WITH_PPOLL ON
+ WITH_SIMPLEDBUS_LOOP OFF
+ WITH_SOCKETHANDLER_LOOP ON
+ WITH_TESTS ON
+
+In order to change these options, you can modify this values with ccmake, do the appropriate changes in CmakeList.txt or via
+the commandline for cmake or (when installed via ccmake)
+
+You will need some packages in order to comile the GENIVI AudioManager Daemon, these are:
+ -dbus (only when DBUS_WRAPPER==ON) [tested on version 1.2.16]
+ -sqlite3 [tested on version 3.6.22]
+ -automotive-dlt [tested on version 2.2.0]
+ -doxygen (only when WITH_DOCUMENTATION==ON) [tested on version 1.6.3]
+
+ to install them in a build environment like Ubuntu you can use:
+ sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen git cmake build-essential
+
+For building the tests, you will need the following packages:
+ -google mock [tested on version 1.6.0-1]
+ -google test [tested on version 1.6.0]
+ -python [tested on version 2.6]
+
+ to install them in a build environment like Ubuntu you can use:
+ sudo apt-get install libgtest-dev google-mock python2.6-dev
+
+More details in the CMake Files CmakeList.txt in the projects.
+
+The build was tested on a freshly setup LinuxMint 12 (don't like Unity) with the following steps:
+ sudo apt-get update
+ sudo apt-get upgrade
+ sudo apt-get install libdbus-1-dev libsqlite3-dev doxygen libgtest-dev google-mock git cmake build-essential python2.6-dev
+
+ git clone https://<kavi-account>:<kavi-password>@git.genivi.org/srv/git/DLT-daemon
In order to build the project (out of source build), please follow these instructions on the commandline:
-mkdir /build
-cd build
-cmake ..
-make -j4
+ mkdir /build
+ cd build
+ cmake ..
+ make -j4
after the script finished, you should have:
-a /bin folder which contains all executables and the libraries:
-a /build folder which has all build objects (erase that if you need a clean build)
+ a /bin folder which contains all executables and the libraries:
+ a /build folder which has all build objects (erase that if you need a clean build)
+ a /doc folder in case you turned the documentation on
-The options of the AudioManager
+The commandline options of the AudioManager:
Usage: AudioManagerDaemon [options]
options:
diff --git a/cmake/FindDBUS.cmake b/cmake/FindDBUS.cmake
index 48bc348..e37b93a 100644
--- a/cmake/FindDBUS.cmake
+++ b/cmake/FindDBUS.cmake
@@ -23,6 +23,7 @@ FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h
FIND_PATH(DBUS_ARCH_INCLUDE_DIR dbus/dbus-arch-deps.h
/usr/lib/dbus-1.0/include
+/usr/lib/*/dbus-1.0/include
)
FIND_LIBRARY(DBUS_LIBRARY
diff --git a/cmake/config.cmake b/cmake/config.cmake
index c5a9b1a..a0856db 100644
--- a/cmake/config.cmake
+++ b/cmake/config.cmake
@@ -7,11 +7,15 @@
#cmakedefine WITH_SOCKETHANDLER_LOOP
#cmakedefine WITH_SIMPLEDBUS_LOOP
#cmakedefine WITH_PPOLL
+#cmakedefine WITH_TELNET
#cmakedefine DEFAULT_PLUGIN_COMMAND_DIR "@DEFAULT_PLUGIN_COMMAND_DIR@"
#cmakedefine DEFAULT_PLUGIN_ROUTING_DIR "@DEFAULT_PLUGIN_ROUTING_DIR@"
#cmakedefine CONTROLLER_PLUGIN "@CONTROLLER_PLUGIN@"
+#cmakedefine DEFAULT_TELNETPORT @DEFAULT_TELNETPORT@
+#cmakedefine MAX_TELNETCONNECTIONS @MAX_TELNETCONNECTIONS@
+
#cmakedefine DBUS_SERVICE_PREFIX "@DBUS_SERVICE_PREFIX@"
#cmakedefine DBUS_SERVICE_OBJECT_PATH "@DBUS_SERVICE_OBJECT_PATH@"
diff --git a/includes/audiomanagertypes.cpp b/includes/audiomanagertypes.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/includes/audiomanagertypes.cpp
diff --git a/includes/audiomanagertypes.h b/includes/audiomanagertypes.h
index 27764d1..265a8c7 100644
--- a/includes/audiomanagertypes.h
+++ b/includes/audiomanagertypes.h
@@ -22,8 +22,8 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_9BBD9DCA_BBCF_45e4_8291_45F44B455D62__INCLUDED_)
-#define EA_9BBD9DCA_BBCF_45e4_8291_45F44B455D62__INCLUDED_
+#if !defined(EA_F71B3C5D_FC1B_400e_A704_C0FF897D4E53__INCLUDED_)
+#define EA_F71B3C5D_FC1B_400e_A704_C0FF897D4E53__INCLUDED_
#include <stdint.h>
#include "projecttypes.h"
@@ -124,56 +124,56 @@ namespace am {
* After the buildup of a connection the first timing information needs to be sent within 5 seconds, the timing information from the routing adaptors need to be sent via 4 seconds. If the latency for a connection is variable and changes over lifetime of the connection, the routing adaptors shall resend the value and the audiomanger will correct the over all latency.\n
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:04 AM
+ * @created 11-Jan-2012 9:19:44 PM
*/
typedef uint16_t am_domainID_t;
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:05 AM
+ * @created 11-Jan-2012 9:19:45 PM
*/
typedef uint16_t am_sourceID_t;
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:06 AM
+ * @created 11-Jan-2012 9:19:45 PM
*/
typedef uint16_t am_sinkID_t;
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:06 AM
+ * @created 11-Jan-2012 9:19:45 PM
*/
typedef uint16_t am_gatewayID_t;
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:06 AM
+ * @created 11-Jan-2012 9:19:46 PM
*/
typedef uint16_t am_crossfaderID_t;
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:06 AM
+ * @created 11-Jan-2012 9:19:46 PM
*/
typedef uint16_t am_connectionID_t;
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:06 AM
+ * @created 11-Jan-2012 9:19:46 PM
*/
typedef uint16_t am_mainConnectionID_t;
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:06 AM
+ * @created 11-Jan-2012 9:19:46 PM
*/
typedef uint16_t am_speed_t;
@@ -181,7 +181,7 @@ namespace am {
* The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and maximum can be limited by actual project.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:07 AM
+ * @created 11-Jan-2012 9:19:46 PM
*/
typedef int16_t am_volume_t;
@@ -190,21 +190,21 @@ namespace am {
* The range of this type is customer specific.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:07 AM
+ * @created 11-Jan-2012 9:19:47 PM
*/
typedef int16_t am_mainVolume_t;
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:07 AM
+ * @created 11-Jan-2012 9:19:47 PM
*/
typedef uint16_t am_sourceClass_t;
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:07 AM
+ * @created 11-Jan-2012 9:19:47 PM
*/
typedef uint16_t am_sinkClass_t;
@@ -212,7 +212,7 @@ namespace am {
* time in ms!
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:07 AM
+ * @created 11-Jan-2012 9:19:47 PM
*/
typedef uint16_t am_time_t;
@@ -220,7 +220,7 @@ namespace am {
* offset time that is introduced in milli seconds.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:08 AM
+ * @created 11-Jan-2012 9:19:48 PM
*/
typedef int16_t am_timeSync_t;
@@ -228,14 +228,14 @@ namespace am {
* with the help of this enum, sinks and sources can report their availability state
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:08 AM
+ * @created 11-Jan-2012 9:19:48 PM
*/
enum am_Availablility_e
{
A_AVAILABLE = 0,
- A_UNAVAILABLE,
- A_UNKNOWN,
- A_MAX,
+ A_UNAVAILABLE = 1,
+ A_UNKNOWN = 2,
+ A_MAX = 3,
A_MIN = A_AVAILABLE
};
@@ -243,7 +243,7 @@ namespace am {
* represents the connection state
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:08 AM
+ * @created 11-Jan-2012 9:19:48 PM
*/
enum am_ConnectionState_e
{
@@ -254,34 +254,34 @@ namespace am {
/**
* the connection is ready to be used
*/
- CS_CONNECTED,
+ CS_CONNECTED = 1,
/**
* the connection is in the course to be knocked down
*/
- CS_DISCONNECTING,
+ CS_DISCONNECTING = 2,
/**
* only relevant for connectionStatechanged. Is send after the connection was removed
*/
- CS_DISCONNECTED,
+ CS_DISCONNECTED = 3,
/**
* this means the connection is still build up but unused at the moment
*/
- CS_SUSPENDED,
- CS_MAX,
+ CS_SUSPENDED = 4,
+ CS_MAX = 5,
CS_MIN = CS_CONNECTING
};
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:08 AM
+ * @created 11-Jan-2012 9:19:48 PM
*/
enum am_DomainState_e
{
DS_CONTROLLED = 0,
- DS_INDEPENDENT_STARTUP,
- DS_INDEPENDENT_RUNDOWN,
- DS_MAX,
+ DS_INDEPENDENT_STARTUP = 1,
+ DS_INDEPENDENT_RUNDOWN = 2,
+ DS_MAX = 3,
DS_MIN = DS_CONTROLLED
};
@@ -289,15 +289,15 @@ namespace am {
* This enum characterizes the data of the EarlyData_t
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:08 AM
+ * @created 11-Jan-2012 9:19:48 PM
*/
enum am_EarlyDataType_e
{
ED_SOURCE_VOLUME = 0,
- ED_SINK_VOLUME,
- ED_SOURCE_PROPERTY,
- ED_SINK_PROPERTY,
- ED_MAX,
+ ED_SINK_VOLUME = 1,
+ ED_SOURCE_PROPERTY = 2,
+ ED_SINK_PROPERTY = 3,
+ ED_MAX = 4,
ES_MIN = ED_SOURCE_VOLUME
};
@@ -305,38 +305,38 @@ namespace am {
* the errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:09 AM
+ * @created 11-Jan-2012 9:19:49 PM
*/
enum am_Error_e
{
E_OK = 0,
- E_UNKNOWN,
- E_OUT_OF_RANGE,
- E_NOT_USED,
- E_DATABASE_ERROR,
- E_ALREADY_EXISTS,
- E_NO_CHANGE,
- E_NOT_POSSIBLE,
- E_NON_EXISTENT,
- E_ABORTED,
+ E_UNKNOWN = 1,
+ E_OUT_OF_RANGE = 2,
+ E_NOT_USED = 3,
+ E_DATABASE_ERROR = 4,
+ E_ALREADY_EXISTS = 5,
+ E_NO_CHANGE = 6,
+ E_NOT_POSSIBLE = 7,
+ E_NON_EXISTENT = 8,
+ E_ABORTED = 9,
/**
* This error is returned in case a connect is issued with a connectionFormat that cannot be selected for the connection. This could be either due to the capabilities of a source or a sink or gateway compatibilities for example
*/
- E_WRONG_FORMAT,
- E_MAX,
+ E_WRONG_FORMAT = 10,
+ E_MAX = 11,
E_MIN = E_OK
};
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:09 AM
+ * @created 11-Jan-2012 9:19:49 PM
*/
enum am_MuteState_e
{
MS_MUTED = 0,
- MS_UNMUTED,
- MS_MAX,
+ MS_UNMUTED = 1,
+ MS_MAX = 2,
MS_MIN = MS_MUTED
};
@@ -344,7 +344,7 @@ namespace am {
* The source state reflects the state of the source
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:09 AM
+ * @created 11-Jan-2012 9:19:49 PM
*/
enum am_SourceState_e
{
@@ -355,12 +355,12 @@ namespace am {
/**
* The source cannot be heared
*/
- SS_OFF,
+ SS_OFF = 1,
/**
* The source is paused. Meaning it cannot be heared but should be prepared to play again soon.
*/
- SS_PAUSED,
- SS_MAX,
+ SS_PAUSED = 2,
+ SS_MAX = 3,
SS_MIN = SS_ON
};
@@ -368,32 +368,34 @@ namespace am {
* This enumeration is used to define the type of the action that is correlated to a handle.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:09 AM
+ * @created 11-Jan-2012 9:19:49 PM
*/
enum am_Handle_e
{
H_CONNECT = 0,
- H_DISCONNECT,
- H_SETSOURCESTATE,
- H_SETSINKVOLUME,
- H_SETSOURCEVOLUME,
- H_SETSINKSOUNDPROPERTY,
- H_SETSOURCESOUNDPROPERTY,
- H_CROSSFADE,
- H_MAX,
+ H_DISCONNECT = 1,
+ H_SETSOURCESTATE = 2,
+ H_SETSINKVOLUME = 3,
+ H_SETSOURCEVOLUME = 4,
+ H_SETSINKSOUNDPROPERTY = 5,
+ H_SETSOURCESOUNDPROPERTY = 6,
+ H_SETSINKSOUNDPROPERTIES = 7,
+ H_SETSOURCESOUNDPROPERTIES = 8,
+ H_CROSSFADE = 9,
+ H_MAX = 10,
H_MIN = H_CONNECT
};
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:09 AM
+ * @created 11-Jan-2012 9:19:49 PM
*/
enum am_InterruptState_e
{
IS_OFF = 0,
- IS_INTERRUPTED,
- IS_MAX,
+ IS_INTERRUPTED = 1,
+ IS_MAX = 2,
IS_MIN = IS_OFF
};
@@ -401,14 +403,14 @@ namespace am {
* describes the active sink of a crossfader.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:10 AM
+ * @created 11-Jan-2012 9:19:49 PM
*/
enum am_HotSink_e
{
HS_SINKA = 0,
- HS_SINKB,
- HS_INTERMEDIATE,
- HS_MAX,
+ HS_SINKB = 1,
+ HS_INTERMEDIATE = 2,
+ HS_MAX = 3,
HS_MIN = HS_SINKA
};
@@ -416,7 +418,7 @@ namespace am {
* this describes the availability of a sink or a source together with the latest change
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:10 AM
+ * @created 11-Jan-2012 9:19:50 PM
*/
struct am_Availability_s
{
@@ -436,7 +438,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:10 AM
+ * @created 11-Jan-2012 9:19:50 PM
*/
struct am_ClassProperty_s
{
@@ -450,7 +452,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:10 AM
+ * @created 11-Jan-2012 9:19:50 PM
*/
struct am_Crossfader_s
{
@@ -468,7 +470,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:11 AM
+ * @created 11-Jan-2012 9:19:51 PM
*/
struct am_Gateway_s
{
@@ -509,7 +511,7 @@ namespace am {
* This represents one "hopp" in a route
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:11 AM
+ * @created 11-Jan-2012 9:19:51 PM
*/
struct am_RoutingElement_s
{
@@ -525,7 +527,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:11 AM
+ * @created 11-Jan-2012 9:19:51 PM
*/
struct am_Route_s
{
@@ -540,7 +542,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:12 AM
+ * @created 11-Jan-2012 9:19:52 PM
*/
struct am_SoundProperty_s
{
@@ -554,7 +556,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:12 AM
+ * @created 11-Jan-2012 9:19:52 PM
*/
struct am_SystemProperty_s
{
@@ -574,7 +576,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:12 AM
+ * @created 11-Jan-2012 9:19:52 PM
*/
struct am_SinkClass_s
{
@@ -589,7 +591,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:12 AM
+ * @created 11-Jan-2012 9:19:53 PM
*/
struct am_SourceClass_s
{
@@ -608,7 +610,7 @@ namespace am {
* this type holds all information of sources relevant to the HMI
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:13 AM
+ * @created 11-Jan-2012 9:19:53 PM
*/
struct am_SourceType_s
{
@@ -625,7 +627,7 @@ namespace am {
* this type holds all information of sinks relevant to the HMI
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:13 AM
+ * @created 11-Jan-2012 9:19:53 PM
*/
struct am_SinkType_s
{
@@ -643,7 +645,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:13 AM
+ * @created 11-Jan-2012 9:19:53 PM
*/
struct am_Handle_s
{
@@ -657,7 +659,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:14 AM
+ * @created 11-Jan-2012 9:19:54 PM
*/
struct am_MainSoundProperty_s
{
@@ -672,7 +674,7 @@ namespace am {
* this type holds all information of connections relevant to the HMI
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:14 AM
+ * @created 11-Jan-2012 9:19:54 PM
*/
struct am_MainConnectionType_s
{
@@ -689,7 +691,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:14 AM
+ * @created 11-Jan-2012 9:19:54 PM
*/
struct am_MainConnection_s
{
@@ -705,7 +707,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:15 AM
+ * @created 11-Jan-2012 9:19:55 PM
*/
struct am_Sink_s
{
@@ -729,7 +731,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:15 AM
+ * @created 11-Jan-2012 9:19:56 PM
*/
struct am_Source_s
{
@@ -762,7 +764,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:15 AM
+ * @created 11-Jan-2012 9:19:56 PM
*/
struct am_Domain_s
{
@@ -781,7 +783,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:16 AM
+ * @created 11-Jan-2012 9:19:56 PM
*/
struct am_Connection_s
{
@@ -801,7 +803,7 @@ namespace am {
* soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:16 AM
+ * @created 11-Jan-2012 9:19:56 PM
*/
union am_EarlyData_u
{
@@ -818,7 +820,7 @@ namespace am {
* sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:16 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
union am_DataType_u
{
@@ -832,7 +834,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:16 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
struct am_EarlyData_s
{
@@ -844,4 +846,4 @@ namespace am {
};
}
-#endif // !defined(EA_9BBD9DCA_BBCF_45e4_8291_45F44B455D62__INCLUDED_)
+#endif // !defined(EA_F71B3C5D_FC1B_400e_A704_C0FF897D4E53__INCLUDED_)
diff --git a/includes/command/CommandReceiveInterface.h b/includes/command/CommandReceiveInterface.h
index b363bd3..9e2aa8a 100644
--- a/includes/command/CommandReceiveInterface.h
+++ b/includes/command/CommandReceiveInterface.h
@@ -22,8 +22,8 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_2C18A494_5252_4d1b_A0B0_FAE151B68AEA__INCLUDED_)
-#define EA_2C18A494_5252_4d1b_A0B0_FAE151B68AEA__INCLUDED_
+#if !defined(EA_A90A11B4_5916_4910_AE0C_4F9713F898A1__INCLUDED_)
+#define EA_A90A11B4_5916_4910_AE0C_4F9713F898A1__INCLUDED_
#include <vector>
#include <string>
@@ -34,12 +34,13 @@ class SocketHandler;
}
+#define CommandReceiveVersion 1
namespace am {
/**
* The interface towards the Controlling Instance (e.g HMI). It handles the communication towards the HMI and other system components who need to interact with the audiomanagement.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
class CommandReceiveInterface
{
@@ -188,7 +189,11 @@ namespace am {
* @param socketHandler
*/
virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) const =0;
+ /**
+ * This function returns the version of the interface.
+ */
+ virtual uint16_t getInterfaceVersion() const =0;
};
}
-#endif // !defined(EA_2C18A494_5252_4d1b_A0B0_FAE151B68AEA__INCLUDED_)
+#endif // !defined(EA_A90A11B4_5916_4910_AE0C_4F9713F898A1__INCLUDED_)
diff --git a/includes/command/CommandSendInterface.h b/includes/command/CommandSendInterface.h
index 0da4d76..8ae8b50 100644
--- a/includes/command/CommandSendInterface.h
+++ b/includes/command/CommandSendInterface.h
@@ -22,22 +22,24 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_D28BAC35_CEA8_4ec8_AF26_00050F6CD9FA__INCLUDED_)
-#define EA_D28BAC35_CEA8_4ec8_AF26_00050F6CD9FA__INCLUDED_
+#if !defined(EA_B654AC7A_A617_46d0_836D_36974F99E750__INCLUDED_)
+#define EA_B654AC7A_A617_46d0_836D_36974F99E750__INCLUDED_
#include <vector>
#include <string>
#include "../audiomanagertypes.h"
-#include "CommandReceiveInterface.h"
-
-#include "CommandReceiveInterface.h"
+
+namespace am {
+class CommandReceiveInterface;
+}
+#define CommandSendVersion 1
namespace am {
/**
* This interface handles all communication from the AudioManagerDaemon towards the system. It is designed in such a way that only callbacks with no return types are implemented. So when the CommandInterfacePlugins are designed in such a way that they broadcast signals to any node who is interested in the particular information (like signals on Dbus for example), more information can be retrieved via the CommandReceiveInterface.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:58 PM
*/
class CommandSendInterface
{
@@ -139,13 +141,18 @@ namespace am {
*/
virtual void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty) =0;
/**
- * this callback is called when the timinginformation for a mainconnection has changed.
+ * CommandReceiveVer_0.0.9.
*
- * @param mainConnection
* @param time
+ * @param mainConnectionID
+ */
+ virtual void cbTimingInformationChanged(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID) =0;
+ /**
+ * This function returns the version of the interface
+ * returns E_OK, E_UNKOWN if version is unknown.
*/
- virtual void cbTimingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time) =0;
+ virtual uint16_t getInterfaceVersion() const =0;
};
}
-#endif // !defined(EA_D28BAC35_CEA8_4ec8_AF26_00050F6CD9FA__INCLUDED_)
+#endif // !defined(EA_B654AC7A_A617_46d0_836D_36974F99E750__INCLUDED_)
diff --git a/includes/config.h b/includes/config.h
index fb74975..f12b474 100644
--- a/includes/config.h
+++ b/includes/config.h
@@ -1,17 +1,21 @@
#ifndef _CONFIG_H
#define _CONFIG_H
-#define DAEMONVERSION "ver-0.0.1-1-g93d7610"
+#define DAEMONVERSION "ver-0.0.1-4-ge7af3cd"
#define WITH_DBUS_WRAPPER
#define WITH_SOCKETHANDLER_LOOP
/* #undef WITH_SIMPLEDBUS_LOOP */
#define WITH_PPOLL
+/* #undef WITH_TELNET */
#define DEFAULT_PLUGIN_COMMAND_DIR "/home/christian/workspace/gitserver/bin/plugins/command"
#define DEFAULT_PLUGIN_ROUTING_DIR "/home/christian/workspace/gitserver/bin/plugins/routing"
#define CONTROLLER_PLUGIN "/home/christian/workspace/gitserver/bin/plugins/control/libPluginControlInterface.so"
+#define DEFAULT_TELNETPORT 6060
+#define MAX_TELNETCONNECTIONS 3
+
#define DBUS_SERVICE_PREFIX "org.genivi.audiomanager"
#define DBUS_SERVICE_OBJECT_PATH "/org/genivi/audiomanager"
diff --git a/includes/control/ControlReceiveInterface.h b/includes/control/ControlReceiveInterface.h
index bcdd451..9478794 100644
--- a/includes/control/ControlReceiveInterface.h
+++ b/includes/control/ControlReceiveInterface.h
@@ -22,8 +22,8 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_0244757B_93AD_4fd4_83D0_7AB70C332042__INCLUDED_)
-#define EA_0244757B_93AD_4fd4_83D0_7AB70C332042__INCLUDED_
+#if !defined(EA_1D9028B1_EE8B_4860_B728_B37C63BA3D03__INCLUDED_)
+#define EA_1D9028B1_EE8B_4860_B728_B37C63BA3D03__INCLUDED_
#include <vector>
#include <string>
@@ -33,12 +33,13 @@ class SocketHandler;
}
+#define ControlReceiveVersion 1
namespace am {
/**
* This interface gives access to all important functions of the audiomanager that are used by the AudioManagerController to control the system.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:58 PM
*/
class ControlReceiveInterface
{
@@ -126,6 +127,15 @@ namespace am {
*/
virtual am_Error_e setSourceVolume(am_Handle_s& handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e rampType, const am_time_t time) =0;
/**
+ * is used to set several sinkSoundProperties at a time
+ * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if property is out of range, E_NO_CHANGE if no change is neccessary
+ *
+ * @param handle
+ * @param sinkID
+ * @param soundProperty
+ */
+ virtual am_Error_e setSinkSoundProperties(am_Handle_s& handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& soundProperty) =0;
+ /**
* is used to set sinkSoundProperties
* @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if property is out of range, E_NO_CHANGE if no change is neccessary
*
@@ -135,6 +145,15 @@ namespace am {
*/
virtual am_Error_e setSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) =0;
/**
+ * is used to set several SourceSoundProperties at a time
+ * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if property is out of range. E_NO_CHANGE if no change is neccessary
+ *
+ * @param handle
+ * @param sourceID
+ * @param soundProperty
+ */
+ virtual am_Error_e setSourceSoundProperties(am_Handle_s& handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& soundProperty) =0;
+ /**
* is used to set sourceSoundProperties
* @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE if property is out of range. E_NO_CHANGE if no change is neccessary
*
@@ -536,7 +555,11 @@ namespace am {
* @param socketHandler
*/
virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) =0;
+ /**
+ * This function returns the version of the interface
+ */
+ virtual uint16_t getInterfaceVersion() const =0;
};
}
-#endif // !defined(EA_0244757B_93AD_4fd4_83D0_7AB70C332042__INCLUDED_)
+#endif // !defined(EA_1D9028B1_EE8B_4860_B728_B37C63BA3D03__INCLUDED_)
diff --git a/includes/control/ControlSendInterface.h b/includes/control/ControlSendInterface.h
index da7cbce..8d2f299 100644
--- a/includes/control/ControlSendInterface.h
+++ b/includes/control/ControlSendInterface.h
@@ -22,21 +22,25 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_FCDD8CB7_6516_4ee0_AF20_BF3953319E5D__INCLUDED_)
-#define EA_FCDD8CB7_6516_4ee0_AF20_BF3953319E5D__INCLUDED_
+#if !defined(EA_F5981A51_5790_4c74_A384_3600DFC50AF5__INCLUDED_)
+#define EA_F5981A51_5790_4c74_A384_3600DFC50AF5__INCLUDED_
#include <vector>
#include <string>
#include "../audiomanagertypes.h"
-#include "ControlReceiveInterface.h"
+
+namespace am {
+class ControlReceiveInterface;
+}
+#define ControlSendVersion 1
namespace am {
/**
* This interface is presented by the AudioManager controller.
* All the hooks represent system events that need to be handled. The callback functions are used to handle for example answers to function calls on the AudioManagerCoreInterface.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:18 AM
+ * @created 11-Jan-2012 9:55:56 PM
*/
class ControlSendInterface
{
@@ -315,6 +319,13 @@ namespace am {
* @param handle
* @param error
*/
+ virtual void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
+ /**
+ * ack for setting of sourcesoundproperties
+ *
+ * @param handle
+ * @param error
+ */
virtual void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
/**
* ack for setting of sinksoundproperties
@@ -322,8 +333,20 @@ namespace am {
* @param handle
* @param error
*/
+ virtual void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
+ /**
+ * ack for setting of sinksoundproperties
+ *
+ * @param handle
+ * @param error
+ */
virtual void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
+ /**
+ * This function returns the version of the interface
+ * returns E_OK, E_UNKOWN if version is unknown.
+ */
+ virtual uint16_t getInterfaceVersion() const =0;
};
}
-#endif // !defined(EA_FCDD8CB7_6516_4ee0_AF20_BF3953319E5D__INCLUDED_)
+#endif // !defined(EA_F5981A51_5790_4c74_A384_3600DFC50AF5__INCLUDED_)
diff --git a/includes/projecttypes.h b/includes/projecttypes.h
index 6e00614..a50e92c 100644
--- a/includes/projecttypes.h
+++ b/includes/projecttypes.h
@@ -22,22 +22,22 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_2CBBFF9A_7EFD_4a63_8AD7_1DC609634438__INCLUDED_)
-#define EA_2CBBFF9A_7EFD_4a63_8AD7_1DC609634438__INCLUDED_
+#if !defined(EA_D30EA3FF_652C_41f2_84C1_C4EDCBFA0E37__INCLUDED_)
+#define EA_D30EA3FF_652C_41f2_84C1_C4EDCBFA0E37__INCLUDED_
namespace am {
/**
* This enum classifies the format in which data is exchanged within a connection. The enum itself is project specific although there are some Genivi standard formats defined.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
enum am_ConnectionFormat_e
{
CF_STEREO = 0,
- CF_MONO,
- CF_ANALOG,
- CF_MAX,
+ CF_MONO = 1,
+ CF_ANALOG = 2,
+ CF_MAX = 3,
CF_MIN = CF_STEREO
};
@@ -45,17 +45,17 @@ namespace am {
* This enum gives the information about reason for reason for Source/Sink change
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
enum am_AvailabilityReason_e
{
AR_NEWMEDIA = 0,
- AR_SAMEMEDIA,
- AR_NOMEDIA,
- AR_UNKNOWN,
- AR_TEMPERATURE,
- AR_VOLTAGE,
- AR_MAX,
+ AR_SAMEMEDIA = 1,
+ AR_NOMEDIA = 2,
+ AR_UNKNOWN = 3,
+ AR_TEMPERATURE = 4,
+ AR_VOLTAGE = 5,
+ AR_MAX = 6,
AR_MIN = AR_NEWMEDIA
};
@@ -63,7 +63,7 @@ namespace am {
* product specific identifier of property
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
enum am_ClassProperty_e
{
@@ -74,8 +74,8 @@ namespace am {
/**
* defines the SINK_TYPE. Project specific
*/
- CP_SINK_TYPE,
- CP_MAX,
+ CP_SINK_TYPE = 1,
+ CP_MAX = 2,
CP_MIN = CP_SOURCE_TYPE
};
@@ -84,7 +84,7 @@ namespace am {
* It is in the responsibility of the product to make sure that the routing plugins are aware of the ramp types used.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
enum am_RampType_e
{
@@ -95,10 +95,10 @@ namespace am {
/**
* This ramp type will set the volume as fast as possible.
*/
- RAMP_NO_BLOB,
- RAMP_LOG,
- RAMP_STRAIGHT,
- RAMP_MAX,
+ RAMP_NO_BLOB = 1,
+ RAMP_LOG = 2,
+ RAMP_STRAIGHT = 3,
+ RAMP_MAX = 4,
RAMP_MIN = RAMP_DIRECT
};
@@ -106,14 +106,14 @@ namespace am {
* sound properties. Within genivi only the standard properties are defined, for products these need to be extended.
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
enum am_SoundPropertyType_e
{
SP_TREBLE = 0,
- SP_MID,
- SP_BASS,
- SP_MAX,
+ SP_MID = 1,
+ SP_BASS = 2,
+ SP_MAX = 3,
SP_MIN = SP_TREBLE
};
@@ -121,7 +121,7 @@ namespace am {
* Here are all SoundProperties that can be set via the CommandInterface. Product specific
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
enum am_MainSoundPropertyType_e
{
@@ -129,8 +129,8 @@ namespace am {
* gives the navigation offset in percent
*/
MSP_NAVIGATION_OFFSET = 0,
- MSP_TEST,
- MSP_MAX,
+ MSP_TEST = 1,
+ MSP_MAX = 2,
MSP_MIN = MSP_NAVIGATION_OFFSET
};
@@ -138,13 +138,13 @@ namespace am {
* describes the different system properties. Project specific
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:17 AM
+ * @created 11-Jan-2012 9:19:57 PM
*/
enum am_SystemPropertyType_e
{
SYP_TEST = 0,
- SYP_MAX,
+ SYP_MAX = 1,
SYP_MIN = SYP_TEST
};
}
-#endif // !defined(EA_2CBBFF9A_7EFD_4a63_8AD7_1DC609634438__INCLUDED_)
+#endif // !defined(EA_D30EA3FF_652C_41f2_84C1_C4EDCBFA0E37__INCLUDED_)
diff --git a/includes/routing/RoutingReceiveInterface.h b/includes/routing/RoutingReceiveInterface.h
index 33df05b..c1cfc76 100644
--- a/includes/routing/RoutingReceiveInterface.h
+++ b/includes/routing/RoutingReceiveInterface.h
@@ -22,24 +22,26 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_4264FCC6_2875_4a34_B7B3_1157DD551AF6__INCLUDED_)
-#define EA_4264FCC6_2875_4a34_B7B3_1157DD551AF6__INCLUDED_
+#if !defined(EA_F103F724_CE43_4c5d_A6E5_859230D16B1E__INCLUDED_)
+#define EA_F103F724_CE43_4c5d_A6E5_859230D16B1E__INCLUDED_
#include <vector>
#include <string>
#include "../audiomanagertypes.h"
+
namespace am {
class DBusWrapper;
class SocketHandler;
}
+#define RoutingReceiveVersion 1
namespace am {
/**
* Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:18 AM
+ * @created 11-Jan-2012 9:54:30 PM
*/
class RoutingReceiveInterface
{
@@ -85,6 +87,13 @@ namespace am {
*/
virtual void ackSetSourceState(const am_Handle_s handle, const am_Error_e error) =0;
/**
+ * acknowledges asyncSetSinkSoundProperties
+ *
+ * @param handle
+ * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
+ */
+ virtual void ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
+ /**
* acknowledges asyncSetSinkSoundProperty
*
* @param handle
@@ -92,6 +101,13 @@ namespace am {
*/
virtual void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) =0;
/**
+ * acknowledges asyncSetSourceSoundProperties
+ *
+ * @param handle
+ * @param error E_OK on success, E_ABORTED if action was aborted, E_UNKNOWN on error
+ */
+ virtual void ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) =0;
+ /**
* acknowledges asyncSetSourceSoundProperty
*
* @param handle
@@ -301,7 +317,11 @@ namespace am {
* @param socketHandler
*/
virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) const =0;
+ /**
+ * This function returns the version of the interface
+ */
+ virtual uint16_t getInterfaceVersion() const =0;
};
}
-#endif // !defined(EA_4264FCC6_2875_4a34_B7B3_1157DD551AF6__INCLUDED_)
+#endif // !defined(EA_F103F724_CE43_4c5d_A6E5_859230D16B1E__INCLUDED_)
diff --git a/includes/routing/RoutingSendInterface.h b/includes/routing/RoutingSendInterface.h
index 06d4994..9637a08 100644
--- a/includes/routing/RoutingSendInterface.h
+++ b/includes/routing/RoutingSendInterface.h
@@ -22,22 +22,26 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_BEEEF7D0_77D1_4bb1_8A9D_5E6E127272EE__INCLUDED_)
-#define EA_BEEEF7D0_77D1_4bb1_8A9D_5E6E127272EE__INCLUDED_
+#if !defined(EA_8F359F31_A78B_4e36_B94C_31E6A09C8F67__INCLUDED_)
+#define EA_8F359F31_A78B_4e36_B94C_31E6A09C8F67__INCLUDED_
#include <vector>
#include <string>
#include "../audiomanagertypes.h"
-
+
+namespace am {
+class RoutingReceiveInterface;
+}
#include "RoutingReceiveInterface.h"
+#define RoutingSendVersion 1
namespace am {
/**
* This class implements everything from Audiomanager -> RoutingAdapter
* @author christian
* @version 1.0
- * @created 22-Dec-2011 12:55:19 AM
+ * @created 11-Jan-2012 9:22:46 PM
*/
class RoutingSendInterface
{
@@ -120,6 +124,15 @@ namespace am {
* @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
*
* @param handle
+ * @param listSoundProperties
+ * @param sinkID
+ */
+ virtual am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID) =0;
+ /**
+ * this function sets the sinksoundproperty.
+ * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
+ *
+ * @param handle
* @param soundProperty
* @param sinkID
*/
@@ -129,6 +142,15 @@ namespace am {
* @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
*
* @param handle
+ * @param listSoundProperties
+ * @param sourceID
+ */
+ virtual am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID) =0;
+ /**
+ * this function sets the sourcesoundproperty.
+ * @return E_OK on success, E_UNKNOWN on error, E_OUT_OF_RANGE in case the propery value is out of range
+ *
+ * @param handle
* @param soundProperty
* @param sourceID
*/
@@ -159,7 +181,11 @@ namespace am {
* @param BusName
*/
virtual am_Error_e returnBusName(std::string& BusName) const =0;
+ /**
+ * This function returns the version of the interface
+ */
+ virtual uint16_t getInterfaceVersion() const =0;
};
}
-#endif // !defined(EA_BEEEF7D0_77D1_4bb1_8A9D_5E6E127272EE__INCLUDED_)
+#endif // !defined(EA_8F359F31_A78B_4e36_B94C_31E6A09C8F67__INCLUDED_)