summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2011-12-22 00:41:48 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2011-12-22 00:57:31 +0100
commit4618280b6d777ac7bf3bb5cf5b0ea3f0d9e4b2b7 (patch)
tree775c659467a21c26b8c0683595721cec2e5b83dc /includes
parentb9b9e9ace5c6c7c493438ecf9a4b33b47543e8e3 (diff)
downloadaudiomanager-4618280b6d777ac7bf3bb5cf5b0ea3f0d9e4b2b7.tar.gz
* 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
Diffstat (limited to 'includes')
-rw-r--r--includes/SocketHandler.h256
-rw-r--r--includes/audiomanagertypes.cpp0
-rw-r--r--includes/audiomanagertypes.h100
-rw-r--r--includes/command/CommandReceiveInterface.h20
-rw-r--r--includes/command/CommandSendInterface.h8
-rw-r--r--includes/control/ControlReceiveInterface.h21
-rw-r--r--includes/control/ControlSendInterface.h8
-rw-r--r--includes/dbus/CommandInterface.xml174
-rw-r--r--includes/dbus/DBusConfiguration.h34
-rw-r--r--includes/dbus/DBusWrapper.h105
-rw-r--r--includes/projecttypes.h20
-rw-r--r--includes/routing/RoutingReceiveInterface.h35
-rw-r--r--includes/routing/RoutingSendInterface.h8
13 files changed, 695 insertions, 94 deletions
diff --git a/includes/SocketHandler.h b/includes/SocketHandler.h
new file mode 100644
index 0000000..c76e343
--- /dev/null
+++ b/includes/SocketHandler.h
@@ -0,0 +1,256 @@
+/**
+* Copyright (C) 2011, BMW AG
+*
+* GeniviAudioMananger AudioManagerDaemon
+*
+* \file SocketHandler.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 SOCKETHANDLER_H_
+#define SOCKETHANDLER_H_
+
+#include <audiomanagertypes.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <stdint.h>
+#include <sys/poll.h>
+#include <list>
+#include <map>
+
+namespace am {
+
+typedef uint16_t sh_timerHandle_t; //!<this is a handle for a timer to be used with the SocketHandler
+typedef uint16_t sh_pollHandle_t; //!<this is a handle for a filedescriptor to be used with the SocketHandler
+
+class shPollPrepare;
+class shPollCheck;
+class shPollFired;
+class shPollDispatch;
+class TBasicTimerCallback;
+
+class SocketHandler
+{
+public:
+ SocketHandler();
+ virtual ~SocketHandler();
+
+ am_Error_e addFDPoll(const int fd,const short event, shPollPrepare *prepare,shPollFired *fired,shPollCheck *check,shPollDispatch *dispatch, void* userData,sh_pollHandle_t& handle);
+ am_Error_e removeFDPoll(const sh_pollHandle_t handle);
+ am_Error_e updateEventFlags(const sh_pollHandle_t handle, const short events);
+ am_Error_e addTimer(const timespec timeouts,TBasicTimerCallback*& callback,sh_timerHandle_t& handle, void* userData);
+ am_Error_e removeTimer(const sh_timerHandle_t handle);
+ am_Error_e restartTimer(const sh_timerHandle_t handle, const timespec timeouts);
+ am_Error_e stopTimer(const sh_timerHandle_t handle);
+ void start_listenting();
+ void stop_listening();
+
+private:
+ struct timer_s //!<struct that holds information of timers
+ {
+ sh_timerHandle_t handle; //!<the handle of the timer
+ timespec countdown; //!<the countdown, this value is decreased every time the timer is up
+ timespec timeout; //!<the original timer value
+ TBasicTimerCallback* callback; //!<the callbackfunction
+ void * userData; //!<saves a void pointer together with the rest.
+ };
+
+ class SubstractTime //!<functor to easy substract from each countdown value
+ {
+ private:
+ timespec param;
+ public:
+ SubstractTime(timespec param): param(param) {}
+ void operator()(timer_s& t) const;
+ };
+
+ struct sh_poll_s //!<struct that holds information about polls
+ {
+ sh_pollHandle_t handle; //!<handle to uniquely adress a filedesriptor
+ shPollPrepare *prepareCB;
+ shPollFired *firedCB;
+ shPollCheck *checkCB;
+ shPollDispatch *dispatchCB;
+ pollfd pollfdValue; //!<the array for polling the filedescriptors
+ void *userData; //!<userdata saved together with the callback.
+ };
+
+ typedef std::vector<pollfd> mPollfd_t; //!<vector of filedescriptors
+ typedef std::vector<sh_poll_s> mListPoll_t; //!<list for the callbacks
+
+ class CopyPollfd
+ {
+ private:
+ mPollfd_t& mArray;
+ public:
+ CopyPollfd(mPollfd_t& dest): mArray(dest) {}
+ void operator()(const sh_poll_s& row);
+ };
+
+ bool fdIsValid(const int fd) const;
+ void initTimer();
+ void timerUp();
+ int timespec2ms(const timespec& time);
+ static bool compareCountdown(const timer_s& a, const timer_s& b)
+ {
+ return (a.countdown.tv_sec==b.countdown.tv_sec) ? (a.countdown.tv_nsec < b.countdown.tv_nsec) : (a.countdown.tv_sec < b.countdown.tv_sec);
+ }
+
+ static bool onlyFiredEvents(const pollfd& a)
+ {
+ return a.events==0 ? false : true;
+ }
+
+ //todo: maybe we could simplify mListActiveTimer to hold only the handle and the countdown ....
+ mPollfd_t mfdPollingArray;
+ mListPoll_t mListPoll;
+ std::list<timer_s> mListTimer; //!<list of all timers
+ std::list<timer_s> mListActiveTimer; //!<list of all currently active timers
+ sh_timerHandle_t mNextTimer;
+ sh_timerHandle_t mLastInsertedHandle;
+ sh_pollHandle_t mLastInsertedPollHandle;
+ timespec mTimeout;
+ bool mDispatch;
+ bool mRecreatePollfds;
+};
+
+/**
+ * classic functor for the BasicTimerCallback
+ */
+class TBasicTimerCallback
+{
+public:
+ virtual void Call (const sh_timerHandle_t handle, void* userData)=0;
+ virtual ~TBasicTimerCallback(){};
+};
+
+class shPollPrepare
+{
+public:
+ virtual void Call (const sh_pollHandle_t handle, void* userData)=0;
+ virtual ~shPollPrepare(){};
+};
+
+class shPollFired
+{
+public:
+ virtual void Call(const pollfd pollfd,const sh_pollHandle_t handle, void* userData)=0;
+ virtual ~ shPollFired(){};
+};
+
+class shPollCheck
+{
+public:
+ virtual bool Call (const sh_pollHandle_t handle, void* userData)=0;
+ virtual ~ shPollCheck(){};
+};
+
+class shPollDispatch
+{
+public:
+ virtual bool Call (const sh_pollHandle_t handle, void* userData)=0;
+ virtual ~ shPollDispatch(){};
+};
+
+/**
+ * template to create the functor for a class
+ */
+template <class TClass> class TSpecificTimerCallback : public TBasicTimerCallback
+{
+private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(sh_timerHandle_t handle, void* userData);
+
+public:
+ TSpecificTimerCallback(TClass* instance, void(TClass::*function)(sh_timerHandle_t handle, void* userData))
+ :mInstance(instance), mFunction(function){};
+
+ virtual void Call(sh_timerHandle_t handle, void* userData)
+ {
+ (*mInstance.*mFunction)(handle, userData);
+ }
+};
+
+/**
+ * template to create the functor for a class
+ */
+template <class TClass> class shPollPrepare_T : public shPollPrepare
+{
+private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(const sh_timerHandle_t handle, void* userData);
+
+public:
+ shPollPrepare_T(TClass* instance, void(TClass::*function)(const sh_timerHandle_t handle, void* userData))
+ :mInstance(instance), mFunction(function){};
+
+ virtual void Call(const sh_timerHandle_t handle, void* userData)
+ {
+ (*mInstance.*mFunction)(handle,userData);
+ };
+};
+
+template <class TClass> class shPollFired_T : public shPollFired
+{
+private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(const pollfd pollfd,const sh_pollHandle_t handle, void* userData);
+
+public:
+ shPollFired_T(TClass* instance, void(TClass::*function)(const pollfd pollfd,const sh_pollHandle_t handle, void* userData))
+ :mInstance(instance), mFunction(function){};
+
+ virtual void Call(const pollfd pollfd,const sh_pollHandle_t handle, void* userData)
+ {
+ (*mInstance.*mFunction)(pollfd,handle,userData);
+ };
+};
+
+template <class TClass> class shPollCheck_T : public shPollCheck
+{
+private:
+ TClass* mInstance;
+ bool (TClass::*mFunction)(const sh_pollHandle_t handle, void* userData);
+
+public:
+ shPollCheck_T(TClass* instance, bool(TClass::*function)(const sh_pollHandle_t handle, void* userData))
+ :mInstance(instance), mFunction(function){};
+
+ virtual bool Call(const sh_pollHandle_t handle, void* userData)
+ {
+ return (*mInstance.*mFunction)(handle,userData);
+ };
+};
+
+template <class TClass> class shPollDispatch_T : public shPollDispatch
+{
+private:
+ TClass* mInstance;
+ bool (TClass::*mFunction)(const sh_pollHandle_t handle, void* userData);
+
+public:
+ shPollDispatch_T(TClass* instance, bool (TClass::*function)(const sh_pollHandle_t handle, void* userData))
+ :mInstance(instance), mFunction(function){};
+
+ virtual bool Call(const sh_pollHandle_t handle, void* userData)
+ {
+ return (*mInstance.*mFunction)(handle,userData);
+ };
+};
+} /* namespace am */
+#endif /* SOCKETHANDLER_H_ */
diff --git a/includes/audiomanagertypes.cpp b/includes/audiomanagertypes.cpp
deleted file mode 100644
index e69de29..0000000
--- a/includes/audiomanagertypes.cpp
+++ /dev/null
diff --git a/includes/audiomanagertypes.h b/includes/audiomanagertypes.h
index 46fc00a..27764d1 100644
--- a/includes/audiomanagertypes.h
+++ b/includes/audiomanagertypes.h
@@ -22,8 +22,8 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_AFA9C9DE_BF7D_4bc2_AE65_3747DCA2D732__INCLUDED_)
-#define EA_AFA9C9DE_BF7D_4bc2_AE65_3747DCA2D732__INCLUDED_
+#if !defined(EA_9BBD9DCA_BBCF_45e4_8291_45F44B455D62__INCLUDED_)
+#define EA_9BBD9DCA_BBCF_45e4_8291_45F44B455D62__INCLUDED_
#include <stdint.h>
#include "projecttypes.h"
@@ -124,56 +124,56 @@ namespace am {
* After the buildup of a connection the first timing information needs to be sent within 5 seconds, the timing information from the routing adaptors need to be sent via 4 seconds. If the latency for a connection is variable and changes over lifetime of the connection, the routing adaptors shall resend the value and the audiomanger will correct the over all latency.\n
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:20 PM
+ * @created 22-Dec-2011 12:55:04 AM
*/
typedef uint16_t am_domainID_t;
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:20 PM
+ * @created 22-Dec-2011 12:55:05 AM
*/
typedef uint16_t am_sourceID_t;
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:06 AM
*/
typedef uint16_t am_sinkID_t;
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:06 AM
*/
typedef uint16_t am_gatewayID_t;
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:06 AM
*/
typedef uint16_t am_crossfaderID_t;
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:06 AM
*/
typedef uint16_t am_connectionID_t;
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:06 AM
*/
typedef uint16_t am_mainConnectionID_t;
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:06 AM
*/
typedef uint16_t am_speed_t;
@@ -181,7 +181,7 @@ namespace am {
* The unit is 0.1 db steps,The smallest value -3000 (=AM_MUTE). The minimum and maximum can be limited by actual project.
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:07 AM
*/
typedef int16_t am_volume_t;
@@ -190,21 +190,21 @@ namespace am {
* The range of this type is customer specific.
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:07 AM
*/
typedef int16_t am_mainVolume_t;
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:07 AM
*/
typedef uint16_t am_sourceClass_t;
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:07 AM
*/
typedef uint16_t am_sinkClass_t;
@@ -212,7 +212,7 @@ namespace am {
* time in ms!
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:07 AM
*/
typedef uint16_t am_time_t;
@@ -220,7 +220,7 @@ namespace am {
* offset time that is introduced in milli seconds.
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:08 AM
*/
typedef int16_t am_timeSync_t;
@@ -228,7 +228,7 @@ namespace am {
* with the help of this enum, sinks and sources can report their availability state
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:08 AM
*/
enum am_Availablility_e
{
@@ -243,7 +243,7 @@ namespace am {
* represents the connection state
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:08 AM
*/
enum am_ConnectionState_e
{
@@ -274,7 +274,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:08 AM
*/
enum am_DomainState_e
{
@@ -289,7 +289,7 @@ namespace am {
* This enum characterizes the data of the EarlyData_t
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:08 AM
*/
enum am_EarlyDataType_e
{
@@ -305,7 +305,7 @@ namespace am {
* the errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter.
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:09 AM
*/
enum am_Error_e
{
@@ -330,7 +330,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:09 AM
*/
enum am_MuteState_e
{
@@ -344,7 +344,7 @@ namespace am {
* The source state reflects the state of the source
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:09 AM
*/
enum am_SourceState_e
{
@@ -368,7 +368,7 @@ namespace am {
* This enumeration is used to define the type of the action that is correlated to a handle.
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:09 AM
*/
enum am_Handle_e
{
@@ -387,7 +387,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:09 AM
*/
enum am_InterruptState_e
{
@@ -401,7 +401,7 @@ namespace am {
* describes the active sink of a crossfader.
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:10 AM
*/
enum am_HotSink_e
{
@@ -416,7 +416,7 @@ namespace am {
* this describes the availability of a sink or a source together with the latest change
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:10 AM
*/
struct am_Availability_s
{
@@ -436,7 +436,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:10 AM
*/
struct am_ClassProperty_s
{
@@ -450,7 +450,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:10 AM
*/
struct am_Crossfader_s
{
@@ -468,7 +468,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:11 AM
*/
struct am_Gateway_s
{
@@ -509,7 +509,7 @@ namespace am {
* This represents one "hopp" in a route
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:11 AM
*/
struct am_RoutingElement_s
{
@@ -525,7 +525,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:21 PM
+ * @created 22-Dec-2011 12:55:11 AM
*/
struct am_Route_s
{
@@ -540,7 +540,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:22 PM
+ * @created 22-Dec-2011 12:55:12 AM
*/
struct am_SoundProperty_s
{
@@ -554,7 +554,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:22 PM
+ * @created 22-Dec-2011 12:55:12 AM
*/
struct am_SystemProperty_s
{
@@ -574,7 +574,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:22 PM
+ * @created 22-Dec-2011 12:55:12 AM
*/
struct am_SinkClass_s
{
@@ -589,7 +589,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:22 PM
+ * @created 22-Dec-2011 12:55:12 AM
*/
struct am_SourceClass_s
{
@@ -608,7 +608,7 @@ namespace am {
* this type holds all information of sources relevant to the HMI
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:22 PM
+ * @created 22-Dec-2011 12:55:13 AM
*/
struct am_SourceType_s
{
@@ -625,7 +625,7 @@ namespace am {
* this type holds all information of sinks relevant to the HMI
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:22 PM
+ * @created 22-Dec-2011 12:55:13 AM
*/
struct am_SinkType_s
{
@@ -643,7 +643,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:22 PM
+ * @created 22-Dec-2011 12:55:13 AM
*/
struct am_Handle_s
{
@@ -657,7 +657,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:22 PM
+ * @created 22-Dec-2011 12:55:14 AM
*/
struct am_MainSoundProperty_s
{
@@ -672,7 +672,7 @@ namespace am {
* this type holds all information of connections relevant to the HMI
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:23 PM
+ * @created 22-Dec-2011 12:55:14 AM
*/
struct am_MainConnectionType_s
{
@@ -689,7 +689,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:23 PM
+ * @created 22-Dec-2011 12:55:14 AM
*/
struct am_MainConnection_s
{
@@ -705,7 +705,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:23 PM
+ * @created 22-Dec-2011 12:55:15 AM
*/
struct am_Sink_s
{
@@ -729,7 +729,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:23 PM
+ * @created 22-Dec-2011 12:55:15 AM
*/
struct am_Source_s
{
@@ -762,7 +762,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:23 PM
+ * @created 22-Dec-2011 12:55:15 AM
*/
struct am_Domain_s
{
@@ -781,7 +781,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:23 PM
+ * @created 22-Dec-2011 12:55:16 AM
*/
struct am_Connection_s
{
@@ -801,7 +801,7 @@ namespace am {
* soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:23 PM
+ * @created 22-Dec-2011 12:55:16 AM
*/
union am_EarlyData_u
{
@@ -818,7 +818,7 @@ namespace am {
* sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:16 AM
*/
union am_DataType_u
{
@@ -832,7 +832,7 @@ namespace am {
/**
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:16 AM
*/
struct am_EarlyData_s
{
@@ -844,4 +844,4 @@ namespace am {
};
}
-#endif // !defined(EA_AFA9C9DE_BF7D_4bc2_AE65_3747DCA2D732__INCLUDED_)
+#endif // !defined(EA_9BBD9DCA_BBCF_45e4_8291_45F44B455D62__INCLUDED_)
diff --git a/includes/command/CommandReceiveInterface.h b/includes/command/CommandReceiveInterface.h
index 13c2144..b363bd3 100644
--- a/includes/command/CommandReceiveInterface.h
+++ b/includes/command/CommandReceiveInterface.h
@@ -22,13 +22,16 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_774DDC80_E4EF_41c2_846F_FFC9FB85C2E8__INCLUDED_)
-#define EA_774DDC80_E4EF_41c2_846F_FFC9FB85C2E8__INCLUDED_
+#if !defined(EA_2C18A494_5252_4d1b_A0B0_FAE151B68AEA__INCLUDED_)
+#define EA_2C18A494_5252_4d1b_A0B0_FAE151B68AEA__INCLUDED_
#include <vector>
#include <string>
#include "../audiomanagertypes.h"
+namespace am {
class DBusWrapper;
+class SocketHandler;
+}
namespace am {
@@ -36,7 +39,7 @@ 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 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
class CommandReceiveInterface
{
@@ -173,12 +176,19 @@ namespace am {
virtual am_Error_e getTimingInformation(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay) const =0;
/**
* this function is used to retrieve a pointer to the dBusConnectionWrapper
- * @return E_OK if pointer is valid, E_UKNOWN on error
+ * @return E_OK if pointer is valid, E_UKNOWN if AudioManager was compiled without DBus Support
*
* @param dbusConnectionWrapper This is a wrapper class that is needed to keep dbus inclusions away from the interface. The DBusWrapperClass will return the pointer to the DbusConnection call (getDBusConnection)
*/
virtual am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const =0;
+ /**
+ * This function returns the pointer to the socketHandler. This can be used to integrate socket-based activites like communication with the mainloop of the AudioManager.
+ * returns E_OK if pointer is valid, E_UNKNOWN in case AudioManager was compiled without socketHandler support,
+ *
+ * @param socketHandler
+ */
+ virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) const =0;
};
}
-#endif // !defined(EA_774DDC80_E4EF_41c2_846F_FFC9FB85C2E8__INCLUDED_)
+#endif // !defined(EA_2C18A494_5252_4d1b_A0B0_FAE151B68AEA__INCLUDED_)
diff --git a/includes/command/CommandSendInterface.h b/includes/command/CommandSendInterface.h
index 76f564c..0da4d76 100644
--- a/includes/command/CommandSendInterface.h
+++ b/includes/command/CommandSendInterface.h
@@ -22,8 +22,8 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_E1A66E00_EE7A_428b_A8DD_81E1B932B623__INCLUDED_)
-#define EA_E1A66E00_EE7A_428b_A8DD_81E1B932B623__INCLUDED_
+#if !defined(EA_D28BAC35_CEA8_4ec8_AF26_00050F6CD9FA__INCLUDED_)
+#define EA_D28BAC35_CEA8_4ec8_AF26_00050F6CD9FA__INCLUDED_
#include <vector>
#include <string>
@@ -37,7 +37,7 @@ 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 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
class CommandSendInterface
{
@@ -148,4 +148,4 @@ namespace am {
};
}
-#endif // !defined(EA_E1A66E00_EE7A_428b_A8DD_81E1B932B623__INCLUDED_)
+#endif // !defined(EA_D28BAC35_CEA8_4ec8_AF26_00050F6CD9FA__INCLUDED_)
diff --git a/includes/control/ControlReceiveInterface.h b/includes/control/ControlReceiveInterface.h
index 5becc5b..bcdd451 100644
--- a/includes/control/ControlReceiveInterface.h
+++ b/includes/control/ControlReceiveInterface.h
@@ -22,19 +22,23 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_F9251584_1FDF_4c41_AF43_CDD2C4EAC0D0__INCLUDED_)
-#define EA_F9251584_1FDF_4c41_AF43_CDD2C4EAC0D0__INCLUDED_
+#if !defined(EA_0244757B_93AD_4fd4_83D0_7AB70C332042__INCLUDED_)
+#define EA_0244757B_93AD_4fd4_83D0_7AB70C332042__INCLUDED_
#include <vector>
#include <string>
-#include "../audiomanagertypes.h"
+#include "../audiomanagertypes.h"
+namespace am {
+class SocketHandler;
+}
+
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 12-Dec-2011 8:33:25 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
class ControlReceiveInterface
{
@@ -525,7 +529,14 @@ namespace am {
* sets the routinginterface to ready.
*/
virtual void setRoutingReady() =0;
+ /**
+ * This function returns the pointer to the socketHandler. This can be used to integrate socket-based activites like communication with the mainloop of the AudioManager.
+ * returns E_OK if pointer is valid, E_UNKNOWN in case AudioManager was compiled without socketHandler support,
+ *
+ * @param socketHandler
+ */
+ virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) =0;
};
}
-#endif // !defined(EA_F9251584_1FDF_4c41_AF43_CDD2C4EAC0D0__INCLUDED_)
+#endif // !defined(EA_0244757B_93AD_4fd4_83D0_7AB70C332042__INCLUDED_)
diff --git a/includes/control/ControlSendInterface.h b/includes/control/ControlSendInterface.h
index 7e1d276..da7cbce 100644
--- a/includes/control/ControlSendInterface.h
+++ b/includes/control/ControlSendInterface.h
@@ -22,8 +22,8 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_0EFEA913_25A8_4004_B878_0459775ABFB2__INCLUDED_)
-#define EA_0EFEA913_25A8_4004_B878_0459775ABFB2__INCLUDED_
+#if !defined(EA_FCDD8CB7_6516_4ee0_AF20_BF3953319E5D__INCLUDED_)
+#define EA_FCDD8CB7_6516_4ee0_AF20_BF3953319E5D__INCLUDED_
#include <vector>
#include <string>
@@ -36,7 +36,7 @@ namespace am {
* 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 12-Dec-2011 8:33:25 PM
+ * @created 22-Dec-2011 12:55:18 AM
*/
class ControlSendInterface
{
@@ -326,4 +326,4 @@ namespace am {
};
}
-#endif // !defined(EA_0EFEA913_25A8_4004_B878_0459775ABFB2__INCLUDED_)
+#endif // !defined(EA_FCDD8CB7_6516_4ee0_AF20_BF3953319E5D__INCLUDED_)
diff --git a/includes/dbus/CommandInterface.xml b/includes/dbus/CommandInterface.xml
new file mode 100644
index 0000000..f6f07a0
--- /dev/null
+++ b/includes/dbus/CommandInterface.xml
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE node PUBLIC
+ "-//freedesktop//DTD D-Bus Object Introspection 1.0//EN"
+ "http://standards.freedesktop.org/dbus/1.0/introspect.dtd">
+
+<node>
+ <interface name="org.genivi.audiomanager.CommandInterface">
+
+ <method name="Connect">
+ <arg type="q" name="sourceID" direction="in"/>
+ <arg type="q" name="sinkID" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="q" name="mainConnectionID" direction="out"/>
+ </method>
+
+ <method name="Disconnect">
+ <arg type="q" name="mainConnectionID" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ </method>
+
+ <method name="SetVolume">
+ <arg type="q" name="sinkID" direction="in"/>
+ <arg type="n" name="volume" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ </method>
+
+ <method name="VolumeStep">
+ <arg type="q" name="sinkID" direction="in"/>
+ <arg type="n" name="volumeStep" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ </method>
+
+ <method name="SetSinkMuteState">
+ <arg type="q" name="sinkID" direction="in"/>
+ <arg type="n" name="muteState" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ </method>
+
+ <method name="SetMainSinkSoundProperty">
+ <arg type="q" name="sinkID" direction="in"/>
+ <arg type="(nn)" name="soundProperty" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ </method>
+
+ <method name="SetMainSourceSoundProperty">
+ <arg type="q" name="sourceID" direction="in"/>
+ <arg type="(nn)" name="soundProperty" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ </method>
+
+ <method name="SetSystemProperty">
+ <arg type="(nn)" name="property" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ </method>
+
+ <method name="GetListMainConnections">
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(qqqnn)" name="listConnections" direction="out"/> <!-- am_mainConnectionID_t mainConnectionID; am_sourceID_t sourceID; am_sinkID_t sinkID; am_timeSync_t delay; am_ConnectionState_e connectionState; -->
+ </method>
+
+ <method name="GetListMainSinks">
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(qs(nn)nnq)" name="listMainSinks" direction="out"/> <!-- am_sinkID_t sinkID; std::string name; am_Availability_s availability; am_mainVolume_t volume; am_MuteState_e muteState; am_sinkClass_t sinkClassID; -->
+ </method>
+
+ <method name="GetListMainSources">
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(qs(nn)q)" name="listMainSources" direction="out"/> <!-- am_sourceID_t sourceID; std::string name; am_Availability_s availability; am_sourceClass_t sourceClassID; -->
+ </method>
+
+ <method name="GetListMainSinkSoundProperties">
+ <arg type="q" name="sinkID" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(nn)" name="listSoundProperties" direction="out"/> <!-- am_MainSoundPropertyType_e type; int16_t value; -->
+ </method>
+
+ <method name="GetListMainSourceSoundProperties">
+ <arg type="q" name="sourceID" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(nn)" name="listSourceProperties" direction="out"/> <!-- am_MainSoundPropertyType_e type; int16_t value; -->
+ </method>
+
+ <method name="GetListSourceClasses">
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(qsa(nn))" name="listSourceClasses" direction="out"/> <!-- am_sourceClass_t SourceClassID; std::string name; std::vector<am_ClassProperty_s> listClassProperties; -->
+ </method>
+
+ <method name="GetListSinkClasses">
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(qsa(nn))" name="listSinkClasses" direction="out"/> <!-- am_sourceClass_t SinkClassID; std::string name; std::vector<am_ClassProperty_s> listClassProperties; -->
+ </method>
+
+ <method name="GetListSystemProperties">
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(nn)" name="listSystemProperties" direction="in"/> <!-- am_SystemProperty_e type; int16_t value; -->
+ </method>
+
+ <method name="GetTimingInformation">
+ <arg type="q" name="mainConnectionID" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="n" name="delay" direction="out"/>
+ </method>
+
+ <signal name="NumberOfMainConnectionsChanged">
+ </signal>
+
+ <signal name="SinkAdded">
+ <arg type="(qs(nn)nnq)" name="newSink" direction="out"/><!-- am_sinkID_t sinkID; std::string name; am_Availability_s availability; am_mainVolume_t volume; am_MuteState_e muteState; am_sinkClass_t sinkClassID; -->
+ </signal>
+
+ <signal name="SinkRemoved">
+ <arg type="q" name="removedSinkID" direction="out"/>
+ </signal>
+
+ <signal name="SourceAdded">
+ <arg type="(qs(nn)q)" name="newSource" direction="out"/><!-- am_sourceID_t sourceID; std::string name; am_Availability_s availability; am_sourceClass_t sourceClassID; -->
+ </signal>
+
+ <signal name="SourceRemoved">
+ <arg type="q" name="removedSourceID" direction="out"/>
+ </signal>
+
+ <signal name="NumberOfSinkClassesChanged">
+ </signal>
+
+ <signal name="NumberOfSourceClassesChanged">
+ </signal>
+
+ <signal name="MainConnectionStateChanged">
+ <arg type="q" name="connectionID" direction="out"/>
+ <arg type="n" name="connectionState" direction="out"/>
+ </signal>
+
+ <signal name="MainSinkSoundPropertyChanged">
+ <arg type="q" name="sinkID" direction="out"/>
+ <arg type="(nn)" name="SoundProperty" direction="out"/>
+ </signal>
+
+ <signal name="MainSourceSoundPropertyChanged">
+ <arg type="q" name="sourceID" direction="out"/>
+ <arg type="(nn)" name="SoundProperty" direction="out"/>
+ </signal>
+
+ <signal name="SinkAvailabilityChanged">
+ <arg type="q" name="sinkID" direction="out"/>
+ <arg type="(nn)" name="availability" direction="out"/>
+ </signal>
+
+ <signal name="SourceAvailabilityChanged">
+ <arg type="q" name="sourceID" direction="out"/>
+ <arg type="(nn)" name="availability" direction="out"/>
+ </signal>
+
+ <signal name="VolumeChanged">
+ <arg type="q" name="sinkID" direction="out"/>
+ <arg type="n" name="volume" direction="out"/>
+ </signal>
+
+ <signal name="SinkMuteStateChanged">
+ <arg type="q" name="sinkID" direction="out"/>
+ <arg type="n" name="muteState" direction="out"/>
+ </signal>
+
+ <signal name="SystemPropertyChanged">
+ <arg type="(nn)" name="SystemProperty" direction="out"/>
+ </signal>
+
+ <signal name="TimingInformationChanged">
+ <arg type="q" name="mainConnection" direction="out"/>
+ <arg type="n" name="time" direction="out"/>
+ </signal>
+
+ </interface>
+</node>
diff --git a/includes/dbus/DBusConfiguration.h b/includes/dbus/DBusConfiguration.h
new file mode 100644
index 0000000..6536044
--- /dev/null
+++ b/includes/dbus/DBusConfiguration.h
@@ -0,0 +1,34 @@
+/**
+* Copyright (C) 2011, BMW AG
+*
+* GeniviAudioMananger AudioManagerDaemon
+*
+* \file DBusConfiguration.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.
+*
+* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+*/
+
+#ifndef DBUSCONFIGURATION_H_
+#define DBUSCONFIGURATION_H_
+
+#define DBUS_SERVICE_PREFIX "org.genivi.audiomanager\0"
+#define DBUS_SERVICE_OBJECT_PATH "/org/genivi/audiomanager\0"
+
+
+
+#endif /* DBUSCONFIGURATION_H_ */
diff --git a/includes/dbus/DBusWrapper.h b/includes/dbus/DBusWrapper.h
new file mode 100644
index 0000000..42190a5
--- /dev/null
+++ b/includes/dbus/DBusWrapper.h
@@ -0,0 +1,105 @@
+/**
+* Copyright (C) 2011, BMW AG
+*
+* GeniviAudioMananger AudioManagerDaemon
+*
+* \file DBusWrapper.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.
+*
+* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+*/
+
+#ifndef DBUSWRAPPER_H_
+#define DBUSWRAPPER_H_
+
+
+#include "DBusConfiguration.h"
+#include "SocketHandler.h"
+#include <dbus/dbus.h>
+#include <string>
+#include <list>
+
+namespace am {
+/**
+ * This wraps dbus and provides everything needed to anyone who wants to use dbus (including plugins)
+ */
+class DBusWrapper {
+public:
+ DBusWrapper(SocketHandler* socketHandler);
+ virtual ~DBusWrapper();
+
+ /**
+ * registers a callback that is entered as path below the main path.
+ * The configuration of the mainpath is done via DBusConfiguration.h
+ * @param vtable the vtable that holds a pointer to the callback that is called when the path is called from the dbus
+ * @param path the name of the path
+ * @param userdata pointer to the class that will handle the callback
+ */
+ void registerCallback(const DBusObjectPathVTable* vtable, const std::string& path, void* userdata);
+
+ /**
+ * returns the dbus connection
+ * @param connection pointer to the connection
+ */
+ void getDBusConnection(DBusConnection*& connection) const;
+
+ /**
+ * If Dbus is used, this MainLoop must be called as mainloop, otherwise the messages are not dispatched.
+ */
+ void dbusMainLoop();
+
+ static dbus_bool_t addWatch(DBusWatch *watch, void *userData);
+ static void removeWatch(DBusWatch *watch, void *userData);
+ static void toogleWatch(DBusWatch *watch, void *userData);
+
+ static dbus_bool_t addTimeout(DBusTimeout *timeout,void* userData);
+ static void removeTimeout(DBusTimeout *timeout, void* userData);
+ static void toggleTimeout(DBusTimeout *timeout, void* userData);
+
+ bool dbusDispatchCallback(const sh_pollHandle_t handle, void* userData);
+ shPollDispatch_T<DBusWrapper> pDbusDispatchCallback;
+
+ bool dbusCheckCallback(const sh_pollHandle_t handle, void* userData);
+ shPollCheck_T<DBusWrapper> pDbusCheckCallback;
+
+ void dbusFireCallback(const pollfd pollfd,const sh_pollHandle_t handle, void* userData);
+ shPollFired_T<DBusWrapper> pDbusFireCallback;
+
+ void dbusTimerCallback(sh_timerHandle_t handle, void* userData);
+ TSpecificTimerCallback<DBusWrapper> pDbusTimerCallback;
+
+private:
+ static DBusWrapper* mReference;
+ static DBusHandlerResult cbRootIntrospection(DBusConnection *conn, DBusMessage *msg, void *reference);
+ dbus_bool_t addWatchDelegate(DBusWatch * watch,void* userData);
+ void removeWatchDelegate(DBusWatch *watch, void *userData);
+ void toogleWatchDelegate(DBusWatch *watch, void *userData);
+ dbus_bool_t addTimeoutDelegate(DBusTimeout *timeout,void* userData);
+ void removeTimeoutDelegate(DBusTimeout *timeout, void* userData);
+ void toggleTimeoutDelegate(DBusTimeout *timeout, void* userData);
+ DBusObjectPathVTable mObjectPathVTable;
+ DBusConnection* mDbusConnection;
+ DBusError mDBusError;
+ std::list<std::string> mNodesList;
+ std::vector<sh_timerHandle_t*> mListTimerhandlePointer;
+ SocketHandler *mSocketHandler;
+ std::map<DBusWatch*,sh_pollHandle_t> mMapHandleWatch;
+};
+
+}
+
+#endif /* DBUSWRAPPER_H_ */
diff --git a/includes/projecttypes.h b/includes/projecttypes.h
index 01b6212..6e00614 100644
--- a/includes/projecttypes.h
+++ b/includes/projecttypes.h
@@ -22,15 +22,15 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_DA40303E_6D22_450f_8135_AE77F31A2394__INCLUDED_)
-#define EA_DA40303E_6D22_450f_8135_AE77F31A2394__INCLUDED_
+#if !defined(EA_2CBBFF9A_7EFD_4a63_8AD7_1DC609634438__INCLUDED_)
+#define EA_2CBBFF9A_7EFD_4a63_8AD7_1DC609634438__INCLUDED_
namespace am {
/**
* This enum classifies the format in which data is exchanged within a connection. The enum itself is project specific although there are some Genivi standard formats defined.
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
enum am_ConnectionFormat_e
{
@@ -45,7 +45,7 @@ namespace am {
* This enum gives the information about reason for reason for Source/Sink change
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
enum am_AvailabilityReason_e
{
@@ -63,7 +63,7 @@ namespace am {
* product specific identifier of property
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
enum am_ClassProperty_e
{
@@ -84,7 +84,7 @@ namespace am {
* It is in the responsibility of the product to make sure that the routing plugins are aware of the ramp types used.
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
enum am_RampType_e
{
@@ -106,7 +106,7 @@ namespace am {
* sound properties. Within genivi only the standard properties are defined, for products these need to be extended.
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
enum am_SoundPropertyType_e
{
@@ -121,7 +121,7 @@ namespace am {
* Here are all SoundProperties that can be set via the CommandInterface. Product specific
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
enum am_MainSoundPropertyType_e
{
@@ -138,7 +138,7 @@ namespace am {
* describes the different system properties. Project specific
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:24 PM
+ * @created 22-Dec-2011 12:55:17 AM
*/
enum am_SystemPropertyType_e
{
@@ -147,4 +147,4 @@ namespace am {
SYP_MIN = SYP_TEST
};
}
-#endif // !defined(EA_DA40303E_6D22_450f_8135_AE77F31A2394__INCLUDED_)
+#endif // !defined(EA_2CBBFF9A_7EFD_4a63_8AD7_1DC609634438__INCLUDED_)
diff --git a/includes/routing/RoutingReceiveInterface.h b/includes/routing/RoutingReceiveInterface.h
index c2df390..33df05b 100644
--- a/includes/routing/RoutingReceiveInterface.h
+++ b/includes/routing/RoutingReceiveInterface.h
@@ -22,20 +22,24 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_608714FA_D916_4497_B948_2D305C5741EB__INCLUDED_)
-#define EA_608714FA_D916_4497_B948_2D305C5741EB__INCLUDED_
+#if !defined(EA_4264FCC6_2875_4a34_B7B3_1157DD551AF6__INCLUDED_)
+#define EA_4264FCC6_2875_4a34_B7B3_1157DD551AF6__INCLUDED_
#include <vector>
#include <string>
#include "../audiomanagertypes.h"
-class DBusWrapper;
+namespace am {
+class DBusWrapper;
+class SocketHandler;
+}
+
namespace am {
/**
* Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:26 PM
+ * @created 22-Dec-2011 12:55:18 AM
*/
class RoutingReceiveInterface
{
@@ -219,21 +223,21 @@ namespace am {
*/
virtual am_Error_e deregisterCrossfader(const am_crossfaderID_t crossfaderID) =0;
/**
- * this function peeks a sourceClassID. It is used by the RoutingPlugins to determine the sourceClassIDs of a sourceClass.
+ * this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
* @return E_OK on succes, E_DATABASE_ERROR on error
*
* @param name
* @param sourceClassID
*/
- virtual am_Error_e peekSinkClassID(const std::string& name, am_sourceClass_t& sourceClassID) =0;
+ virtual am_Error_e peekSourceClassID(const std::string name, const am_sourceClass_t& sourceClassID) =0;
/**
- * this function peeks a sink classID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
+ * this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
* @return E_OK on succes, E_DATABASE_ERROR on error
*
* @param name
* @param sinkClassID
*/
- virtual am_Error_e peekSourceClassID(const std::string& name, am_sinkClass_t& sinkClassID) =0;
+ virtual am_Error_e peekSinkClassID(const std::string name, const am_sinkClass_t& sinkClassID) =0;
/**
* is called when a low level interrupt changes it status.
*
@@ -284,13 +288,20 @@ namespace am {
*/
virtual am_Error_e sendChangedData(const std::vector<am_EarlyData_s>& earlyData) =0;
/**
- * this function is used to retrieve the pointer to the dBusConnectionWrapper
- * @return E_OK on success, E_UNKNOWN on error
+ * this function is used to retrieve a pointer to the dBusConnectionWrapper
+ * @return E_OK if pointer is valid, E_UKNOWN if AudioManager was compiled without DBus Support
*
* @param dbusConnectionWrapper This is a wrapper class that is needed to keep dbus inclusions away from the interface. The DBusWrapperClass will return the pointer to the DbusConnection call (getDBusConnection)
*/
- virtual am_Error_e getDBusConnectionWrapper(DBusWrapper* dbusConnectionWrapper) const =0;
+ virtual am_Error_e getDBusConnectionWrapper(DBusWrapper*& dbusConnectionWrapper) const =0;
+ /**
+ * This function returns the pointer to the socketHandler. This can be used to integrate socket-based activites like communication with the mainloop of the AudioManager.
+ * returns E_OK if pointer is valid, E_UNKNOWN in case AudioManager was compiled without socketHandler support,
+ *
+ * @param socketHandler
+ */
+ virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) const =0;
};
}
-#endif // !defined(EA_608714FA_D916_4497_B948_2D305C5741EB__INCLUDED_)
+#endif // !defined(EA_4264FCC6_2875_4a34_B7B3_1157DD551AF6__INCLUDED_)
diff --git a/includes/routing/RoutingSendInterface.h b/includes/routing/RoutingSendInterface.h
index b042968..06d4994 100644
--- a/includes/routing/RoutingSendInterface.h
+++ b/includes/routing/RoutingSendInterface.h
@@ -22,8 +22,8 @@
*
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_B8D31066_968E_4ef2_A85E_A29A742A5206__INCLUDED_)
-#define EA_B8D31066_968E_4ef2_A85E_A29A742A5206__INCLUDED_
+#if !defined(EA_BEEEF7D0_77D1_4bb1_8A9D_5E6E127272EE__INCLUDED_)
+#define EA_BEEEF7D0_77D1_4bb1_8A9D_5E6E127272EE__INCLUDED_
#include <vector>
#include <string>
@@ -37,7 +37,7 @@ namespace am {
* This class implements everything from Audiomanager -> RoutingAdapter
* @author christian
* @version 1.0
- * @created 12-Dec-2011 8:33:26 PM
+ * @created 22-Dec-2011 12:55:19 AM
*/
class RoutingSendInterface
{
@@ -162,4 +162,4 @@ namespace am {
};
}
-#endif // !defined(EA_B8D31066_968E_4ef2_A85E_A29A742A5206__INCLUDED_)
+#endif // !defined(EA_BEEEF7D0_77D1_4bb1_8A9D_5E6E127272EE__INCLUDED_)