summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-02-27 10:11:08 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-02-27 19:10:59 +0100
commitaa93713377d28a8ce7821466ef828f79a18e982d (patch)
treef1efc6d524ef4656f93977e746d75428e06ac236 /includes
parent02b17a992e900ad82df8edf02e5e51e750ece36b (diff)
downloadaudiomanager-aa93713377d28a8ce7821466ef828f79a18e982d.tar.gz
* [GAM-4] updated interfaces
* shifted mainpage doxygen from EA generated to mainpage.h * added logo to doxygen documentation * fixed compile bug in cmakelists when no plugins are build * [ GAM-23 ]fixed plugin version recognition in cmake * first working CAmSerializer with DatabaseObserver
Diffstat (limited to 'includes')
-rw-r--r--includes/CAmSerializer.h350
-rw-r--r--includes/audiomanagertypes.h248
-rw-r--r--includes/command/CommandReceiveInterface.h78
-rw-r--r--includes/command/CommandSendInterface.h119
-rw-r--r--includes/control/ControlReceiveInterface.h82
-rw-r--r--includes/control/ControlSendInterface.h90
-rw-r--r--includes/projecttypes.h63
-rw-r--r--includes/routing/RoutingReceiveInterface.h78
-rw-r--r--includes/routing/RoutingSendInterface.h80
9 files changed, 753 insertions, 435 deletions
diff --git a/includes/CAmSerializer.h b/includes/CAmSerializer.h
new file mode 100644
index 0000000..e4924e9
--- /dev/null
+++ b/includes/CAmSerializer.h
@@ -0,0 +1,350 @@
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+#ifndef CAMSERIALIZER_H_
+#define CAMSERIALIZER_H_
+
+#include <pthread.h>
+#include <deque>
+#include <cassert>
+#include <memory>
+#include <stdexcept>
+#include "DLTWrapper.h"
+#include "SocketHandler.h"
+
+#include "iostream" //todo remove
+
+namespace am
+{
+/**
+ * magic class that does the serialization of functions calls
+ * The constructor must be called within the main threadcontext, after that using the
+ * overloaded template function call will serialize all calls and call them within the
+ * main thread context.\n
+ * If you want to use synchronous calls make sure that you use one instance of this class
+ * per thread otherwise you could be lost in never returning calls.
+ */
+class CAmSerializer
+{
+private:
+
+ /**
+ * Prototype for a delegate
+ */
+ class CAmDelegate
+ {
+ public:
+ virtual ~CAmDelegate(){};
+ virtual void call()=0;
+
+ };
+
+ typedef CAmDelegate* CAmDelegagePtr; //!< pointer to a delegate
+
+ /**
+ * delegate template for no argument
+ */
+ template<class TClass> class CAmNoArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)();
+
+ public:
+ CAmNoArgDelegate(TClass* instance, void(TClass::*function)()) :
+ mInstance(instance), //
+ mFunction(function){};
+
+ void call()
+ {
+ (*mInstance.*mFunction)();
+ };
+ };
+
+ /**
+ * delegate template for one argument
+ */
+ template<class TClass, typename Targ> class CAmOneArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(Targ);
+ Targ mArgument;
+
+ public:
+ CAmOneArgDelegate(TClass* instance, void(TClass::*function)(Targ), Targ argument) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument) { };
+
+ void call()
+ {
+ (*mInstance.*mFunction)(mArgument);
+ };
+ };
+
+ /**
+ * delegate template for two arguments
+ */
+ template<class TClass, typename Targ, typename Targ1> class CAmTwoArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(Targ argument,Targ1 argument1);
+ Targ mArgument;
+ Targ1 mArgument1;
+
+ public:
+ CAmTwoArgDelegate(TClass* instance, void(TClass::*function)(Targ argument,Targ1 argument1), Targ argument, Targ1 argument1) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument), //
+ mArgument1(argument1){};
+
+ void call()
+ {
+ (*mInstance.*mFunction)(mArgument,mArgument1);
+ };
+ };
+
+ /**
+ * delegate template for three arguments
+ */
+ template<class TClass, typename Targ, typename Targ1, typename Targ2> class CAmThreeArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(Targ argument,Targ1 argument1,Targ2 argument2);
+ Targ mArgument;
+ Targ1 mArgument1;
+ Targ2 mArgument2;
+
+ public:
+ CAmThreeArgDelegate(TClass* instance, void(TClass::*function)(Targ argument,Targ1 argument1,Targ2 argument2), Targ argument, Targ1 argument1, Targ2 argument2) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument), //
+ mArgument1(argument1), //
+ mArgument2(argument2){};
+
+ void call()
+ {
+ (*mInstance.*mFunction)(mArgument,mArgument1,mArgument2);
+ };
+ };
+
+ /**
+ * delegate template for four arguments
+ */
+ template<class TClass, typename Targ, typename Targ1, typename Targ2, typename Targ3> class CAmFourArgDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(Targ argument, Targ1 argument1, Targ2 argument2, Targ3 argument3);
+ Targ mArgument;
+ Targ1 mArgument1;
+ Targ2 mArgument2;
+ Targ3 mArgument3;
+
+ public:
+ CAmFourArgDelegate(TClass* instance, void(TClass::*function)(Targ argument,Targ1 argument1,Targ2 argument2, Targ3 argument3), Targ argument, Targ1 argument1, Targ2 argument2, Targ3 argument3) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument), //
+ mArgument1(argument1), //
+ mArgument2(argument2), //
+ mArgument3(argument3){};
+
+ void call()
+ {
+ (*mInstance.*mFunction)(mArgument,mArgument1,mArgument2,mArgument3);
+ };
+ };
+
+ /**
+ * rings the line of the pipe and adds the delegate pointer to the queue
+ * @param p delegate pointer
+ */
+ inline void send(CAmDelegagePtr p)
+ {
+ if (write(mPipe[1], &p, sizeof(p)) == -1)
+ {
+ throw std::runtime_error("could not write to pipe !");
+ }
+ }
+ int mPipe[2]; //!< the pipe
+ std::deque<CAmDelegagePtr> mListDelegatePoiters; //!< intermediate queue to store the pipe results
+
+public:
+
+ /**
+ * calls a function with no arguments threadsafe
+ * @param instance the instance of the class that shall be called
+ * @param function the function that shall be called as memberfunction pointer.
+ * Here is an example:
+ * @code
+ * class myClass
+ * {
+ * public:
+ * void myfunction();
+ * }
+ * CAmSerializer serial(&Sockethandler);
+ * myClass instanceMyClass;
+ * serial<CommandSender>(&instanceMyClass,&myClass::myfunction);
+ * @endcode
+ */
+ template<class TClass>
+ void asyncCall(TClass* instance, void(TClass::*function)())
+ {
+ CAmDelegagePtr p(new CAmNoArgDelegate<TClass>(instance, function));
+ send(p);
+ }
+
+ /**
+ * calls a function with one arguments asynchronously threadsafe
+ * @param instance the instance of the class that shall be called
+ * @param function the function that shall be called as memberfunction pointer.
+ * Here is an example:
+ * @code
+ * class myClass
+ * {
+ * public:
+ * void myfunction(int k);
+ * }
+ * CAmSerializer serial(&Sockethandler);
+ * myClass instanceMyClass;
+ * serial<CommandSender,int>(&instanceMyClass,&myClass::myfunction,k);
+ * @endcode
+ */
+ template<class TClass1, class Targ>
+ void asyncCall(TClass1* instance, void(TClass1::*function)(Targ), Targ argument)
+ {
+ CAmDelegagePtr p(new CAmOneArgDelegate<TClass1, Targ>(instance, function, argument));
+ send(p);
+ }
+
+ /**
+ * calls a function with two arguments asynchronously threadsafe. for more see asyncCall with one argument
+ * @param instance
+ * @param function
+ * @param argument
+ * @param argument1
+ */
+ template<class TClass1, class Targ, class Targ1>
+ void asyncCall(TClass1* instance, void(TClass1::*function)(Targ argument,Targ1 argument1), Targ argument, Targ1 argument1)
+ {
+ CAmDelegagePtr p(new CAmTwoArgDelegate<TClass1, Targ, Targ1>(instance, function, argument,argument1));
+ send(p);
+ }
+
+ /**
+ * calls a function with three arguments asynchronously threadsafe. for more see asyncCall with one argument
+ * @param instance
+ * @param function
+ * @param argument
+ * @param argument1
+ * @param argument2
+ */
+ template<class TClass1, class Targ, class Targ1, class Targ2>
+ void asyncCall(TClass1* instance, void(TClass1::*function)(Targ argument,Targ1 argument1, Targ2 argument2), Targ argument, Targ1 argument1, Targ2 argument2)
+ {
+ CAmDelegagePtr p(new CAmThreeArgDelegate<TClass1, Targ, Targ1, Targ2>(instance, function, argument,argument1, argument2));
+ send(p);
+ }
+
+ /**
+ * calls a function with four arguments asynchronously threadsafe. for more see asyncCall with one argument
+ * @param instance
+ * @param function
+ * @param argument
+ * @param argument1
+ * @param argument2
+ * @param argument3
+ */
+ template<class TClass1, class Targ, class Targ1, class Targ2, class Targ3>
+ void asyncCall(TClass1* instance, void(TClass1::*function)(Targ argument,Targ1 argument1, Targ2 argument2, Targ3 argument3), Targ argument, Targ1 argument1, Targ2 argument2, Targ3 argument3)
+ {
+ CAmDelegagePtr p(new CAmFourArgDelegate<TClass1, Targ, Targ1, Targ2, Targ3>(instance, function, argument,argument1, argument2, argument3));
+ send(p);
+ }
+
+ void receiverCallback(const pollfd pollfd, const sh_pollHandle_t handle, void* userData)
+ {
+ (void) handle;
+ (void) userData;
+ int numReads;
+ CAmDelegagePtr listPointers[3];
+ if ((numReads=read(pollfd.fd,&listPointers, sizeof(listPointers))) == -1)
+ {
+ logError("CAmSerializer::receiverCallback could not read pipe!");
+ throw std::runtime_error("CAmSerializer Could not read pipe!");
+ }
+ mListDelegatePoiters.assign(listPointers, listPointers+(numReads/sizeof(CAmDelegagePtr)));
+ }
+
+ bool checkerCallback(const sh_pollHandle_t handle, void* userData)
+ {
+ (void) handle;
+ (void) userData;
+ if (mListDelegatePoiters.empty())
+ return false;
+ return true;
+ }
+
+ bool dispatcherCallback(const sh_pollHandle_t handle, void* userData)
+ {
+ (void) handle;
+ (void) userData;
+ CAmDelegagePtr delegatePoiter = mListDelegatePoiters.front();
+ mListDelegatePoiters.pop_front();
+ delegatePoiter->call();
+ delete delegatePoiter;
+ if (mListDelegatePoiters.empty())
+ return false;
+ return true;
+ }
+
+ shPollFired_T<CAmSerializer> receiverCallbackT;
+ shPollDispatch_T<CAmSerializer> dispatcherCallbackT;
+ shPollCheck_T<CAmSerializer> checkerCallbackT;
+
+ /**
+ * The constructor must be called in the mainthread context !
+ * @param iSocketHandler pointer to the sockethandler
+ */
+ CAmSerializer(SocketHandler *iSocketHandler) :
+ mPipe(), //
+ mListDelegatePoiters(), //
+ receiverCallbackT(this, &CAmSerializer::receiverCallback), //
+ dispatcherCallbackT(this, &CAmSerializer::dispatcherCallback), //
+ checkerCallbackT(this, &CAmSerializer::checkerCallback)
+ {
+ if (pipe(mPipe) == -1)
+ {
+ logError("CAmSerializer could not create pipe!");
+ throw std::runtime_error("CAmSerializer Could not open pipe!");
+ }
+
+ short event = 0;
+ sh_pollHandle_t handle;
+ event |= POLLIN;
+ iSocketHandler->addFDPoll(mPipe[0], event, NULL, &receiverCallbackT, NULL, &dispatcherCallbackT, NULL, handle);
+ }
+
+ virtual ~CAmSerializer(){}
+};
+} /* namespace am */
+#endif /* CAMSERIALIZER_H_ */
diff --git a/includes/audiomanagertypes.h b/includes/audiomanagertypes.h
index f1bd542..2d9b883 100644
--- a/includes/audiomanagertypes.h
+++ b/includes/audiomanagertypes.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \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
-*/
-#if !defined(EA_6D2D8AED_B7CC_424e_8C3F_EB10C5EBDC21__INCLUDED_)
-#define EA_6D2D8AED_B7CC_424e_8C3F_EB10C5EBDC21__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_5B7FFAAE_6D10_4b76_8E0F_E8060678C777__INCLUDED_)
+#define EA_5B7FFAAE_6D10_4b76_8E0F_E8060678C777__INCLUDED_
#include <stdint.h>
#include "projecttypes.h"
@@ -34,152 +29,65 @@
namespace am {
/**
- * This is the domain type. Each domain has a unique identifier.
- *
- * \mainpage
- * Copyright Copyright (C) 2011,2012 BMW AG
- *
- * \date 21.2.2012
- *
- * \author Christian Mueller (christian.ei.mueller@bmw.de)
- *
- * \par About AudioManagerInterfaces
- * The AudioManager is a Deamon that manages all Audio Connections in a GENIVI headunit.
- * It is a managing instance that uses so called RoutingAdaptors to control AudioDomains that then do the "real" connections.
- *
- * \par More information
- * can be found at https://collab.genivi.org/wiki/display/genivi/GENIVI+Home \n \n \n \n
- *
- * \section architecture Architecture Overview
- *
- * The architecture concept bases on the partition of management (logic) and routing (action). Sinks and sources are clustered into independent parts which are capable of exchanging audio with each other (AudioDomains). Between these AudioDomains, Audio can be interchanged via Gateways. \n
- * Since the routing and the management shall be independent from the actual used system, it is realized as an OwnedComponent, the AudioManager. Each AudioDomain has a Routing Adapter which implements some necessary logic and is the interface between the AudioManager and the AudioDomains.
- *
- * \section domains Audio Domains
- *
- * An Audio Domain consists of sinks and sources that can exchange audio with each other. To make the most out of the concept, AudioDomains shall be chosen in such a way that they are implemented by already existing audio routing engines.
- *
- * The AudioManager assumes that there are no restrictions in interconnection of sinks and sources. One or more sources can be connected to one sink and one or more sinks can be connected to one source. Since real hardware or software might end up in having restrictions, the knowledge of this must exist in the AudioManager and handled by him accordingly. This shall be accomplished via a plug-in mechanism. An AudioDomain is not tied to a hardware or software implementation. It can be software or hardware or even a combination of both. \n
- *
- * Examples for possible audio domains:\n
- * PulseAudio, Alsa, Jack, DSP, FPGA, MOST, In-chip switching matrix\n
- *
- * The clustering and usage of the AudioDomains will vary from each product. Care must be taken while choosing the right AudioDomains in regards to system load (due to resampling), latency and of course flexibility.\n
- * In special implementations of the AudioDomain, it is capable of operation a certain time without interaction to the AudioManager. This is needed to fulfill the requirements for Early & Late Audio, more information can be found below.
- *
- * \section routing_adaptor Routing Adapter
- *
- * Via this adapter, the interconnection from the AudioManager to the AudioDomains is accomplished. An AudioDomain shall have exactly one RoutingAdapter. In the terms of GENIVI, a RoutingAdapter is an AbstractComponent, this means that we define an API and a certain behavior in UML models but do not maintain components itself. Existing implementations from Proof of Concepts are shipped as example Adapters "as is" but cannot be seen as maintained components.\n
- * The implementation of a routing adapter can and will vary from each project to another since the combination of sinks and sources, the used hardware etc has influence on the adapters. Besides interchanging and abstracting information between the AudioManager and the sinks and sources, the Adapters also need to implement some business logic in order to interact with the AudioManager. This includes for example the registering of components, managing the current state, error handling etc.\n
- * In the special case of an EarlyDomain, the routing adapter also has to manage start-up and rundown including persistence for his domain while the AudioManager is not started or already stopped. During this periods of time, these special adapters have to be able to fulfill basic tasks like changing volumes, for example (this implies that the Adapter is implemented on a different piece of hardware, e.g. vehicle processor).
- *
- * \section Gateway
- *
- * Gateways are used to let audio flow between two domains. They always have a direction and can only transport one stream at a time. Several gateways connecting the same domains together can exist in parallel so that more than one source can be connected to more than one sink from the same domains at the same time.\n
- * The representation of a Gateway in the domain which originates the audio is a sink. In the receiving domain, the gateway appears as a source. The AudioManager knows about the Gateways, in terms of connection, it handles it as simple sources and sinks.
- *
- * \section AudioManagerDaemon
- *
- * The AudioManager is the central managing instance of the Audio architecture. It is designed as an OwnedComponent, this means that the software is maintained within GENIVI as open source component. The AudioManager consists of 4 central components.\n
- *
- * GOwnedComponent: AudioManager Daemon\n
- *
- * This component is owned and maintained by Genivi. It is the central audio framework component. There can be only one daemon in a system (singleton).
- *
- * \subsection controlinterface Control Interface Plugin
- *
- * This describes the interface towards the Controlling Instances of the AudioManagerDaemon. This is the HMI and interrupt sources that use this interface to start their interrupt and stop it again. The interface shall be asynchronous. Via this interface all user interactions are handled.
- *
- * \subsection routinginterface Routing Interface Plugin
- *
- * This interface is used by the AudioManager to control the RoutingAdapters and communicate with them. The communication is based on two interfaces, one is provided by the AudioManager for communication from the adapters towards the AudioManager and one for the opposite direction. The design of the AudioManager shall be done in such a way that several Interfaces are supported at the same time via a plug-in mechanism. The plug-ins are (either statically - due to performance reasons or dynamically) loaded at start-up. Due to this architecture, the number of buses and routing adapters that are supported are as low as possible for each system and as high as needed without the need of changing the AudioManager itself. The AudioManager expects a bus-like structure behind each plug-in, so that a plug-in can implement a bus interface and proxy the messages to the routing adapters - the AudioManager will be capable of addressing more than one adapter one each plug-in. The interface shall is asynchronous for all timely critical commands.
- *
- * \section interfaces Interfaces
- * the calls to the interfaces of the AudioManagerDaemon are generally not threadsafe !
- * Nevertheless if such calls from a different thread-context are needed, you may use the defered-call pattern that utilizes the mainloop (Sockethandler) to get self called in the next loop of the mainloop. For more infomation please check the audiomanger wiki page.
- *
- * \section deferred The deferred call pattern
- * Create a unix pipe or socket and add the file descriptor to the Sockethandler. Whenever a call needs to be deferred you can store the necessary information protected by a mutex in a queue and write to the socket or pipe. This will lead to a callback in the next loop of the mainloop - when getting called by the callback that was registered at the Sockethandler execute your call with the information stored away.
- *
- *
- * \section sources_sinks Sources & Sinks
- * \subsection Visibility
- * Sources and sinks can either be visible or not. If they are visible, the HMI is informed about their existence and can use them. \n
- * Invisible Sources and Sinks either are system only relevant (e.g. an audio processing that has a source and a sink) or belong to a gateway.
- *
- * \subsection Availability
- * It can be the case, that sources and sinks are present in the system but cannot be used at the moment. This is indicated via the availability. A sample use-case for this feature is CD drive that shall only be available if a CD is inserted.
- *
- * \section Interrupts
- * \subsection llinterrupts Low level interrupts
- * \todo write low level Interrupts description
- *
- * \subsection Interrupts
- * \todo write Interrupts description
- *
- * \section Persistency
- * It is the job of the AudioManagerController to handle the persistency. It is planned to expose an interface via the ControlInterface to accomplish this but the GENIVI persistance is not ready yet. \n
- *
- *
- * \section speed Speed dependent volume
- * The adjustments for the speed are done product specific in the controller. The speed information itself is retrieved by the AudioManagerDaemon, sampled and quantified and forwarded to the controller.\n
- * Turning speed controlled volume on/off and possible settings are achieved via SinkSoundProperty settings.
- *
- * \section Lipsync
- * It is the job of the AudioManager to retrieve all latency timing information from each connection, to aggregate this information and provide a latency information on a per MainConnection Basis. It is not the task of the AudioManager to actually delay or speed up video or audio signals to achieve a lipsync. The actual correction shall be done in the videoplayer with the information provided by the AudioManager.
- * The time information is always reported by the routingadaptors for each connection. Delays that are introduced in a sink or a gateway are counting for the connection that connects to this sink or gateway.\n
- * 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 Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * a domain ID
+ * @author Christian Mueller
+ * @created 27-Feb-2012 6:57:27 PM
*/
typedef uint16_t am_domainID_t;
/**
+ * a source ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:27 PM
*/
typedef uint16_t am_sourceID_t;
/**
+ * a sink ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:27 PM
*/
typedef uint16_t am_sinkID_t;
/**
+ * a gateway ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:27 PM
*/
typedef uint16_t am_gatewayID_t;
/**
+ * a crossfader ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_crossfaderID_t;
/**
+ * a connection ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_connectionID_t;
/**
+ * a mainConnection ID
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_mainConnectionID_t;
/**
+ * speed
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 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 Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef int16_t am_volume_t;
@@ -187,40 +95,40 @@ namespace am {
* This is the volume presented on the command interface. It is in the duty of the Controller to change the volumes given here into meaningful values on the routing interface.
* The range of this type is customer specific.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef int16_t am_mainVolume_t;
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_sourceClass_t;
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_sinkClass_t;
/**
* time in ms!
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef uint16_t am_time_t;
/**
* offset time that is introduced in milli seconds.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
typedef int16_t am_timeSync_t;
/**
* with the help of this enum, sinks and sources can report their availability state
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_Availablility_e
{
@@ -242,7 +150,7 @@ namespace am {
/**
* represents the connection state
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_ConnectionState_e
{
@@ -272,7 +180,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_DomainState_e
{
@@ -298,7 +206,7 @@ namespace am {
/**
* This enum characterizes the data of the EarlyData_t
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_EarlyDataType_e
{
@@ -328,7 +236,7 @@ namespace am {
/**
* the errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_Error_e
{
@@ -381,7 +289,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_MuteState_e
{
@@ -403,7 +311,7 @@ namespace am {
/**
* The source state reflects the state of the source
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_SourceState_e
{
@@ -426,7 +334,7 @@ namespace am {
/**
* This enumeration is used to define the type of the action that is correlated to a handle.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_Handle_e
{
@@ -446,7 +354,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:31 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_InterruptState_e
{
@@ -468,7 +376,7 @@ namespace am {
/**
* describes the active sink of a crossfader.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
enum am_HotSink_e
{
@@ -494,7 +402,7 @@ namespace am {
/**
* this describes the availability of a sink or a source together with the latest change
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_Availability_s
{
@@ -513,7 +421,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_ClassProperty_s
{
@@ -526,7 +434,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_Crossfader_s
{
@@ -543,7 +451,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_Gateway_s
{
@@ -583,7 +491,7 @@ namespace am {
/**
* This represents one "hopp" in a route
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:28 PM
*/
struct am_RoutingElement_s
{
@@ -598,7 +506,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_Route_s
{
@@ -612,7 +520,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:32 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SoundProperty_s
{
@@ -625,7 +533,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SystemProperty_s
{
@@ -644,7 +552,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SinkClass_s
{
@@ -658,7 +566,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SourceClass_s
{
@@ -676,7 +584,7 @@ namespace am {
/**
* this type holds all information of sources relevant to the HMI
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SourceType_s
{
@@ -692,7 +600,7 @@ namespace am {
/**
* this type holds all information of sinks relevant to the HMI
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_SinkType_s
{
@@ -709,7 +617,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:33 PM
+ * @created 27-Feb-2012 6:57:29 PM
*/
struct am_Handle_s
{
@@ -722,7 +630,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_MainSoundProperty_s
{
@@ -736,7 +644,7 @@ namespace am {
/**
* this type holds all information of connections relevant to the HMI
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_MainConnectionType_s
{
@@ -752,7 +660,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_MainConnection_s
{
@@ -775,7 +683,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_Sink_s
{
@@ -798,7 +706,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_Source_s
{
@@ -830,7 +738,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:30 PM
*/
struct am_Domain_s
{
@@ -848,7 +756,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:34 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
struct am_Connection_s
{
@@ -867,7 +775,7 @@ namespace am {
* volume_t in case of ED_SOURCE_VOLUME, ED_SINK_VOLUME
* soundProperty_t in case of ED_SOURCE_PROPERTY, ED_SINK_PROPERTY
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
union am_EarlyData_u
{
@@ -883,7 +791,7 @@ namespace am {
* sourceID in case of ED_SOURCE_VOLUME, ED_SOURCE_PROPERTY
* sinkID in case of ED_SINK_VOLUME, ED_SINK_PROPERTY
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
union am_DataType_u
{
@@ -896,7 +804,7 @@ namespace am {
/**
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
struct am_EarlyData_s
{
@@ -908,4 +816,4 @@ namespace am {
};
}
-#endif // !defined(EA_6D2D8AED_B7CC_424e_8C3F_EB10C5EBDC21__INCLUDED_)
+#endif // !defined(EA_5B7FFAAE_6D10_4b76_8E0F_E8060678C777__INCLUDED_)
diff --git a/includes/command/CommandReceiveInterface.h b/includes/command/CommandReceiveInterface.h
index b07ef2e..2e79f44 100644
--- a/includes/command/CommandReceiveInterface.h
+++ b/includes/command/CommandReceiveInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \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
-*/
-#if !defined(EA_241FAB0A_6108_4f68_8AAD_F2218B1C41D9__INCLUDED_)
-#define EA_241FAB0A_6108_4f68_8AAD_F2218B1C41D9__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_7F5A2204_92A2_4006_80F8_099931A426CE__INCLUDED_)
+#define EA_7F5A2204_92A2_4006_80F8_099931A426CE__INCLUDED_
#include <vector>
#include <string>
@@ -34,16 +29,17 @@ class SocketHandler;
}
-#define CommandReceiveVersion 1.0
+#define CommandReceiveVersion "1.0"
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.
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
class CommandReceiveInterface
{
@@ -202,9 +198,23 @@ namespace am {
virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) const =0;
/**
* This function returns the version of the interface.
+ *
+ * @param version
+ */
+ virtual void getInterfaceVersion(std::string& version) const =0;
+ /**
+ * asynchronous confirmation of setCommandReady.
+ *
+ * @param handle the handle that was handed over by setCommandReady
+ */
+ virtual void confirmCommandReady(const uint16_t handle) =0;
+ /**
+ * asynchronous confirmation of setCommandRundown
+ *
+ * @param handle the handle that was given via setCommandRundown
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void confirmCommandRundown(const uint16_t handle) =0;
};
}
-#endif // !defined(EA_241FAB0A_6108_4f68_8AAD_F2218B1C41D9__INCLUDED_)
+#endif // !defined(EA_7F5A2204_92A2_4006_80F8_099931A426CE__INCLUDED_)
diff --git a/includes/command/CommandSendInterface.h b/includes/command/CommandSendInterface.h
index f8c47be..e5135df 100644
--- a/includes/command/CommandSendInterface.h
+++ b/includes/command/CommandSendInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \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
-*/
-#if !defined(EA_A230EB7E_1719_4470_BCC6_12B0606A80E6__INCLUDED_)
-#define EA_A230EB7E_1719_4470_BCC6_12B0606A80E6__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_78C60EC5_4114_41a8_BE01_4911668CE1C1__INCLUDED_)
+#define EA_78C60EC5_4114_41a8_BE01_4911668CE1C1__INCLUDED_
#include <vector>
#include <string>
@@ -35,16 +30,17 @@ class CommandReceiveInterface;
#include "CommandReceiveInterface.h"
-#define CommandSendVersion 1.0
+#define CommandSendVersion "1.0"
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.
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:36 PM
+ * @created 27-Feb-2012 6:57:32 PM
*/
class CommandSendInterface
{
@@ -60,36 +56,62 @@ namespace am {
/**
* This command starts the interface, the plugin itself. This is not meant to start communication with the HMI itself. It is a good idea to implement here everything that sets up the basic communication like DbusCommunication etc...
+ * Be aware of side effects with systemd and socketbased communication!
* @return E_OK on success, E_UNKNOWN on error
*
* @param commandreceiveinterface pointer to the receive interface. Is used to call the audiomanagerdaemon
*/
virtual am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface) =0;
/**
- * This command stops the interface before the plugin is unloaded.
- * @return E_OK on success, E_UNKNOWN on error
+ * This function will indirectly be called by the Controller and is used to start the Communication. Before this command, all communication will be ignored by the AudioManager.
+ * After the Plugin is ready, it will asynchronously answer with condfirmCommandReady, the handle that is handed over must be returned.
+ *
+ * @param handle the handle uniquely idenfies the request
*/
- virtual am_Error_e stopInterface() =0;
+ virtual void setCommandReady(const uint16_t handle) =0;
/**
- * This callback is fired when the Interface is ready to be used. Before this command, all communication will be ignored by the Audiomanager
+ * This function will indirectly be called by the Controller and is used to stop the Communication. After this command, all communication will be ignored by the AudioManager. The plugin has to be prepared that either the power will be switched off or the Interface is started again with setCommandReady
+ * After the Plugin is ready to rundown, it will asynchronously answer with condfirmCommandRundown, the handle that is handed over must be returned.
+ *
+ * @param handle This handle uniquly idenfies the request
*/
- virtual am_Error_e cbCommunicationReady() =0;
+ virtual void setCommandRundown(const uint16_t handle) =0;
/**
- * This callback is fired when the AudioManager is about to rundown. After this command no more action will be carried out by the AudioManager.
+ * Callback that is called when the number of connections change
+ *
+ * @param mainConnection
*/
- virtual am_Error_e cbCommunicationRundown() =0;
+ virtual void cbNewMainConnection(const am_MainConnectionType_s mainConnection) =0;
/**
* Callback that is called when the number of connections change
+ *
+ * @param mainConnection
+ */
+ virtual void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection) =0;
+ /**
+ * Callback that is called when the number of sinks change
+ *
+ * @param sink
*/
- virtual void cbNumberOfMainConnectionsChanged() =0;
+ virtual void cbNewSink(const am_SinkType_s& sink) =0;
/**
* Callback that is called when the number of sinks change
+ *
+ * @param sinkID
*/
- virtual void cbNumberOfSinksChanged() =0;
+ virtual void cbRemovedSink(const am_sinkID_t sinkID) =0;
/**
* Callback that is called when the number of sources change
+ *
+ * @param source
*/
- virtual void cbNumberOfSourcesChanged() =0;
+ virtual void cbNewSource(const am_SourceType_s& source) =0;
+ /**
+ * Callback that is called when the number of sources change
+ *
+ * @param source
+ */
+ virtual void cbRemovedSource(const am_sourceID_t source) =0;
/**
* this callback is fired if the number of sink classes changed
*/
@@ -111,7 +133,7 @@ namespace am {
* @param sinkID
* @param soundProperty
*/
- virtual void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s soundProperty) =0;
+ virtual void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty) =0;
/**
* this callback indicates that a sourceSoundProperty has changed.
*
@@ -154,18 +176,19 @@ namespace am {
*/
virtual void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty) =0;
/**
- * CommandReceiveVer_0.0.9.
+ * This callback is fired if the timinginformation for a mainConnectionID changed
*
* @param mainConnectionID
* @param time
*/
virtual void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time) =0;
/**
- * This function returns the version of the interface
- * returns E_OK, E_UNKOWN if version is unknown.
+ * returns the interface version as string.
+ *
+ * @param version
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void getInterfaceVersion(std::string& version) const =0;
};
}
-#endif // !defined(EA_A230EB7E_1719_4470_BCC6_12B0606A80E6__INCLUDED_)
+#endif // !defined(EA_78C60EC5_4114_41a8_BE01_4911668CE1C1__INCLUDED_)
diff --git a/includes/control/ControlReceiveInterface.h b/includes/control/ControlReceiveInterface.h
index a3ec949..35bf977 100644
--- a/includes/control/ControlReceiveInterface.h
+++ b/includes/control/ControlReceiveInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \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
-*/
-#if !defined(EA_E6BEDBFE_083F_4174_8B46_FDDAEE627EB3__INCLUDED_)
-#define EA_E6BEDBFE_083F_4174_8B46_FDDAEE627EB3__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_4782C934_9728_44b7_8F9A_D8FB838CF1A7__INCLUDED_)
+#define EA_4782C934_9728_44b7_8F9A_D8FB838CF1A7__INCLUDED_
#include <vector>
#include <string>
@@ -33,16 +28,17 @@ class SocketHandler;
}
-#define ControlReceiveVersion 1.0
+#define ControlReceiveVersion "1.0"
namespace am {
/**
* This interface gives access to all important functions of the audiomanager that are used by the AudioManagerController to control the system.
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:36 PM
+ * @created 27-Feb-2012 6:57:32 PM
*/
class ControlReceiveInterface
{
@@ -576,22 +572,30 @@ namespace am {
*/
virtual am_Error_e getListSystemProperties(std::vector<am_SystemProperty_s>& listSystemProperties) const =0;
/**
- * sets the command interface to ready
+ * sets the command interface to ready. Will send setCommandReady to each of the plugins. The corresponding answer is confirmCommandReady.
*/
virtual void setCommandReady() =0;
/**
- * sets the command interface into the rundown state
+ * sets the command interface into the rundown state. Will send setCommandRundown to each of the plugins. The corresponding answer is confirmCommandRundown.
*/
virtual void setCommandRundown() =0;
/**
- * sets the routinginterface to ready.
+ * sets the routinginterface to ready. Will send the command setRoutingReady to each of the plugins. The related answer is confirmRoutingReady.
*/
virtual void setRoutingReady() =0;
/**
- * sets the routinginterface to the rundown state
+ * sets the routinginterface to the rundown state. Will send the command setRoutingRundown to each of the plugins. The related answer is confirmRoutingRundown.
*/
virtual void setRoutingRundown() =0;
/**
+ * acknowledges the setControllerReady call.
+ */
+ virtual void confirmControllerReady() =0;
+ /**
+ * acknowledges the setControllerRundown call.
+ */
+ virtual void confirmControllerRundown() =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,
*
@@ -600,9 +604,11 @@ namespace am {
virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) =0;
/**
* This function returns the version of the interface
+ *
+ * @param version
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void getInterfaceVersion(std::string& version) const =0;
};
}
-#endif // !defined(EA_E6BEDBFE_083F_4174_8B46_FDDAEE627EB3__INCLUDED_)
+#endif // !defined(EA_4782C934_9728_44b7_8F9A_D8FB838CF1A7__INCLUDED_)
diff --git a/includes/control/ControlSendInterface.h b/includes/control/ControlSendInterface.h
index 79aeb71..4857dd0 100644
--- a/includes/control/ControlSendInterface.h
+++ b/includes/control/ControlSendInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \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
-*/
-#if !defined(EA_71CB967F_6C92_467f_99BE_B9F5210165C2__INCLUDED_)
-#define EA_71CB967F_6C92_467f_99BE_B9F5210165C2__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_453737DF_D0F3_4dda_8960_2B6C2FE2297F__INCLUDED_)
+#define EA_453737DF_D0F3_4dda_8960_2B6C2FE2297F__INCLUDED_
#include <vector>
#include <string>
@@ -33,17 +28,18 @@ namespace am {
class ControlReceiveInterface;
}
-#define ControlSendVersion 1.0
+#define ControlSendVersion "1.0"
namespace am {
/**
* This interface is presented by the AudioManager controller.
* All the hooks represent system events that need to be handled. The callback functions are used to handle for example answers to function calls on the AudioManagerCoreInterface.
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:37 PM
+ * @created 27-Feb-2012 6:57:33 PM
*/
class ControlSendInterface
{
@@ -64,13 +60,13 @@ namespace am {
*/
virtual am_Error_e startupController(ControlReceiveInterface* controlreceiveinterface) =0;
/**
- * stops the controller
+ * this message is used tell the controller that it should get ready. This message must be acknowledged via confirmControllerReady.
*/
- virtual am_Error_e stopController() =0;
+ virtual void setControllerReady() =0;
/**
- * This hook is fired when all plugins have been loaded.
+ * this message tells the controller that he should prepare everything for the power to be switched off. This message must be acknowledged via confirmControllerRundown.
*/
- virtual void hookAllPluginsLoaded() =0;
+ virtual void setControllerRundown() =0;
/**
* is called when a connection request comes in via the command interface
* @return E_OK on success, E_NOT_POSSIBLE on error, E_ALREADY_EXISTENT if already exists
@@ -366,9 +362,27 @@ namespace am {
/**
* This function returns the version of the interface
* returns E_OK, E_UNKOWN if version is unknown.
+ *
+ * @param version
+ */
+ virtual void getInterfaceVersion(std::string& version) const =0;
+ /**
+ * confirms the setCommandReady call
+ */
+ virtual void confirmCommandReady() =0;
+ /**
+ * confirms the setRoutingReady call
+ */
+ virtual void confirmRoutingReady() =0;
+ /**
+ * confirms the setCommandRundown call
+ */
+ virtual void confirmCommandRundown() =0;
+ /**
+ * confirms the setRoutingRundown command
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void confirmRoutingRundown() =0;
};
}
-#endif // !defined(EA_71CB967F_6C92_467f_99BE_B9F5210165C2__INCLUDED_)
+#endif // !defined(EA_453737DF_D0F3_4dda_8960_2B6C2FE2297F__INCLUDED_)
diff --git a/includes/projecttypes.h b/includes/projecttypes.h
index dd55451..b480070 100644
--- a/includes/projecttypes.h
+++ b/includes/projecttypes.h
@@ -1,35 +1,30 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \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
-*/
-#if !defined(EA_8A329625_1F6F_478f_A704_D5359425FB4E__INCLUDED_)
-#define EA_8A329625_1F6F_478f_A704_D5359425FB4E__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_2597AEAA_55EC_440a_8189_04DF7389A1AD__INCLUDED_)
+#define EA_2597AEAA_55EC_440a_8189_04DF7389A1AD__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 Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_ConnectionFormat_e
{
@@ -59,7 +54,7 @@ namespace am {
/**
* This enum gives the information about reason for reason for Source/Sink change
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_AvailabilityReason_e
{
@@ -97,7 +92,7 @@ namespace am {
/**
* product specific identifier of property
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_ClassProperty_e
{
@@ -120,7 +115,7 @@ namespace am {
* The given ramp types here are just a possiblity. for products, different ramp types can be defined here.
* It is in the responsibility of the product to make sure that the routing plugins are aware of the ramp types used.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_RampType_e
{
@@ -142,7 +137,7 @@ namespace am {
/**
* sound properties. Within genivi only the standard properties are defined, for products these need to be extended.
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_SoundPropertyType_e
{
@@ -168,7 +163,7 @@ namespace am {
/**
* Here are all SoundProperties that can be set via the CommandInterface. Product specific
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_MainSoundPropertyType_e
{
@@ -194,7 +189,7 @@ namespace am {
/**
* describes the different system properties. Project specific
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:35 PM
+ * @created 27-Feb-2012 6:57:31 PM
*/
enum am_SystemPropertyType_e
{
@@ -205,4 +200,4 @@ namespace am {
SYP_MAX
};
}
-#endif // !defined(EA_8A329625_1F6F_478f_A704_D5359425FB4E__INCLUDED_)
+#endif // !defined(EA_2597AEAA_55EC_440a_8189_04DF7389A1AD__INCLUDED_)
diff --git a/includes/routing/RoutingReceiveInterface.h b/includes/routing/RoutingReceiveInterface.h
index f9df264..b9d6f34 100644
--- a/includes/routing/RoutingReceiveInterface.h
+++ b/includes/routing/RoutingReceiveInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \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
-*/
-#if !defined(EA_3F1137F5_C65B_42b9_A805_A65B61A04AA1__INCLUDED_)
-#define EA_3F1137F5_C65B_42b9_A805_A65B61A04AA1__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_1872FCAA_4ACA_4547_ABD0_F0CC01DE516C__INCLUDED_)
+#define EA_1872FCAA_4ACA_4547_ABD0_F0CC01DE516C__INCLUDED_
#include <vector>
#include <string>
@@ -35,16 +30,17 @@ class SocketHandler;
}
-#define RoutingReceiveVersion 1.0
+#define RoutingReceiveVersion "1.0"
namespace am {
/**
* Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:37 PM
+ * @created 27-Feb-2012 6:57:33 PM
*/
class RoutingReceiveInterface
{
@@ -330,9 +326,23 @@ namespace am {
virtual am_Error_e getSocketHandler(SocketHandler*& socketHandler) const =0;
/**
* This function returns the version of the interface
+ *
+ * @param version retrieves the verison of the interface
+ */
+ virtual void getInterfaceVersion(std::string& version) const =0;
+ /**
+ * confirms the setRoutingReady Command
+ *
+ * @param handle the handle that was given via setRoutingReady
+ */
+ virtual void confirmRoutingReady(const uint16_t handle) const =0;
+ /**
+ * confirms the setRoutingRundown Command
+ *
+ * @param handle handle that was given via setRoutingRundown
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void confirmRoutingRundown(const uint16_t handle) const =0;
};
}
-#endif // !defined(EA_3F1137F5_C65B_42b9_A805_A65B61A04AA1__INCLUDED_)
+#endif // !defined(EA_1872FCAA_4ACA_4547_ABD0_F0CC01DE516C__INCLUDED_)
diff --git a/includes/routing/RoutingSendInterface.h b/includes/routing/RoutingSendInterface.h
index b126c56..0f07022 100644
--- a/includes/routing/RoutingSendInterface.h
+++ b/includes/routing/RoutingSendInterface.h
@@ -1,29 +1,24 @@
-/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger
-*
-* \file
-*
-* \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
-*/
-#if !defined(EA_E6EBF9D0_B241_44f2_AABB_8DAE02D74E88__INCLUDED_)
-#define EA_E6EBF9D0_B241_44f2_AABB_8DAE02D74E88__INCLUDED_
+/** Copyright (c) 2012 GENIVI Alliance
+ * Copyright (c) 2012 BMW
+ *
+ * @author Christian Mueller, BMW
+ *
+ * @copyright
+ * {
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * }
+ *
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
+#if !defined(EA_C3949186_203B_474d_AD8F_42D39FB00FFA__INCLUDED_)
+#define EA_C3949186_203B_474d_AD8F_42D39FB00FFA__INCLUDED_
#include <vector>
#include <string>
@@ -35,16 +30,17 @@ class RoutingReceiveInterface;
#include "RoutingReceiveInterface.h"
-#define RoutingSendVersion 1.0
+#define RoutingSendVersion "1.0"
namespace am {
/**
* This class implements everything from Audiomanager -> RoutingAdapter
- * There are two rules that have to be kept in mind when implementing against this interface:
- * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!!
- * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.
- * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.
+ * There are two rules that have to be kept in mind when implementing against this interface:\n<b>
+ * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
+ * 2. YOU MAY NOT THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS CALL THAT EXPECTS A RETURN VALUE.</b>\n
+ * Violation these rules may lead to unexpected behavior! Nevertheless you can implement thread safe by using the deferred-call pattern described on the wiki which also helps to implement calls that are forbidden.\n
+ * For more information, please check CAmSerializer
* @author Christian Mueller
- * @created 21-Feb-2012 4:58:37 PM
+ * @created 27-Feb-2012 6:57:33 PM
*/
class RoutingSendInterface
{
@@ -63,15 +59,19 @@ namespace am {
*
* @param routingreceiveinterface pointer to the receive interface
*/
- virtual void startupRoutingInterface(RoutingReceiveInterface* routingreceiveinterface) =0;
+ virtual am_Error_e startupInterface(RoutingReceiveInterface* routingreceiveinterface) =0;
/**
- * indicates that the interface is now ready to be used. Should be used as trigger to register all sinks, sources, etc...
+ * indicates that the routing now ready to be used. Should be used as trigger to register all sinks, sources, etc...
+ *
+ * @param handle handle that uniquely identifies the request
*/
- virtual void routingInterfacesReady() =0;
+ virtual void setRoutingReady(const uint16_t handle) =0;
/**
- * is used to indicate the rundown of the system
+ * indicates that the routing plugins need to be prepared to switch the power off or be ready again.
+ *
+ * @param handle the handle that uniquely identifies the request
*/
- virtual void routingInterfacesRundown() =0;
+ virtual void setRoutingRundown(const uint16_t handle) =0;
/**
* aborts an asynchronous action.
* @return E_OK on success, E_UNKNOWN on error, E_NON_EXISTENT if handle was not found
@@ -194,9 +194,11 @@ namespace am {
virtual am_Error_e returnBusName(std::string& BusName) const =0;
/**
* This function returns the version of the interface
+ *
+ * @param version
*/
- virtual uint16_t getInterfaceVersion() const =0;
+ virtual void getInterfaceVersion(std::string& version) const =0;
};
}
-#endif // !defined(EA_E6EBF9D0_B241_44f2_AABB_8DAE02D74E88__INCLUDED_)
+#endif // !defined(EA_C3949186_203B_474d_AD8F_42D39FB00FFA__INCLUDED_)