summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/include
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-01-10 15:58:38 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-01-12 00:09:34 +0100
commit472d0762b68ce0f2a755b4215515a3e031831495 (patch)
tree276e811f00dfe17cba15c56092b33d67ba2793f6 /AudioManagerDaemon/include
parent6ebae8c4d3a340c135ed2f5f611a0e1c31994164 (diff)
downloadaudiomanager-472d0762b68ce0f2a755b4215515a3e031831495.tar.gz
* recreated the header files out of the model. Added versioning support in the headerfiles generated
* ensured compatibility with 64 bit systems while compiling dbus [ changed FindDBUS.cmake] * updated the README to better support building * updated typo in introspectable string of DBusWrapper * reworked including strategie * added getInterfafeVersion method on all interfaces * added Interface Versioning support * added version as part of .so ending * it is no possible to set a vector of source and sink sound properties at a time * added interface to ask for all loaded plugins on RoutingSender * added first version of telnet server (not yet productive) - set to not active in CMakeLists.txt * added changelog (created out of git commit log) * added default values for all enum types to be save even on other if communication is on other domain
Diffstat (limited to 'AudioManagerDaemon/include')
-rw-r--r--AudioManagerDaemon/include/CommandReceiver.h14
-rw-r--r--AudioManagerDaemon/include/CommandSender.h1
-rw-r--r--AudioManagerDaemon/include/ControlReceiver.h16
-rw-r--r--AudioManagerDaemon/include/ControlSender.h3
-rw-r--r--AudioManagerDaemon/include/DatabaseHandler.h4
-rw-r--r--AudioManagerDaemon/include/DatabaseObserver.h8
-rw-r--r--AudioManagerDaemon/include/RoutingReceiver.h18
-rw-r--r--AudioManagerDaemon/include/RoutingSender.h7
-rw-r--r--AudioManagerDaemon/include/TelnetServer.h89
9 files changed, 134 insertions, 26 deletions
diff --git a/AudioManagerDaemon/include/CommandReceiver.h b/AudioManagerDaemon/include/CommandReceiver.h
index 6d9201f..114d075 100644
--- a/AudioManagerDaemon/include/CommandReceiver.h
+++ b/AudioManagerDaemon/include/CommandReceiver.h
@@ -27,15 +27,14 @@
#include <command/CommandReceiveInterface.h>
#include <config.h>
-#ifdef WITH_DBUS_WRAPPER
-#include <dbus/DBusWrapper.h>
-#endif
-#include <SocketHandler.h>
-#include "DatabaseHandler.h"
-#include "ControlSender.h"
namespace am {
+class DatabaseHandler;
+class ControlSender;
+class DBusWrapper;
+class SocketHandler;
+
/**
* This class realizes the command Interface
*/
@@ -64,11 +63,12 @@ public:
am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const ;
am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const ;
am_Error_e getSocketHandler(SocketHandler*& socketHandler) const;
+ uint16_t getInterfaceVersion() const;
private:
DatabaseHandler* mDatabaseHandler; //!< pointer to the databasehandler
- DBusWrapper* mDBusWrapper; //!< pointer to the dbuswrapper
ControlSender* mControlSender; //!< pointer to the control sender
+ DBusWrapper* mDBusWrapper; //!< pointer to the dbuswrapper
SocketHandler* mSocketHandler; //!< pointer to the SocketHandler
};
diff --git a/AudioManagerDaemon/include/CommandSender.h b/AudioManagerDaemon/include/CommandSender.h
index df83e7c..5a412f3 100644
--- a/AudioManagerDaemon/include/CommandSender.h
+++ b/AudioManagerDaemon/include/CommandSender.h
@@ -59,6 +59,7 @@ public:
void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState) ;
void cbSystemPropertyChanged(const am_SystemProperty_s& SystemProperty) ;
void cbTimingInformationChanged(const am_mainConnectionID_t mainConnection, const am_timeSync_t time) ;
+ uint16_t getInterfaceVersion() const;
#ifdef UNIT_TEST
friend class CommandInterfaceBackdoor; //this is to get access to the loaded plugins and be able to exchange the interfaces
#endif
diff --git a/AudioManagerDaemon/include/ControlReceiver.h b/AudioManagerDaemon/include/ControlReceiver.h
index 303d675..a8afb79 100644
--- a/AudioManagerDaemon/include/ControlReceiver.h
+++ b/AudioManagerDaemon/include/ControlReceiver.h
@@ -26,17 +26,16 @@
#define CONTRONLRECEIVER_H_
#include <control/ControlReceiveInterface.h>
-#include <SocketHandler.h>
#include <config.h>
-#ifdef WITH_DBUS_WRAPPER
-#include <dbus/DBusWrapper.h>
-#endif
-#include "DatabaseHandler.h"
-#include "RoutingSender.h"
-#include "CommandSender.h"
+
namespace am {
+class SocketHandler;
+class DatabaseHandler;
+class RoutingSender;
+class CommandSender;
+
/**
* This class is used to receive all commands from the control interface
*/
@@ -53,7 +52,9 @@ public:
am_Error_e setSinkVolume(am_Handle_s& handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) ;
am_Error_e setSourceVolume(am_Handle_s& handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e rampType, const am_time_t time) ;
am_Error_e setSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e setSinkSoundProperties(am_Handle_s& handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& soundProperty) ;
am_Error_e setSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e setSourceSoundProperties(am_Handle_s& handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& soundProperty) ;
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) ;
am_Error_e abortAction(const am_Handle_s handle) ;
am_Error_e enterDomainDB(const am_Domain_s& domainData, am_domainID_t& domainID) ;
@@ -107,6 +108,7 @@ public:
void setRoutingReady() ;
void setCommandReady() ;
am_Error_e getSocketHandler(SocketHandler*& socketHandler);
+ uint16_t getInterfaceVersion() const;
private:
DatabaseHandler* mDatabaseHandler; //!< pointer tto the databasehandler
diff --git a/AudioManagerDaemon/include/ControlSender.h b/AudioManagerDaemon/include/ControlSender.h
index 9550595..2134fa6 100644
--- a/AudioManagerDaemon/include/ControlSender.h
+++ b/AudioManagerDaemon/include/ControlSender.h
@@ -78,7 +78,10 @@ public:
void cbAckSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) ;
void cbAckSetSourceState(const am_Handle_s handle, const am_Error_e error) ;
void cbAckSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
void cbAckSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void cbAckSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
+ uint16_t getInterfaceVersion() const;
#ifdef UNIT_TEST
friend class ControlInterfaceBackdoor;
diff --git a/AudioManagerDaemon/include/DatabaseHandler.h b/AudioManagerDaemon/include/DatabaseHandler.h
index c4b6dd4..05fd237 100644
--- a/AudioManagerDaemon/include/DatabaseHandler.h
+++ b/AudioManagerDaemon/include/DatabaseHandler.h
@@ -26,11 +26,13 @@
#define DATABASEHANDLER_H_
#include "audiomanagertypes.h"
-#include "DatabaseObserver.h"
#include <sqlite3.h>
+#include <map>
namespace am {
+class DatabaseObserver;
+
#define DYNAMIC_ID_BOUNDARY 100 //!< the value below is reserved for staticIDs, the value above will be assigned to dynamically registered items
//todo: we do not have to create MainSoundProperty tables if visible = false.
diff --git a/AudioManagerDaemon/include/DatabaseObserver.h b/AudioManagerDaemon/include/DatabaseObserver.h
index 21959a8..f35defe 100644
--- a/AudioManagerDaemon/include/DatabaseObserver.h
+++ b/AudioManagerDaemon/include/DatabaseObserver.h
@@ -25,17 +25,20 @@
#ifndef DATABASEOBSERVER_H_
#define DATABASEOBSERVER_H_
-#include "CommandSender.h"
-#include "RoutingSender.h"
+#include <audiomanagertypes.h>
namespace am {
+class TelnetServer;
+class CommandSender;
+class RoutingSender;
/**
* This class observes the Database and notifies other classes about important events, mainly the CommandSender.
*/
class DatabaseObserver {
public:
DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender);
+ DatabaseObserver(CommandSender *iCommandSender, RoutingSender *iRoutingSender,TelnetServer *iTelnetServer);
virtual ~DatabaseObserver();
void numberOfMainConnectionsChanged() ;
void numberOfSinkClassesChanged() ;
@@ -62,6 +65,7 @@ public:
private:
CommandSender *mCommandSender; //!< pointer to the comandSender
RoutingSender* mRoutingSender; //!< pointer to the routingSender
+ TelnetServer* mTelnetServer; //!< pointer to the telnetserver
};
}
diff --git a/AudioManagerDaemon/include/RoutingReceiver.h b/AudioManagerDaemon/include/RoutingReceiver.h
index f3ba2fe..a53a4ea 100644
--- a/AudioManagerDaemon/include/RoutingReceiver.h
+++ b/AudioManagerDaemon/include/RoutingReceiver.h
@@ -26,17 +26,16 @@
#define ROUTINGRECEIVER_H_
#include <routing/RoutingReceiveInterface.h>
-#include <SocketHandler.h>
#include <config.h>
-#ifdef WITH_DBUS_WRAPPER
-#include <dbus/DBusWrapper.h>
-#endif
-#include "DatabaseHandler.h"
-#include "RoutingSender.h"
-#include "ControlSender.h"
namespace am {
+class SocketHandler;
+class DBusWrapper;
+class DatabaseHandler;
+class RoutingSender;
+class ControlSender;
+
/**
* Implements the Receiving side of the RoutingPlugins.
*/
@@ -52,7 +51,9 @@ public:
void ackSetSourceVolumeChange(const am_Handle_s handle, const am_volume_t volume, const am_Error_e error) ;
void ackSetSourceState(const am_Handle_s handle, const am_Error_e error) ;
void ackSetSinkSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void ackSetSinkSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
void ackSetSourceSoundProperty(const am_Handle_s handle, const am_Error_e error) ;
+ void ackSetSourceSoundProperties(const am_Handle_s handle, const am_Error_e error) ;
void ackCrossFading(const am_Handle_s handle, const am_HotSink_e hotSink, const am_Error_e error) ;
void ackSourceVolumeTick(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume) ;
void ackSinkVolumeTick(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume) ;
@@ -80,13 +81,14 @@ public:
am_Error_e sendChangedData(const std::vector<am_EarlyData_s>& earlyData) ;
am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const ;
am_Error_e getSocketHandler(SocketHandler*& socketHandler) const;
+ uint16_t getInterfaceVersion() const;
private:
DatabaseHandler *mDatabaseHandler; //!< pointer to the databaseHandler
RoutingSender *mRoutingSender; //!< pointer to the routingSender
ControlSender *mControlSender; //!< pointer to the controlSender
- DBusWrapper *mDBusWrapper; //!< pointer to dbuswrapper
SocketHandler *mSocketHandler; //!< pointer to sockethandler
+ DBusWrapper *mDBusWrapper; //!< pointer to dbuswrapper
};
diff --git a/AudioManagerDaemon/include/RoutingSender.h b/AudioManagerDaemon/include/RoutingSender.h
index 5f5967e..459fe84 100644
--- a/AudioManagerDaemon/include/RoutingSender.h
+++ b/AudioManagerDaemon/include/RoutingSender.h
@@ -103,10 +103,14 @@ public:
am_Error_e asyncSetSourceVolume(am_Handle_s& handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_RampType_e ramp, const am_time_t time) ;
am_Error_e asyncSetSourceState(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SourceState_e state) ;
am_Error_e asyncSetSinkSoundProperty(am_Handle_s& handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty) ;
+ am_Error_e asyncSetSourceSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sourceID_t sourceID) ;
+ am_Error_e asyncSetSinkSoundProperties(am_Handle_s& handle, const std::vector<am_SoundProperty_s>& listSoundProperties, const am_sinkID_t sinkID) ;
am_Error_e asyncSetSourceSoundProperty(am_Handle_s& handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty) ;
am_Error_e asyncCrossFade(am_Handle_s& handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_RampType_e rampType, const am_time_t time) ;
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState) ;
am_Error_e getListHandles(std::vector<am_Handle_s> & listHandles) const ;
+ am_Error_e getListPlugins(std::vector<std::string>& interfaces) const;
+ uint16_t getInterfaceVersion() const;
//!< is used to pair interfaces with busnames
struct InterfaceNamePairs
@@ -132,6 +136,7 @@ public:
am_SourceState_e sourceState;
am_volume_t volume;
am_HotSink_e hotSink;
+ std::vector<am_SoundProperty_s>* soundProperties;
};
};
@@ -146,7 +151,7 @@ public:
* @param handle the handle
* @return a class holding the handle data
*/
- am_handleData_c returnHandleData(am_Handle_s handle);
+ am_handleData_c returnHandleData(const am_Handle_s handle) const;
private:
diff --git a/AudioManagerDaemon/include/TelnetServer.h b/AudioManagerDaemon/include/TelnetServer.h
new file mode 100644
index 0000000..9b7d097
--- /dev/null
+++ b/AudioManagerDaemon/include/TelnetServer.h
@@ -0,0 +1,89 @@
+/**
+* Copyright (C) 2011, BMW AG
+*
+* GeniviAudioMananger AudioManagerDaemon
+*
+* \file TelnetServer.h
+*
+* \date 20-Oct-2011 3:42:04 PM
+* \author Christian Mueller (christian.ei.mueller@bmw.de)
+*
+* \section License
+* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+*
+* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+*
+*/
+
+
+#ifndef TELNETSERVER_H_
+#define TELNETSERVER_H_
+
+#include "SocketHandler.h"
+#include <queue>
+#include <map>
+
+namespace am {
+
+class DatabaseHandler;
+class CommandSender;
+class RoutingSender;
+class ControlSender;
+class CommandReceiver;
+class RoutingReceiver;
+class ControlReceiver;
+
+class TelnetServer
+{
+public:
+ TelnetServer(SocketHandler *iSocketHandler,CommandSender *iCommandSender,CommandReceiver *iCommandReceiver, RoutingSender *iRoutingSender,RoutingReceiver *iRoutingReceiver,ControlSender *iControlSender, ControlReceiver *iControlReceiver,DatabaseHandler *iDatabasehandler,unsigned int servPort, unsigned int maxConnections);
+ virtual ~TelnetServer();
+ void connectSocket(const pollfd pfd,const sh_pollHandle_t handle, void* userData);
+ void receiveData(const pollfd pfd,const sh_pollHandle_t handle, void* userData);
+ bool dispatchData(const sh_pollHandle_t handle, void* userData);
+ bool check(const sh_pollHandle_t handle, void* userData);
+ shPollFired_T<TelnetServer> telnetConnectFiredCB;
+ shPollFired_T<TelnetServer> telnetReceiveFiredCB;
+ shPollDispatch_T<TelnetServer> telnetDispatchCB;
+ shPollCheck_T<TelnetServer> telnetCheckCB;
+private:
+ typedef void (*CommandPrototype)(std::vector<std::string>& msg,int filedescriptor);
+ typedef std::map<std::string,CommandPrototype> mMapCommand_t;
+ static void listCommand(std::vector<std::string>& msg,int filedescriptor);
+ void listCommandShadow(std::vector<std::string>& msg,int filedescriptor);
+ void sliceCommand(const std::string& string,std::string& command,std::vector<std::string>& msg);
+ mMapCommand_t createCommandMap();
+ struct connection_s
+ {
+ int filedescriptor;
+ sh_pollHandle_t handle;
+ };
+
+ static TelnetServer* instance;
+ SocketHandler *mSocketHandler;
+ CommandSender *mCommandSender;
+ CommandReceiver *mCommandReceiver;
+ RoutingSender *mRoutingSender;
+ RoutingReceiver *mRoutingReceiver;
+ ControlSender *mControlSender;
+ ControlReceiver *mControlReceiver;
+ DatabaseHandler *mDatabasehandler;
+ sh_pollHandle_t mConnecthandle;
+ std::queue<std::string> msgList;
+ std::vector<connection_s> mListConnections;
+ int mConnectFD;
+ unsigned int mServerPort;
+ unsigned int mMaxConnections;
+ mMapCommand_t mMapCommands;
+
+};
+
+} /* namespace am */
+#endif /* TELNETSERVER_H_ */