2 * Copyright (C) 2012 - 2014, BMW AG
4 * This file is part of GENIVI Project AudioManager.
6 * Contributions are licensed to the GENIVI Alliance under one or more
7 * Contribution License Agreements.
10 * This Source Code Form is subject to the terms of the
11 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
12 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 * \author Christian Linke, christian.linke@bmw.de BMW 2011 - 2014
18 * For further information see http://projects.genivi.org/audio-manager
20 * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL.
21 * PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN.
23 #if !defined(EA_B654431C_A920_4376_9B2F_3FF803354EAD__INCLUDED_)
24 #define EA_B654431C_A920_4376_9B2F_3FF803354EAD__INCLUDED_
28 #include "audiomanagertypes.h"
30 class IAmCommandReceive;
33 #include "IAmCommandReceive.h"
34 #include "audiomanagertypes.h"
36 #define CommandSendVersion "3.0"
40 * This interface handles all communication from the AudioManagerDaemon towards
41 * the system. It is designed in such a way that only callbacks with no return
42 * types are implemented. So when the CommandInterfacePlugins are designed in such
43 * a way that they broadcast signals to any node who is interested in the
44 * particular information (like signals on Dbus for example), more information can
45 * be retrieved via the CommandReceiveInterface.
46 * There are two rules that have to be kept in mind when implementing against this
49 * 1. CALLS TO THIS INTERFACE ARE NOT THREAD SAFE !!!! \n
50 * 2. YOU MAY NOT CALL THE CALLING INTERFACE DURING AN SYNCHRONOUS OR ASYNCHRONOUS
51 * CALL THAT EXPECTS A RETURN VALUE.\n
53 * Violation these rules may lead to unexpected behavior! Nevertheless you can
54 * implement thread safe by using the deferred-call pattern described on the wiki
55 * which also helps to implement calls that are forbidden.\n
56 * For more information, please check CAmSerializer
66 virtual ~IAmCommandSend() {
71 * returns the interface version as string.
73 virtual void getInterfaceVersion(std::string& version) const =0;
75 * This command starts the interface, the plugin itself. This is not meant to
76 * start communication with the HMI itself. It is a good idea to implement here
77 * everything that sets up the basic communication like DbusCommunication etc...
78 * Be aware of side effects with systemd and socketbased communication!
79 * @return E_OK on success, E_UNKNOWN on error
81 virtual am_Error_e startupInterface(IAmCommandReceive* commandreceiveinterface) =0;
83 * This function will indirectly be called by the Controller and is used to start
84 * the Communication. Before this command, all communication will be ignored by
86 * After the Plugin is ready, it will asynchronously answer with
87 * condfirmCommandReady, the handle that is handed over must be returned.
89 virtual void setCommandReady(const uint16_t handle) =0;
91 * This function will indirectly be called by the Controller and is used to stop
92 * the Communication. After this command, all communication will be ignored by the
93 * AudioManager. The plugin has to be prepared that either the power will be
94 * switched off or the Interface is started again with setCommandReady
95 * After the Plugin is ready to rundown, it will asynchronously answer with
96 * condfirmCommandRundown, the handle that is handed over must be returned.
98 virtual void setCommandRundown(const uint16_t handle) =0;
100 * Callback that is called when the number of connections change
102 virtual void cbNewMainConnection(const am_MainConnectionType_s& mainConnection) =0;
104 * Callback that is called when the number of connections change
106 virtual void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection) =0;
108 * Callback that is called when the number of sinks change
110 virtual void cbNewSink(const am_SinkType_s& sink) =0;
112 * Callback that is called when the number of sinks change
114 virtual void cbRemovedSink(const am_sinkID_t sinkID) =0;
116 * Callback that is called when the number of sources change
118 virtual void cbNewSource(const am_SourceType_s& source) =0;
120 * Callback that is called when the number of sources change
122 virtual void cbRemovedSource(const am_sourceID_t source) =0;
124 * this callback is fired if the number of sink classes changed
126 virtual void cbNumberOfSinkClassesChanged() =0;
128 * this callback is fired if the number of source classes changed
130 virtual void cbNumberOfSourceClassesChanged() =0;
132 * This callback is called when the ConnectionState of a connection changed.
134 virtual void cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState) =0;
136 * this callback indicates that a sinkSoundProperty has changed.
138 virtual void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty) =0;
140 * this callback indicates that a sourceSoundProperty has changed.
142 virtual void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty) =0;
144 * this callback is called when the availability of a sink has changed
146 virtual void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability) =0;
148 * this callback is called when the availability of source has changed.
150 virtual void cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability) =0;
152 * this callback indicates a volume change on the indicated sink
154 virtual void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume) =0;
156 * this callback indicates a mute state change on a sink.
158 virtual void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState) =0;
160 * is fired if a systemProperty changed
162 virtual void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty) =0;
164 * This callback is fired if the timinginformation for a mainConnectionID changed
166 virtual void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time) =0;
168 * This callback is called when a sink is updated.
170 virtual void cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) =0;
172 * This callback is called when a source is updated.
174 virtual void cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) =0;
176 * This callback is called when a notificated value of a sink changes.
178 virtual void cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s& notification) =0;
180 * This callback is called when a notifcated value of a source changes.
182 virtual void cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s& notification) =0;
184 * This callback is triggered when a mainNotificationConfiguration is changed.
186 virtual void cbMainSinkNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration) =0;
188 * This callback is triggered when a mainNotificationConfiguration is changed.
190 virtual void cbMainSourceNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration) =0;
194 #endif // !defined(EA_B654431C_A920_4376_9B2F_3FF803354EAD__INCLUDED_)