2 * This file was generated by the CommonAPI Generators.
3 * Used org.genivi.commonapi.core 2.1.2.201309301424.
4 * Used org.franca.core 0.8.9.201308271211.
6 * Copyright (c) 2012 BMW
8 * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
11 * 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,
12 * 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,
13 * subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15 * 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.
16 * 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
17 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 * For further information see http://www.genivi.org/.
21 #include <org/genivi/am/CommandControlStubDefault.h>
27 CommandControlStubDefault::CommandControlStubDefault():
28 remoteEventHandler_(this) {
31 CommandControlStubRemoteEvent* CommandControlStubDefault::initStubAdapter(const std::shared_ptr<CommandControlStubAdapter>& stubAdapter) {
32 stubAdapter_ = stubAdapter;
33 return &remoteEventHandler_;
38 * connects a source to sink
39 (at)return E_OK on success, E_NOT_POSSIBLE on
40 * failure, E_ALREADY_EXISTS if the connection does already exists
42 void CommandControlStubDefault::connect(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sourceID_t sourceID, am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID, am_Error_e& error) {
43 // Call old style methods in default
44 connect(sourceID, sinkID, mainConnectionID, error);
46 void CommandControlStubDefault::connect(am_sourceID_t sourceID, am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID, am_Error_e& error) {
47 // No operation in default
51 * disconnects a mainConnection
52 (at)return E_OK on successes, E_NON_EXISTENT if
53 * the connection does not exist, E_NOT_POSSIBLE on error.
55 void CommandControlStubDefault::disconnect(const std::shared_ptr<CommonAPI::ClientId> clientId, am_mainConnectionID_t mainConnectionID, am_Error_e& error) {
56 // Call old style methods in default
57 disconnect(mainConnectionID, error);
59 void CommandControlStubDefault::disconnect(am_mainConnectionID_t mainConnectionID, am_Error_e& error) {
60 // No operation in default
64 * sets the volume for a sink
65 (at)return E_OK on success, E_UNKOWN on error,
66 * E_OUT_OF_RANGE in case the value is out of range
68 void CommandControlStubDefault::setVolume(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sinkID_t sinkID, am_mainVolume_t volume, am_Error_e& error) {
69 // Call old style methods in default
70 setVolume(sinkID, volume, error);
72 void CommandControlStubDefault::setVolume(am_sinkID_t sinkID, am_mainVolume_t volume, am_Error_e& error) {
73 // No operation in default
77 * This function is used to increment or decrement the current volume for a
79 (at)return E_OK on success, E_UNKNOWN on error and E_OUT_OF_RANGE if
80 * the value is not in the given volume range.
82 void CommandControlStubDefault::volumeStep(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sinkID_t sinkID, int16_t volumeStep_, am_Error_e& error) {
83 // Call old style methods in default
84 volumeStep(sinkID, volumeStep_, error);
86 void CommandControlStubDefault::volumeStep(am_sinkID_t sinkID, int16_t volumeStep_, am_Error_e& error) {
87 // No operation in default
91 * sets the mute state of a sink
92 (at)return E_OK on success, E_UNKNOWN on error.
93 * If the mute state is already the desired one, the Daemon will return E_OK.
95 void CommandControlStubDefault::setSinkMuteState(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sinkID_t sinkID, am_MuteState_e muteState, am_Error_e& error) {
96 // Call old style methods in default
97 setSinkMuteState(sinkID, muteState, error);
99 void CommandControlStubDefault::setSinkMuteState(am_sinkID_t sinkID, am_MuteState_e muteState, am_Error_e& error) {
100 // No operation in default
104 * This method is used to set sound properties, e.g. Equalizer Values. Since the
105 * capabilities of the system can differ, the exact key value pairs can be
106 * extended in each product
107 (at)return E_OK on success, E_OUT_OF_RANGE if value
108 * exceeds range, E_UNKNOWN in case of an error
110 void CommandControlStubDefault::setMainSinkSoundProperty(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sinkID_t sinkID, am_MainSoundProperty_s soundProperty, am_Error_e& error) {
111 // Call old style methods in default
112 setMainSinkSoundProperty(sinkID, soundProperty, error);
114 void CommandControlStubDefault::setMainSinkSoundProperty(am_sinkID_t sinkID, am_MainSoundProperty_s soundProperty, am_Error_e& error) {
115 // No operation in default
119 * This method is used to set sound properties, e.g. Equalizer Values. Since the
120 * capabilities of the system can differ, the exact key value pairs can be
121 * extended in each product
122 (at)return E_OK on success, E_OUT_OF_RANGE if value
123 * exceeds range, E_UNKNOWN in case of an error
125 void CommandControlStubDefault::setMainSourceSoundProperty(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sourceID_t sourceID, am_MainSoundProperty_s soundProperty, am_Error_e& error) {
126 // Call old style methods in default
127 setMainSourceSoundProperty(sourceID, soundProperty, error);
129 void CommandControlStubDefault::setMainSourceSoundProperty(am_sourceID_t sourceID, am_MainSoundProperty_s soundProperty, am_Error_e& error) {
130 // No operation in default
134 * is used to set a specific system property.
135 (at)return E_OK on success,
136 * E_OUT_OF_RANGE if value exceeds range, E_UNKNOWN in case of an error
138 void CommandControlStubDefault::setSystemProperty(const std::shared_ptr<CommonAPI::ClientId> clientId, am_SystemProperty_s property, am_Error_e& error) {
139 // Call old style methods in default
140 setSystemProperty(property, error);
142 void CommandControlStubDefault::setSystemProperty(am_SystemProperty_s property, am_Error_e& error) {
143 // No operation in default
147 * returns the actual list of MainConnections
148 (at)return E_OK on success,
149 * E_DATABASE_ERROR on error
151 void CommandControlStubDefault::getListMainConnections(const std::shared_ptr<CommonAPI::ClientId> clientId, am_MainConnection_L& listConnections, am_Error_e& error) {
152 // Call old style methods in default
153 getListMainConnections(listConnections, error);
155 void CommandControlStubDefault::getListMainConnections(am_MainConnection_L& listConnections, am_Error_e& error) {
156 // No operation in default
160 * returns the actual list of Sinks
161 (at)return E_OK on success, E_DATABASE_ERROR
164 void CommandControlStubDefault::getListMainSinks(const std::shared_ptr<CommonAPI::ClientId> clientId, am_SinkType_L& listMainSinks, am_Error_e& error) {
165 // Call old style methods in default
166 getListMainSinks(listMainSinks, error);
168 void CommandControlStubDefault::getListMainSinks(am_SinkType_L& listMainSinks, am_Error_e& error) {
169 // No operation in default
173 * returns the actual list of Sources
174 (at)return E_OK on success,
175 * E_DATABASE_ERROR on error
177 void CommandControlStubDefault::getListMainSources(const std::shared_ptr<CommonAPI::ClientId> clientId, am_SourceType_L& listMainSources, am_Error_e& error) {
178 // Call old style methods in default
179 getListMainSources(listMainSources, error);
181 void CommandControlStubDefault::getListMainSources(am_SourceType_L& listMainSources, am_Error_e& error) {
182 // No operation in default
186 * This is used to retrieve all source sound properties related to a source.
187 * Returns a vector of the sound properties and values as pair
189 * on success, E_DATABASE_ERROR on error
191 void CommandControlStubDefault::getListMainSinkSoundProperties(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sinkID_t sinkID, am_MainSoundProperty_L& listSoundProperties, am_Error_e& error) {
192 // Call old style methods in default
193 getListMainSinkSoundProperties(sinkID, listSoundProperties, error);
195 void CommandControlStubDefault::getListMainSinkSoundProperties(am_sinkID_t sinkID, am_MainSoundProperty_L& listSoundProperties, am_Error_e& error) {
196 // No operation in default
200 * This is used to retrieve all source sound properties related to a
202 (at)return E_OK on success, E_DATABASE_ERROR on error
204 void CommandControlStubDefault::getListMainSourceSoundProperties(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sourceID_t sourceID, am_MainSoundProperty_L& listSourceProperties, am_Error_e& error) {
205 // Call old style methods in default
206 getListMainSourceSoundProperties(sourceID, listSourceProperties, error);
208 void CommandControlStubDefault::getListMainSourceSoundProperties(am_sourceID_t sourceID, am_MainSoundProperty_L& listSourceProperties, am_Error_e& error) {
209 // No operation in default
213 * This is used to retrieve SourceClass Information of all source classes
215 (at)return E_OK on success, E_DATABASE_ERROR on error
217 void CommandControlStubDefault::getListSourceClasses(const std::shared_ptr<CommonAPI::ClientId> clientId, am_SourceClass_L& listSourceClasses, am_Error_e& error) {
218 // Call old style methods in default
219 getListSourceClasses(listSourceClasses, error);
221 void CommandControlStubDefault::getListSourceClasses(am_SourceClass_L& listSourceClasses, am_Error_e& error) {
222 // No operation in default
226 * This is used to retrieve SinkClass Information of all sink classes
228 * E_OK on success, E_DATABASE_ERROR on error
230 void CommandControlStubDefault::getListSinkClasses(const std::shared_ptr<CommonAPI::ClientId> clientId, am_SinkClass_L& listSinkClasses, am_Error_e& error) {
231 // Call old style methods in default
232 getListSinkClasses(listSinkClasses, error);
234 void CommandControlStubDefault::getListSinkClasses(am_SinkClass_L& listSinkClasses, am_Error_e& error) {
235 // No operation in default
239 * Retrieves a complete list of all systemProperties.
240 (at)return E_OK on success,
241 * E_DATABASE_ERROR on error
243 void CommandControlStubDefault::getListSystemProperties(const std::shared_ptr<CommonAPI::ClientId> clientId, am_SystemProperty_L& listSystemProperties, am_Error_e& error) {
244 // Call old style methods in default
245 getListSystemProperties(listSystemProperties, error);
247 void CommandControlStubDefault::getListSystemProperties(am_SystemProperty_L& listSystemProperties, am_Error_e& error) {
248 // No operation in default
252 * returns the delay in ms that the audiopath for the given mainConnection
254 (at)return E_OK on success, E_NOT_POSSIBLE if timing information is not
255 * yet retrieved, E_DATABASE_ERROR on read error on the database
257 void CommandControlStubDefault::getTimingInformation(const std::shared_ptr<CommonAPI::ClientId> clientId, am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay, am_Error_e& error) {
258 // Call old style methods in default
259 getTimingInformation(mainConnectionID, delay, error);
261 void CommandControlStubDefault::getTimingInformation(am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay, am_Error_e& error) {
262 // No operation in default
266 * Retrieves the list of MainNotifications for a sink. Does not return the
269 void CommandControlStubDefault::getListMainSinkNotificationConfigurations(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sinkID_t sinkID, am_NotificationConfiguration_L& listMainNotificationConfigurations, am_Error_e& error) {
270 // Call old style methods in default
271 getListMainSinkNotificationConfigurations(sinkID, listMainNotificationConfigurations, error);
273 void CommandControlStubDefault::getListMainSinkNotificationConfigurations(am_sinkID_t sinkID, am_NotificationConfiguration_L& listMainNotificationConfigurations, am_Error_e& error) {
274 // No operation in default
278 * Retrieves the list of MainNotifications for a source. Does not return the
281 void CommandControlStubDefault::getListMainSourceNotificationConfigurations(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sourceID_t sourceID, am_NotificationConfiguration_L& listMainNotificationConfigurations, am_Error_e& error) {
282 // Call old style methods in default
283 getListMainSourceNotificationConfigurations(sourceID, listMainNotificationConfigurations, error);
285 void CommandControlStubDefault::getListMainSourceNotificationConfigurations(am_sourceID_t sourceID, am_NotificationConfiguration_L& listMainNotificationConfigurations, am_Error_e& error) {
286 // No operation in default
290 * sets a MainNotificationConfiuration. This can be used to turn on an off
291 * notifications an to change the mode of the configuration.
293 * success, E_NON_EXISTENT if sinkID does not exists, E_DATABASE_ERROR on error
295 void CommandControlStubDefault::setMainSinkNotificationConfiguration(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sinkID_t sinkID, am_NotificationConfiguration_s mainNotificationConfiguration, am_Error_e& error) {
296 // Call old style methods in default
297 setMainSinkNotificationConfiguration(sinkID, mainNotificationConfiguration, error);
299 void CommandControlStubDefault::setMainSinkNotificationConfiguration(am_sinkID_t sinkID, am_NotificationConfiguration_s mainNotificationConfiguration, am_Error_e& error) {
300 // No operation in default
304 * sets a MainNotificationConfiuration. This can be used to turn on an off
305 * notifications an to change the mode of the configuration.
307 * success, E_NON_EXISTENT if sourceID does not exists, E_DATABASE_ERROR on error
309 void CommandControlStubDefault::setMainSourceNotificationConfiguration(const std::shared_ptr<CommonAPI::ClientId> clientId, am_sourceID_t sourceID, am_NotificationConfiguration_s mainNotificationConfiguration, am_Error_e& error) {
310 // Call old style methods in default
311 setMainSourceNotificationConfiguration(sourceID, mainNotificationConfiguration, error);
313 void CommandControlStubDefault::setMainSourceNotificationConfiguration(am_sourceID_t sourceID, am_NotificationConfiguration_s mainNotificationConfiguration, am_Error_e& error) {
314 // No operation in default
319 * Callback that is called when the number of connections change
321 void CommandControlStubDefault::fireNewMainConnectionEvent(const am_MainConnectionType_s& mainConnection) {
322 stubAdapter_->fireNewMainConnectionEvent(mainConnection);
325 * Callback that is called when the number of connections change
327 void CommandControlStubDefault::fireRemovedMainConnectionEvent(const am_mainConnectionID_t& mainConnection) {
328 stubAdapter_->fireRemovedMainConnectionEvent(mainConnection);
331 * Callback that is called when the number of sinks change
333 void CommandControlStubDefault::fireNewSinkEvent(const am_SinkType_s& sink) {
334 stubAdapter_->fireNewSinkEvent(sink);
337 * Callback that is called when the number of sinks change
339 void CommandControlStubDefault::fireRemovedSinkEvent(const am_sinkID_t& sinkID) {
340 stubAdapter_->fireRemovedSinkEvent(sinkID);
343 * Callback that is called when the number of sources change
345 void CommandControlStubDefault::fireNewSourceEvent(const am_SourceType_s& source) {
346 stubAdapter_->fireNewSourceEvent(source);
349 * Callback that is called when the number of sources change
351 void CommandControlStubDefault::fireRemovedSourceEvent(const am_sourceID_t& source) {
352 stubAdapter_->fireRemovedSourceEvent(source);
355 * this callback is fired if the number of sink classes changed
357 void CommandControlStubDefault::fireNumberOfSinkClassesChangedEvent() {
358 stubAdapter_->fireNumberOfSinkClassesChangedEvent();
361 * this callback is fired if the number of source classes changed
363 void CommandControlStubDefault::fireNumberOfSourceClassesChangedEvent() {
364 stubAdapter_->fireNumberOfSourceClassesChangedEvent();
367 * This callback is called when the ConnectionState of a connection changed.
369 void CommandControlStubDefault::fireMainConnectionStateChangedEvent(const am_mainConnectionID_t& connectionID, const am_ConnectionState_e& connectionState) {
370 stubAdapter_->fireMainConnectionStateChangedEvent(connectionID, connectionState);
373 * this callback indicates that a sinkSoundProperty has changed.
375 void CommandControlStubDefault::fireMainSinkSoundPropertyChangedEvent(const am_sinkID_t& sinkID, const am_MainSoundProperty_s& soundProperty) {
376 stubAdapter_->fireMainSinkSoundPropertyChangedEvent(sinkID, soundProperty);
379 * this callback indicates that a sourceSoundProperty has changed.
381 void CommandControlStubDefault::fireMainSourceSoundPropertyChangedEvent(const am_sourceID_t& sourceID, const am_MainSoundProperty_s& soundProperty) {
382 stubAdapter_->fireMainSourceSoundPropertyChangedEvent(sourceID, soundProperty);
385 * this callback is called when the availability of a sink has changed
387 void CommandControlStubDefault::fireSinkAvailabilityChangedEvent(const am_sinkID_t& sinkID, const am_Availability_s& availability) {
388 stubAdapter_->fireSinkAvailabilityChangedEvent(sinkID, availability);
391 * this callback is called when the availability of source has changed.
393 void CommandControlStubDefault::fireSourceAvailabilityChangedEvent(const am_sourceID_t& sourceID, const am_Availability_s& availability) {
394 stubAdapter_->fireSourceAvailabilityChangedEvent(sourceID, availability);
397 * this callback indicates a volume change on the indicated sink
399 void CommandControlStubDefault::fireVolumeChangedEvent(const am_sinkID_t& sinkID, const am_mainVolume_t& volume) {
400 stubAdapter_->fireVolumeChangedEvent(sinkID, volume);
403 * this callback indicates a mute state change on a sink.
405 void CommandControlStubDefault::fireSinkMuteStateChangedEvent(const am_sinkID_t& sinkID, const am_MuteState_e& muteState) {
406 stubAdapter_->fireSinkMuteStateChangedEvent(sinkID, muteState);
409 * is fired if a systemProperty changed
411 void CommandControlStubDefault::fireSystemPropertyChangedEvent(const am_SystemProperty_s& systemProperty) {
412 stubAdapter_->fireSystemPropertyChangedEvent(systemProperty);
415 * This callback is fired if the timinginformation for a mainConnectionID changed
417 void CommandControlStubDefault::fireTimingInformationChangedEvent(const am_mainConnectionID_t& mainConnectionID, const am_timeSync_t& time) {
418 stubAdapter_->fireTimingInformationChangedEvent(mainConnectionID, time);
421 * This callback is called when a sink is updated.
423 void CommandControlStubDefault::fireSinkUpdatedEvent(const am_sinkID_t& sinkID, const am_sinkClass_t& sinkClassID, const am_MainSoundProperty_L& listMainSoundProperties) {
424 stubAdapter_->fireSinkUpdatedEvent(sinkID, sinkClassID, listMainSoundProperties);
427 * This callback is called when a source is updated.
429 void CommandControlStubDefault::fireSourceUpdatedEvent(const am_sourceID_t& sourceID, const am_sourceClass_t& sourceClassID, const am_MainSoundProperty_L& listMainSoundProperties) {
430 stubAdapter_->fireSourceUpdatedEvent(sourceID, sourceClassID, listMainSoundProperties);
433 * This callback is called when a notificated value of a sink changes.
435 void CommandControlStubDefault::fireSinkNotificationEvent(const am_sinkID_t& sinkID, const am_NotificationPayload_s& notification) {
436 stubAdapter_->fireSinkNotificationEvent(sinkID, notification);
439 * This callback is called when a notifcated value of a source changes.
441 void CommandControlStubDefault::fireSourceNotificationEvent(const am_sourceID_t& sourceID, const am_NotificationPayload_s& notification) {
442 stubAdapter_->fireSourceNotificationEvent(sourceID, notification);
445 * This callback is triggered when a mainNotificationConfiguration is changed.
447 void CommandControlStubDefault::fireMainSinkNotificationConfigurationChangedEvent(const am_sinkID_t& sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration) {
448 stubAdapter_->fireMainSinkNotificationConfigurationChangedEvent(sinkID, mainNotificationConfiguration);
451 * This callback is triggered when a mainNotificationConfiguration is changed.
453 void CommandControlStubDefault::fireMainSourceNotificationConfigurationChangedEvent(const am_sourceID_t& sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration) {
454 stubAdapter_->fireMainSourceNotificationConfigurationChangedEvent(sourceID, mainNotificationConfiguration);
458 CommandControlStubDefault::RemoteEventHandler::RemoteEventHandler(CommandControlStubDefault* defaultStub):
459 defaultStub_(defaultStub) {
463 } // namespace genivi