* 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
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)
#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
*/
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
};
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
#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
*/
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) ;
void setRoutingReady() ;
void setCommandReady() ;
am_Error_e getSocketHandler(SocketHandler*& socketHandler);
+ uint16_t getInterfaceVersion() const;
private:
DatabaseHandler* mDatabaseHandler; //!< pointer tto the databasehandler
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;
#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.
#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() ;
private:
CommandSender *mCommandSender; //!< pointer to the comandSender
RoutingSender* mRoutingSender; //!< pointer to the routingSender
+ TelnetServer* mTelnetServer; //!< pointer to the telnetserver
};
}
#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.
*/
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) ;
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
};
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
am_SourceState_e sourceState;
am_volume_t volume;
am_HotSink_e hotSink;
+ std::vector<am_SoundProperty_s>* soundProperties;
};
};
* @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:
--- /dev/null
+/**
+* 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_ */
*/
#include "CommandReceiver.h"
+#include "DatabaseHandler.h"
+#include "ControlSender.h"
#include <SocketHandler.h>
#include <config.h>
#include <assert.h>
#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;
#endif /*WITH_SOCKETHANDLER_LOOP*/
}
+uint16_t CommandReceiver::getInterfaceVersion() const
+{
+ return CommandReceiveVersion;
+}
+
+
+
#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
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)
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);
}
mListLibraryHandles.clear();
}
+uint16_t CommandSender::getInterfaceVersion() const
+{
+ return CommandSendVersion;
+}
+
+
+
*/
#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>
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)
{
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)
}
+uint16_t ControlReceiver::getInterfaceVersion() const
+{
+ return ControlReceiveVersion;
+}
+
+
+
+
-/*
- * 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>
using namespace am;
+#define REQUIRED_MIN_INTERFACE_VERSION 1
+
ControlSender::ControlSender(std::string controlPluginFile)
:mlibHandle(NULL),
mController(NULL)
createFunc = getCreateFunction<ControlSendInterface*()>(controlPluginFile,mlibHandle);
assert(createFunc!=NULL);
mController = createFunc();
+
+ //check libversion
+ assert(REQUIRED_MIN_INTERFACE_VERSION<=mController->getInterfaceVersion());
}
else
{
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;
+}
+
+
+
#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>" \
*/
#include "DatabaseHandler.h"
+#include "DatabaseObserver.h"
#include <assert.h>
#include <vector>
#include <fstream>
*/
#include "DatabaseObserver.h"
-#include <assert.h>
#include "CommandSender.h"
#include "RoutingSender.h"
+#include "TelnetServer.h"
+#include <assert.h>
using namespace am;
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
}
+
+
+
*/
#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;
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);
}
+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)
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);
}
+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)
{
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;
}
-am_Error_e am::RoutingReceiver::getSocketHandler(SocketHandler *& socketHandler) const
+am_Error_e RoutingReceiver::getSocketHandler(SocketHandler *& socketHandler) const
{
#ifdef WITH_SOCKETHANDLER_LOOP
socketHandler=mSocketHandler;
#endif
}
+uint16_t RoutingReceiver::getInterfaceVersion() const
+{
+ return RoutingReceiveVersion;
+}
+
+
+
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(); \
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;
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;
}
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());
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()
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;
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;
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);
}
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);
+}
+
+
+
+
+
--- /dev/null
+/**
+* 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;
+}
+
+
+
+
+
//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>
#include <string.h>
#include <stdio.h>
-
-
#include <dlt/dlt.h>
DLT_DECLARE_CONTEXT(AudioManager)
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 ()
{
{
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);
signalChildAction.sa_flags = SA_NOCLDWAIT;
sigaction (SIGCHLD, &signalChildAction, NULL);
-
//Instantiate all classes. Keep in same order !
#ifdef WITH_SOCKETHANDLER_LOOP
SocketHandler iSocketHandler;
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);
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();
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());
};
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
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,
*/
#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;
#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();
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
using namespace am;
using namespace testing;
-DLT_DECLARE_CONTEXT(DLT_CONTEXT)
+DLT_DECLARE_CONTEXT(DLT_CONTEXT);
routingInterfaceTest::routingInterfaceTest()
:plistRoutingPluginDirs(),
--- /dev/null
+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.
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
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" )
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)
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(
${DBUS_INCLUDE_DIR}
${DBUS_ARCH_INCLUDE_DIR}
${AUDIO_INCLUDES_FOLDER}
+ ${DLT_INCLUDE_DIRS}
${INCLUDES_FOLDER}
)
add_library(PluginCommandInterfaceDbus SHARED ${PLUGINDBUS_SRCS_CXX})
+SET_TARGET_PROPERTIES(PluginCommandInterfaceDbus PROPERTIES
+ SOVERSION "${LIB_INTERFACE_VERSION}"
+)
+
+
TARGET_LINK_LIBRARIES(PluginCommandInterfaceDbus
${DLT_LIBRARIES}
${DBUS_LIBRARY}
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;
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);
+}
+
+
+
+
+
am_Error_e(DBusWrapper*& dbusConnectionWrapper));
MOCK_CONST_METHOD1(getSocketHandler,
am_Error_e(SocketHandler*& socketHandler));
-
+ MOCK_CONST_METHOD0(getInterfaceVersion,
+ uint16_t());
};
+
} // namespace am
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}
add_library(PluginControlInterface SHARED ${PLUGIN_CONTROL_SRCS_CXX})
+SET_TARGET_PROPERTIES(PluginControlInterface PROPERTIES
+ SOVERSION "${LIB_INTERFACE_VERSION}"
+)
+
TARGET_LINK_LIBRARIES(PluginControlInterface
${DLT_LIBRARIES})
#define CONTROLSENDER_H_
#include <control/ControlSendInterface.h>
-#include <control/ControlReceiveInterface.h>
using namespace am;
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_ */
{
}
+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);
+}
+
+
+
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)
add_library(PluginRoutingInterfaceAsync SHARED ${PLUGINDBUS_SRCS_CXX})
+SET_TARGET_PROPERTIES(PluginRoutingInterfaceAsync PROPERTIES
+ SOVERSION "${LIB_INTERFACE_VERSION}"
+)
+
TARGET_LINK_LIBRARIES(PluginRoutingInterfaceAsync
${DLT_LIBRARIES}
${DBUS_LIBRARY}
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
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;
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,
am_Error_e(DBusWrapper*& dbusConnectionWrapper));
MOCK_CONST_METHOD1(getSocketHandler,
am_Error_e(SocketHandler*& socketHandler));
+ MOCK_CONST_METHOD0(getInterfaceVersion,
+ uint16_t());
};
} // namespace am
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(
add_library(PluginRoutingInterfaceDbus SHARED ${PLUGINDBUS_SRCS_CXX})
+SET_TARGET_PROPERTIES(PluginRoutingInterfaceDbus PROPERTIES
+ SOVERSION "${LIB_INTERFACE_VERSION}"
+)
+
TARGET_LINK_LIBRARIES(PluginRoutingInterfaceDbus
${DLT_LIBRARIES}
${DBUS_LIBRARY}
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_ */
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);
+}
+
+
+
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
***********************************************************************************************************
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:
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
#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@"
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_9BBD9DCA_BBCF_45e4_8291_45F44B455D62__INCLUDED_)\r
-#define EA_9BBD9DCA_BBCF_45e4_8291_45F44B455D62__INCLUDED_\r
+#if !defined(EA_F71B3C5D_FC1B_400e_A704_C0FF897D4E53__INCLUDED_)\r
+#define EA_F71B3C5D_FC1B_400e_A704_C0FF897D4E53__INCLUDED_\r
\r
#include <stdint.h>\r
#include "projecttypes.h"\r
* 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;
* 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;
* 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;
* 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;
* 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;
* 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
};
* 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
{
/**
* 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
};
* 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
};
* 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
};
* 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
{
/**
* 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
};
* 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
};
* 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
};
* 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
{
/**
* @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
{
/**
* @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
{
/**
* @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
{
* 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
{
/**
* @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
{
/**
* @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
{
/**
* @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
{
/**
* @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
{
/**
* @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
{
* 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
{
* 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
{
/**
* @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
{
/**
* @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
{
* 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
{
/**
* @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
{
/**
* @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
{
/**
* @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
{
/**
* @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
{
/**
* @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
{
* 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
{
* 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
{
/**
* @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
{
};
}
-#endif // !defined(EA_9BBD9DCA_BBCF_45e4_8291_45F44B455D62__INCLUDED_)
+#endif // !defined(EA_F71B3C5D_FC1B_400e_A704_C0FF897D4E53__INCLUDED_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_2C18A494_5252_4d1b_A0B0_FAE151B68AEA__INCLUDED_)\r
-#define EA_2C18A494_5252_4d1b_A0B0_FAE151B68AEA__INCLUDED_\r
+#if !defined(EA_A90A11B4_5916_4910_AE0C_4F9713F898A1__INCLUDED_)\r
+#define EA_A90A11B4_5916_4910_AE0C_4F9713F898A1__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
}\r
+#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
{
* @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_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_D28BAC35_CEA8_4ec8_AF26_00050F6CD9FA__INCLUDED_)\r
-#define EA_D28BAC35_CEA8_4ec8_AF26_00050F6CD9FA__INCLUDED_\r
+#if !defined(EA_B654AC7A_A617_46d0_836D_36974F99E750__INCLUDED_)\r
+#define EA_B654AC7A_A617_46d0_836D_36974F99E750__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
#include "../audiomanagertypes.h"\r
-#include "CommandReceiveInterface.h"
-
-#include "CommandReceiveInterface.h"
+\r
+namespace am {\r
+class CommandReceiveInterface;\r
+}
+#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
{
*/
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\r
+ * 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_)
#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"
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_0244757B_93AD_4fd4_83D0_7AB70C332042__INCLUDED_)\r
-#define EA_0244757B_93AD_4fd4_83D0_7AB70C332042__INCLUDED_\r
+#if !defined(EA_1D9028B1_EE8B_4860_B728_B37C63BA3D03__INCLUDED_)\r
+#define EA_1D9028B1_EE8B_4860_B728_B37C63BA3D03__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
}\r
+#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
{
*/
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\r
+ * @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\r
* @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
*
*/
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\r
+ * @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\r
* @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 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_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_FCDD8CB7_6516_4ee0_AF20_BF3953319E5D__INCLUDED_)\r
-#define EA_FCDD8CB7_6516_4ee0_AF20_BF3953319E5D__INCLUDED_\r
+#if !defined(EA_F5981A51_5790_4c74_A384_3600DFC50AF5__INCLUDED_)\r
+#define EA_F5981A51_5790_4c74_A384_3600DFC50AF5__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
#include "../audiomanagertypes.h"\r
-#include "ControlReceiveInterface.h"
+\r
+namespace am {\r
+class ControlReceiveInterface;\r
+}
+#define ControlSendVersion 1
namespace am {
/**
* This interface is presented by the AudioManager controller.\r
* 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
{
* @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
* @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\r
+ * 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_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_2CBBFF9A_7EFD_4a63_8AD7_1DC609634438__INCLUDED_)\r
-#define EA_2CBBFF9A_7EFD_4a63_8AD7_1DC609634438__INCLUDED_\r
+#if !defined(EA_D30EA3FF_652C_41f2_84C1_C4EDCBFA0E37__INCLUDED_)\r
+#define EA_D30EA3FF_652C_41f2_84C1_C4EDCBFA0E37__INCLUDED_\r
\r
namespace am {\r
/**\r
* 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.\r
* @author christian\r
* @version 1.0\r
- * @created 22-Dec-2011 12:55:17 AM\r
+ * @created 11-Jan-2012 9:19:57 PM\r
*/\r
enum am_ConnectionFormat_e\r
{\r
CF_STEREO = 0,\r
- CF_MONO,\r
- CF_ANALOG,\r
- CF_MAX,\r
+ CF_MONO = 1,\r
+ CF_ANALOG = 2,\r
+ CF_MAX = 3,\r
CF_MIN = CF_STEREO\r
};\r
\r
* This enum gives the information about reason for reason for Source/Sink change\r
* @author christian\r
* @version 1.0\r
- * @created 22-Dec-2011 12:55:17 AM\r
+ * @created 11-Jan-2012 9:19:57 PM\r
*/\r
enum am_AvailabilityReason_e\r
{\r
AR_NEWMEDIA = 0,\r
- AR_SAMEMEDIA,\r
- AR_NOMEDIA,\r
- AR_UNKNOWN,\r
- AR_TEMPERATURE,\r
- AR_VOLTAGE,\r
- AR_MAX,\r
+ AR_SAMEMEDIA = 1,\r
+ AR_NOMEDIA = 2,\r
+ AR_UNKNOWN = 3,\r
+ AR_TEMPERATURE = 4,\r
+ AR_VOLTAGE = 5,\r
+ AR_MAX = 6,\r
AR_MIN = AR_NEWMEDIA\r
};\r
\r
* product specific identifier of property\r
* @author christian\r
* @version 1.0\r
- * @created 22-Dec-2011 12:55:17 AM\r
+ * @created 11-Jan-2012 9:19:57 PM\r
*/\r
enum am_ClassProperty_e\r
{\r
/**\r
* defines the SINK_TYPE. Project specific\r
*/\r
- CP_SINK_TYPE,\r
- CP_MAX,\r
+ CP_SINK_TYPE = 1,\r
+ CP_MAX = 2,\r
CP_MIN = CP_SOURCE_TYPE\r
};\r
\r
* 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
{
/**
* 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
};
* 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
};
* 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
{
* 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
};
* 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_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_4264FCC6_2875_4a34_B7B3_1157DD551AF6__INCLUDED_)\r
-#define EA_4264FCC6_2875_4a34_B7B3_1157DD551AF6__INCLUDED_\r
+#if !defined(EA_F103F724_CE43_4c5d_A6E5_859230D16B1E__INCLUDED_)\r
+#define EA_F103F724_CE43_4c5d_A6E5_859230D16B1E__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
#include "../audiomanagertypes.h"\r
+\r
namespace am {\r
class DBusWrapper;\r
class SocketHandler;\r
}\r
+#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
{
*/
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
*/
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
* @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_)
*\r
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN\r
*/\r
-#if !defined(EA_BEEEF7D0_77D1_4bb1_8A9D_5E6E127272EE__INCLUDED_)\r
-#define EA_BEEEF7D0_77D1_4bb1_8A9D_5E6E127272EE__INCLUDED_\r
+#if !defined(EA_8F359F31_A78B_4e36_B94C_31E6A09C8F67__INCLUDED_)\r
+#define EA_8F359F31_A78B_4e36_B94C_31E6A09C8F67__INCLUDED_\r
\r
#include <vector>\r
#include <string>\r
#include "../audiomanagertypes.h"\r
-
+\r
+namespace am {\r
+class RoutingReceiveInterface;\r
+}
#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
{
* @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.\r
+ * @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
*/
* @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.\r
+ * @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
*/
* @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_)