summaryrefslogtreecommitdiff
path: root/includes/command/CommandSendInterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/command/CommandSendInterface.h')
-rw-r--r--includes/command/CommandSendInterface.h119
1 files changed, 71 insertions, 48 deletions
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_)