From a2edae5cee4254b933f42399edc0e092abd4f5cf Mon Sep 17 00:00:00 2001 From: Aleksandar Donchev Date: Mon, 2 Sep 2013 11:57:28 +0200 Subject: *PluginCommandInterfaceCAPI, PluginRoutingInterfaceCAPI, NodeStateCommunicatorCAPI with unit tests first version. Choosing between DBUS and Common-API via cmake. CommonAPI - legacy support for DBus properties (Set 1) Signed-off-by: Christian Linke (cherry picked from commit ea96ef59e29466667c90b506426e2a5a9cdb82d2) --- PluginCommandInterfaceCAPI/CMakeLists.txt | 99 ++ PluginCommandInterfaceCAPI/cmake/config.cmake | 4 + .../fidl/CommandInterface.fdepl | 6 + .../fidl/CommandInterface.fidl | 723 ++++++++++ .../fidl/PluginCommandInterfaceCAPI_dbus.conf | 8 + PluginCommandInterfaceCAPI/fidl/amTypes.fidl | 329 +++++ .../include/CAmCommandSenderCAPI.h | 120 ++ .../include/CAmCommandSenderCommon.h | 61 + .../include/CAmCommandSenderService.h | 74 + .../include/configCommandCAPI.h | 4 + .../org/genivi/audiomanager/CommandInterface.cpp | 332 +++++ .../org/genivi/audiomanager/CommandInterface.h | 820 +++++++++++ .../audiomanager/CommandInterfaceDBusProxy.cpp | 458 ++++++ .../audiomanager/CommandInterfaceDBusProxy.h | 157 ++ .../CommandInterfaceDBusStubAdapter.cpp | 521 +++++++ .../audiomanager/CommandInterfaceDBusStubAdapter.h | 79 + .../genivi/audiomanager/CommandInterfaceProxy.h | 794 ++++++++++ .../audiomanager/CommandInterfaceProxyBase.h | 170 +++ .../org/genivi/audiomanager/CommandInterfaceStub.h | 282 ++++ .../audiomanager/CommandInterfaceStubDefault.cpp | 177 +++ .../audiomanager/CommandInterfaceStubDefault.h | 124 ++ .../src-gen/org/genivi/audiomanager/am.cpp | 477 ++++++ .../src-gen/org/genivi/audiomanager/am.h | 1515 ++++++++++++++++++++ .../src/CAmCommandSenderCAPI.cpp | 364 +++++ .../src/CAmCommandSenderCommon.cpp | 159 ++ .../src/CAmCommandSenderService.cpp | 236 +++ .../test/CAmCommandSenderCAPITest.cpp | 1101 ++++++++++++++ .../test/CAmCommandSenderCAPITest.h | 77 + .../test/CAmTestCAPIWrapper.cpp | 31 + .../test/CAmTestCAPIWrapper.h | 32 + PluginCommandInterfaceCAPI/test/CMakeLists.txt | 105 ++ .../test/MockIAmCommandReceive.h | 86 ++ .../test/MockNotificationsClient.h | 110 ++ 33 files changed, 9635 insertions(+) create mode 100644 PluginCommandInterfaceCAPI/CMakeLists.txt create mode 100644 PluginCommandInterfaceCAPI/cmake/config.cmake create mode 100644 PluginCommandInterfaceCAPI/fidl/CommandInterface.fdepl create mode 100755 PluginCommandInterfaceCAPI/fidl/CommandInterface.fidl create mode 100644 PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf create mode 100755 PluginCommandInterfaceCAPI/fidl/amTypes.fidl create mode 100644 PluginCommandInterfaceCAPI/include/CAmCommandSenderCAPI.h create mode 100644 PluginCommandInterfaceCAPI/include/CAmCommandSenderCommon.h create mode 100644 PluginCommandInterfaceCAPI/include/CAmCommandSenderService.h create mode 100644 PluginCommandInterfaceCAPI/include/configCommandCAPI.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxy.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxyBase.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStub.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.h create mode 100644 PluginCommandInterfaceCAPI/src/CAmCommandSenderCAPI.cpp create mode 100644 PluginCommandInterfaceCAPI/src/CAmCommandSenderCommon.cpp create mode 100644 PluginCommandInterfaceCAPI/src/CAmCommandSenderService.cpp create mode 100644 PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.cpp create mode 100644 PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.h create mode 100644 PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.cpp create mode 100644 PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.h create mode 100644 PluginCommandInterfaceCAPI/test/CMakeLists.txt create mode 100644 PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h create mode 100644 PluginCommandInterfaceCAPI/test/MockNotificationsClient.h (limited to 'PluginCommandInterfaceCAPI') diff --git a/PluginCommandInterfaceCAPI/CMakeLists.txt b/PluginCommandInterfaceCAPI/CMakeLists.txt new file mode 100644 index 0000000..d66d849 --- /dev/null +++ b/PluginCommandInterfaceCAPI/CMakeLists.txt @@ -0,0 +1,99 @@ +# Copyright (c) 2012 GENIVI Alliance +# Copyright (c) 2012 BMW +# +# author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 +# +# 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. +# +# For further information see http://www.genivi.org/. +# + +cmake_minimum_required(VERSION 2.6) +include(CMakeDependentOption) + +PROJECT(PluginCommandInterfaceCAPI) + +OPTION (WITH_COMMAND_INTERFACE_COMMON_CAPI + "build with commandinterface common-api plugin" ON ) + +IF (WITH_COMMAND_INTERFACE_COMMON_CAPI AND WITH_CAPI_WRAPPER) + +set(LIBRARY_OUTPUT_PATH ${PLUGINS_OUTPUT_PATH}/command) + +set(DOC_OUTPUT_PATH ${DOC_OUTPUT_PATH}/CommandCAPIPlugin) +set(INCLUDE_FOLDER "include") +message(STATUS "prefix ${CMAKE_INSTALL_PREFIX}") +SET(SHARED_FOLDER "${CMAKE_INSTALL_PREFIX}/share") + +FILE(READ "${AUDIO_INCLUDE_FOLDER}/command/IAmCommandSend.h" VERSION_BUFFER LIMIT 6000) +STRING(REGEX MATCH "CommandSendVersion*.[^0-9]*[0-9].[0-9]*[0-9]" LIB_INTERFACE_VERSION_STRING ${VERSION_BUFFER}) +STRING(REGEX REPLACE "CommandSendVersion*.." "" LIB_INTERFACE_VERSION ${LIB_INTERFACE_VERSION_STRING}) +MESSAGE(STATUS "Building against command interface version ${LIB_INTERFACE_VERSION}") + +INSERT_DBUS_CONF_IF_NEEDED("@COMMAND_INTERFACE_DBUS_CONF@" + "${CMAKE_CURRENT_SOURCE_DIR}/fidl/PluginCommandInterfaceCAPI_dbus.conf" + COMMAND_INTERFACE_DBUS_CONF) +set(COMMAND_INTERFACE_DBUS_CONF ${COMMAND_INTERFACE_DBUS_CONF} PARENT_SCOPE) + +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/configCommandCAPI.h ) + +FIND_PACKAGE(CommonAPI REQUIRED) +FIND_PACKAGE(CommonAPI_DBus REQUIRED) + +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${AUDIO_INCLUDE_FOLDER} + ${PROJECT_INCLUDE_FOLDER} + ${DLT_INCLUDE_DIRS} + ${COMMON_API_INCLUDE_DIRS} + ${COMMON_API_DBUS_INCLUDE_DIRS} + ${COMMON_API_GEN_INCLUDE_DIR} + ${INCLUDE_FOLDER} +) + +# all source files go here +file(GLOB PLUGINCAPI_SRCS_CXX "src/*.cpp" ${COMMON_API_GEN_SOURCES}) + +add_library(PluginCommandInterfaceCAPI MODULE ${PLUGINCAPI_SRCS_CXX}) + +SET_TARGET_PROPERTIES(PluginCommandInterfaceCAPI PROPERTIES + SOVERSION "${LIB_INTERFACE_VERSION}" +) + +TARGET_LINK_LIBRARIES(PluginCommandInterfaceCAPI + ${DLT_LIBRARIES} + ${COMMON_API_LIBRARIES} + ${COMMON_API_DBUS_LIBRARIES} +) + +IF(WITH_TESTS) + add_subdirectory (test) +ENDIF(WITH_TESTS) + +#IF(WITH_DOCUMENTATION) +# file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH}) +# configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE) +# add_custom_target (PluginInterfaceDBusDocs ALL +# COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH} +# SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile +# ) +#ENDIF(WITH_DOCUMENTATION) + +INSTALL(TARGETS PluginCommandInterfaceCAPI + DESTINATION "lib/${LIB_INSTALL_SUFFIX}/command" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ + COMPONENT sampleplugins +) + +SET(ADD_DEPEND "audiomanager-bin" "dlt") +set_property(GLOBAL APPEND PROPERTY sampleplugins_prop "${ADD_DEPEND}") + +ENDIF (WITH_COMMAND_INTERFACE_COMMON_CAPI AND WITH_CAPI_WRAPPER) diff --git a/PluginCommandInterfaceCAPI/cmake/config.cmake b/PluginCommandInterfaceCAPI/cmake/config.cmake new file mode 100644 index 0000000..8bd2faa --- /dev/null +++ b/PluginCommandInterfaceCAPI/cmake/config.cmake @@ -0,0 +1,4 @@ +#ifndef _COMMANDCAPI_CONFIG_H +#define _COMMANDCAPI_CONFIG_H + +#endif /* _COMMANDCAPI_CONFIG_H */ diff --git a/PluginCommandInterfaceCAPI/fidl/CommandInterface.fdepl b/PluginCommandInterfaceCAPI/fidl/CommandInterface.fdepl new file mode 100644 index 0000000..b500f07 --- /dev/null +++ b/PluginCommandInterfaceCAPI/fidl/CommandInterface.fdepl @@ -0,0 +1,6 @@ +import "CommandInterface.fidl" +import "platform:/plugin/org.genivi.commonapi.dbus/deployment/deployment.fdepl" + +define org.genivi.commonapi.dbus.deployment.deployment for interface org.genivi.am.CommandInterface { + DefaultEnumBackingType=Int16 +} \ No newline at end of file diff --git a/PluginCommandInterfaceCAPI/fidl/CommandInterface.fidl b/PluginCommandInterfaceCAPI/fidl/CommandInterface.fidl new file mode 100755 index 0000000..8f1a220 --- /dev/null +++ b/PluginCommandInterfaceCAPI/fidl/CommandInterface.fidl @@ -0,0 +1,723 @@ +package org.genivi.audiomanager + +import org.genivi.audiomanager.am.* from "amTypes.fidl" + +<** + @author : J�rgen Gehring + + @description : CommandInterface AudioManager. + + @details : Source D-Bus specification org.genivi.audiomanager.CommandInterface + +**> + +interface CommandInterface { + version { + major 0 + minor 1 + } + method Connect { + in { + am_sourceID_t sourceID + am_sinkID_t sinkID + } + out { + am_Error_e result + am_mainConnectionID_t mainConnectionID + } + } + method Disconnect { + in { + am_mainConnectionID_t mainConnectionID + } + out { + am_Error_e result + } + } + method SetVolume { + in { + am_sinkID_t sinkID + am_mainVolume_t volume + } + out { + am_Error_e result + } + } + method VolumeStep { + in { + am_sinkID_t sinkID + am_mainVolume_t volumeStep + } + out { + am_Error_e result + } + } + method SetSinkMuteState { + in { + am_sinkID_t sinkID + am_MuteState_e muteState + } + out { + am_Error_e result + } + } + method SetMainSinkSoundProperty { + in { + am_sinkID_t sinkID + am_MainSoundProperty_s soundProperty + } + out { + am_Error_e result + } + } + method SetMainSourceSoundProperty { + in { + am_sourceID_t sourceID + am_MainSoundProperty_s soundProperty + } + out { + am_Error_e result + } + } + method SetSystemProperty { + in { + am_SystemProperty_s soundProperty + } + out { + am_Error_e result + } + } + method GetListMainConnections { + out { + am_Error_e result + am_MainConnectionType_l listConnections + } + } + method GetListMainSinks { + out { + am_Error_e result + am_SinkType_l listMainSinks + } + } + method GetListMainSources { + out { + am_Error_e result + am_SourceType_l listMainSources + } + } + method GetListMainSinkSoundProperties { + in { + am_sinkID_t sinkID + } + out { + am_Error_e result + am_MainSoundProperty_l listSoundProperties + } + } + method GetListMainSourceSoundProperties { + in { + am_sourceID_t sourceID + } + out { + am_Error_e result + am_MainSoundProperty_l listSourceProperties + } + } + method GetListSourceClasses { + out { + am_Error_e result + am_SourceClass_l listSourceClasses + } + } + method GetListSinkClasses { + out { + am_Error_e result + am_SinkClass_l listSinkClasses + } + } + method GetListSystemProperties { + out { + am_Error_e result + am_SystemProperty_l listSystemProperties + } + } + method GetTimingInformation { + in { + am_mainConnectionID_t mainConnectionID + } + out { + am_Error_e result + am_timeSync_t delay + } + } + broadcast NumberOfMainConnectionsChanged { + } + broadcast MainConnectionStateChanged { + out { + am_mainConnectionID_t connectionID + am_ConnectionState_e connectionState + } + } + broadcast NumberOfSourceClassesChanged { + } + broadcast SourceAdded { + out { + am_SourceType_s newSource + } + } + broadcast SourceRemoved { + out { + am_sourceID_t removedSourceID + } + } + broadcast MainSourceSoundPropertyChanged { + out { + am_sourceID_t sourceID + am_MainSoundProperty_s SoundProperty + } + } + broadcast SourceAvailabilityChanged { + out { + am_sourceID_t sourceID + am_Availability_s availability + } + } + broadcast NumberOfSinkClassesChanged { + } + broadcast SinkAdded { + out { + am_SinkType_s newSink + } + } + broadcast SinkRemoved { + out { + am_sinkID_t removedSinkID + } + } + broadcast MainSinkSoundPropertyChanged { + out { + am_sinkID_t sinkID + am_MainSoundProperty_s SoundProperty + } + } + broadcast SinkAvailabilityChanged { + out { + am_sinkID_t sinkID + am_Availability_s availability + } + } + broadcast VolumeChanged { + out { + am_sinkID_t sinkID + am_mainVolume_t volume + } + } + broadcast SinkMuteStateChanged { + out { + am_sinkID_t sinkID + am_MuteState_e muteState + } + } + broadcast SystemPropertyChanged { + out { + am_SystemProperty_s SystemProperty + } + } + broadcast TimingInformationChanged { + out { + am_mainConnectionID_t mainConnection + am_timeSync_t time + } + } + + broadcast SinkUpdated{ + out{ + am_sinkID_t sinkID + am_sinkClass_t sinkClassID + am_MainSoundProperty_l listMainSoundProperties + } + } + + broadcast SourceUpdated{ + out{ + am_sourceID_t sourceID + am_sourceClass_t sourceClassID + am_MainSoundProperty_l listMainSoundProperties + } + } + + broadcast SinkNotification{ + out{ + am_sinkID_t sinkID + am_NotificationPayload_s notification + } + } + + broadcast SourceNotification{ + out{ + am_sourceID_t sourceID + am_NotificationPayload_s notification + } + } + + broadcast MainSinkNotificationConfigurationChanged{ + out{ + am_sinkID_t sinkID + am_NotificationConfiguration_s mainNotificationConfiguration + } + } + + broadcast MainSourceNotificationConfigurationChanged{ + out{ + am_sourceID_t sourceID + am_NotificationConfiguration_s mainNotificationConfiguration + } + } + + typedef am_sourceID_t is UInt16 + + typedef am_sinkID_t is UInt16 + + typedef am_mainConnectionID_t is UInt16 + + typedef am_timeSync_t is Int16 + + typedef am_mainVolume_t is Int16 + + typedef am_sourceClass_t is UInt16 + + typedef am_sinkClass_t is UInt16 + + <** + @description : The errors of the audiomanager. All possible errors are in here. This enum is used widely as return parameter. + **> + enumeration am_Error_e { + + //E_UNKNOWN = "0x00" + + <** + @description : no error - positive reply + **> + E_OK = "0x00" + + <** + @description : value out of range + **> + E_OUT_OF_RANGE = "0x01" + + <** + @description : not used + **> + E_NOT_USED = "0x02" + + <** + @description : a database error occurred + **> + E_DATABASE_ERROR = "0x03" + + <** + @description : the desired object already exists + **> + E_ALREADY_EXISTS = "0x04" + + <** + @description : there is no change + **> + E_NO_CHANGE = "0x05" + + <** + @description : the desired action is not possible + **> + E_NOT_POSSIBLE = "0x06" + + <** + @description : the desired object is non existent + **> + E_NON_EXISTENT = "0x07" + + <** + @description : the asynchronous action was aborted + **> + E_ABORTED = "0x08" + + <** + @description : This error is returned in case a connect is issued with a connectionFormat + that cannot be selected for the connection. This could be either due to the capabilities of + a source or a sink or gateway compatibilities for example + **> + E_WRONG_FORMAT = "0x09" + E_MAX = "0xA" + } + + enumeration am_MuteState_e { + + <** + @description : default + **> + MS_UNKNOWN = "0x00" + + <** + @description : the source / sink is muted + **> + MS_MUTED = "0x01" + + <** + @description : the source / sink is unmuted + **> + MS_UNMUTED = "0x02" + MS_MAX = "0x03" + } + + enumeration am_MainSoundPropertyType_e { + + <** + @description : default + **> + MSP_UNKNOWN = "0x00" + + <** + @description : example value between -10 and +10 + **> + MSP_EXAMPLE_TREBLE = "0x01" + + <** + @description : example value between -10 and +10 + **> + MSP_EXAMPLE_MID = "0x02" + + <** + @description : example value between -10 and +10 + **> + MSP_EXAMPLE_BASS = "0x03" + MSP_SOURCE_TYPE = "0x04" + MSP_MAX = "0x05" + } + + enumeration am_SystemPropertyType_e { + + <** + @description : default + **> + SYP_UNKNOWN = "0x00" + SYP_MAX = "0x01" + } + + enumeration am_ConnectionState_e { + CS_UNKNOWN = "0x00" + + <** + @description : This means the connection is just building up + **> + CS_CONNECTING = "0x01" + + <** + @description : the connection is ready to be used + **> + CS_CONNECTED = "0x02" + + <** + @description : the connection is in the course to be knocked down + **> + CS_DISCONNECTING = "0x03" + + <** + @description : only relevant for connectionStatechanged. Is send after the connection was removed + **> + CS_DISCONNECTED = "0x04" + + <** + @description : this means the connection is still build up but unused at the moment + **> + CS_SUSPENDED = "0x05" + CS_MAX = "0x06" + } + + enumeration am_Availablility_e { + + <** + @description : default + **> + A_UNKNOWN = "0x00" + + <** + @description : The source / sink is available + **> + A_AVAILABLE = "0x01" + + <** + @description : the source / sink is not available + **> + A_UNAVAILABLE = "0x02" + A_MAX = "0x03" + } + + enumeration am_AvailabilityReason_e { + + <** + @description : default + **> + AR_UNKNOWN = "0x00" + + <** + @description : the availability changed because an new media was entered. + **> + AR_GENIVI_NEWMEDIA = "0x01" + + <** + @description : the availability changed because the same media was entered. + **> + AR_GENIVI_SAMEMEDIA = "0x02" + + <** + @description : the availability changed because there is no media. + **> + AR_GENIVI_NOMEDIA = "0x03" + + <** + @description : the availability changed because of a temperature event. + **> + AR_GENIVI_TEMPERATURE = "0x04" + + <** + @description : the availability changed because of a voltage event. + **> + AR_GENIVI_VOLTAGE = "0x05" + + <** + @description : the availability changed because of fatal errors reading or accessing media. + **> + AR_GENIVI_ERRORMEDIA = "0x06" + AR_MAX = "0x07" + } + + enumeration am_ClassProperty_e { + + <** + @description : default + **> + CP_UNKNOWN = "0x00" + + <** + @description : defines the source type of a source. Project specific, could be for example differentiation between interrupt source and main source. + **> + CP_GENIVI_SOURCE_TYPE = "0x01" + /** + * defines the SINK_TYPE. Project specific + */ + <** + @description : defines the SINK_TYPE. Project specific. + **> + CP_GENIVI_SINK_TYPE = "0x02" + CP_MAX = "0x03" + } + + enumeration am_InterruptState_e + { + /** + * default + */ + IS_UNKNOWN = "0x00" + /** + * the interrupt state is off - no interrupt + */ + IS_OFF = "0x01" + /** + * the interrupt state is interrupted - the interrupt is active + */ + IS_INTERRUPTED = "0x02" + IS_MAX = "0x03" + } + + struct am_MainSoundProperty_s { + + <** + @description : the type of the property + **> + am_MainSoundPropertyType_e type + + <** + @description : the actual value + **> + Int16 value + } array am_MainSoundProperty_l of am_MainSoundProperty_s + + struct am_SystemProperty_s { + + <** + @description : the type that is set + **> + am_SystemPropertyType_e type + + <** + @description : the actual value + **> + Int16 value + } + + array am_SystemProperty_l of am_SystemProperty_s + + struct am_MainConnectionType_s { + + <** + @description : the ID of the mainconnection + **> + am_mainConnectionID_t mainConnectionID + + <** + @description : the sourceID where the connection starts + **> + am_sourceID_t sourceID + + <** + @description : the sinkID where the connection ends + **> + am_sinkID_t sinkID + + <** + @description : the delay of the mainconnection + **> + am_timeSync_t delay + + <** + @description : the current connection state + **> + am_ConnectionState_e connectionState + } + + array am_MainConnectionType_l of am_MainConnectionType_s + + struct am_Availability_s { + + <** + @description : the current availability state. + **> + am_Availablility_e availability + + <** + @description : the reason for the last change. This can be used to trigger events that deal with state changes. + **> + am_AvailabilityReason_e availabilityReason + } + + struct am_SourceType_s { + + <** + @description : his is the ID of the source, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID). + **> + am_sourceID_t sourceID + + <** + @description : The name of the source. Must be unique in the whole system. + **> + String name + + <** + @description : the availability of the source + **> + am_Availability_s availability + + <** + @description : the sourceClassID, indicates the class the source is in. This information can be used by the Controller to implement different behaviour for different classes. + **> + am_sourceClass_t sourceClassID + } + + array am_SourceType_l of am_SourceType_s + + struct am_SinkType_s { + + <** + @description : This is the ID of the sink, it is unique in the system. There are 2 ways, ID can be created: either it is assigned during the registration process (in a dynamic context, uniqueness will be ensured by the AudioManagerDaemon), or it is a fixed (the project has to ensure the uniqueness of the ID). + **> + am_sinkID_t sinkID + + <** + @description : The name of the sink. Must be unique in the whole system. + **> + String name + + <** + @description : + This attribute reflects the availability of the sink. There are several reasons why a sink could be not available for the moment: for example the shutdown of a sink because of overtemperature or over- & undervoltage. The availability consists of two pieces of information: + Availablility: the status itself, can be A_AVAILABLE, A_UNAVAILABLE or A_UNKNOWN + AvailabilityReason: this informs about the last reason for a change in availability. The reasons itself are product specific. + + **> + am_Availability_s availability + + <** + @description : This is the representation of the Volume for the commandInterface. It is used by the HMI to set the volume of a sink, the AudioManagerController has to transform this into real source and sink volumes. + **> + am_mainVolume_t volume + am_MuteState_e muteState + + <** + @description : the sinkClassID references to a sinkClass. With the help of classification, rules can be setup to define the system behaviour. + **> + am_sinkClass_t sinkClassID + } + + array am_SinkType_l of am_SinkType_s + + struct am_ClassProperty_s { + + <** + @description : he property as enum. + **> + am_ClassProperty_e classProperty + Int16 value + } + + array am_ClassProperty_l of am_ClassProperty_s + + struct am_SourceClass_s { + + <** + @description : the source ID. + **> + am_sourceClass_t sourceClassID + + <** + @description : the name of the sourceClass - must be unique in the system. + **> + String name + + <** + @description : the list of the class properties. These are pairs of a project specific enum describing the type of the value and an integer holding the real value. + **> + am_ClassProperty_l listClassProperties + } + + array am_SourceClass_l of am_SourceClass_s + + struct am_SinkClass_s { + + <** + @description : the ID of the sinkClass. + **> + am_sinkClass_t sinkClassID + + <** + @description : the name of the sinkClass - must be unique in the system. + **> + String name + + <** + @description : the list of the class properties. These are pairs of a project specific enum describing the type of the value and an integer holding the real value. + **> + am_ClassProperty_l listClassProperties + } + + array am_SinkClass_l of am_SinkClass_s + + struct am_NotificationPayload_s + { + am_NotificationType_e type + <** + @description : This is finally the value of the notification. It's meaning depends on the notificationType + **> + Int16 value + + } + +} diff --git a/PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf b/PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf new file mode 100644 index 0000000..b3ae199 --- /dev/null +++ b/PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf @@ -0,0 +1,8 @@ +######################################## Command interface configuration ######################################### +# PluginCommandInterfaceCAPI_dbus.conf # +# If you change something make sure you re-configure with 'ccmake..' which generates the *_dbus.conf file again. # +################################################################################################################## +[local:org.genivi.audiomanger.commandinterface:org.genivi.audiomanger] +dbus_connection=org.genivi.audiomanager +dbus_object=/org/genivi/audiomanager/commandinterface +dbus_interface=org.genivi.audiomanager.commandinterface \ No newline at end of file diff --git a/PluginCommandInterfaceCAPI/fidl/amTypes.fidl b/PluginCommandInterfaceCAPI/fidl/amTypes.fidl new file mode 100755 index 0000000..6f11698 --- /dev/null +++ b/PluginCommandInterfaceCAPI/fidl/amTypes.fidl @@ -0,0 +1,329 @@ +package org.genivi.audiomanager + +typeCollection am +{ + typedef am_sourceID_t is UInt16 + typedef am_sinkID_t is UInt16 + typedef am_gatewayID_t is UInt16 + typedef gongHandle is Int16 + typedef am_sourceClass_t is UInt16 + typedef am_sinkClass_t is UInt16 + typedef am_volume_t is Int16 + typedef am_mainVolume_t is Int16 + typedef am_handle_t is UInt16 + typedef am_time_t is UInt16 + + enumeration gp_indicatorDirection_e + { + INDICATOR_RIGHT ="0x00" + INDICATOR_LEFT="0x01" + INDICATOR_WARNING="0x02" + } + + enumeration am_RampType_e + { + RAMP_UNKNOWN = "0x00" + RAMP_GENIVI_DIRECT = "0x01" + RAMP_GENIVI_NO_PLOP = "0x02" + RAMP_GENIVI_EXP_INV = "0x03" + RAMP_GENIVI_LINEAR = "0x04" + RAMP_GENIVI_EXP = "0x05" + RAMP_MAX = "0x06" + } + + enumeration am_MuteState_e + { + MS_UNKNOWN = "0x00" + MS_MUTED = "0x01" + MS_UNMUTED = "0x02" + MS_MAX = "0x03" + } + + enumeration am_SourceState_e + { + SS_UNKNNOWN = "0x00" + SS_ON = "0x01" + SS_OFF = "0x02" + SS_PAUSED = "0x03" + SS_MAX = "0x04" + } + enumeration am_Error_e + { + E_OK = "0x00" + E_UNKNOWN = "0x01" + E_OUT_OF_RANGE = "0x02" + E_NOT_USED = "0x03" + E_DATABASE_ERROR = "0x04" + E_ALREADY_EXISTS = "0x05" + E_NO_CHANGE = "0x06" + E_NOT_POSSIBLE = "0x07" + E_NON_EXISTENT = "0x08" + E_ABORTED = "0x09" + E_WRONG_FORMAT = "0xA" + E_MAX = "0xB" + } + + enumeration am_DomainState_e + { + + DS_UNKNOWN = "0" + DS_CONTROLLED = "1" + DS_INDEPENDENT_STARTUP = "2" + DS_INDEPENDENT_RUNDOWN = "3" + DS_MAX = "4" + } + + enumeration gongType_e + { + AT_NUN = "0x01" + AT_POC = "0x02" + AT_QUE = "0x03" + AT_IWA = "0x04" + AT_WA = "0x05" + AT_ETC_F = "0x06" + AT_ETC_F2 = "0x07" + AT_ETC_ST = "0x08" + AT_ETC_S = "0x09" + AT_REV = "0x0A" + AT_ESU = "0x0B" + AT_ESD = "0x0C" + AT_DG = "0x0D" + AT_SG = "0x0E" + AT_IDG = "0x0F" + AT_ION = "0x10" + AT_IOFF = "0x11" + AT_FBS = "0x12" + AT_VFS = "0x13" + AT_GES = "0x14" + AT_UEE = "0x15" + } + + enumeration gp_indicatorStatus_e + { + IS_ON = "0x00" + IS_OFF = "0x01" + } + + enumeration gongStatus_e + { + NOT_PLAYING = "0x00" + PLAYING = "0x01" + INTERRUPTED = "0x02" + } + + enumeration gongError_e + { + SUCCESS = "0x00" + ERROR = "0x01" + LOW_PRIORITY = "0x02" + } + + enumeration gongClass_e + { + GONGCLASS_1 = "0x01" + GONGCLASS_2 = "0x02" + GONGCLASS_PDC = "0x03" + GONGCLASS_TURN = "0x04" + GONGCLASS_OBSTACLE = "0x05" + } + + enumeration sampleSet_e + { + setBMW = "0x00" + setMini = "0x01" + setRR = "0x02" + } + + enumeration am_Availability_e + { + A_UNKNOWN = "0x00" + A_AVAILABLE = "0x01" + A_UNAVAILABLE = "0x02" + A_MAX = "0x03" + } + enumeration am_AvailabilityReason_e + { + AR_UNKNOWN = "0x00" + AR_GENIVI_NEWMEDIA = "0x01" + AR_GENIVI_SAMEMEDIA = "0x02" + AR_GENIVI_NOMEDIA = "0x03" + AR_GENIVI_TEMPERATURE = "0x04" + AR_GENIVI_VOLTAGE = "0x05" + AR_GENIVI_ERRORMEDIA = "0x06" + AR_MAX = "0x07" + } + + enumeration am_InterruptState_e + { + IS_UNKNOWN = "0x00" + IS_OFF = "0x01" + IS_INTERRUPTED = "0x02" + IS_MAX = "0x03" + } + + enumeration am_SoundPropertyType_e + { + SP_UNKNOWN = "0x00" + SP_EXAMPLE_TREBLE = "0x01" + SP_EXAMPLE_MID = "0x02" + SP_EXAMPLE_BASS = "0x03" + SP_ENTER_SINKID = "0x04" + SP_INTERR_SUPERSEEDINGID = "0x05" + SP_INTERR_OVERLAYID = "0x06" + SP_PRIORITY = "0x07" + SP_MAX = "0x08" + } + + enumeration am_ConnectionFormat_e + { + CF_UNKNOWN = "0x00" + CF_GENIVI_MONO = "0x01" + CF_GENIVI_STEREO = "0x02" + CF_GENIVI_ANALOG = "0x03" + CF_GENIVI_AUTO = "0x04" + CF_MAX = "0x05" + } + array am_ConnectionFormat_L of am_ConnectionFormat_e + + enumeration am_MainSoundPropertyType_e + { + MSP_UNKNOWN = "0x00" + MSP_EXAMPLE_TREBLE = "0x01" + MSP_EXAMPLE_MID = "0x02" + MSP_EXAMPLE_BASS = "0x03" + MSP_SOURCE_TYPE = "0x04" + MSP_MAX = "0x05" + } + + enumeration am_NotificationType_e + { + NT_UNKNOWN = "0x00" + NT_LOUDNESS = "0x01" + NT_MAX = "0x02" + } + + enumeration am_NotificationStatus_e + { + NS_UNKNOWN = "0x00" + NS_OFF = "0x01" + NS_PERIODIC = "0x02" + NS_MINIMUM = "0x03" + NS_MAXIMUM = "0x04" + NS_CHANGE = "0x05" + NS_MAX = "0x06" + } + + struct distanceInformation_s + { + Int32 FrontLeft + Int32 FrontRight + Int32 RearLeft + Int32 RearRight + } + + struct sampleNames_s + { + sampleSet_e sample + String sampleName + } array listSampleNamesL of sampleNames_s + + typedef am_domainID_t is UInt16 + + struct am_Domain_s + { + am_domainID_t domainID + String name + String busname + String nodename + Boolean early + Boolean complete + am_DomainState_e ^state + } + + struct notificationPayload_s + { + Int16 type + Int16 payload + } + + struct am_Availability_s + { + am_Availability_e availability + am_AvailabilityReason_e availabilityReason + } + + struct am_SoundProperty_s + { + am_SoundPropertyType_e type + Int16 value + } + array am_SoundProperty_L of am_SoundProperty_s + + struct am_MainSoundProperty_s + { + am_MainSoundPropertyType_e type + Int16 value + } + array am_MainSoundProperty_L of am_MainSoundProperty_s + + struct am_NotificationConfiguration_s + { + am_NotificationType_e type + am_NotificationStatus_e status + Int16 parameter + } + array am_NotificationConfiguration_L of am_NotificationConfiguration_s + + + array bool_L of Boolean + + struct sourceData_s + { + am_sourceID_t sourceID + am_domainID_t domainID + String name + am_sourceClass_t sourceClassID + am_SourceState_e sourceState + am_volume_t volume + Boolean visible + am_Availability_s available + am_InterruptState_e interruptState + am_SoundProperty_L listSoundProperties + am_ConnectionFormat_L listConnectionFormats + am_MainSoundProperty_L listMainSoundProperties + am_NotificationConfiguration_L listMainNotificationConfigurations + am_NotificationConfiguration_L listNotificationConfigurations + } + + struct sinkData_s + { + am_sinkID_t sinkID + String name + am_domainID_t domainID + am_sinkClass_t sinkClassID + am_volume_t volume + Boolean visible + am_Availability_s available + am_MuteState_e muteState + am_mainVolume_t mainVolume + am_SoundProperty_L listSoundProperties + am_ConnectionFormat_L listConnectionFormats + am_MainSoundProperty_L listMainSoundProperties + am_NotificationConfiguration_L listMainNotificationConfigurations + am_NotificationConfiguration_L listNotificationConfigurations + } + + struct am_Gateway_s + { + am_gatewayID_t gatewayID + String name + am_sinkID_t sinkID + am_sourceID_t sourceID + am_domainID_t domainSinkID + am_domainID_t domainSourceID + am_domainID_t controlDomainID + am_ConnectionFormat_L listSourceFormats + am_ConnectionFormat_L listSinkFormats + bool_L convertionMatrix + } +} \ No newline at end of file diff --git a/PluginCommandInterfaceCAPI/include/CAmCommandSenderCAPI.h b/PluginCommandInterfaceCAPI/include/CAmCommandSenderCAPI.h new file mode 100644 index 0000000..9427823 --- /dev/null +++ b/PluginCommandInterfaceCAPI/include/CAmCommandSenderCAPI.h @@ -0,0 +1,120 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#ifndef CAPICOMMANDSENDER_H_ +#define CAPICOMMANDSENDER_H_ + +#include +#include "shared/CAmCommonAPIWrapper.h" +#include "command/IAmCommandSend.h" +#include "command/IAmCommandReceive.h" +#include "CAmCommandSenderService.h" + + + +namespace am +{ +using namespace CommonAPI; +using namespace org::genivi::audiomanager; + + +/** + * Common-api implementation of CommandSendInterface. + * This class publish a service + */ +class CAmCommandSenderCAPI: public IAmCommandSend +{ + CAmCommandSenderCAPI(); +public: + CAmCommandSenderCAPI(CAmCommonAPIWrapper *aWrapper); + virtual ~CAmCommandSenderCAPI(); + am_Error_e startService(IAmCommandReceive* commandreceiveinterface); + am_Error_e startupInterface(IAmCommandReceive* commandreceiveinterface); + am_Error_e tearDownInterface(IAmCommandReceive* commandreceiveinterface = NULL); + void setCommandReady(const uint16_t handle); + void setCommandRundown(const uint16_t handle); + void cbNewMainConnection(const am_MainConnectionType_s& mainConnection); + void cbRemovedMainConnection(const am_mainConnectionID_t mainConnection); + void cbNewSink(const am_SinkType_s& sink); + void cbRemovedSink(const am_sinkID_t sinkID); + void cbNewSource(const am_SourceType_s& source); + void cbRemovedSource(const am_sourceID_t source); + void cbNumberOfSinkClassesChanged(); + void cbNumberOfSourceClassesChanged(); + void cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState); + void cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s& soundProperty); + void cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s& soundProperty); + void cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s& availability); + void cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s& availability); + void cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume); + void cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState); + void cbSystemPropertyChanged(const am_SystemProperty_s& systemProperty); + void cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time); + void getInterfaceVersion(std::string& version) const; + void cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector& listMainSoundProperties); + void cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector& listMainSoundProperties); + void cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s& notification) ; + void cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s& notification) ; + void cbMainSinkNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration) ; + void cbMainSourceNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration) ; + + static const char * COMMAND_SENDER_SERVICE; + +private: + std::shared_ptr mService; + CAmCommonAPIWrapper* mpCAmCAPIWrapper; ///< ! pointer to dbus wrapper + IAmCommandReceive* mpIAmCommandReceive; ///< ! pointer to commandReceive Interface + bool mReady; ///< ! if false, calls shall be ignored. + bool mIsServiceStarted; + + /** + * list of sinks, needed to send out only deltas + */ + std::vector mlistSinks; + + /** + * list of sources, needed to send out only deltas + */ + std::vector mlistSources; + + /** + * used as comparison function for am_SinkType_s + */ + struct sortBySinkID + { + bool operator()(const am_SinkType_s & a, const am_SinkType_s & b) + { + return (a.sinkID < b.sinkID); + } + }; + + /** + * used as comparison function for am_SourceType_s + */ + struct sortBySourceID + { + bool operator()(const am_SourceType_s & a, const am_SourceType_s & b) + { + return (a.sourceID < b.sourceID); + } + }; + +}; + +} + +#endif /* CAPICOMMANDSENDER_H_ */ diff --git a/PluginCommandInterfaceCAPI/include/CAmCommandSenderCommon.h b/PluginCommandInterfaceCAPI/include/CAmCommandSenderCommon.h new file mode 100644 index 0000000..4301dd7 --- /dev/null +++ b/PluginCommandInterfaceCAPI/include/CAmCommandSenderCommon.h @@ -0,0 +1,61 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#ifndef CAMCOMMANDSENDERCOMMON_H_ +#define CAMCOMMANDSENDERCOMMON_H_ + +#include +#include "audiomanagertypes.h" +#include + +using namespace am; +using namespace org::genivi::audiomanager; + +/** + * The following functions convert the basics AudiomManager types from/to CommonAPI types. + */ + +extern void CAmConvertAvailablility(const am_Availability_s & , CommandInterface::am_Availability_s & ); +extern void CAmConvertMainSoundProperty(const am_MainSoundProperty_s & , CommandInterface::am_MainSoundProperty_s & ); +extern void CAmConvertSystemProperty(const am_SystemProperty_s &, CommandInterface::am_SystemProperty_s &); + +extern CommandInterface::am_ClassProperty_e CAmConvert2CAPIType(const am_ClassProperty_e & property); +extern CommandInterface::am_SystemPropertyType_e CAmConvert2CAPIType(const am_SystemPropertyType_e &); +extern CommandInterface::am_Availablility_e CAmConvert2CAPIType(const am_Availability_e & ); +extern CommandInterface::am_AvailabilityReason_e CAmConvert2CAPIType(const am_AvailabilityReason_e & ); + +extern CommandInterface::am_MuteState_e CAmConvert2CAPIType(const am_MuteState_e &); +extern am_MuteState_e CAmConvertFromCAPIType(const CommandInterface::am_MuteState_e &); + +extern CommandInterface::am_MainSoundPropertyType_e CAmConvert2CAPIType(const am_MainSoundPropertyType_e &); +extern am_MainSoundPropertyType_e CAmConvertFromCAPIType(const CommandInterface::am_MainSoundPropertyType_e &); + +extern CommandInterface::am_ConnectionState_e CAmConvert2CAPIType(const am_ConnectionState_e &); +extern am_ConnectionState_e CAmConvertFromCAPIType(const CommandInterface::am_ConnectionState_e &); + +extern org::genivi::audiomanager::am::am_NotificationType_e CAmConvert2CAPIType(const am_NotificationType_e &); +extern am_NotificationType_e CAmConvertFromCAPIType(const org::genivi::audiomanager::am::am_NotificationType_e &); + +extern org::genivi::audiomanager::am::am_NotificationStatus_e CAmConvert2CAPIType(const am_NotificationStatus_e &); +extern am_NotificationStatus_e CAmConvertFromCAPIType(const org::genivi::audiomanager::am::am_NotificationStatus_e &); + +extern CommandInterface::am_Error_e CAmConvert2CAPIType(const am_Error_e &); +extern am_Error_e CAmConvertFromCAPIType(const CommandInterface::am_Error_e & error); + +extern am_SystemPropertyType_e CAmConvertFromCAPIType(const CommandInterface::am_SystemPropertyType_e &); + +#endif /* CAMCOMMANDSENDERCOMMON_H_ */ diff --git a/PluginCommandInterfaceCAPI/include/CAmCommandSenderService.h b/PluginCommandInterfaceCAPI/include/CAmCommandSenderService.h new file mode 100644 index 0000000..cac6162 --- /dev/null +++ b/PluginCommandInterfaceCAPI/include/CAmCommandSenderService.h @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#ifndef CAMCOMMANDSENDERSERVICE_H_ +#define CAMCOMMANDSENDERSERVICE_H_ + +#include +#include "../../include/command/IAmCommandReceive.h" + +namespace am { + +using namespace org::genivi::audiomanager; + +/** + * A concrete stub implementation used by the command sender plug-in. + */ +class CAmCommandSenderService: public CommandInterfaceStubDefault { + IAmCommandReceive* mpIAmCommandReceive; +public: + CAmCommandSenderService(); + CAmCommandSenderService(IAmCommandReceive *aReceiver); + virtual ~CAmCommandSenderService(); + + virtual void Connect(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID); + + virtual void Disconnect(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result); + + virtual void SetVolume(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volume, CommandInterface::am_Error_e& result); + + virtual void VolumeStep(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volumeStep, CommandInterface::am_Error_e& result); + + virtual void SetSinkMuteState(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MuteState_e muteState, CommandInterface::am_Error_e& result); + + virtual void SetMainSinkSoundProperty(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result); + + virtual void SetMainSourceSoundProperty(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result); + + virtual void SetSystemProperty(CommandInterface::am_SystemProperty_s soundProperty, CommandInterface::am_Error_e& result); + + virtual void GetListMainConnections(CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections); + + virtual void GetListMainSinks(CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks); + + virtual void GetListMainSources(CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources); + + virtual void GetListMainSinkSoundProperties(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties); + + virtual void GetListMainSourceSoundProperties(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties); + + virtual void GetListSourceClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses); + + virtual void GetListSinkClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses); + + virtual void GetListSystemProperties(CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties); + + virtual void GetTimingInformation(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay); +}; + +} /* namespace am */ +#endif /* CAMCOMMANDSENDERSERVICE_H_ */ diff --git a/PluginCommandInterfaceCAPI/include/configCommandCAPI.h b/PluginCommandInterfaceCAPI/include/configCommandCAPI.h new file mode 100644 index 0000000..8bd2faa --- /dev/null +++ b/PluginCommandInterfaceCAPI/include/configCommandCAPI.h @@ -0,0 +1,4 @@ +#ifndef _COMMANDCAPI_CONFIG_H +#define _COMMANDCAPI_CONFIG_H + +#endif /* _COMMANDCAPI_CONFIG_H */ diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.cpp b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.cpp new file mode 100644 index 0000000..d0e10bd --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.cpp @@ -0,0 +1,332 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#include "CommandInterface.h" + +namespace org { +namespace genivi { +namespace audiomanager { + +CommandInterface::am_MainSoundProperty_s::am_MainSoundProperty_s(const am_MainSoundPropertyType_e& typeValue, const int16_t& valueValue): + type(typeValue), + value(valueValue) +{ +} + + +bool operator==(const CommandInterface::am_MainSoundProperty_s& lhs, const CommandInterface::am_MainSoundProperty_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.type == rhs.type && + lhs.value == rhs.value + ; +} + +void CommandInterface::am_MainSoundProperty_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> type; + inputStream >> value; +} + +void CommandInterface::am_MainSoundProperty_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << type; + outputStream << value; +} +CommandInterface::am_SystemProperty_s::am_SystemProperty_s(const am_SystemPropertyType_e& typeValue, const int16_t& valueValue): + type(typeValue), + value(valueValue) +{ +} + + +bool operator==(const CommandInterface::am_SystemProperty_s& lhs, const CommandInterface::am_SystemProperty_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.type == rhs.type && + lhs.value == rhs.value + ; +} + +void CommandInterface::am_SystemProperty_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> type; + inputStream >> value; +} + +void CommandInterface::am_SystemProperty_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << type; + outputStream << value; +} +CommandInterface::am_MainConnectionType_s::am_MainConnectionType_s(const am_mainConnectionID_t& mainConnectionIDValue, const am_sourceID_t& sourceIDValue, const am_sinkID_t& sinkIDValue, const am_timeSync_t& delayValue, const am_ConnectionState_e& connectionStateValue): + mainConnectionID(mainConnectionIDValue), + sourceID(sourceIDValue), + sinkID(sinkIDValue), + delay(delayValue), + connectionState(connectionStateValue) +{ +} + + +bool operator==(const CommandInterface::am_MainConnectionType_s& lhs, const CommandInterface::am_MainConnectionType_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.mainConnectionID == rhs.mainConnectionID && + lhs.sourceID == rhs.sourceID && + lhs.sinkID == rhs.sinkID && + lhs.delay == rhs.delay && + lhs.connectionState == rhs.connectionState + ; +} + +void CommandInterface::am_MainConnectionType_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> mainConnectionID; + inputStream >> sourceID; + inputStream >> sinkID; + inputStream >> delay; + inputStream >> connectionState; +} + +void CommandInterface::am_MainConnectionType_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << mainConnectionID; + outputStream << sourceID; + outputStream << sinkID; + outputStream << delay; + outputStream << connectionState; +} +CommandInterface::am_Availability_s::am_Availability_s(const am_Availablility_e& availabilityValue, const am_AvailabilityReason_e& availabilityReasonValue): + availability(availabilityValue), + availabilityReason(availabilityReasonValue) +{ +} + + +bool operator==(const CommandInterface::am_Availability_s& lhs, const CommandInterface::am_Availability_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.availability == rhs.availability && + lhs.availabilityReason == rhs.availabilityReason + ; +} + +void CommandInterface::am_Availability_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> availability; + inputStream >> availabilityReason; +} + +void CommandInterface::am_Availability_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << availability; + outputStream << availabilityReason; +} +CommandInterface::am_SourceType_s::am_SourceType_s(const am_sourceID_t& sourceIDValue, const std::string& nameValue, const am_Availability_s& availabilityValue, const am_sourceClass_t& sourceClassIDValue): + sourceID(sourceIDValue), + name(nameValue), + availability(availabilityValue), + sourceClassID(sourceClassIDValue) +{ +} + + +bool operator==(const CommandInterface::am_SourceType_s& lhs, const CommandInterface::am_SourceType_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.sourceID == rhs.sourceID && + lhs.name == rhs.name && + lhs.availability == rhs.availability && + lhs.sourceClassID == rhs.sourceClassID + ; +} + +void CommandInterface::am_SourceType_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> sourceID; + inputStream >> name; + inputStream >> availability; + inputStream >> sourceClassID; +} + +void CommandInterface::am_SourceType_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << sourceID; + outputStream << name; + outputStream << availability; + outputStream << sourceClassID; +} +CommandInterface::am_SinkType_s::am_SinkType_s(const am_sinkID_t& sinkIDValue, const std::string& nameValue, const am_Availability_s& availabilityValue, const am_mainVolume_t& volumeValue, const am_MuteState_e& muteStateValue, const am_sinkClass_t& sinkClassIDValue): + sinkID(sinkIDValue), + name(nameValue), + availability(availabilityValue), + volume(volumeValue), + muteState(muteStateValue), + sinkClassID(sinkClassIDValue) +{ +} + + +bool operator==(const CommandInterface::am_SinkType_s& lhs, const CommandInterface::am_SinkType_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.sinkID == rhs.sinkID && + lhs.name == rhs.name && + lhs.availability == rhs.availability && + lhs.volume == rhs.volume && + lhs.muteState == rhs.muteState && + lhs.sinkClassID == rhs.sinkClassID + ; +} + +void CommandInterface::am_SinkType_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> sinkID; + inputStream >> name; + inputStream >> availability; + inputStream >> volume; + inputStream >> muteState; + inputStream >> sinkClassID; +} + +void CommandInterface::am_SinkType_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << sinkID; + outputStream << name; + outputStream << availability; + outputStream << volume; + outputStream << muteState; + outputStream << sinkClassID; +} +CommandInterface::am_ClassProperty_s::am_ClassProperty_s(const am_ClassProperty_e& classPropertyValue, const int16_t& valueValue): + classProperty(classPropertyValue), + value(valueValue) +{ +} + + +bool operator==(const CommandInterface::am_ClassProperty_s& lhs, const CommandInterface::am_ClassProperty_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.classProperty == rhs.classProperty && + lhs.value == rhs.value + ; +} + +void CommandInterface::am_ClassProperty_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> classProperty; + inputStream >> value; +} + +void CommandInterface::am_ClassProperty_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << classProperty; + outputStream << value; +} +CommandInterface::am_SourceClass_s::am_SourceClass_s(const am_sourceClass_t& sourceClassIDValue, const std::string& nameValue, const am_ClassProperty_l& listClassPropertiesValue): + sourceClassID(sourceClassIDValue), + name(nameValue), + listClassProperties(listClassPropertiesValue) +{ +} + + +bool operator==(const CommandInterface::am_SourceClass_s& lhs, const CommandInterface::am_SourceClass_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.sourceClassID == rhs.sourceClassID && + lhs.name == rhs.name && + lhs.listClassProperties == rhs.listClassProperties + ; +} + +void CommandInterface::am_SourceClass_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> sourceClassID; + inputStream >> name; + inputStream >> listClassProperties; +} + +void CommandInterface::am_SourceClass_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << sourceClassID; + outputStream << name; + outputStream << listClassProperties; +} +CommandInterface::am_SinkClass_s::am_SinkClass_s(const am_sinkClass_t& sinkClassIDValue, const std::string& nameValue, const am_ClassProperty_l& listClassPropertiesValue): + sinkClassID(sinkClassIDValue), + name(nameValue), + listClassProperties(listClassPropertiesValue) +{ +} + + +bool operator==(const CommandInterface::am_SinkClass_s& lhs, const CommandInterface::am_SinkClass_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.sinkClassID == rhs.sinkClassID && + lhs.name == rhs.name && + lhs.listClassProperties == rhs.listClassProperties + ; +} + +void CommandInterface::am_SinkClass_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> sinkClassID; + inputStream >> name; + inputStream >> listClassProperties; +} + +void CommandInterface::am_SinkClass_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << sinkClassID; + outputStream << name; + outputStream << listClassProperties; +} +CommandInterface::am_NotificationPayload_s::am_NotificationPayload_s(const am::am_NotificationType_e& typeValue, const int16_t& valueValue): + type(typeValue), + value(valueValue) +{ +} + + +bool operator==(const CommandInterface::am_NotificationPayload_s& lhs, const CommandInterface::am_NotificationPayload_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.type == rhs.type && + lhs.value == rhs.value + ; +} + +void CommandInterface::am_NotificationPayload_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> type; + inputStream >> value; +} + +void CommandInterface::am_NotificationPayload_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << type; + outputStream << value; +} + +} // namespace audiomanager +} // namespace genivi +} // namespace org diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.h b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.h new file mode 100644 index 0000000..252c0ef --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.h @@ -0,0 +1,820 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_AUDIOMANAGER_Command_Interface_H_ +#define ORG_GENIVI_AUDIOMANAGER_Command_Interface_H_ + + +#include + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include +#include +#include +#include +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace audiomanager { + +class CommandInterface { + public: + virtual ~CommandInterface() { } + + static inline const char* getInterfaceId(); + static inline CommonAPI::Version getInterfaceVersion(); + typedef uint16_t am_sourceID_t; + + typedef uint16_t am_sinkID_t; + + typedef uint16_t am_mainConnectionID_t; + + typedef int16_t am_timeSync_t; + + typedef int16_t am_mainVolume_t; + + typedef uint16_t am_sourceClass_t; + + typedef uint16_t am_sinkClass_t; + + enum class am_Error_e: int32_t { + E_OK = 0x0, + E_OUT_OF_RANGE = 0x1, + E_NOT_USED = 0x2, + E_DATABASE_ERROR = 0x3, + E_ALREADY_EXISTS = 0x4, + E_NO_CHANGE = 0x5, + E_NOT_POSSIBLE = 0x6, + E_NON_EXISTENT = 0x7, + E_ABORTED = 0x8, + E_WRONG_FORMAT = 0x9, + E_MAX = 0xa + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_Error_eComparator; + + enum class am_MuteState_e: int32_t { + MS_UNKNOWN = 0x0, + MS_MUTED = 0x1, + MS_UNMUTED = 0x2, + MS_MAX = 0x3 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_MuteState_eComparator; + + enum class am_MainSoundPropertyType_e: int32_t { + MSP_UNKNOWN = 0x0, + MSP_EXAMPLE_TREBLE = 0x1, + MSP_EXAMPLE_MID = 0x2, + MSP_EXAMPLE_BASS = 0x3, + MSP_SOURCE_TYPE = 0x4, + MSP_MAX = 0x5 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_MainSoundPropertyType_eComparator; + + enum class am_SystemPropertyType_e: int32_t { + SYP_UNKNOWN = 0x0, + SYP_MAX = 0x1 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_SystemPropertyType_eComparator; + + enum class am_ConnectionState_e: int32_t { + CS_UNKNOWN = 0x0, + CS_CONNECTING = 0x1, + CS_CONNECTED = 0x2, + CS_DISCONNECTING = 0x3, + CS_DISCONNECTED = 0x4, + CS_SUSPENDED = 0x5, + CS_MAX = 0x6 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_ConnectionState_eComparator; + + enum class am_Availablility_e: int32_t { + A_UNKNOWN = 0x0, + A_AVAILABLE = 0x1, + A_UNAVAILABLE = 0x2, + A_MAX = 0x3 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_Availablility_eComparator; + + enum class am_AvailabilityReason_e: int32_t { + AR_UNKNOWN = 0x0, + AR_GENIVI_NEWMEDIA = 0x1, + AR_GENIVI_SAMEMEDIA = 0x2, + AR_GENIVI_NOMEDIA = 0x3, + AR_GENIVI_TEMPERATURE = 0x4, + AR_GENIVI_VOLTAGE = 0x5, + AR_GENIVI_ERRORMEDIA = 0x6, + AR_MAX = 0x7 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_AvailabilityReason_eComparator; + + enum class am_ClassProperty_e: int32_t { + CP_UNKNOWN = 0x0, + CP_GENIVI_SOURCE_TYPE = 0x1, + CP_GENIVI_SINK_TYPE = 0x2, + CP_MAX = 0x3 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_ClassProperty_eComparator; + + enum class am_InterruptState_e: int32_t { + IS_UNKNOWN = 0x0, + IS_OFF = 0x1, + IS_INTERRUPTED = 0x2, + IS_MAX = 0x3 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_InterruptState_eComparator; + + struct am_MainSoundProperty_s: CommonAPI::SerializableStruct { + am_MainSoundPropertyType_e type; + int16_t value; + + am_MainSoundProperty_s() = default; + am_MainSoundProperty_s(const am_MainSoundPropertyType_e& type, const int16_t& value); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt16Type(); + } + }; + + typedef std::vector am_MainSoundProperty_l; + + struct am_SystemProperty_s: CommonAPI::SerializableStruct { + am_SystemPropertyType_e type; + int16_t value; + + am_SystemProperty_s() = default; + am_SystemProperty_s(const am_SystemPropertyType_e& type, const int16_t& value); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt16Type(); + } + }; + + typedef std::vector am_SystemProperty_l; + + struct am_MainConnectionType_s: CommonAPI::SerializableStruct { + am_mainConnectionID_t mainConnectionID; + am_sourceID_t sourceID; + am_sinkID_t sinkID; + am_timeSync_t delay; + am_ConnectionState_e connectionState; + + am_MainConnectionType_s() = default; + am_MainConnectionType_s(const am_mainConnectionID_t& mainConnectionID, const am_sourceID_t& sourceID, const am_sinkID_t& sinkID, const am_timeSync_t& delay, const am_ConnectionState_e& connectionState); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeInt16Type(); + typeOutputStream.writeInt32Type(); + } + }; + + typedef std::vector am_MainConnectionType_l; + + struct am_Availability_s: CommonAPI::SerializableStruct { + am_Availablility_e availability; + am_AvailabilityReason_e availabilityReason; + + am_Availability_s() = default; + am_Availability_s(const am_Availablility_e& availability, const am_AvailabilityReason_e& availabilityReason); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt32Type(); + } + }; + + struct am_SourceType_s: CommonAPI::SerializableStruct { + am_sourceID_t sourceID; + std::string name; + am_Availability_s availability; + am_sourceClass_t sourceClassID; + + am_SourceType_s() = default; + am_SourceType_s(const am_sourceID_t& sourceID, const std::string& name, const am_Availability_s& availability, const am_sourceClass_t& sourceClassID); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeStringType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt32Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.writeUInt16Type(); + } + }; + + typedef std::vector am_SourceType_l; + + struct am_SinkType_s: CommonAPI::SerializableStruct { + am_sinkID_t sinkID; + std::string name; + am_Availability_s availability; + am_mainVolume_t volume; + am_MuteState_e muteState; + am_sinkClass_t sinkClassID; + + am_SinkType_s() = default; + am_SinkType_s(const am_sinkID_t& sinkID, const std::string& name, const am_Availability_s& availability, const am_mainVolume_t& volume, const am_MuteState_e& muteState, const am_sinkClass_t& sinkClassID); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeStringType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt32Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.writeInt16Type(); + typeOutputStream.writeInt32Type(); + typeOutputStream.writeUInt16Type(); + } + }; + + typedef std::vector am_SinkType_l; + + struct am_ClassProperty_s: CommonAPI::SerializableStruct { + am_ClassProperty_e classProperty; + int16_t value; + + am_ClassProperty_s() = default; + am_ClassProperty_s(const am_ClassProperty_e& classProperty, const int16_t& value); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt16Type(); + } + }; + + typedef std::vector am_ClassProperty_l; + + struct am_SourceClass_s: CommonAPI::SerializableStruct { + am_sourceClass_t sourceClassID; + std::string name; + am_ClassProperty_l listClassProperties; + + am_SourceClass_s() = default; + am_SourceClass_s(const am_sourceClass_t& sourceClassID, const std::string& name, const am_ClassProperty_l& listClassProperties); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeStringType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + } + }; + + typedef std::vector am_SourceClass_l; + + struct am_SinkClass_s: CommonAPI::SerializableStruct { + am_sinkClass_t sinkClassID; + std::string name; + am_ClassProperty_l listClassProperties; + + am_SinkClass_s() = default; + am_SinkClass_s(const am_sinkClass_t& sinkClassID, const std::string& name, const am_ClassProperty_l& listClassProperties); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeStringType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + } + }; + + typedef std::vector am_SinkClass_l; + + struct am_NotificationPayload_s: CommonAPI::SerializableStruct { + am::am_NotificationType_e type; + int16_t value; + + am_NotificationPayload_s() = default; + am_NotificationPayload_s(const am::am_NotificationType_e& type, const int16_t& value); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt16Type(); + } + }; + +}; + +const char* CommandInterface::getInterfaceId() { + return "org.genivi.audiomanager.CommandInterface"; +} + +CommonAPI::Version CommandInterface::getInterfaceVersion() { + return CommonAPI::Version(0, 1); +} + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, CommandInterface::am_Error_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const CommandInterface::am_Error_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct CommandInterface::am_Error_eComparator { + inline bool operator()(const am_Error_e& lhs, const am_Error_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, CommandInterface::am_MuteState_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const CommandInterface::am_MuteState_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct CommandInterface::am_MuteState_eComparator { + inline bool operator()(const am_MuteState_e& lhs, const am_MuteState_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, CommandInterface::am_MainSoundPropertyType_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const CommandInterface::am_MainSoundPropertyType_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct CommandInterface::am_MainSoundPropertyType_eComparator { + inline bool operator()(const am_MainSoundPropertyType_e& lhs, const am_MainSoundPropertyType_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, CommandInterface::am_SystemPropertyType_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const CommandInterface::am_SystemPropertyType_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct CommandInterface::am_SystemPropertyType_eComparator { + inline bool operator()(const am_SystemPropertyType_e& lhs, const am_SystemPropertyType_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, CommandInterface::am_ConnectionState_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const CommandInterface::am_ConnectionState_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct CommandInterface::am_ConnectionState_eComparator { + inline bool operator()(const am_ConnectionState_e& lhs, const am_ConnectionState_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, CommandInterface::am_Availablility_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const CommandInterface::am_Availablility_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct CommandInterface::am_Availablility_eComparator { + inline bool operator()(const am_Availablility_e& lhs, const am_Availablility_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, CommandInterface::am_AvailabilityReason_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const CommandInterface::am_AvailabilityReason_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct CommandInterface::am_AvailabilityReason_eComparator { + inline bool operator()(const am_AvailabilityReason_e& lhs, const am_AvailabilityReason_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, CommandInterface::am_ClassProperty_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const CommandInterface::am_ClassProperty_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct CommandInterface::am_ClassProperty_eComparator { + inline bool operator()(const am_ClassProperty_e& lhs, const am_ClassProperty_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, CommandInterface::am_InterruptState_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const CommandInterface::am_InterruptState_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct CommandInterface::am_InterruptState_eComparator { + inline bool operator()(const am_InterruptState_e& lhs, const am_InterruptState_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +bool operator==(const CommandInterface::am_MainSoundProperty_s& lhs, const CommandInterface::am_MainSoundProperty_s& rhs); +inline bool operator!=(const CommandInterface::am_MainSoundProperty_s& lhs, const CommandInterface::am_MainSoundProperty_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const CommandInterface::am_SystemProperty_s& lhs, const CommandInterface::am_SystemProperty_s& rhs); +inline bool operator!=(const CommandInterface::am_SystemProperty_s& lhs, const CommandInterface::am_SystemProperty_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const CommandInterface::am_MainConnectionType_s& lhs, const CommandInterface::am_MainConnectionType_s& rhs); +inline bool operator!=(const CommandInterface::am_MainConnectionType_s& lhs, const CommandInterface::am_MainConnectionType_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const CommandInterface::am_Availability_s& lhs, const CommandInterface::am_Availability_s& rhs); +inline bool operator!=(const CommandInterface::am_Availability_s& lhs, const CommandInterface::am_Availability_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const CommandInterface::am_SourceType_s& lhs, const CommandInterface::am_SourceType_s& rhs); +inline bool operator!=(const CommandInterface::am_SourceType_s& lhs, const CommandInterface::am_SourceType_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const CommandInterface::am_SinkType_s& lhs, const CommandInterface::am_SinkType_s& rhs); +inline bool operator!=(const CommandInterface::am_SinkType_s& lhs, const CommandInterface::am_SinkType_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const CommandInterface::am_ClassProperty_s& lhs, const CommandInterface::am_ClassProperty_s& rhs); +inline bool operator!=(const CommandInterface::am_ClassProperty_s& lhs, const CommandInterface::am_ClassProperty_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const CommandInterface::am_SourceClass_s& lhs, const CommandInterface::am_SourceClass_s& rhs); +inline bool operator!=(const CommandInterface::am_SourceClass_s& lhs, const CommandInterface::am_SourceClass_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const CommandInterface::am_SinkClass_s& lhs, const CommandInterface::am_SinkClass_s& rhs); +inline bool operator!=(const CommandInterface::am_SinkClass_s& lhs, const CommandInterface::am_SinkClass_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const CommandInterface::am_NotificationPayload_s& lhs, const CommandInterface::am_NotificationPayload_s& rhs); +inline bool operator!=(const CommandInterface::am_NotificationPayload_s& lhs, const CommandInterface::am_NotificationPayload_s& rhs) { + return !(lhs == rhs); +} + +} // namespace audiomanager +} // namespace genivi +} // namespace org + +namespace CommonAPI { + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + +} + + +namespace std { + //hashes for types + //Hash for am_Error_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::CommandInterface::am_Error_e& am_Error_e) const { + return static_cast(am_Error_e); + } + }; + //Hash for am_MuteState_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::CommandInterface::am_MuteState_e& am_MuteState_e) const { + return static_cast(am_MuteState_e); + } + }; + //Hash for am_MainSoundPropertyType_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::CommandInterface::am_MainSoundPropertyType_e& am_MainSoundPropertyType_e) const { + return static_cast(am_MainSoundPropertyType_e); + } + }; + //Hash for am_SystemPropertyType_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::CommandInterface::am_SystemPropertyType_e& am_SystemPropertyType_e) const { + return static_cast(am_SystemPropertyType_e); + } + }; + //Hash for am_ConnectionState_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::CommandInterface::am_ConnectionState_e& am_ConnectionState_e) const { + return static_cast(am_ConnectionState_e); + } + }; + //Hash for am_Availablility_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::CommandInterface::am_Availablility_e& am_Availablility_e) const { + return static_cast(am_Availablility_e); + } + }; + //Hash for am_AvailabilityReason_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::CommandInterface::am_AvailabilityReason_e& am_AvailabilityReason_e) const { + return static_cast(am_AvailabilityReason_e); + } + }; + //Hash for am_ClassProperty_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::CommandInterface::am_ClassProperty_e& am_ClassProperty_e) const { + return static_cast(am_ClassProperty_e); + } + }; + //Hash for am_InterruptState_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::CommandInterface::am_InterruptState_e& am_InterruptState_e) const { + return static_cast(am_InterruptState_e); + } + }; + + //hashes for error types +} + +#endif // ORG_GENIVI_AUDIOMANAGER_Command_Interface_H_ diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.cpp b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.cpp new file mode 100644 index 0000000..b178ee7 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.cpp @@ -0,0 +1,458 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#include "CommandInterfaceDBusProxy.h" + +namespace org { +namespace genivi { +namespace audiomanager { + +std::shared_ptr createCommandInterfaceDBusProxy( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyConnection) { + return std::make_shared(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection); +} + +__attribute__((constructor)) void registerCommandInterfaceDBusProxy(void) { + CommonAPI::DBus::DBusFactory::registerProxyFactoryMethod(CommandInterface::getInterfaceId(), + &createCommandInterfaceDBusProxy); +} + +CommandInterfaceDBusProxy::CommandInterfaceDBusProxy( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyconnection): + CommonAPI::DBus::DBusProxy(commonApiAddress, interfaceName, busName, objectPath, dbusProxyconnection) +, numberOfMainConnectionsChanged_(*this, "NumberOfMainConnectionsChanged", ""), + mainConnectionStateChanged_(*this, "MainConnectionStateChanged", "qi"), + numberOfSourceClassesChanged_(*this, "NumberOfSourceClassesChanged", ""), + sourceAdded_(*this, "SourceAdded", "(qs(ii)q)"), + sourceRemoved_(*this, "SourceRemoved", "q"), + mainSourceSoundPropertyChanged_(*this, "MainSourceSoundPropertyChanged", "q(in)"), + sourceAvailabilityChanged_(*this, "SourceAvailabilityChanged", "q(ii)"), + numberOfSinkClassesChanged_(*this, "NumberOfSinkClassesChanged", ""), + sinkAdded_(*this, "SinkAdded", "(qs(ii)niq)"), + sinkRemoved_(*this, "SinkRemoved", "q"), + mainSinkSoundPropertyChanged_(*this, "MainSinkSoundPropertyChanged", "q(in)"), + sinkAvailabilityChanged_(*this, "SinkAvailabilityChanged", "q(ii)"), + volumeChanged_(*this, "VolumeChanged", "qn"), + sinkMuteStateChanged_(*this, "SinkMuteStateChanged", "qi"), + systemPropertyChanged_(*this, "SystemPropertyChanged", "(in)"), + timingInformationChanged_(*this, "TimingInformationChanged", "qn"), + sinkUpdated_(*this, "SinkUpdated", "qqa(in)"), + sourceUpdated_(*this, "SourceUpdated", "qqa(in)"), + sinkNotification_(*this, "SinkNotification", "q(in)"), + sourceNotification_(*this, "SourceNotification", "q(in)"), + mainSinkNotificationConfigurationChanged_(*this, "MainSinkNotificationConfigurationChanged", "q(iin)"), + mainSourceNotificationConfigurationChanged_(*this, "MainSourceNotificationConfigurationChanged", "q(iin)") + { +} + + +CommandInterfaceDBusProxy::NumberOfMainConnectionsChangedEvent& CommandInterfaceDBusProxy::getNumberOfMainConnectionsChangedEvent() { + return numberOfMainConnectionsChanged_; +} +CommandInterfaceDBusProxy::MainConnectionStateChangedEvent& CommandInterfaceDBusProxy::getMainConnectionStateChangedEvent() { + return mainConnectionStateChanged_; +} +CommandInterfaceDBusProxy::NumberOfSourceClassesChangedEvent& CommandInterfaceDBusProxy::getNumberOfSourceClassesChangedEvent() { + return numberOfSourceClassesChanged_; +} +CommandInterfaceDBusProxy::SourceAddedEvent& CommandInterfaceDBusProxy::getSourceAddedEvent() { + return sourceAdded_; +} +CommandInterfaceDBusProxy::SourceRemovedEvent& CommandInterfaceDBusProxy::getSourceRemovedEvent() { + return sourceRemoved_; +} +CommandInterfaceDBusProxy::MainSourceSoundPropertyChangedEvent& CommandInterfaceDBusProxy::getMainSourceSoundPropertyChangedEvent() { + return mainSourceSoundPropertyChanged_; +} +CommandInterfaceDBusProxy::SourceAvailabilityChangedEvent& CommandInterfaceDBusProxy::getSourceAvailabilityChangedEvent() { + return sourceAvailabilityChanged_; +} +CommandInterfaceDBusProxy::NumberOfSinkClassesChangedEvent& CommandInterfaceDBusProxy::getNumberOfSinkClassesChangedEvent() { + return numberOfSinkClassesChanged_; +} +CommandInterfaceDBusProxy::SinkAddedEvent& CommandInterfaceDBusProxy::getSinkAddedEvent() { + return sinkAdded_; +} +CommandInterfaceDBusProxy::SinkRemovedEvent& CommandInterfaceDBusProxy::getSinkRemovedEvent() { + return sinkRemoved_; +} +CommandInterfaceDBusProxy::MainSinkSoundPropertyChangedEvent& CommandInterfaceDBusProxy::getMainSinkSoundPropertyChangedEvent() { + return mainSinkSoundPropertyChanged_; +} +CommandInterfaceDBusProxy::SinkAvailabilityChangedEvent& CommandInterfaceDBusProxy::getSinkAvailabilityChangedEvent() { + return sinkAvailabilityChanged_; +} +CommandInterfaceDBusProxy::VolumeChangedEvent& CommandInterfaceDBusProxy::getVolumeChangedEvent() { + return volumeChanged_; +} +CommandInterfaceDBusProxy::SinkMuteStateChangedEvent& CommandInterfaceDBusProxy::getSinkMuteStateChangedEvent() { + return sinkMuteStateChanged_; +} +CommandInterfaceDBusProxy::SystemPropertyChangedEvent& CommandInterfaceDBusProxy::getSystemPropertyChangedEvent() { + return systemPropertyChanged_; +} +CommandInterfaceDBusProxy::TimingInformationChangedEvent& CommandInterfaceDBusProxy::getTimingInformationChangedEvent() { + return timingInformationChanged_; +} +CommandInterfaceDBusProxy::SinkUpdatedEvent& CommandInterfaceDBusProxy::getSinkUpdatedEvent() { + return sinkUpdated_; +} +CommandInterfaceDBusProxy::SourceUpdatedEvent& CommandInterfaceDBusProxy::getSourceUpdatedEvent() { + return sourceUpdated_; +} +CommandInterfaceDBusProxy::SinkNotificationEvent& CommandInterfaceDBusProxy::getSinkNotificationEvent() { + return sinkNotification_; +} +CommandInterfaceDBusProxy::SourceNotificationEvent& CommandInterfaceDBusProxy::getSourceNotificationEvent() { + return sourceNotification_; +} +CommandInterfaceDBusProxy::MainSinkNotificationConfigurationChangedEvent& CommandInterfaceDBusProxy::getMainSinkNotificationConfigurationChangedEvent() { + return mainSinkNotificationConfigurationChanged_; +} +CommandInterfaceDBusProxy::MainSourceNotificationConfigurationChangedEvent& CommandInterfaceDBusProxy::getMainSourceNotificationConfigurationChangedEvent() { + return mainSourceNotificationConfigurationChanged_; +} + +void CommandInterfaceDBusProxy::Connect(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "Connect", + "qq", + sourceID, sinkID, + callStatus + , result, mainConnectionID); +} +std::future CommandInterfaceDBusProxy::ConnectAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, ConnectAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "Connect", + "qq", + sourceID, sinkID, + std::move(callback)); +} +void CommandInterfaceDBusProxy::Disconnect(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "Disconnect", + "q", + mainConnectionID, + callStatus + , result); +} +std::future CommandInterfaceDBusProxy::DisconnectAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, DisconnectAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "Disconnect", + "q", + mainConnectionID, + std::move(callback)); +} +void CommandInterfaceDBusProxy::SetVolume(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "SetVolume", + "qn", + sinkID, volume, + callStatus + , result); +} +std::future CommandInterfaceDBusProxy::SetVolumeAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, SetVolumeAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "SetVolume", + "qn", + sinkID, volume, + std::move(callback)); +} +void CommandInterfaceDBusProxy::VolumeStep(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "VolumeStep", + "qn", + sinkID, volumeStep, + callStatus + , result); +} +std::future CommandInterfaceDBusProxy::VolumeStepAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, VolumeStepAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "VolumeStep", + "qn", + sinkID, volumeStep, + std::move(callback)); +} +void CommandInterfaceDBusProxy::SetSinkMuteState(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "SetSinkMuteState", + "qi", + sinkID, muteState, + callStatus + , result); +} +std::future CommandInterfaceDBusProxy::SetSinkMuteStateAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, SetSinkMuteStateAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "SetSinkMuteState", + "qi", + sinkID, muteState, + std::move(callback)); +} +void CommandInterfaceDBusProxy::SetMainSinkSoundProperty(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "SetMainSinkSoundProperty", + "q(in)", + sinkID, soundProperty, + callStatus + , result); +} +std::future CommandInterfaceDBusProxy::SetMainSinkSoundPropertyAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSinkSoundPropertyAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "SetMainSinkSoundProperty", + "q(in)", + sinkID, soundProperty, + std::move(callback)); +} +void CommandInterfaceDBusProxy::SetMainSourceSoundProperty(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "SetMainSourceSoundProperty", + "q(in)", + sourceID, soundProperty, + callStatus + , result); +} +std::future CommandInterfaceDBusProxy::SetMainSourceSoundPropertyAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSourceSoundPropertyAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "SetMainSourceSoundProperty", + "q(in)", + sourceID, soundProperty, + std::move(callback)); +} +void CommandInterfaceDBusProxy::SetSystemProperty(const CommandInterface::am_SystemProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "SetSystemProperty", + "(in)", + soundProperty, + callStatus + , result); +} +std::future CommandInterfaceDBusProxy::SetSystemPropertyAsync(const CommandInterface::am_SystemProperty_s& soundProperty, SetSystemPropertyAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "SetSystemProperty", + "(in)", + soundProperty, + std::move(callback)); +} +void CommandInterfaceDBusProxy::GetListMainConnections(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetListMainConnections", + "", + callStatus + , result, listConnections); +} +std::future CommandInterfaceDBusProxy::GetListMainConnectionsAsync(GetListMainConnectionsAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetListMainConnections", + "", + std::move(callback)); +} +void CommandInterfaceDBusProxy::GetListMainSinks(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetListMainSinks", + "", + callStatus + , result, listMainSinks); +} +std::future CommandInterfaceDBusProxy::GetListMainSinksAsync(GetListMainSinksAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetListMainSinks", + "", + std::move(callback)); +} +void CommandInterfaceDBusProxy::GetListMainSources(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetListMainSources", + "", + callStatus + , result, listMainSources); +} +std::future CommandInterfaceDBusProxy::GetListMainSourcesAsync(GetListMainSourcesAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetListMainSources", + "", + std::move(callback)); +} +void CommandInterfaceDBusProxy::GetListMainSinkSoundProperties(const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetListMainSinkSoundProperties", + "q", + sinkID, + callStatus + , result, listSoundProperties); +} +std::future CommandInterfaceDBusProxy::GetListMainSinkSoundPropertiesAsync(const CommandInterface::am_sinkID_t& sinkID, GetListMainSinkSoundPropertiesAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetListMainSinkSoundProperties", + "q", + sinkID, + std::move(callback)); +} +void CommandInterfaceDBusProxy::GetListMainSourceSoundProperties(const CommandInterface::am_sourceID_t& sourceID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetListMainSourceSoundProperties", + "q", + sourceID, + callStatus + , result, listSourceProperties); +} +std::future CommandInterfaceDBusProxy::GetListMainSourceSoundPropertiesAsync(const CommandInterface::am_sourceID_t& sourceID, GetListMainSourceSoundPropertiesAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetListMainSourceSoundProperties", + "q", + sourceID, + std::move(callback)); +} +void CommandInterfaceDBusProxy::GetListSourceClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetListSourceClasses", + "", + callStatus + , result, listSourceClasses); +} +std::future CommandInterfaceDBusProxy::GetListSourceClassesAsync(GetListSourceClassesAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetListSourceClasses", + "", + std::move(callback)); +} +void CommandInterfaceDBusProxy::GetListSinkClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetListSinkClasses", + "", + callStatus + , result, listSinkClasses); +} +std::future CommandInterfaceDBusProxy::GetListSinkClassesAsync(GetListSinkClassesAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetListSinkClasses", + "", + std::move(callback)); +} +void CommandInterfaceDBusProxy::GetListSystemProperties(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetListSystemProperties", + "", + callStatus + , result, listSystemProperties); +} +std::future CommandInterfaceDBusProxy::GetListSystemPropertiesAsync(GetListSystemPropertiesAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetListSystemProperties", + "", + std::move(callback)); +} +void CommandInterfaceDBusProxy::GetTimingInformation(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetTimingInformation", + "q", + mainConnectionID, + callStatus + , result, delay); +} +std::future CommandInterfaceDBusProxy::GetTimingInformationAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, GetTimingInformationAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetTimingInformation", + "q", + mainConnectionID, + std::move(callback)); +} + +void CommandInterfaceDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 0; + ownVersionMinor = 1; +} + +} // namespace audiomanager +} // namespace genivi +} // namespace org diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.h b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.h new file mode 100644 index 0000000..719692b --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.h @@ -0,0 +1,157 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_AUDIOMANAGER_Command_Interface_DBUS_PROXY_H_ +#define ORG_GENIVI_AUDIOMANAGER_Command_Interface_DBUS_PROXY_H_ + +#include + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include + +namespace org { +namespace genivi { +namespace audiomanager { + +class CommandInterfaceDBusProxy: virtual public CommandInterfaceProxyBase, virtual public CommonAPI::DBus::DBusProxy { + public: + CommandInterfaceDBusProxy( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyconnection); + + virtual ~CommandInterfaceDBusProxy() { } + + + virtual NumberOfMainConnectionsChangedEvent& getNumberOfMainConnectionsChangedEvent(); + virtual MainConnectionStateChangedEvent& getMainConnectionStateChangedEvent(); + virtual NumberOfSourceClassesChangedEvent& getNumberOfSourceClassesChangedEvent(); + virtual SourceAddedEvent& getSourceAddedEvent(); + virtual SourceRemovedEvent& getSourceRemovedEvent(); + virtual MainSourceSoundPropertyChangedEvent& getMainSourceSoundPropertyChangedEvent(); + virtual SourceAvailabilityChangedEvent& getSourceAvailabilityChangedEvent(); + virtual NumberOfSinkClassesChangedEvent& getNumberOfSinkClassesChangedEvent(); + virtual SinkAddedEvent& getSinkAddedEvent(); + virtual SinkRemovedEvent& getSinkRemovedEvent(); + virtual MainSinkSoundPropertyChangedEvent& getMainSinkSoundPropertyChangedEvent(); + virtual SinkAvailabilityChangedEvent& getSinkAvailabilityChangedEvent(); + virtual VolumeChangedEvent& getVolumeChangedEvent(); + virtual SinkMuteStateChangedEvent& getSinkMuteStateChangedEvent(); + virtual SystemPropertyChangedEvent& getSystemPropertyChangedEvent(); + virtual TimingInformationChangedEvent& getTimingInformationChangedEvent(); + virtual SinkUpdatedEvent& getSinkUpdatedEvent(); + virtual SourceUpdatedEvent& getSourceUpdatedEvent(); + virtual SinkNotificationEvent& getSinkNotificationEvent(); + virtual SourceNotificationEvent& getSourceNotificationEvent(); + virtual MainSinkNotificationConfigurationChangedEvent& getMainSinkNotificationConfigurationChangedEvent(); + virtual MainSourceNotificationConfigurationChangedEvent& getMainSourceNotificationConfigurationChangedEvent(); + + + virtual void Connect(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID); + virtual std::future ConnectAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, ConnectAsyncCallback callback); + + virtual void Disconnect(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + virtual std::future DisconnectAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, DisconnectAsyncCallback callback); + + virtual void SetVolume(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + virtual std::future SetVolumeAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, SetVolumeAsyncCallback callback); + + virtual void VolumeStep(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + virtual std::future VolumeStepAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, VolumeStepAsyncCallback callback); + + virtual void SetSinkMuteState(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + virtual std::future SetSinkMuteStateAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, SetSinkMuteStateAsyncCallback callback); + + virtual void SetMainSinkSoundProperty(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + virtual std::future SetMainSinkSoundPropertyAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSinkSoundPropertyAsyncCallback callback); + + virtual void SetMainSourceSoundProperty(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + virtual std::future SetMainSourceSoundPropertyAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSourceSoundPropertyAsyncCallback callback); + + virtual void SetSystemProperty(const CommandInterface::am_SystemProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + virtual std::future SetSystemPropertyAsync(const CommandInterface::am_SystemProperty_s& soundProperty, SetSystemPropertyAsyncCallback callback); + + virtual void GetListMainConnections(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections); + virtual std::future GetListMainConnectionsAsync(GetListMainConnectionsAsyncCallback callback); + + virtual void GetListMainSinks(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks); + virtual std::future GetListMainSinksAsync(GetListMainSinksAsyncCallback callback); + + virtual void GetListMainSources(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources); + virtual std::future GetListMainSourcesAsync(GetListMainSourcesAsyncCallback callback); + + virtual void GetListMainSinkSoundProperties(const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties); + virtual std::future GetListMainSinkSoundPropertiesAsync(const CommandInterface::am_sinkID_t& sinkID, GetListMainSinkSoundPropertiesAsyncCallback callback); + + virtual void GetListMainSourceSoundProperties(const CommandInterface::am_sourceID_t& sourceID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties); + virtual std::future GetListMainSourceSoundPropertiesAsync(const CommandInterface::am_sourceID_t& sourceID, GetListMainSourceSoundPropertiesAsyncCallback callback); + + virtual void GetListSourceClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses); + virtual std::future GetListSourceClassesAsync(GetListSourceClassesAsyncCallback callback); + + virtual void GetListSinkClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses); + virtual std::future GetListSinkClassesAsync(GetListSinkClassesAsyncCallback callback); + + virtual void GetListSystemProperties(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties); + virtual std::future GetListSystemPropertiesAsync(GetListSystemPropertiesAsyncCallback callback); + + virtual void GetTimingInformation(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay); + virtual std::future GetTimingInformationAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, GetTimingInformationAsyncCallback callback); + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + + private: + + CommonAPI::DBus::DBusEvent numberOfMainConnectionsChanged_; + CommonAPI::DBus::DBusEvent mainConnectionStateChanged_; + CommonAPI::DBus::DBusEvent numberOfSourceClassesChanged_; + CommonAPI::DBus::DBusEvent sourceAdded_; + CommonAPI::DBus::DBusEvent sourceRemoved_; + CommonAPI::DBus::DBusEvent mainSourceSoundPropertyChanged_; + CommonAPI::DBus::DBusEvent sourceAvailabilityChanged_; + CommonAPI::DBus::DBusEvent numberOfSinkClassesChanged_; + CommonAPI::DBus::DBusEvent sinkAdded_; + CommonAPI::DBus::DBusEvent sinkRemoved_; + CommonAPI::DBus::DBusEvent mainSinkSoundPropertyChanged_; + CommonAPI::DBus::DBusEvent sinkAvailabilityChanged_; + CommonAPI::DBus::DBusEvent volumeChanged_; + CommonAPI::DBus::DBusEvent sinkMuteStateChanged_; + CommonAPI::DBus::DBusEvent systemPropertyChanged_; + CommonAPI::DBus::DBusEvent timingInformationChanged_; + CommonAPI::DBus::DBusEvent sinkUpdated_; + CommonAPI::DBus::DBusEvent sourceUpdated_; + CommonAPI::DBus::DBusEvent sinkNotification_; + CommonAPI::DBus::DBusEvent sourceNotification_; + CommonAPI::DBus::DBusEvent mainSinkNotificationConfigurationChanged_; + CommonAPI::DBus::DBusEvent mainSourceNotificationConfigurationChanged_; +}; + +} // namespace audiomanager +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_AUDIOMANAGER_Command_Interface_DBUS_PROXY_H_ diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.cpp b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.cpp new file mode 100644 index 0000000..d796464 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.cpp @@ -0,0 +1,521 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#include "CommandInterfaceDBusStubAdapter.h" +#include + +namespace org { +namespace genivi { +namespace audiomanager { + +std::shared_ptr createCommandInterfaceDBusStubAdapter( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyConnection, + const std::shared_ptr& stubBase) { + return std::make_shared(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase); +} + +__attribute__((constructor)) void registerCommandInterfaceDBusStubAdapter(void) { + CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(CommandInterface::getInterfaceId(), + &createCommandInterfaceDBusStubAdapter); +} + +CommandInterfaceDBusStubAdapter::CommandInterfaceDBusStubAdapter( + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr& dbusConnection, + const std::shared_ptr& stub): + CommandInterfaceDBusStubAdapterHelper(commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath, dbusConnection, std::dynamic_pointer_cast(stub)) { +} + +const char* CommandInterfaceDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const { + return + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + ; +} + + + +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > connectStubDispatcher(&CommandInterfaceStub::Connect, "iq"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > disconnectStubDispatcher(&CommandInterfaceStub::Disconnect, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > setVolumeStubDispatcher(&CommandInterfaceStub::SetVolume, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > volumeStepStubDispatcher(&CommandInterfaceStub::VolumeStep, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > setSinkMuteStateStubDispatcher(&CommandInterfaceStub::SetSinkMuteState, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > setMainSinkSoundPropertyStubDispatcher(&CommandInterfaceStub::SetMainSinkSoundProperty, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > setMainSourceSoundPropertyStubDispatcher(&CommandInterfaceStub::SetMainSourceSoundProperty, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > setSystemPropertyStubDispatcher(&CommandInterfaceStub::SetSystemProperty, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple<>, + std::tuple + > getListMainConnectionsStubDispatcher(&CommandInterfaceStub::GetListMainConnections, "ia(qqqni)"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple<>, + std::tuple + > getListMainSinksStubDispatcher(&CommandInterfaceStub::GetListMainSinks, "ia(qs(ii)niq)"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple<>, + std::tuple + > getListMainSourcesStubDispatcher(&CommandInterfaceStub::GetListMainSources, "ia(qs(ii)q)"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > getListMainSinkSoundPropertiesStubDispatcher(&CommandInterfaceStub::GetListMainSinkSoundProperties, "ia(in)"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > getListMainSourceSoundPropertiesStubDispatcher(&CommandInterfaceStub::GetListMainSourceSoundProperties, "ia(in)"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple<>, + std::tuple + > getListSourceClassesStubDispatcher(&CommandInterfaceStub::GetListSourceClasses, "ia(qsa(in))"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple<>, + std::tuple + > getListSinkClassesStubDispatcher(&CommandInterfaceStub::GetListSinkClasses, "ia(qsa(in))"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple<>, + std::tuple + > getListSystemPropertiesStubDispatcher(&CommandInterfaceStub::GetListSystemProperties, "ia(in)"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + CommandInterfaceStub, + std::tuple, + std::tuple + > getTimingInformationStubDispatcher(&CommandInterfaceStub::GetTimingInformation, "in"); + + +void CommandInterfaceDBusStubAdapter::fireNumberOfMainConnectionsChangedEvent() { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "NumberOfMainConnectionsChanged", + "" + ); +} +void CommandInterfaceDBusStubAdapter::fireMainConnectionStateChangedEvent(const CommandInterface::am_mainConnectionID_t& connectionID, const CommandInterface::am_ConnectionState_e& connectionState) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "MainConnectionStateChanged", + "qi", + connectionID, connectionState + ); +} +void CommandInterfaceDBusStubAdapter::fireNumberOfSourceClassesChangedEvent() { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "NumberOfSourceClassesChanged", + "" + ); +} +void CommandInterfaceDBusStubAdapter::fireSourceAddedEvent(const CommandInterface::am_SourceType_s& newSource) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SourceAdded", + "(qs(ii)q)", + newSource + ); +} +void CommandInterfaceDBusStubAdapter::fireSourceRemovedEvent(const CommandInterface::am_sourceID_t& removedSourceID) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SourceRemoved", + "q", + removedSourceID + ); +} +void CommandInterfaceDBusStubAdapter::fireMainSourceSoundPropertyChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& SoundProperty) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "MainSourceSoundPropertyChanged", + "q(in)", + sourceID, SoundProperty + ); +} +void CommandInterfaceDBusStubAdapter::fireSourceAvailabilityChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_Availability_s& availability) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SourceAvailabilityChanged", + "q(ii)", + sourceID, availability + ); +} +void CommandInterfaceDBusStubAdapter::fireNumberOfSinkClassesChangedEvent() { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "NumberOfSinkClassesChanged", + "" + ); +} +void CommandInterfaceDBusStubAdapter::fireSinkAddedEvent(const CommandInterface::am_SinkType_s& newSink) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SinkAdded", + "(qs(ii)niq)", + newSink + ); +} +void CommandInterfaceDBusStubAdapter::fireSinkRemovedEvent(const CommandInterface::am_sinkID_t& removedSinkID) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SinkRemoved", + "q", + removedSinkID + ); +} +void CommandInterfaceDBusStubAdapter::fireMainSinkSoundPropertyChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& SoundProperty) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "MainSinkSoundPropertyChanged", + "q(in)", + sinkID, SoundProperty + ); +} +void CommandInterfaceDBusStubAdapter::fireSinkAvailabilityChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_Availability_s& availability) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SinkAvailabilityChanged", + "q(ii)", + sinkID, availability + ); +} +void CommandInterfaceDBusStubAdapter::fireVolumeChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "VolumeChanged", + "qn", + sinkID, volume + ); +} +void CommandInterfaceDBusStubAdapter::fireSinkMuteStateChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SinkMuteStateChanged", + "qi", + sinkID, muteState + ); +} +void CommandInterfaceDBusStubAdapter::fireSystemPropertyChangedEvent(const CommandInterface::am_SystemProperty_s& SystemProperty) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SystemPropertyChanged", + "(in)", + SystemProperty + ); +} +void CommandInterfaceDBusStubAdapter::fireTimingInformationChangedEvent(const CommandInterface::am_mainConnectionID_t& mainConnection, const CommandInterface::am_timeSync_t& time) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "TimingInformationChanged", + "qn", + mainConnection, time + ); +} +void CommandInterfaceDBusStubAdapter::fireSinkUpdatedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_sinkClass_t& sinkClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SinkUpdated", + "qqa(in)", + sinkID, sinkClassID, listMainSoundProperties + ); +} +void CommandInterfaceDBusStubAdapter::fireSourceUpdatedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sourceClass_t& sourceClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SourceUpdated", + "qqa(in)", + sourceID, sourceClassID, listMainSoundProperties + ); +} +void CommandInterfaceDBusStubAdapter::fireSinkNotificationEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_NotificationPayload_s& notification) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SinkNotification", + "q(in)", + sinkID, notification + ); +} +void CommandInterfaceDBusStubAdapter::fireSourceNotificationEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_NotificationPayload_s& notification) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SourceNotification", + "q(in)", + sourceID, notification + ); +} +void CommandInterfaceDBusStubAdapter::fireMainSinkNotificationConfigurationChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "MainSinkNotificationConfigurationChanged", + "q(iin)", + sinkID, mainNotificationConfiguration + ); +} +void CommandInterfaceDBusStubAdapter::fireMainSourceNotificationConfigurationChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "MainSourceNotificationConfigurationChanged", + "q(iin)", + sourceID, mainNotificationConfiguration + ); +} + +} // namespace audiomanager +} // namespace genivi +} // namespace org + +template<> +const org::genivi::audiomanager::CommandInterfaceDBusStubAdapterHelper::StubDispatcherTable org::genivi::audiomanager::CommandInterfaceDBusStubAdapterHelper::stubDispatcherTable_ = { + { { "Connect", "qq" }, &org::genivi::audiomanager::connectStubDispatcher }, + { { "Disconnect", "q" }, &org::genivi::audiomanager::disconnectStubDispatcher }, + { { "SetVolume", "qn" }, &org::genivi::audiomanager::setVolumeStubDispatcher }, + { { "VolumeStep", "qn" }, &org::genivi::audiomanager::volumeStepStubDispatcher }, + { { "SetSinkMuteState", "qi" }, &org::genivi::audiomanager::setSinkMuteStateStubDispatcher }, + { { "SetMainSinkSoundProperty", "q(in)" }, &org::genivi::audiomanager::setMainSinkSoundPropertyStubDispatcher }, + { { "SetMainSourceSoundProperty", "q(in)" }, &org::genivi::audiomanager::setMainSourceSoundPropertyStubDispatcher }, + { { "SetSystemProperty", "(in)" }, &org::genivi::audiomanager::setSystemPropertyStubDispatcher }, + { { "GetListMainConnections", "" }, &org::genivi::audiomanager::getListMainConnectionsStubDispatcher }, + { { "GetListMainSinks", "" }, &org::genivi::audiomanager::getListMainSinksStubDispatcher }, + { { "GetListMainSources", "" }, &org::genivi::audiomanager::getListMainSourcesStubDispatcher }, + { { "GetListMainSinkSoundProperties", "q" }, &org::genivi::audiomanager::getListMainSinkSoundPropertiesStubDispatcher }, + { { "GetListMainSourceSoundProperties", "q" }, &org::genivi::audiomanager::getListMainSourceSoundPropertiesStubDispatcher }, + { { "GetListSourceClasses", "" }, &org::genivi::audiomanager::getListSourceClassesStubDispatcher }, + { { "GetListSinkClasses", "" }, &org::genivi::audiomanager::getListSinkClassesStubDispatcher }, + { { "GetListSystemProperties", "" }, &org::genivi::audiomanager::getListSystemPropertiesStubDispatcher }, + { { "GetTimingInformation", "q" }, &org::genivi::audiomanager::getTimingInformationStubDispatcher } +}; diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.h b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.h new file mode 100644 index 0000000..06dd676 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.h @@ -0,0 +1,79 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_AUDIOMANAGER_Command_Interface_DBUS_STUB_ADAPTER_H_ +#define ORG_GENIVI_AUDIOMANAGER_Command_Interface_DBUS_STUB_ADAPTER_H_ + +#include + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace audiomanager { + +typedef CommonAPI::DBus::DBusStubAdapterHelper CommandInterfaceDBusStubAdapterHelper; + +class CommandInterfaceDBusStubAdapter: public CommandInterfaceStubAdapter, public CommandInterfaceDBusStubAdapterHelper { + public: + CommandInterfaceDBusStubAdapter( + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr& dbusConnection, + const std::shared_ptr& stub); + + + void fireNumberOfMainConnectionsChangedEvent(); + void fireMainConnectionStateChangedEvent(const CommandInterface::am_mainConnectionID_t& connectionID, const CommandInterface::am_ConnectionState_e& connectionState); + void fireNumberOfSourceClassesChangedEvent(); + void fireSourceAddedEvent(const CommandInterface::am_SourceType_s& newSource); + void fireSourceRemovedEvent(const CommandInterface::am_sourceID_t& removedSourceID); + void fireMainSourceSoundPropertyChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& SoundProperty); + void fireSourceAvailabilityChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_Availability_s& availability); + void fireNumberOfSinkClassesChangedEvent(); + void fireSinkAddedEvent(const CommandInterface::am_SinkType_s& newSink); + void fireSinkRemovedEvent(const CommandInterface::am_sinkID_t& removedSinkID); + void fireMainSinkSoundPropertyChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& SoundProperty); + void fireSinkAvailabilityChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_Availability_s& availability); + void fireVolumeChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume); + void fireSinkMuteStateChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState); + void fireSystemPropertyChangedEvent(const CommandInterface::am_SystemProperty_s& SystemProperty); + void fireTimingInformationChangedEvent(const CommandInterface::am_mainConnectionID_t& mainConnection, const CommandInterface::am_timeSync_t& time); + void fireSinkUpdatedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_sinkClass_t& sinkClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties); + void fireSourceUpdatedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sourceClass_t& sourceClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties); + void fireSinkNotificationEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_NotificationPayload_s& notification); + void fireSourceNotificationEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_NotificationPayload_s& notification); + void fireMainSinkNotificationConfigurationChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration); + void fireMainSourceNotificationConfigurationChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration); + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; +}; + +} // namespace audiomanager +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_AUDIOMANAGER_Command_Interface_DBUS_STUB_ADAPTER_H_ diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxy.h b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxy.h new file mode 100644 index 0000000..437fefd --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxy.h @@ -0,0 +1,794 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_AUDIOMANAGER_Command_Interface_PROXY_H_ +#define ORG_GENIVI_AUDIOMANAGER_Command_Interface_PROXY_H_ + +#include "CommandInterfaceProxyBase.h" + +#define COMMONAPI_INTERNAL_COMPILATION + + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace audiomanager { + +template +class CommandInterfaceProxy: virtual public CommandInterface, virtual public CommandInterfaceProxyBase, public _AttributeExtensions... { + public: + CommandInterfaceProxy(std::shared_ptr delegate); + ~CommandInterfaceProxy(); + + + /// Returns the wrapper class that provides access to the broadcast NumberOfMainConnectionsChanged. + virtual NumberOfMainConnectionsChangedEvent& getNumberOfMainConnectionsChangedEvent() { + return delegate_->getNumberOfMainConnectionsChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast MainConnectionStateChanged. + virtual MainConnectionStateChangedEvent& getMainConnectionStateChangedEvent() { + return delegate_->getMainConnectionStateChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast NumberOfSourceClassesChanged. + virtual NumberOfSourceClassesChangedEvent& getNumberOfSourceClassesChangedEvent() { + return delegate_->getNumberOfSourceClassesChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SourceAdded. + virtual SourceAddedEvent& getSourceAddedEvent() { + return delegate_->getSourceAddedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SourceRemoved. + virtual SourceRemovedEvent& getSourceRemovedEvent() { + return delegate_->getSourceRemovedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast MainSourceSoundPropertyChanged. + virtual MainSourceSoundPropertyChangedEvent& getMainSourceSoundPropertyChangedEvent() { + return delegate_->getMainSourceSoundPropertyChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SourceAvailabilityChanged. + virtual SourceAvailabilityChangedEvent& getSourceAvailabilityChangedEvent() { + return delegate_->getSourceAvailabilityChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast NumberOfSinkClassesChanged. + virtual NumberOfSinkClassesChangedEvent& getNumberOfSinkClassesChangedEvent() { + return delegate_->getNumberOfSinkClassesChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SinkAdded. + virtual SinkAddedEvent& getSinkAddedEvent() { + return delegate_->getSinkAddedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SinkRemoved. + virtual SinkRemovedEvent& getSinkRemovedEvent() { + return delegate_->getSinkRemovedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast MainSinkSoundPropertyChanged. + virtual MainSinkSoundPropertyChangedEvent& getMainSinkSoundPropertyChangedEvent() { + return delegate_->getMainSinkSoundPropertyChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SinkAvailabilityChanged. + virtual SinkAvailabilityChangedEvent& getSinkAvailabilityChangedEvent() { + return delegate_->getSinkAvailabilityChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast VolumeChanged. + virtual VolumeChangedEvent& getVolumeChangedEvent() { + return delegate_->getVolumeChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SinkMuteStateChanged. + virtual SinkMuteStateChangedEvent& getSinkMuteStateChangedEvent() { + return delegate_->getSinkMuteStateChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SystemPropertyChanged. + virtual SystemPropertyChangedEvent& getSystemPropertyChangedEvent() { + return delegate_->getSystemPropertyChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast TimingInformationChanged. + virtual TimingInformationChangedEvent& getTimingInformationChangedEvent() { + return delegate_->getTimingInformationChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SinkUpdated. + virtual SinkUpdatedEvent& getSinkUpdatedEvent() { + return delegate_->getSinkUpdatedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SourceUpdated. + virtual SourceUpdatedEvent& getSourceUpdatedEvent() { + return delegate_->getSourceUpdatedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SinkNotification. + virtual SinkNotificationEvent& getSinkNotificationEvent() { + return delegate_->getSinkNotificationEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SourceNotification. + virtual SourceNotificationEvent& getSourceNotificationEvent() { + return delegate_->getSourceNotificationEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast MainSinkNotificationConfigurationChanged. + virtual MainSinkNotificationConfigurationChangedEvent& getMainSinkNotificationConfigurationChangedEvent() { + return delegate_->getMainSinkNotificationConfigurationChangedEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast MainSourceNotificationConfigurationChanged. + virtual MainSourceNotificationConfigurationChangedEvent& getMainSourceNotificationConfigurationChangedEvent() { + return delegate_->getMainSourceNotificationConfigurationChangedEvent(); + } + + + + /** + * Calls Connect with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void Connect(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID); + /** + * Calls Connect with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future ConnectAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, ConnectAsyncCallback callback); + + /** + * Calls Disconnect with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void Disconnect(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + /** + * Calls Disconnect with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future DisconnectAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, DisconnectAsyncCallback callback); + + /** + * Calls SetVolume with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void SetVolume(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + /** + * Calls SetVolume with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future SetVolumeAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, SetVolumeAsyncCallback callback); + + /** + * Calls VolumeStep with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void VolumeStep(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + /** + * Calls VolumeStep with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future VolumeStepAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, VolumeStepAsyncCallback callback); + + /** + * Calls SetSinkMuteState with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void SetSinkMuteState(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + /** + * Calls SetSinkMuteState with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future SetSinkMuteStateAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, SetSinkMuteStateAsyncCallback callback); + + /** + * Calls SetMainSinkSoundProperty with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void SetMainSinkSoundProperty(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + /** + * Calls SetMainSinkSoundProperty with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future SetMainSinkSoundPropertyAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSinkSoundPropertyAsyncCallback callback); + + /** + * Calls SetMainSourceSoundProperty with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void SetMainSourceSoundProperty(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + /** + * Calls SetMainSourceSoundProperty with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future SetMainSourceSoundPropertyAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSourceSoundPropertyAsyncCallback callback); + + /** + * Calls SetSystemProperty with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void SetSystemProperty(const CommandInterface::am_SystemProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result); + /** + * Calls SetSystemProperty with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future SetSystemPropertyAsync(const CommandInterface::am_SystemProperty_s& soundProperty, SetSystemPropertyAsyncCallback callback); + + /** + * Calls GetListMainConnections with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetListMainConnections(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections); + /** + * Calls GetListMainConnections with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetListMainConnectionsAsync(GetListMainConnectionsAsyncCallback callback); + + /** + * Calls GetListMainSinks with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetListMainSinks(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks); + /** + * Calls GetListMainSinks with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetListMainSinksAsync(GetListMainSinksAsyncCallback callback); + + /** + * Calls GetListMainSources with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetListMainSources(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources); + /** + * Calls GetListMainSources with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetListMainSourcesAsync(GetListMainSourcesAsyncCallback callback); + + /** + * Calls GetListMainSinkSoundProperties with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetListMainSinkSoundProperties(const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties); + /** + * Calls GetListMainSinkSoundProperties with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetListMainSinkSoundPropertiesAsync(const CommandInterface::am_sinkID_t& sinkID, GetListMainSinkSoundPropertiesAsyncCallback callback); + + /** + * Calls GetListMainSourceSoundProperties with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetListMainSourceSoundProperties(const CommandInterface::am_sourceID_t& sourceID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties); + /** + * Calls GetListMainSourceSoundProperties with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetListMainSourceSoundPropertiesAsync(const CommandInterface::am_sourceID_t& sourceID, GetListMainSourceSoundPropertiesAsyncCallback callback); + + /** + * Calls GetListSourceClasses with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetListSourceClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses); + /** + * Calls GetListSourceClasses with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetListSourceClassesAsync(GetListSourceClassesAsyncCallback callback); + + /** + * Calls GetListSinkClasses with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetListSinkClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses); + /** + * Calls GetListSinkClasses with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetListSinkClassesAsync(GetListSinkClassesAsyncCallback callback); + + /** + * Calls GetListSystemProperties with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetListSystemProperties(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties); + /** + * Calls GetListSystemProperties with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetListSystemPropertiesAsync(GetListSystemPropertiesAsyncCallback callback); + + /** + * Calls GetTimingInformation with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetTimingInformation(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay); + /** + * Calls GetTimingInformation with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetTimingInformationAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, GetTimingInformationAsyncCallback callback); + + /// Returns the CommonAPI address of the remote partner this proxy communicates with. + virtual std::string getAddress() const; + + /// Returns the domain of the remote partner this proxy communicates with. + virtual const std::string& getDomain() const; + + /// Returns the service ID of the remote partner this proxy communicates with. + virtual const std::string& getServiceId() const; + + /// Returns the instance ID of the remote partner this proxy communicates with. + virtual const std::string& getInstanceId() const; + + /// Returns true if the remote partner for this proxy is available. + virtual bool isAvailable() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr delegate_; +}; + + +// +// CommandInterfaceProxy Implementation +// +template +CommandInterfaceProxy<_AttributeExtensions...>::CommandInterfaceProxy(std::shared_ptr delegate): + delegate_(std::dynamic_pointer_cast(delegate)), + _AttributeExtensions(*(std::dynamic_pointer_cast(delegate)))... { +} + +template +CommandInterfaceProxy<_AttributeExtensions...>::~CommandInterfaceProxy() { +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::Connect(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID) { + delegate_->Connect(sourceID, sinkID, callStatus, result, mainConnectionID); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::ConnectAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, ConnectAsyncCallback callback) { + return delegate_->ConnectAsync(sourceID, sinkID, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::Disconnect(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + delegate_->Disconnect(mainConnectionID, callStatus, result); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::DisconnectAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, DisconnectAsyncCallback callback) { + return delegate_->DisconnectAsync(mainConnectionID, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::SetVolume(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + delegate_->SetVolume(sinkID, volume, callStatus, result); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::SetVolumeAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, SetVolumeAsyncCallback callback) { + return delegate_->SetVolumeAsync(sinkID, volume, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::VolumeStep(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + delegate_->VolumeStep(sinkID, volumeStep, callStatus, result); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::VolumeStepAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, VolumeStepAsyncCallback callback) { + return delegate_->VolumeStepAsync(sinkID, volumeStep, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::SetSinkMuteState(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + delegate_->SetSinkMuteState(sinkID, muteState, callStatus, result); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::SetSinkMuteStateAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, SetSinkMuteStateAsyncCallback callback) { + return delegate_->SetSinkMuteStateAsync(sinkID, muteState, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::SetMainSinkSoundProperty(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + delegate_->SetMainSinkSoundProperty(sinkID, soundProperty, callStatus, result); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::SetMainSinkSoundPropertyAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSinkSoundPropertyAsyncCallback callback) { + return delegate_->SetMainSinkSoundPropertyAsync(sinkID, soundProperty, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::SetMainSourceSoundProperty(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + delegate_->SetMainSourceSoundProperty(sourceID, soundProperty, callStatus, result); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::SetMainSourceSoundPropertyAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSourceSoundPropertyAsyncCallback callback) { + return delegate_->SetMainSourceSoundPropertyAsync(sourceID, soundProperty, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::SetSystemProperty(const CommandInterface::am_SystemProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) { + delegate_->SetSystemProperty(soundProperty, callStatus, result); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::SetSystemPropertyAsync(const CommandInterface::am_SystemProperty_s& soundProperty, SetSystemPropertyAsyncCallback callback) { + return delegate_->SetSystemPropertyAsync(soundProperty, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::GetListMainConnections(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections) { + delegate_->GetListMainConnections(callStatus, result, listConnections); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::GetListMainConnectionsAsync(GetListMainConnectionsAsyncCallback callback) { + return delegate_->GetListMainConnectionsAsync(callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::GetListMainSinks(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks) { + delegate_->GetListMainSinks(callStatus, result, listMainSinks); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::GetListMainSinksAsync(GetListMainSinksAsyncCallback callback) { + return delegate_->GetListMainSinksAsync(callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::GetListMainSources(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources) { + delegate_->GetListMainSources(callStatus, result, listMainSources); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::GetListMainSourcesAsync(GetListMainSourcesAsyncCallback callback) { + return delegate_->GetListMainSourcesAsync(callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::GetListMainSinkSoundProperties(const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties) { + delegate_->GetListMainSinkSoundProperties(sinkID, callStatus, result, listSoundProperties); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::GetListMainSinkSoundPropertiesAsync(const CommandInterface::am_sinkID_t& sinkID, GetListMainSinkSoundPropertiesAsyncCallback callback) { + return delegate_->GetListMainSinkSoundPropertiesAsync(sinkID, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::GetListMainSourceSoundProperties(const CommandInterface::am_sourceID_t& sourceID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties) { + delegate_->GetListMainSourceSoundProperties(sourceID, callStatus, result, listSourceProperties); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::GetListMainSourceSoundPropertiesAsync(const CommandInterface::am_sourceID_t& sourceID, GetListMainSourceSoundPropertiesAsyncCallback callback) { + return delegate_->GetListMainSourceSoundPropertiesAsync(sourceID, callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::GetListSourceClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses) { + delegate_->GetListSourceClasses(callStatus, result, listSourceClasses); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::GetListSourceClassesAsync(GetListSourceClassesAsyncCallback callback) { + return delegate_->GetListSourceClassesAsync(callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::GetListSinkClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses) { + delegate_->GetListSinkClasses(callStatus, result, listSinkClasses); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::GetListSinkClassesAsync(GetListSinkClassesAsyncCallback callback) { + return delegate_->GetListSinkClassesAsync(callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::GetListSystemProperties(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties) { + delegate_->GetListSystemProperties(callStatus, result, listSystemProperties); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::GetListSystemPropertiesAsync(GetListSystemPropertiesAsyncCallback callback) { + return delegate_->GetListSystemPropertiesAsync(callback); +} + +template +void CommandInterfaceProxy<_AttributeExtensions...>::GetTimingInformation(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay) { + delegate_->GetTimingInformation(mainConnectionID, callStatus, result, delay); +} + +template +std::future CommandInterfaceProxy<_AttributeExtensions...>::GetTimingInformationAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, GetTimingInformationAsyncCallback callback) { + return delegate_->GetTimingInformationAsync(mainConnectionID, callback); +} + + +template +std::string CommandInterfaceProxy<_AttributeExtensions...>::getAddress() const { + return delegate_->getAddress(); +} + +template +const std::string& CommandInterfaceProxy<_AttributeExtensions...>::getDomain() const { + return delegate_->getDomain(); +} + +template +const std::string& CommandInterfaceProxy<_AttributeExtensions...>::getServiceId() const { + return delegate_->getServiceId(); +} + +template +const std::string& CommandInterfaceProxy<_AttributeExtensions...>::getInstanceId() const { + return delegate_->getInstanceId(); +} + +template +bool CommandInterfaceProxy<_AttributeExtensions...>::isAvailable() const { + return delegate_->isAvailable(); +} + +template +CommonAPI::ProxyStatusEvent& CommandInterfaceProxy<_AttributeExtensions...>::getProxyStatusEvent() { + return delegate_->getProxyStatusEvent(); +} + +template +CommonAPI::InterfaceVersionAttribute& CommandInterfaceProxy<_AttributeExtensions...>::getInterfaceVersionAttribute() { + return delegate_->getInterfaceVersionAttribute(); +} + +} // namespace audiomanager +} // namespace genivi +} // namespace org + + + +#endif // ORG_GENIVI_AUDIOMANAGER_Command_Interface_PROXY_H_ diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxyBase.h b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxyBase.h new file mode 100644 index 0000000..f7615a0 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxyBase.h @@ -0,0 +1,170 @@ + /* + * This file was generated by the CommonAPI Generators. + * + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + #ifndef ORG_GENIVI_AUDIOMANAGER_Command_Interface_PROXY_BASE_H_ + #define ORG_GENIVI_AUDIOMANAGER_Command_Interface_PROXY_BASE_H_ + + #include "CommandInterface.h" + + + #include + + #define COMMONAPI_INTERNAL_COMPILATION + + #include + #include + #include + #include + #include + #include + + #include + #include + #include + #include + + #undef COMMONAPI_INTERNAL_COMPILATION + + namespace org { + namespace genivi { + namespace audiomanager { + + class CommandInterfaceProxyBase: virtual public CommonAPI::Proxy { + public: + typedef CommonAPI::Event<> NumberOfMainConnectionsChangedEvent; + typedef CommonAPI::Event MainConnectionStateChangedEvent; + typedef CommonAPI::Event<> NumberOfSourceClassesChangedEvent; + typedef CommonAPI::Event SourceAddedEvent; + typedef CommonAPI::Event SourceRemovedEvent; + typedef CommonAPI::Event MainSourceSoundPropertyChangedEvent; + typedef CommonAPI::Event SourceAvailabilityChangedEvent; + typedef CommonAPI::Event<> NumberOfSinkClassesChangedEvent; + typedef CommonAPI::Event SinkAddedEvent; + typedef CommonAPI::Event SinkRemovedEvent; + typedef CommonAPI::Event MainSinkSoundPropertyChangedEvent; + typedef CommonAPI::Event SinkAvailabilityChangedEvent; + typedef CommonAPI::Event VolumeChangedEvent; + typedef CommonAPI::Event SinkMuteStateChangedEvent; + typedef CommonAPI::Event SystemPropertyChangedEvent; + typedef CommonAPI::Event TimingInformationChangedEvent; + typedef CommonAPI::Event SinkUpdatedEvent; + typedef CommonAPI::Event SourceUpdatedEvent; + typedef CommonAPI::Event SinkNotificationEvent; + typedef CommonAPI::Event SourceNotificationEvent; + typedef CommonAPI::Event MainSinkNotificationConfigurationChangedEvent; + typedef CommonAPI::Event MainSourceNotificationConfigurationChangedEvent; + typedef std::function ConnectAsyncCallback; + typedef std::function DisconnectAsyncCallback; + typedef std::function SetVolumeAsyncCallback; + typedef std::function VolumeStepAsyncCallback; + typedef std::function SetSinkMuteStateAsyncCallback; + typedef std::function SetMainSinkSoundPropertyAsyncCallback; + typedef std::function SetMainSourceSoundPropertyAsyncCallback; + typedef std::function SetSystemPropertyAsyncCallback; + typedef std::function GetListMainConnectionsAsyncCallback; + typedef std::function GetListMainSinksAsyncCallback; + typedef std::function GetListMainSourcesAsyncCallback; + typedef std::function GetListMainSinkSoundPropertiesAsyncCallback; + typedef std::function GetListMainSourceSoundPropertiesAsyncCallback; + typedef std::function GetListSourceClassesAsyncCallback; + typedef std::function GetListSinkClassesAsyncCallback; + typedef std::function GetListSystemPropertiesAsyncCallback; + typedef std::function GetTimingInformationAsyncCallback; + + + virtual NumberOfMainConnectionsChangedEvent& getNumberOfMainConnectionsChangedEvent() = 0; + virtual MainConnectionStateChangedEvent& getMainConnectionStateChangedEvent() = 0; + virtual NumberOfSourceClassesChangedEvent& getNumberOfSourceClassesChangedEvent() = 0; + virtual SourceAddedEvent& getSourceAddedEvent() = 0; + virtual SourceRemovedEvent& getSourceRemovedEvent() = 0; + virtual MainSourceSoundPropertyChangedEvent& getMainSourceSoundPropertyChangedEvent() = 0; + virtual SourceAvailabilityChangedEvent& getSourceAvailabilityChangedEvent() = 0; + virtual NumberOfSinkClassesChangedEvent& getNumberOfSinkClassesChangedEvent() = 0; + virtual SinkAddedEvent& getSinkAddedEvent() = 0; + virtual SinkRemovedEvent& getSinkRemovedEvent() = 0; + virtual MainSinkSoundPropertyChangedEvent& getMainSinkSoundPropertyChangedEvent() = 0; + virtual SinkAvailabilityChangedEvent& getSinkAvailabilityChangedEvent() = 0; + virtual VolumeChangedEvent& getVolumeChangedEvent() = 0; + virtual SinkMuteStateChangedEvent& getSinkMuteStateChangedEvent() = 0; + virtual SystemPropertyChangedEvent& getSystemPropertyChangedEvent() = 0; + virtual TimingInformationChangedEvent& getTimingInformationChangedEvent() = 0; + virtual SinkUpdatedEvent& getSinkUpdatedEvent() = 0; + virtual SourceUpdatedEvent& getSourceUpdatedEvent() = 0; + virtual SinkNotificationEvent& getSinkNotificationEvent() = 0; + virtual SourceNotificationEvent& getSourceNotificationEvent() = 0; + virtual MainSinkNotificationConfigurationChangedEvent& getMainSinkNotificationConfigurationChangedEvent() = 0; + virtual MainSourceNotificationConfigurationChangedEvent& getMainSourceNotificationConfigurationChangedEvent() = 0; + + + virtual void Connect(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID) = 0; + virtual std::future ConnectAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sinkID_t& sinkID, ConnectAsyncCallback callback) = 0; + + virtual void Disconnect(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) = 0; + virtual std::future DisconnectAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, DisconnectAsyncCallback callback) = 0; + + virtual void SetVolume(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) = 0; + virtual std::future SetVolumeAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume, SetVolumeAsyncCallback callback) = 0; + + virtual void VolumeStep(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) = 0; + virtual std::future VolumeStepAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volumeStep, VolumeStepAsyncCallback callback) = 0; + + virtual void SetSinkMuteState(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) = 0; + virtual std::future SetSinkMuteStateAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState, SetSinkMuteStateAsyncCallback callback) = 0; + + virtual void SetMainSinkSoundProperty(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) = 0; + virtual std::future SetMainSinkSoundPropertyAsync(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSinkSoundPropertyAsyncCallback callback) = 0; + + virtual void SetMainSourceSoundProperty(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) = 0; + virtual std::future SetMainSourceSoundPropertyAsync(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& soundProperty, SetMainSourceSoundPropertyAsyncCallback callback) = 0; + + virtual void SetSystemProperty(const CommandInterface::am_SystemProperty_s& soundProperty, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result) = 0; + virtual std::future SetSystemPropertyAsync(const CommandInterface::am_SystemProperty_s& soundProperty, SetSystemPropertyAsyncCallback callback) = 0; + + virtual void GetListMainConnections(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections) = 0; + virtual std::future GetListMainConnectionsAsync(GetListMainConnectionsAsyncCallback callback) = 0; + + virtual void GetListMainSinks(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks) = 0; + virtual std::future GetListMainSinksAsync(GetListMainSinksAsyncCallback callback) = 0; + + virtual void GetListMainSources(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources) = 0; + virtual std::future GetListMainSourcesAsync(GetListMainSourcesAsyncCallback callback) = 0; + + virtual void GetListMainSinkSoundProperties(const CommandInterface::am_sinkID_t& sinkID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties) = 0; + virtual std::future GetListMainSinkSoundPropertiesAsync(const CommandInterface::am_sinkID_t& sinkID, GetListMainSinkSoundPropertiesAsyncCallback callback) = 0; + + virtual void GetListMainSourceSoundProperties(const CommandInterface::am_sourceID_t& sourceID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties) = 0; + virtual std::future GetListMainSourceSoundPropertiesAsync(const CommandInterface::am_sourceID_t& sourceID, GetListMainSourceSoundPropertiesAsyncCallback callback) = 0; + + virtual void GetListSourceClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses) = 0; + virtual std::future GetListSourceClassesAsync(GetListSourceClassesAsyncCallback callback) = 0; + + virtual void GetListSinkClasses(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses) = 0; + virtual std::future GetListSinkClassesAsync(GetListSinkClassesAsyncCallback callback) = 0; + + virtual void GetListSystemProperties(CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties) = 0; + virtual std::future GetListSystemPropertiesAsync(GetListSystemPropertiesAsyncCallback callback) = 0; + + virtual void GetTimingInformation(const CommandInterface::am_mainConnectionID_t& mainConnectionID, CommonAPI::CallStatus& callStatus, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay) = 0; + virtual std::future GetTimingInformationAsync(const CommandInterface::am_mainConnectionID_t& mainConnectionID, GetTimingInformationAsyncCallback callback) = 0; + }; + + } // namespace audiomanager + } // namespace genivi + } // namespace org + + #endif // ORG_GENIVI_AUDIOMANAGER_Command_Interface_PROXY_BASE_H_ diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStub.h b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStub.h new file mode 100644 index 0000000..2e26869 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStub.h @@ -0,0 +1,282 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_AUDIOMANAGER_Command_Interface_STUB_H_ +#define ORG_GENIVI_AUDIOMANAGER_Command_Interface_STUB_H_ + + + +#include + +#include "CommandInterface.h" + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include +#include +#include +#include +#include + +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace audiomanager { + +/** + * Receives messages from remote and handles all dispatching of deserialized calls + * to a stub for the service CommandInterface. Also provides means to send broadcasts + * and attribute-changed-notifications of observable attributes as defined by this service. + * An application developer should not need to bother with this class. + */ +class CommandInterfaceStubAdapter: virtual public CommonAPI::StubAdapter, public CommandInterface { + public: + + /** + * Sends a broadcast event for NumberOfMainConnectionsChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireNumberOfMainConnectionsChangedEvent() = 0; + /** + * Sends a broadcast event for MainConnectionStateChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireMainConnectionStateChangedEvent(const CommandInterface::am_mainConnectionID_t& connectionID, const CommandInterface::am_ConnectionState_e& connectionState) = 0; + /** + * Sends a broadcast event for NumberOfSourceClassesChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireNumberOfSourceClassesChangedEvent() = 0; + /** + * Sends a broadcast event for SourceAdded. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSourceAddedEvent(const CommandInterface::am_SourceType_s& newSource) = 0; + /** + * Sends a broadcast event for SourceRemoved. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSourceRemovedEvent(const CommandInterface::am_sourceID_t& removedSourceID) = 0; + /** + * Sends a broadcast event for MainSourceSoundPropertyChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireMainSourceSoundPropertyChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& SoundProperty) = 0; + /** + * Sends a broadcast event for SourceAvailabilityChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSourceAvailabilityChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_Availability_s& availability) = 0; + /** + * Sends a broadcast event for NumberOfSinkClassesChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireNumberOfSinkClassesChangedEvent() = 0; + /** + * Sends a broadcast event for SinkAdded. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSinkAddedEvent(const CommandInterface::am_SinkType_s& newSink) = 0; + /** + * Sends a broadcast event for SinkRemoved. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSinkRemovedEvent(const CommandInterface::am_sinkID_t& removedSinkID) = 0; + /** + * Sends a broadcast event for MainSinkSoundPropertyChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireMainSinkSoundPropertyChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& SoundProperty) = 0; + /** + * Sends a broadcast event for SinkAvailabilityChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSinkAvailabilityChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_Availability_s& availability) = 0; + /** + * Sends a broadcast event for VolumeChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireVolumeChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume) = 0; + /** + * Sends a broadcast event for SinkMuteStateChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSinkMuteStateChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState) = 0; + /** + * Sends a broadcast event for SystemPropertyChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSystemPropertyChangedEvent(const CommandInterface::am_SystemProperty_s& SystemProperty) = 0; + /** + * Sends a broadcast event for TimingInformationChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireTimingInformationChangedEvent(const CommandInterface::am_mainConnectionID_t& mainConnection, const CommandInterface::am_timeSync_t& time) = 0; + /** + * Sends a broadcast event for SinkUpdated. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSinkUpdatedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_sinkClass_t& sinkClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties) = 0; + /** + * Sends a broadcast event for SourceUpdated. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSourceUpdatedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sourceClass_t& sourceClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties) = 0; + /** + * Sends a broadcast event for SinkNotification. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSinkNotificationEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_NotificationPayload_s& notification) = 0; + /** + * Sends a broadcast event for SourceNotification. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireSourceNotificationEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_NotificationPayload_s& notification) = 0; + /** + * Sends a broadcast event for MainSinkNotificationConfigurationChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireMainSinkNotificationConfigurationChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration) = 0; + /** + * Sends a broadcast event for MainSourceNotificationConfigurationChanged. Should not be called directly. + * Instead, the "fireEvent" methods of the stub should be used. + */ + virtual void fireMainSourceNotificationConfigurationChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration) = 0; +}; + + +/** + * Defines the necessary callbacks to handle remote set events related to the attributes + * defined in the IDL description for CommandInterface. + * For each attribute two callbacks are defined: + * - a verification callback that allows to verify the requested value and to prevent setting + * e.g. an invalid value ("onRemoteSet"). + * - an action callback to do local work after the attribute value has been changed + * ("onRemoteChanged"). + * + * This class and the one below are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class CommandInterfaceStubRemoteEvent { + public: + virtual ~CommandInterfaceStubRemoteEvent() { } + +}; + + +/** + * Defines the interface that must be implemented by any class that should provide + * the service CommandInterface to remote clients. + * This class and the one above are the ones an application developer needs to have + * a look at if he wants to implement a service. + */ +class CommandInterfaceStub : public CommonAPI::Stub { + public: + virtual ~CommandInterfaceStub() { } + + + /// This is the method that will be called on remote calls on the method Connect. + virtual void Connect(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID) = 0; + /// This is the method that will be called on remote calls on the method Disconnect. + virtual void Disconnect(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result) = 0; + /// This is the method that will be called on remote calls on the method SetVolume. + virtual void SetVolume(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volume, CommandInterface::am_Error_e& result) = 0; + /// This is the method that will be called on remote calls on the method VolumeStep. + virtual void VolumeStep(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volumeStep, CommandInterface::am_Error_e& result) = 0; + /// This is the method that will be called on remote calls on the method SetSinkMuteState. + virtual void SetSinkMuteState(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MuteState_e muteState, CommandInterface::am_Error_e& result) = 0; + /// This is the method that will be called on remote calls on the method SetMainSinkSoundProperty. + virtual void SetMainSinkSoundProperty(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result) = 0; + /// This is the method that will be called on remote calls on the method SetMainSourceSoundProperty. + virtual void SetMainSourceSoundProperty(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result) = 0; + /// This is the method that will be called on remote calls on the method SetSystemProperty. + virtual void SetSystemProperty(CommandInterface::am_SystemProperty_s soundProperty, CommandInterface::am_Error_e& result) = 0; + /// This is the method that will be called on remote calls on the method GetListMainConnections. + virtual void GetListMainConnections(CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections) = 0; + /// This is the method that will be called on remote calls on the method GetListMainSinks. + virtual void GetListMainSinks(CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks) = 0; + /// This is the method that will be called on remote calls on the method GetListMainSources. + virtual void GetListMainSources(CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources) = 0; + /// This is the method that will be called on remote calls on the method GetListMainSinkSoundProperties. + virtual void GetListMainSinkSoundProperties(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties) = 0; + /// This is the method that will be called on remote calls on the method GetListMainSourceSoundProperties. + virtual void GetListMainSourceSoundProperties(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties) = 0; + /// This is the method that will be called on remote calls on the method GetListSourceClasses. + virtual void GetListSourceClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses) = 0; + /// This is the method that will be called on remote calls on the method GetListSinkClasses. + virtual void GetListSinkClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses) = 0; + /// This is the method that will be called on remote calls on the method GetListSystemProperties. + virtual void GetListSystemProperties(CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties) = 0; + /// This is the method that will be called on remote calls on the method GetTimingInformation. + virtual void GetTimingInformation(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay) = 0; + + /// Sends a broadcast event for NumberOfMainConnectionsChanged. + virtual void fireNumberOfMainConnectionsChangedEvent() = 0; + /// Sends a broadcast event for MainConnectionStateChanged. + virtual void fireMainConnectionStateChangedEvent(const CommandInterface::am_mainConnectionID_t& connectionID, const CommandInterface::am_ConnectionState_e& connectionState) = 0; + /// Sends a broadcast event for NumberOfSourceClassesChanged. + virtual void fireNumberOfSourceClassesChangedEvent() = 0; + /// Sends a broadcast event for SourceAdded. + virtual void fireSourceAddedEvent(const CommandInterface::am_SourceType_s& newSource) = 0; + /// Sends a broadcast event for SourceRemoved. + virtual void fireSourceRemovedEvent(const CommandInterface::am_sourceID_t& removedSourceID) = 0; + /// Sends a broadcast event for MainSourceSoundPropertyChanged. + virtual void fireMainSourceSoundPropertyChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& SoundProperty) = 0; + /// Sends a broadcast event for SourceAvailabilityChanged. + virtual void fireSourceAvailabilityChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_Availability_s& availability) = 0; + /// Sends a broadcast event for NumberOfSinkClassesChanged. + virtual void fireNumberOfSinkClassesChangedEvent() = 0; + /// Sends a broadcast event for SinkAdded. + virtual void fireSinkAddedEvent(const CommandInterface::am_SinkType_s& newSink) = 0; + /// Sends a broadcast event for SinkRemoved. + virtual void fireSinkRemovedEvent(const CommandInterface::am_sinkID_t& removedSinkID) = 0; + /// Sends a broadcast event for MainSinkSoundPropertyChanged. + virtual void fireMainSinkSoundPropertyChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& SoundProperty) = 0; + /// Sends a broadcast event for SinkAvailabilityChanged. + virtual void fireSinkAvailabilityChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_Availability_s& availability) = 0; + /// Sends a broadcast event for VolumeChanged. + virtual void fireVolumeChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume) = 0; + /// Sends a broadcast event for SinkMuteStateChanged. + virtual void fireSinkMuteStateChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState) = 0; + /// Sends a broadcast event for SystemPropertyChanged. + virtual void fireSystemPropertyChangedEvent(const CommandInterface::am_SystemProperty_s& SystemProperty) = 0; + /// Sends a broadcast event for TimingInformationChanged. + virtual void fireTimingInformationChangedEvent(const CommandInterface::am_mainConnectionID_t& mainConnection, const CommandInterface::am_timeSync_t& time) = 0; + /// Sends a broadcast event for SinkUpdated. + virtual void fireSinkUpdatedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_sinkClass_t& sinkClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties) = 0; + /// Sends a broadcast event for SourceUpdated. + virtual void fireSourceUpdatedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sourceClass_t& sourceClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties) = 0; + /// Sends a broadcast event for SinkNotification. + virtual void fireSinkNotificationEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_NotificationPayload_s& notification) = 0; + /// Sends a broadcast event for SourceNotification. + virtual void fireSourceNotificationEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_NotificationPayload_s& notification) = 0; + /// Sends a broadcast event for MainSinkNotificationConfigurationChanged. + virtual void fireMainSinkNotificationConfigurationChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration) = 0; + /// Sends a broadcast event for MainSourceNotificationConfigurationChanged. + virtual void fireMainSourceNotificationConfigurationChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration) = 0; +}; + +} // namespace audiomanager +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_AUDIOMANAGER_Command_Interface_STUB_H_ diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.cpp b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.cpp new file mode 100644 index 0000000..0f44b08 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.cpp @@ -0,0 +1,177 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#include + +namespace org { +namespace genivi { +namespace audiomanager { + +CommandInterfaceStubDefault::CommandInterfaceStubDefault(): + remoteEventHandler_(this) { +} + +CommandInterfaceStubRemoteEvent* CommandInterfaceStubDefault::initStubAdapter(const std::shared_ptr& stubAdapter) { + stubAdapter_ = stubAdapter; + return &remoteEventHandler_; +} + + +void CommandInterfaceStubDefault::Connect(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID) { + // No operation in default +} + +void CommandInterfaceStubDefault::Disconnect(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result) { + // No operation in default +} + +void CommandInterfaceStubDefault::SetVolume(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volume, CommandInterface::am_Error_e& result) { + // No operation in default +} + +void CommandInterfaceStubDefault::VolumeStep(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volumeStep, CommandInterface::am_Error_e& result) { + // No operation in default +} + +void CommandInterfaceStubDefault::SetSinkMuteState(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MuteState_e muteState, CommandInterface::am_Error_e& result) { + // No operation in default +} + +void CommandInterfaceStubDefault::SetMainSinkSoundProperty(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result) { + // No operation in default +} + +void CommandInterfaceStubDefault::SetMainSourceSoundProperty(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result) { + // No operation in default +} + +void CommandInterfaceStubDefault::SetSystemProperty(CommandInterface::am_SystemProperty_s soundProperty, CommandInterface::am_Error_e& result) { + // No operation in default +} + +void CommandInterfaceStubDefault::GetListMainConnections(CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections) { + // No operation in default +} + +void CommandInterfaceStubDefault::GetListMainSinks(CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks) { + // No operation in default +} + +void CommandInterfaceStubDefault::GetListMainSources(CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources) { + // No operation in default +} + +void CommandInterfaceStubDefault::GetListMainSinkSoundProperties(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties) { + // No operation in default +} + +void CommandInterfaceStubDefault::GetListMainSourceSoundProperties(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties) { + // No operation in default +} + +void CommandInterfaceStubDefault::GetListSourceClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses) { + // No operation in default +} + +void CommandInterfaceStubDefault::GetListSinkClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses) { + // No operation in default +} + +void CommandInterfaceStubDefault::GetListSystemProperties(CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties) { + // No operation in default +} + +void CommandInterfaceStubDefault::GetTimingInformation(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay) { + // No operation in default +} + + +void CommandInterfaceStubDefault::fireNumberOfMainConnectionsChangedEvent() { + stubAdapter_->fireNumberOfMainConnectionsChangedEvent(); +} +void CommandInterfaceStubDefault::fireMainConnectionStateChangedEvent(const CommandInterface::am_mainConnectionID_t& connectionID, const CommandInterface::am_ConnectionState_e& connectionState) { + stubAdapter_->fireMainConnectionStateChangedEvent(connectionID, connectionState); +} +void CommandInterfaceStubDefault::fireNumberOfSourceClassesChangedEvent() { + stubAdapter_->fireNumberOfSourceClassesChangedEvent(); +} +void CommandInterfaceStubDefault::fireSourceAddedEvent(const CommandInterface::am_SourceType_s& newSource) { + stubAdapter_->fireSourceAddedEvent(newSource); +} +void CommandInterfaceStubDefault::fireSourceRemovedEvent(const CommandInterface::am_sourceID_t& removedSourceID) { + stubAdapter_->fireSourceRemovedEvent(removedSourceID); +} +void CommandInterfaceStubDefault::fireMainSourceSoundPropertyChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& SoundProperty) { + stubAdapter_->fireMainSourceSoundPropertyChangedEvent(sourceID, SoundProperty); +} +void CommandInterfaceStubDefault::fireSourceAvailabilityChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_Availability_s& availability) { + stubAdapter_->fireSourceAvailabilityChangedEvent(sourceID, availability); +} +void CommandInterfaceStubDefault::fireNumberOfSinkClassesChangedEvent() { + stubAdapter_->fireNumberOfSinkClassesChangedEvent(); +} +void CommandInterfaceStubDefault::fireSinkAddedEvent(const CommandInterface::am_SinkType_s& newSink) { + stubAdapter_->fireSinkAddedEvent(newSink); +} +void CommandInterfaceStubDefault::fireSinkRemovedEvent(const CommandInterface::am_sinkID_t& removedSinkID) { + stubAdapter_->fireSinkRemovedEvent(removedSinkID); +} +void CommandInterfaceStubDefault::fireMainSinkSoundPropertyChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& SoundProperty) { + stubAdapter_->fireMainSinkSoundPropertyChangedEvent(sinkID, SoundProperty); +} +void CommandInterfaceStubDefault::fireSinkAvailabilityChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_Availability_s& availability) { + stubAdapter_->fireSinkAvailabilityChangedEvent(sinkID, availability); +} +void CommandInterfaceStubDefault::fireVolumeChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume) { + stubAdapter_->fireVolumeChangedEvent(sinkID, volume); +} +void CommandInterfaceStubDefault::fireSinkMuteStateChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState) { + stubAdapter_->fireSinkMuteStateChangedEvent(sinkID, muteState); +} +void CommandInterfaceStubDefault::fireSystemPropertyChangedEvent(const CommandInterface::am_SystemProperty_s& SystemProperty) { + stubAdapter_->fireSystemPropertyChangedEvent(SystemProperty); +} +void CommandInterfaceStubDefault::fireTimingInformationChangedEvent(const CommandInterface::am_mainConnectionID_t& mainConnection, const CommandInterface::am_timeSync_t& time) { + stubAdapter_->fireTimingInformationChangedEvent(mainConnection, time); +} +void CommandInterfaceStubDefault::fireSinkUpdatedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_sinkClass_t& sinkClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties) { + stubAdapter_->fireSinkUpdatedEvent(sinkID, sinkClassID, listMainSoundProperties); +} +void CommandInterfaceStubDefault::fireSourceUpdatedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sourceClass_t& sourceClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties) { + stubAdapter_->fireSourceUpdatedEvent(sourceID, sourceClassID, listMainSoundProperties); +} +void CommandInterfaceStubDefault::fireSinkNotificationEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_NotificationPayload_s& notification) { + stubAdapter_->fireSinkNotificationEvent(sinkID, notification); +} +void CommandInterfaceStubDefault::fireSourceNotificationEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_NotificationPayload_s& notification) { + stubAdapter_->fireSourceNotificationEvent(sourceID, notification); +} +void CommandInterfaceStubDefault::fireMainSinkNotificationConfigurationChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration) { + stubAdapter_->fireMainSinkNotificationConfigurationChangedEvent(sinkID, mainNotificationConfiguration); +} +void CommandInterfaceStubDefault::fireMainSourceNotificationConfigurationChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration) { + stubAdapter_->fireMainSourceNotificationConfigurationChangedEvent(sourceID, mainNotificationConfiguration); +} + +CommandInterfaceStubDefault::RemoteEventHandler::RemoteEventHandler(CommandInterfaceStubDefault* defaultStub): + defaultStub_(defaultStub) { +} + +} // namespace audiomanager +} // namespace genivi +} // namespace org diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.h b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.h new file mode 100644 index 0000000..a2610c2 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.h @@ -0,0 +1,124 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_AUDIOMANAGER_Command_Interface_STUB_DEFAULT_H_ +#define ORG_GENIVI_AUDIOMANAGER_Command_Interface_STUB_DEFAULT_H_ + +#include + +namespace org { +namespace genivi { +namespace audiomanager { + +/** + * Provides a default implementation for CommandInterfaceStubRemoteEvent and + * CommandInterfaceStub. Method callbacks have an empty implementation, + * remote set calls on attributes will always change the value of the attribute + * to the one received. + * + * Override this stub if you only want to provide a subset of the functionality + * that would be defined for this service, and/or if you do not need any non-default + * behaviour. + */ +class CommandInterfaceStubDefault : public CommandInterfaceStub { + public: + CommandInterfaceStubDefault(); + + CommandInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr& stubAdapter); + + + virtual void Connect(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID); + + virtual void Disconnect(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result); + + virtual void SetVolume(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volume, CommandInterface::am_Error_e& result); + + virtual void VolumeStep(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volumeStep, CommandInterface::am_Error_e& result); + + virtual void SetSinkMuteState(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MuteState_e muteState, CommandInterface::am_Error_e& result); + + virtual void SetMainSinkSoundProperty(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result); + + virtual void SetMainSourceSoundProperty(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result); + + virtual void SetSystemProperty(CommandInterface::am_SystemProperty_s soundProperty, CommandInterface::am_Error_e& result); + + virtual void GetListMainConnections(CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections); + + virtual void GetListMainSinks(CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks); + + virtual void GetListMainSources(CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources); + + virtual void GetListMainSinkSoundProperties(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties); + + virtual void GetListMainSourceSoundProperties(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties); + + virtual void GetListSourceClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses); + + virtual void GetListSinkClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses); + + virtual void GetListSystemProperties(CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties); + + virtual void GetTimingInformation(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay); + + + virtual void fireNumberOfMainConnectionsChangedEvent(); + virtual void fireMainConnectionStateChangedEvent(const CommandInterface::am_mainConnectionID_t& connectionID, const CommandInterface::am_ConnectionState_e& connectionState); + virtual void fireNumberOfSourceClassesChangedEvent(); + virtual void fireSourceAddedEvent(const CommandInterface::am_SourceType_s& newSource); + virtual void fireSourceRemovedEvent(const CommandInterface::am_sourceID_t& removedSourceID); + virtual void fireMainSourceSoundPropertyChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_MainSoundProperty_s& SoundProperty); + virtual void fireSourceAvailabilityChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_Availability_s& availability); + virtual void fireNumberOfSinkClassesChangedEvent(); + virtual void fireSinkAddedEvent(const CommandInterface::am_SinkType_s& newSink); + virtual void fireSinkRemovedEvent(const CommandInterface::am_sinkID_t& removedSinkID); + virtual void fireMainSinkSoundPropertyChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MainSoundProperty_s& SoundProperty); + virtual void fireSinkAvailabilityChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_Availability_s& availability); + virtual void fireVolumeChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_mainVolume_t& volume); + virtual void fireSinkMuteStateChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_MuteState_e& muteState); + virtual void fireSystemPropertyChangedEvent(const CommandInterface::am_SystemProperty_s& SystemProperty); + virtual void fireTimingInformationChangedEvent(const CommandInterface::am_mainConnectionID_t& mainConnection, const CommandInterface::am_timeSync_t& time); + virtual void fireSinkUpdatedEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_sinkClass_t& sinkClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties); + virtual void fireSourceUpdatedEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_sourceClass_t& sourceClassID, const CommandInterface::am_MainSoundProperty_l& listMainSoundProperties); + virtual void fireSinkNotificationEvent(const CommandInterface::am_sinkID_t& sinkID, const CommandInterface::am_NotificationPayload_s& notification); + virtual void fireSourceNotificationEvent(const CommandInterface::am_sourceID_t& sourceID, const CommandInterface::am_NotificationPayload_s& notification); + virtual void fireMainSinkNotificationConfigurationChangedEvent(const CommandInterface::am_sinkID_t& sinkID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration); + virtual void fireMainSourceNotificationConfigurationChangedEvent(const CommandInterface::am_sourceID_t& sourceID, const am::am_NotificationConfiguration_s& mainNotificationConfiguration); + + protected: + + private: + class RemoteEventHandler: public CommandInterfaceStubRemoteEvent { + public: + RemoteEventHandler(CommandInterfaceStubDefault* defaultStub); + + + private: + CommandInterfaceStubDefault* defaultStub_; + }; + + RemoteEventHandler remoteEventHandler_; + std::shared_ptr stubAdapter_; + +}; + +} // namespace audiomanager +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_AUDIOMANAGER_Command_Interface_STUB_DEFAULT_H_ diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.cpp b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.cpp new file mode 100644 index 0000000..94e18a9 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.cpp @@ -0,0 +1,477 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#include "am.h" + + +namespace org { +namespace genivi { +namespace audiomanager { +namespace am { + +distanceInformation_s::distanceInformation_s(const int32_t& FrontLeftValue, const int32_t& FrontRightValue, const int32_t& RearLeftValue, const int32_t& RearRightValue): + FrontLeft(FrontLeftValue), + FrontRight(FrontRightValue), + RearLeft(RearLeftValue), + RearRight(RearRightValue) +{ +} + + +bool operator==(const distanceInformation_s& lhs, const distanceInformation_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.FrontLeft == rhs.FrontLeft && + lhs.FrontRight == rhs.FrontRight && + lhs.RearLeft == rhs.RearLeft && + lhs.RearRight == rhs.RearRight + ; +} + +void distanceInformation_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> FrontLeft; + inputStream >> FrontRight; + inputStream >> RearLeft; + inputStream >> RearRight; +} + +void distanceInformation_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << FrontLeft; + outputStream << FrontRight; + outputStream << RearLeft; + outputStream << RearRight; +} +sampleNames_s::sampleNames_s(const sampleSet_e& sampleValue, const std::string& sampleNameValue): + sample(sampleValue), + sampleName(sampleNameValue) +{ +} + + +bool operator==(const sampleNames_s& lhs, const sampleNames_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.sample == rhs.sample && + lhs.sampleName == rhs.sampleName + ; +} + +void sampleNames_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> sample; + inputStream >> sampleName; +} + +void sampleNames_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << sample; + outputStream << sampleName; +} +am_Domain_s::am_Domain_s(const am_domainID_t& domainIDValue, const std::string& nameValue, const std::string& busnameValue, const std::string& nodenameValue, const bool& earlyValue, const bool& completeValue, const am_DomainState_e& stateValue): + domainID(domainIDValue), + name(nameValue), + busname(busnameValue), + nodename(nodenameValue), + early(earlyValue), + complete(completeValue), + state(stateValue) +{ +} + + +bool operator==(const am_Domain_s& lhs, const am_Domain_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.domainID == rhs.domainID && + lhs.name == rhs.name && + lhs.busname == rhs.busname && + lhs.nodename == rhs.nodename && + lhs.early == rhs.early && + lhs.complete == rhs.complete && + lhs.state == rhs.state + ; +} + +void am_Domain_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> domainID; + inputStream >> name; + inputStream >> busname; + inputStream >> nodename; + inputStream >> early; + inputStream >> complete; + inputStream >> state; +} + +void am_Domain_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << domainID; + outputStream << name; + outputStream << busname; + outputStream << nodename; + outputStream << early; + outputStream << complete; + outputStream << state; +} +notificationPayload_s::notificationPayload_s(const int16_t& typeValue, const int16_t& payloadValue): + type(typeValue), + payload(payloadValue) +{ +} + + +bool operator==(const notificationPayload_s& lhs, const notificationPayload_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.type == rhs.type && + lhs.payload == rhs.payload + ; +} + +void notificationPayload_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> type; + inputStream >> payload; +} + +void notificationPayload_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << type; + outputStream << payload; +} +am_Availability_s::am_Availability_s(const am_Availability_e& availabilityValue, const am_AvailabilityReason_e& availabilityReasonValue): + availability(availabilityValue), + availabilityReason(availabilityReasonValue) +{ +} + + +bool operator==(const am_Availability_s& lhs, const am_Availability_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.availability == rhs.availability && + lhs.availabilityReason == rhs.availabilityReason + ; +} + +void am_Availability_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> availability; + inputStream >> availabilityReason; +} + +void am_Availability_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << availability; + outputStream << availabilityReason; +} +am_SoundProperty_s::am_SoundProperty_s(const am_SoundPropertyType_e& typeValue, const int16_t& valueValue): + type(typeValue), + value(valueValue) +{ +} + + +bool operator==(const am_SoundProperty_s& lhs, const am_SoundProperty_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.type == rhs.type && + lhs.value == rhs.value + ; +} + +void am_SoundProperty_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> type; + inputStream >> value; +} + +void am_SoundProperty_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << type; + outputStream << value; +} +am_MainSoundProperty_s::am_MainSoundProperty_s(const am_MainSoundPropertyType_e& typeValue, const int16_t& valueValue): + type(typeValue), + value(valueValue) +{ +} + + +bool operator==(const am_MainSoundProperty_s& lhs, const am_MainSoundProperty_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.type == rhs.type && + lhs.value == rhs.value + ; +} + +void am_MainSoundProperty_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> type; + inputStream >> value; +} + +void am_MainSoundProperty_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << type; + outputStream << value; +} +am_NotificationConfiguration_s::am_NotificationConfiguration_s(const am_NotificationType_e& typeValue, const am_NotificationStatus_e& statusValue, const int16_t& parameterValue): + type(typeValue), + status(statusValue), + parameter(parameterValue) +{ +} + + +bool operator==(const am_NotificationConfiguration_s& lhs, const am_NotificationConfiguration_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.type == rhs.type && + lhs.status == rhs.status && + lhs.parameter == rhs.parameter + ; +} + +void am_NotificationConfiguration_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> type; + inputStream >> status; + inputStream >> parameter; +} + +void am_NotificationConfiguration_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << type; + outputStream << status; + outputStream << parameter; +} +sourceData_s::sourceData_s(const am_sourceID_t& sourceIDValue, const am_domainID_t& domainIDValue, const std::string& nameValue, const am_sourceClass_t& sourceClassIDValue, const am_SourceState_e& sourceStateValue, const am_volume_t& volumeValue, const bool& visibleValue, const am_Availability_s& availableValue, const am_InterruptState_e& interruptStateValue, const am_SoundProperty_L& listSoundPropertiesValue, const am_ConnectionFormat_L& listConnectionFormatsValue, const am_MainSoundProperty_L& listMainSoundPropertiesValue, const am_NotificationConfiguration_L& listMainNotificationConfigurationsValue, const am_NotificationConfiguration_L& listNotificationConfigurationsValue): + sourceID(sourceIDValue), + domainID(domainIDValue), + name(nameValue), + sourceClassID(sourceClassIDValue), + sourceState(sourceStateValue), + volume(volumeValue), + visible(visibleValue), + available(availableValue), + interruptState(interruptStateValue), + listSoundProperties(listSoundPropertiesValue), + listConnectionFormats(listConnectionFormatsValue), + listMainSoundProperties(listMainSoundPropertiesValue), + listMainNotificationConfigurations(listMainNotificationConfigurationsValue), + listNotificationConfigurations(listNotificationConfigurationsValue) +{ +} + + +bool operator==(const sourceData_s& lhs, const sourceData_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.sourceID == rhs.sourceID && + lhs.domainID == rhs.domainID && + lhs.name == rhs.name && + lhs.sourceClassID == rhs.sourceClassID && + lhs.sourceState == rhs.sourceState && + lhs.volume == rhs.volume && + lhs.visible == rhs.visible && + lhs.available == rhs.available && + lhs.interruptState == rhs.interruptState && + lhs.listSoundProperties == rhs.listSoundProperties && + lhs.listConnectionFormats == rhs.listConnectionFormats && + lhs.listMainSoundProperties == rhs.listMainSoundProperties && + lhs.listMainNotificationConfigurations == rhs.listMainNotificationConfigurations && + lhs.listNotificationConfigurations == rhs.listNotificationConfigurations + ; +} + +void sourceData_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> sourceID; + inputStream >> domainID; + inputStream >> name; + inputStream >> sourceClassID; + inputStream >> sourceState; + inputStream >> volume; + inputStream >> visible; + inputStream >> available; + inputStream >> interruptState; + inputStream >> listSoundProperties; + inputStream >> listConnectionFormats; + inputStream >> listMainSoundProperties; + inputStream >> listMainNotificationConfigurations; + inputStream >> listNotificationConfigurations; +} + +void sourceData_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << sourceID; + outputStream << domainID; + outputStream << name; + outputStream << sourceClassID; + outputStream << sourceState; + outputStream << volume; + outputStream << visible; + outputStream << available; + outputStream << interruptState; + outputStream << listSoundProperties; + outputStream << listConnectionFormats; + outputStream << listMainSoundProperties; + outputStream << listMainNotificationConfigurations; + outputStream << listNotificationConfigurations; +} +sinkData_s::sinkData_s(const am_sinkID_t& sinkIDValue, const std::string& nameValue, const am_domainID_t& domainIDValue, const am_sinkClass_t& sinkClassIDValue, const am_volume_t& volumeValue, const bool& visibleValue, const am_Availability_s& availableValue, const am_MuteState_e& muteStateValue, const am_mainVolume_t& mainVolumeValue, const am_SoundProperty_L& listSoundPropertiesValue, const am_ConnectionFormat_L& listConnectionFormatsValue, const am_MainSoundProperty_L& listMainSoundPropertiesValue, const am_NotificationConfiguration_L& listMainNotificationConfigurationsValue, const am_NotificationConfiguration_L& listNotificationConfigurationsValue): + sinkID(sinkIDValue), + name(nameValue), + domainID(domainIDValue), + sinkClassID(sinkClassIDValue), + volume(volumeValue), + visible(visibleValue), + available(availableValue), + muteState(muteStateValue), + mainVolume(mainVolumeValue), + listSoundProperties(listSoundPropertiesValue), + listConnectionFormats(listConnectionFormatsValue), + listMainSoundProperties(listMainSoundPropertiesValue), + listMainNotificationConfigurations(listMainNotificationConfigurationsValue), + listNotificationConfigurations(listNotificationConfigurationsValue) +{ +} + + +bool operator==(const sinkData_s& lhs, const sinkData_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.sinkID == rhs.sinkID && + lhs.name == rhs.name && + lhs.domainID == rhs.domainID && + lhs.sinkClassID == rhs.sinkClassID && + lhs.volume == rhs.volume && + lhs.visible == rhs.visible && + lhs.available == rhs.available && + lhs.muteState == rhs.muteState && + lhs.mainVolume == rhs.mainVolume && + lhs.listSoundProperties == rhs.listSoundProperties && + lhs.listConnectionFormats == rhs.listConnectionFormats && + lhs.listMainSoundProperties == rhs.listMainSoundProperties && + lhs.listMainNotificationConfigurations == rhs.listMainNotificationConfigurations && + lhs.listNotificationConfigurations == rhs.listNotificationConfigurations + ; +} + +void sinkData_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> sinkID; + inputStream >> name; + inputStream >> domainID; + inputStream >> sinkClassID; + inputStream >> volume; + inputStream >> visible; + inputStream >> available; + inputStream >> muteState; + inputStream >> mainVolume; + inputStream >> listSoundProperties; + inputStream >> listConnectionFormats; + inputStream >> listMainSoundProperties; + inputStream >> listMainNotificationConfigurations; + inputStream >> listNotificationConfigurations; +} + +void sinkData_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << sinkID; + outputStream << name; + outputStream << domainID; + outputStream << sinkClassID; + outputStream << volume; + outputStream << visible; + outputStream << available; + outputStream << muteState; + outputStream << mainVolume; + outputStream << listSoundProperties; + outputStream << listConnectionFormats; + outputStream << listMainSoundProperties; + outputStream << listMainNotificationConfigurations; + outputStream << listNotificationConfigurations; +} +am_Gateway_s::am_Gateway_s(const am_gatewayID_t& gatewayIDValue, const std::string& nameValue, const am_sinkID_t& sinkIDValue, const am_sourceID_t& sourceIDValue, const am_domainID_t& domainSinkIDValue, const am_domainID_t& domainSourceIDValue, const am_domainID_t& controlDomainIDValue, const am_ConnectionFormat_L& listSourceFormatsValue, const am_ConnectionFormat_L& listSinkFormatsValue, const bool_L& convertionMatrixValue): + gatewayID(gatewayIDValue), + name(nameValue), + sinkID(sinkIDValue), + sourceID(sourceIDValue), + domainSinkID(domainSinkIDValue), + domainSourceID(domainSourceIDValue), + controlDomainID(controlDomainIDValue), + listSourceFormats(listSourceFormatsValue), + listSinkFormats(listSinkFormatsValue), + convertionMatrix(convertionMatrixValue) +{ +} + + +bool operator==(const am_Gateway_s& lhs, const am_Gateway_s& rhs) { + if (&lhs == &rhs) + return true; + + return + lhs.gatewayID == rhs.gatewayID && + lhs.name == rhs.name && + lhs.sinkID == rhs.sinkID && + lhs.sourceID == rhs.sourceID && + lhs.domainSinkID == rhs.domainSinkID && + lhs.domainSourceID == rhs.domainSourceID && + lhs.controlDomainID == rhs.controlDomainID && + lhs.listSourceFormats == rhs.listSourceFormats && + lhs.listSinkFormats == rhs.listSinkFormats && + lhs.convertionMatrix == rhs.convertionMatrix + ; +} + +void am_Gateway_s::readFromInputStream(CommonAPI::InputStream& inputStream) { + inputStream >> gatewayID; + inputStream >> name; + inputStream >> sinkID; + inputStream >> sourceID; + inputStream >> domainSinkID; + inputStream >> domainSourceID; + inputStream >> controlDomainID; + inputStream >> listSourceFormats; + inputStream >> listSinkFormats; + inputStream >> convertionMatrix; +} + +void am_Gateway_s::writeToOutputStream(CommonAPI::OutputStream& outputStream) const { + outputStream << gatewayID; + outputStream << name; + outputStream << sinkID; + outputStream << sourceID; + outputStream << domainSinkID; + outputStream << domainSourceID; + outputStream << controlDomainID; + outputStream << listSourceFormats; + outputStream << listSinkFormats; + outputStream << convertionMatrix; +} + +} // namespace am +} // namespace audiomanager +} // namespace genivi +} // namespace org diff --git a/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.h b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.h new file mode 100644 index 0000000..21a5a64 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.h @@ -0,0 +1,1515 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_AUDIOMANAGER_am_H_ +#define ORG_GENIVI_AUDIOMANAGER_am_H_ + + + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include +#include +#include +#include +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace audiomanager { + +namespace am { + typedef uint16_t am_sourceID_t; + + typedef uint16_t am_sinkID_t; + + typedef uint16_t am_gatewayID_t; + + typedef int16_t gongHandle; + + typedef uint16_t am_sourceClass_t; + + typedef uint16_t am_sinkClass_t; + + typedef int16_t am_volume_t; + + typedef int16_t am_mainVolume_t; + + typedef uint16_t am_handle_t; + + typedef uint16_t am_time_t; + + enum class gp_indicatorDirection_e: int32_t { + INDICATOR_RIGHT = 0x0, + INDICATOR_LEFT = 0x1, + INDICATOR_WARNING = 0x2 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct gp_indicatorDirection_eComparator; + + enum class am_RampType_e: int32_t { + RAMP_UNKNOWN = 0x0, + RAMP_GENIVI_DIRECT = 0x1, + RAMP_GENIVI_NO_PLOP = 0x2, + RAMP_GENIVI_EXP_INV = 0x3, + RAMP_GENIVI_LINEAR = 0x4, + RAMP_GENIVI_EXP = 0x5, + RAMP_MAX = 0x6 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_RampType_eComparator; + + enum class am_MuteState_e: int32_t { + MS_UNKNOWN = 0x0, + MS_MUTED = 0x1, + MS_UNMUTED = 0x2, + MS_MAX = 0x3 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_MuteState_eComparator; + + enum class am_SourceState_e: int32_t { + SS_UNKNNOWN = 0x0, + SS_ON = 0x1, + SS_OFF = 0x2, + SS_PAUSED = 0x3, + SS_MAX = 0x4 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_SourceState_eComparator; + + enum class am_Error_e: int32_t { + E_OK = 0x0, + E_UNKNOWN = 0x1, + E_OUT_OF_RANGE = 0x2, + E_NOT_USED = 0x3, + E_DATABASE_ERROR = 0x4, + E_ALREADY_EXISTS = 0x5, + E_NO_CHANGE = 0x6, + E_NOT_POSSIBLE = 0x7, + E_NON_EXISTENT = 0x8, + E_ABORTED = 0x9, + E_WRONG_FORMAT = 0xa, + E_MAX = 0xb + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_Error_eComparator; + + enum class am_DomainState_e: int32_t { + DS_UNKNOWN = 0, + DS_CONTROLLED = 1, + DS_INDEPENDENT_STARTUP = 2, + DS_INDEPENDENT_RUNDOWN = 3, + DS_MAX = 4 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_DomainState_eComparator; + + enum class gongType_e: int32_t { + AT_NUN = 0x1, + AT_POC = 0x2, + AT_QUE = 0x3, + AT_IWA = 0x4, + AT_WA = 0x5, + AT_ETC_F = 0x6, + AT_ETC_F2 = 0x7, + AT_ETC_ST = 0x8, + AT_ETC_S = 0x9, + AT_REV = 0xa, + AT_ESU = 0xb, + AT_ESD = 0xc, + AT_DG = 0xd, + AT_SG = 0xe, + AT_IDG = 0xf, + AT_ION = 0x10, + AT_IOFF = 0x11, + AT_FBS = 0x12, + AT_VFS = 0x13, + AT_GES = 0x14, + AT_UEE = 0x15 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct gongType_eComparator; + + enum class gp_indicatorStatus_e: int32_t { + IS_ON = 0x0, + IS_OFF = 0x1 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct gp_indicatorStatus_eComparator; + + enum class gongStatus_e: int32_t { + NOT_PLAYING = 0x0, + PLAYING = 0x1, + INTERRUPTED = 0x2 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct gongStatus_eComparator; + + enum class gongError_e: int32_t { + SUCCESS = 0x0, + ERROR = 0x1, + LOW_PRIORITY = 0x2 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct gongError_eComparator; + + enum class gongClass_e: int32_t { + GONGCLASS_1 = 0x1, + GONGCLASS_2 = 0x2, + GONGCLASS_PDC = 0x3, + GONGCLASS_TURN = 0x4, + GONGCLASS_OBSTACLE = 0x5 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct gongClass_eComparator; + + enum class sampleSet_e: int32_t { + setBMW = 0x0, + setMini = 0x1, + setRR = 0x2 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct sampleSet_eComparator; + + enum class am_Availability_e: int32_t { + A_UNKNOWN = 0x0, + A_AVAILABLE = 0x1, + A_UNAVAILABLE = 0x2, + A_MAX = 0x3 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_Availability_eComparator; + + enum class am_AvailabilityReason_e: int32_t { + AR_UNKNOWN = 0x0, + AR_GENIVI_NEWMEDIA = 0x1, + AR_GENIVI_SAMEMEDIA = 0x2, + AR_GENIVI_NOMEDIA = 0x3, + AR_GENIVI_TEMPERATURE = 0x4, + AR_GENIVI_VOLTAGE = 0x5, + AR_GENIVI_ERRORMEDIA = 0x6, + AR_MAX = 0x7 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_AvailabilityReason_eComparator; + + enum class am_InterruptState_e: int32_t { + IS_UNKNOWN = 0x0, + IS_OFF = 0x1, + IS_INTERRUPTED = 0x2, + IS_MAX = 0x3 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_InterruptState_eComparator; + + enum class am_SoundPropertyType_e: int32_t { + SP_UNKNOWN = 0x0, + SP_EXAMPLE_TREBLE = 0x1, + SP_EXAMPLE_MID = 0x2, + SP_EXAMPLE_BASS = 0x3, + SP_ENTER_SINKID = 0x4, + SP_INTERR_SUPERSEEDINGID = 0x5, + SP_INTERR_OVERLAYID = 0x6, + SP_PRIORITY = 0x7, + SP_MAX = 0x8 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_SoundPropertyType_eComparator; + + enum class am_ConnectionFormat_e: int32_t { + CF_UNKNOWN = 0x0, + CF_GENIVI_MONO = 0x1, + CF_GENIVI_STEREO = 0x2, + CF_GENIVI_ANALOG = 0x3, + CF_GENIVI_AUTO = 0x4, + CF_MAX = 0x5 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_ConnectionFormat_eComparator; + + typedef std::vector am_ConnectionFormat_L; + + enum class am_MainSoundPropertyType_e: int32_t { + MSP_UNKNOWN = 0x0, + MSP_EXAMPLE_TREBLE = 0x1, + MSP_EXAMPLE_MID = 0x2, + MSP_EXAMPLE_BASS = 0x3, + MSP_SOURCE_TYPE = 0x4, + MSP_MAX = 0x5 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_MainSoundPropertyType_eComparator; + + enum class am_NotificationType_e: int32_t { + NT_UNKNOWN = 0x0, + NT_LOUDNESS = 0x1, + NT_MAX = 0x2 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_NotificationType_eComparator; + + enum class am_NotificationStatus_e: int32_t { + NS_UNKNOWN = 0x0, + NS_OFF = 0x1, + NS_PERIODIC = 0x2, + NS_MINIMUM = 0x3, + NS_MAXIMUM = 0x4, + NS_CHANGE = 0x5, + NS_MAX = 0x6 + }; + + // XXX Definition of a comparator still is necessary for GCC 4.4.1, topic is fixed since 4.5.1 + struct am_NotificationStatus_eComparator; + + struct distanceInformation_s: CommonAPI::SerializableStruct { + int32_t FrontLeft; + int32_t FrontRight; + int32_t RearLeft; + int32_t RearRight; + + distanceInformation_s() = default; + distanceInformation_s(const int32_t& FrontLeft, const int32_t& FrontRight, const int32_t& RearLeft, const int32_t& RearRight); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt32Type(); + } + }; + + struct sampleNames_s: CommonAPI::SerializableStruct { + sampleSet_e sample; + std::string sampleName; + + sampleNames_s() = default; + sampleNames_s(const sampleSet_e& sample, const std::string& sampleName); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeStringType(); + } + }; + + typedef std::vector listSampleNamesL; + + typedef uint16_t am_domainID_t; + + struct am_Domain_s: CommonAPI::SerializableStruct { + am_domainID_t domainID; + std::string name; + std::string busname; + std::string nodename; + bool early; + bool complete; + am_DomainState_e state; + + am_Domain_s() = default; + am_Domain_s(const am_domainID_t& domainID, const std::string& name, const std::string& busname, const std::string& nodename, const bool& early, const bool& complete, const am_DomainState_e& state); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeStringType(); + typeOutputStream.writeStringType(); + typeOutputStream.writeStringType(); + typeOutputStream.writeBoolType(); + typeOutputStream.writeBoolType(); + typeOutputStream.writeInt32Type(); + } + }; + + struct notificationPayload_s: CommonAPI::SerializableStruct { + int16_t type; + int16_t payload; + + notificationPayload_s() = default; + notificationPayload_s(const int16_t& type, const int16_t& payload); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt16Type(); + typeOutputStream.writeInt16Type(); + } + }; + + struct am_Availability_s: CommonAPI::SerializableStruct { + am_Availability_e availability; + am_AvailabilityReason_e availabilityReason; + + am_Availability_s() = default; + am_Availability_s(const am_Availability_e& availability, const am_AvailabilityReason_e& availabilityReason); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt32Type(); + } + }; + + struct am_SoundProperty_s: CommonAPI::SerializableStruct { + am_SoundPropertyType_e type; + int16_t value; + + am_SoundProperty_s() = default; + am_SoundProperty_s(const am_SoundPropertyType_e& type, const int16_t& value); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt16Type(); + } + }; + + typedef std::vector am_SoundProperty_L; + + struct am_MainSoundProperty_s: CommonAPI::SerializableStruct { + am_MainSoundPropertyType_e type; + int16_t value; + + am_MainSoundProperty_s() = default; + am_MainSoundProperty_s(const am_MainSoundPropertyType_e& type, const int16_t& value); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt16Type(); + } + }; + + typedef std::vector am_MainSoundProperty_L; + + struct am_NotificationConfiguration_s: CommonAPI::SerializableStruct { + am_NotificationType_e type; + am_NotificationStatus_e status; + int16_t parameter; + + am_NotificationConfiguration_s() = default; + am_NotificationConfiguration_s(const am_NotificationType_e& type, const am_NotificationStatus_e& status, const int16_t& parameter); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt16Type(); + } + }; + + typedef std::vector am_NotificationConfiguration_L; + + typedef std::vector bool_L; + + struct sourceData_s: CommonAPI::SerializableStruct { + am_sourceID_t sourceID; + am_domainID_t domainID; + std::string name; + am_sourceClass_t sourceClassID; + am_SourceState_e sourceState; + am_volume_t volume; + bool visible; + am_Availability_s available; + am_InterruptState_e interruptState; + am_SoundProperty_L listSoundProperties; + am_ConnectionFormat_L listConnectionFormats; + am_MainSoundProperty_L listMainSoundProperties; + am_NotificationConfiguration_L listMainNotificationConfigurations; + am_NotificationConfiguration_L listNotificationConfigurations; + + sourceData_s() = default; + sourceData_s(const am_sourceID_t& sourceID, const am_domainID_t& domainID, const std::string& name, const am_sourceClass_t& sourceClassID, const am_SourceState_e& sourceState, const am_volume_t& volume, const bool& visible, const am_Availability_s& available, const am_InterruptState_e& interruptState, const am_SoundProperty_L& listSoundProperties, const am_ConnectionFormat_L& listConnectionFormats, const am_MainSoundProperty_L& listMainSoundProperties, const am_NotificationConfiguration_L& listMainNotificationConfigurations, const am_NotificationConfiguration_L& listNotificationConfigurations); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeStringType(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt16Type(); + typeOutputStream.writeBoolType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt32Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.writeInt32Type(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.writeInt32Type(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + } + }; + + struct sinkData_s: CommonAPI::SerializableStruct { + am_sinkID_t sinkID; + std::string name; + am_domainID_t domainID; + am_sinkClass_t sinkClassID; + am_volume_t volume; + bool visible; + am_Availability_s available; + am_MuteState_e muteState; + am_mainVolume_t mainVolume; + am_SoundProperty_L listSoundProperties; + am_ConnectionFormat_L listConnectionFormats; + am_MainSoundProperty_L listMainSoundProperties; + am_NotificationConfiguration_L listMainNotificationConfigurations; + am_NotificationConfiguration_L listNotificationConfigurations; + + sinkData_s() = default; + sinkData_s(const am_sinkID_t& sinkID, const std::string& name, const am_domainID_t& domainID, const am_sinkClass_t& sinkClassID, const am_volume_t& volume, const bool& visible, const am_Availability_s& available, const am_MuteState_e& muteState, const am_mainVolume_t& mainVolume, const am_SoundProperty_L& listSoundProperties, const am_ConnectionFormat_L& listConnectionFormats, const am_MainSoundProperty_L& listMainSoundProperties, const am_NotificationConfiguration_L& listMainNotificationConfigurations, const am_NotificationConfiguration_L& listNotificationConfigurations); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeStringType(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeInt16Type(); + typeOutputStream.writeBoolType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt32Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.writeInt32Type(); + typeOutputStream.writeInt16Type(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.writeInt32Type(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.beginWriteStructType(); + typeOutputStream.writeInt32Type();typeOutputStream.writeInt32Type();typeOutputStream.writeInt16Type(); + typeOutputStream.endWriteStructType(); + typeOutputStream.endWriteVectorType(); + } + }; + + struct am_Gateway_s: CommonAPI::SerializableStruct { + am_gatewayID_t gatewayID; + std::string name; + am_sinkID_t sinkID; + am_sourceID_t sourceID; + am_domainID_t domainSinkID; + am_domainID_t domainSourceID; + am_domainID_t controlDomainID; + am_ConnectionFormat_L listSourceFormats; + am_ConnectionFormat_L listSinkFormats; + bool_L convertionMatrix; + + am_Gateway_s() = default; + am_Gateway_s(const am_gatewayID_t& gatewayID, const std::string& name, const am_sinkID_t& sinkID, const am_sourceID_t& sourceID, const am_domainID_t& domainSinkID, const am_domainID_t& domainSourceID, const am_domainID_t& controlDomainID, const am_ConnectionFormat_L& listSourceFormats, const am_ConnectionFormat_L& listSinkFormats, const bool_L& convertionMatrix); + + + virtual void readFromInputStream(CommonAPI::InputStream& inputStream); + virtual void writeToOutputStream(CommonAPI::OutputStream& outputStream) const; + + static inline void writeToTypeOutputStream(CommonAPI::TypeOutputStream& typeOutputStream) { + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeStringType(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.writeUInt16Type(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.writeInt32Type(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.writeInt32Type(); + typeOutputStream.endWriteVectorType(); + typeOutputStream.beginWriteVectorType(); + typeOutputStream.writeBoolType(); + typeOutputStream.endWriteVectorType(); + } + }; + + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, gp_indicatorDirection_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const gp_indicatorDirection_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct gp_indicatorDirection_eComparator { + inline bool operator()(const gp_indicatorDirection_e& lhs, const gp_indicatorDirection_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_RampType_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_RampType_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_RampType_eComparator { + inline bool operator()(const am_RampType_e& lhs, const am_RampType_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_MuteState_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_MuteState_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_MuteState_eComparator { + inline bool operator()(const am_MuteState_e& lhs, const am_MuteState_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_SourceState_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_SourceState_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_SourceState_eComparator { + inline bool operator()(const am_SourceState_e& lhs, const am_SourceState_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_Error_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_Error_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_Error_eComparator { + inline bool operator()(const am_Error_e& lhs, const am_Error_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_DomainState_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_DomainState_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_DomainState_eComparator { + inline bool operator()(const am_DomainState_e& lhs, const am_DomainState_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, gongType_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const gongType_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct gongType_eComparator { + inline bool operator()(const gongType_e& lhs, const gongType_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, gp_indicatorStatus_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const gp_indicatorStatus_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct gp_indicatorStatus_eComparator { + inline bool operator()(const gp_indicatorStatus_e& lhs, const gp_indicatorStatus_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, gongStatus_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const gongStatus_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct gongStatus_eComparator { + inline bool operator()(const gongStatus_e& lhs, const gongStatus_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, gongError_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const gongError_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct gongError_eComparator { + inline bool operator()(const gongError_e& lhs, const gongError_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, gongClass_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const gongClass_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct gongClass_eComparator { + inline bool operator()(const gongClass_e& lhs, const gongClass_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, sampleSet_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const sampleSet_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct sampleSet_eComparator { + inline bool operator()(const sampleSet_e& lhs, const sampleSet_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_Availability_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_Availability_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_Availability_eComparator { + inline bool operator()(const am_Availability_e& lhs, const am_Availability_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_AvailabilityReason_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_AvailabilityReason_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_AvailabilityReason_eComparator { + inline bool operator()(const am_AvailabilityReason_e& lhs, const am_AvailabilityReason_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_InterruptState_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_InterruptState_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_InterruptState_eComparator { + inline bool operator()(const am_InterruptState_e& lhs, const am_InterruptState_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_SoundPropertyType_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_SoundPropertyType_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_SoundPropertyType_eComparator { + inline bool operator()(const am_SoundPropertyType_e& lhs, const am_SoundPropertyType_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_ConnectionFormat_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_ConnectionFormat_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_ConnectionFormat_eComparator { + inline bool operator()(const am_ConnectionFormat_e& lhs, const am_ConnectionFormat_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_MainSoundPropertyType_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_MainSoundPropertyType_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_MainSoundPropertyType_eComparator { + inline bool operator()(const am_MainSoundPropertyType_e& lhs, const am_MainSoundPropertyType_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_NotificationType_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_NotificationType_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_NotificationType_eComparator { + inline bool operator()(const am_NotificationType_e& lhs, const am_NotificationType_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +inline CommonAPI::InputStream& operator>>(CommonAPI::InputStream& inputStream, am_NotificationStatus_e& enumValue) { + return inputStream.readEnumValue(enumValue); +} + +inline CommonAPI::OutputStream& operator<<(CommonAPI::OutputStream& outputStream, const am_NotificationStatus_e& enumValue) { + return outputStream.writeEnumValue(static_cast(enumValue)); +} + +struct am_NotificationStatus_eComparator { + inline bool operator()(const am_NotificationStatus_e& lhs, const am_NotificationStatus_e& rhs) const { + return static_cast(lhs) < static_cast(rhs); + } +}; + +bool operator==(const distanceInformation_s& lhs, const distanceInformation_s& rhs); +inline bool operator!=(const distanceInformation_s& lhs, const distanceInformation_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const sampleNames_s& lhs, const sampleNames_s& rhs); +inline bool operator!=(const sampleNames_s& lhs, const sampleNames_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const am_Domain_s& lhs, const am_Domain_s& rhs); +inline bool operator!=(const am_Domain_s& lhs, const am_Domain_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const notificationPayload_s& lhs, const notificationPayload_s& rhs); +inline bool operator!=(const notificationPayload_s& lhs, const notificationPayload_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const am_Availability_s& lhs, const am_Availability_s& rhs); +inline bool operator!=(const am_Availability_s& lhs, const am_Availability_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const am_SoundProperty_s& lhs, const am_SoundProperty_s& rhs); +inline bool operator!=(const am_SoundProperty_s& lhs, const am_SoundProperty_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const am_MainSoundProperty_s& lhs, const am_MainSoundProperty_s& rhs); +inline bool operator!=(const am_MainSoundProperty_s& lhs, const am_MainSoundProperty_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const am_NotificationConfiguration_s& lhs, const am_NotificationConfiguration_s& rhs); +inline bool operator!=(const am_NotificationConfiguration_s& lhs, const am_NotificationConfiguration_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const sourceData_s& lhs, const sourceData_s& rhs); +inline bool operator!=(const sourceData_s& lhs, const sourceData_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const sinkData_s& lhs, const sinkData_s& rhs); +inline bool operator!=(const sinkData_s& lhs, const sinkData_s& rhs) { + return !(lhs == rhs); +} +bool operator==(const am_Gateway_s& lhs, const am_Gateway_s& rhs); +inline bool operator!=(const am_Gateway_s& lhs, const am_Gateway_s& rhs) { + return !(lhs == rhs); +} + + +static inline const char* getTypeCollectionName() { + return "org.genivi.audiomanager.am"; +} + + +} // namespace am + +} // namespace audiomanager +} // namespace genivi +} // namespace org + +namespace CommonAPI { + + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + template<> + struct BasicTypeWriter { + inline static void writeType (CommonAPI::TypeOutputStream& typeStream) { + typeStream.writeInt32EnumType(); + } + }; + + template<> + struct InputStreamVectorHelper { + static void beginReadVector(InputStream& inputStream, const std::vector& vectorValue) { + inputStream.beginReadInt32EnumVector(); + } + }; + + template <> + struct OutputStreamVectorHelper { + static void beginWriteVector(OutputStream& outputStream, const std::vector& vectorValue) { + outputStream.beginWriteInt32EnumVector(vectorValue.size()); + } + }; + +} + + +namespace std { + //Hash for gp_indicatorDirection_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::gp_indicatorDirection_e& gp_indicatorDirection_e) const { + return static_cast(gp_indicatorDirection_e); + } + }; + //Hash for am_RampType_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_RampType_e& am_RampType_e) const { + return static_cast(am_RampType_e); + } + }; + //Hash for am_MuteState_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_MuteState_e& am_MuteState_e) const { + return static_cast(am_MuteState_e); + } + }; + //Hash for am_SourceState_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_SourceState_e& am_SourceState_e) const { + return static_cast(am_SourceState_e); + } + }; + //Hash for am_Error_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_Error_e& am_Error_e) const { + return static_cast(am_Error_e); + } + }; + //Hash for am_DomainState_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_DomainState_e& am_DomainState_e) const { + return static_cast(am_DomainState_e); + } + }; + //Hash for gongType_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::gongType_e& gongType_e) const { + return static_cast(gongType_e); + } + }; + //Hash for gp_indicatorStatus_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::gp_indicatorStatus_e& gp_indicatorStatus_e) const { + return static_cast(gp_indicatorStatus_e); + } + }; + //Hash for gongStatus_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::gongStatus_e& gongStatus_e) const { + return static_cast(gongStatus_e); + } + }; + //Hash for gongError_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::gongError_e& gongError_e) const { + return static_cast(gongError_e); + } + }; + //Hash for gongClass_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::gongClass_e& gongClass_e) const { + return static_cast(gongClass_e); + } + }; + //Hash for sampleSet_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::sampleSet_e& sampleSet_e) const { + return static_cast(sampleSet_e); + } + }; + //Hash for am_Availability_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_Availability_e& am_Availability_e) const { + return static_cast(am_Availability_e); + } + }; + //Hash for am_AvailabilityReason_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_AvailabilityReason_e& am_AvailabilityReason_e) const { + return static_cast(am_AvailabilityReason_e); + } + }; + //Hash for am_InterruptState_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_InterruptState_e& am_InterruptState_e) const { + return static_cast(am_InterruptState_e); + } + }; + //Hash for am_SoundPropertyType_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_SoundPropertyType_e& am_SoundPropertyType_e) const { + return static_cast(am_SoundPropertyType_e); + } + }; + //Hash for am_ConnectionFormat_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_ConnectionFormat_e& am_ConnectionFormat_e) const { + return static_cast(am_ConnectionFormat_e); + } + }; + //Hash for am_MainSoundPropertyType_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_MainSoundPropertyType_e& am_MainSoundPropertyType_e) const { + return static_cast(am_MainSoundPropertyType_e); + } + }; + //Hash for am_NotificationType_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_NotificationType_e& am_NotificationType_e) const { + return static_cast(am_NotificationType_e); + } + }; + //Hash for am_NotificationStatus_e + template<> + struct hash { + inline size_t operator()(const org::genivi::audiomanager::am::am_NotificationStatus_e& am_NotificationStatus_e) const { + return static_cast(am_NotificationStatus_e); + } + }; +} + +#endif // ORG_GENIVI_AUDIOMANAGER_am_H_ diff --git a/PluginCommandInterfaceCAPI/src/CAmCommandSenderCAPI.cpp b/PluginCommandInterfaceCAPI/src/CAmCommandSenderCAPI.cpp new file mode 100644 index 0000000..75414c2 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src/CAmCommandSenderCAPI.cpp @@ -0,0 +1,364 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#include "CAmCommandSenderCAPI.h" +#include +#include +#include +#include +#include +#include "shared/CAmDltWrapper.h" +#include "CAmCommandSenderCommon.h" + + +DLT_DECLARE_CONTEXT(ctxCommandCAPI) + +/** + * factory for plugin loading + */ +extern "C" IAmCommandSend* PluginCommandInterfaceCAPIFactory() +{ + CAmDltWrapper::instance()->registerContext(ctxCommandCAPI, "CAPIP", "Common-API Plugin"); + return (new CAmCommandSenderCAPI(Am_CAPI)); +} + +/** + * destroy instance of commandSendInterface + */ +extern "C" void destroyPluginCommandInterfaceCAPIFactory(IAmCommandSend* commandSendInterface) +{ + delete commandSendInterface; +} + + +const char * CAmCommandSenderCAPI::COMMAND_SENDER_SERVICE = "local:org.genivi.audiomanger.commandinterface:org.genivi.audiomanger"; + +#define RETURN_IF_NOT_READY() if(!mReady) return; + +CAmCommandSenderCAPI::CAmCommandSenderCAPI() : + mService(), // + mpCAmCAPIWrapper(NULL), // + mpIAmCommandReceive(NULL), // + mReady(false), + mIsServiceStarted(false) +{ + log(&ctxCommandCAPI, DLT_LOG_INFO, "CommandSenderCAPI constructor called"); +} + +CAmCommandSenderCAPI::CAmCommandSenderCAPI(CAmCommonAPIWrapper *aWrapper) : + mService(), // + mpCAmCAPIWrapper(aWrapper), // + mpIAmCommandReceive(NULL), // + mReady(false), + mIsServiceStarted(false) +{ + log(&ctxCommandCAPI, DLT_LOG_INFO, "CommandSenderCAPI constructor called"); + assert(mpCAmCAPIWrapper!=NULL); +} + +CAmCommandSenderCAPI::~CAmCommandSenderCAPI() +{ + log(&ctxCommandCAPI, DLT_LOG_INFO, "CAPICommandSender destructed"); + CAmDltWrapper::instance()->unregisterContext(ctxCommandCAPI); + tearDownInterface(mpIAmCommandReceive); +} + +/** + * registers a service + */ +am_Error_e CAmCommandSenderCAPI::startService(IAmCommandReceive* commandreceiveinterface) +{ + if(!mIsServiceStarted) + { + assert(commandreceiveinterface); + mService = std::make_shared(commandreceiveinterface); + //Registers the service + if( false == mpCAmCAPIWrapper->registerStub(mService, CAmCommandSenderCAPI::COMMAND_SENDER_SERVICE) ) + { + return (E_NOT_POSSIBLE); + } + mIsServiceStarted = true; + } + return (E_OK); +} + +/** + * sets a command receiver object and registers a service + */ +am_Error_e CAmCommandSenderCAPI::startupInterface(IAmCommandReceive* commandreceiveinterface) +{ + log(&ctxCommandCAPI, DLT_LOG_INFO, "startupInterface called"); + mpIAmCommandReceive = commandreceiveinterface; + return startService(commandreceiveinterface); +} + +/** + * stops the service + */ +am_Error_e CAmCommandSenderCAPI::tearDownInterface(IAmCommandReceive*) +{ + if(mpCAmCAPIWrapper) + { + if(mIsServiceStarted) + { + mIsServiceStarted = false; + mpCAmCAPIWrapper->unregisterStub(CAmCommandSenderCAPI::COMMAND_SENDER_SERVICE); + mService.reset(); + } + return (E_OK); + } + return (E_NOT_POSSIBLE); +} + +void CAmCommandSenderCAPI::setCommandReady(const uint16_t handle) +{ + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbCommunicationReady called"); + mReady = true; + mpIAmCommandReceive->confirmCommandReady(handle,E_OK); +} + +void CAmCommandSenderCAPI::setCommandRundown(const uint16_t handle) +{ + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbCommunicationRundown called"); + mReady = false; + mpIAmCommandReceive->confirmCommandRundown(handle,E_OK); +} + +void CAmCommandSenderCAPI::cbNewMainConnection(const am_MainConnectionType_s& ) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNumberOfMainConnectionsChanged called"); + mService->fireNumberOfMainConnectionsChangedEvent(); +} + +void CAmCommandSenderCAPI::cbRemovedMainConnection(const am_mainConnectionID_t mainConnection) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNumberOfMainConnectionsChanged called"); + mService->fireNumberOfMainConnectionsChangedEvent(); +} + +void CAmCommandSenderCAPI::cbNewSink(const am_SinkType_s& sink) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNewSink called"); + CommandInterface::am_Availability_s convAvailability; + CAmConvertAvailablility(sink.availability, convAvailability); + CommandInterface::am_SinkType_s ciSink(sink.sinkID, sink.name, convAvailability, sink.volume, CAmConvert2CAPIType(sink.muteState), sink.sinkClassID); + mService->fireSinkAddedEvent(ciSink); +} + +void CAmCommandSenderCAPI::cbRemovedSink(const am_sinkID_t sinkID) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbRemovedSink called"); + mService->fireSinkRemovedEvent(sinkID); +} + +void CAmCommandSenderCAPI::cbNewSource(const am_SourceType_s& source) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNewSource called"); + CommandInterface::am_Availability_s convAvailability; + CAmConvertAvailablility(source.availability, convAvailability); + CommandInterface::am_SourceType_s ciSource(source.sourceID, source.name, convAvailability, source.sourceClassID); + mService->fireSourceAddedEvent(ciSource); +} + +void CAmCommandSenderCAPI::cbRemovedSource(const am_sourceID_t source) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbRemovedSource called"); + mService->fireSourceRemovedEvent(source); +} + +void CAmCommandSenderCAPI::cbNumberOfSinkClassesChanged() +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNumberOfSinkClassesChanged called"); + mService->fireNumberOfSinkClassesChangedEvent(); +} + +void CAmCommandSenderCAPI::cbNumberOfSourceClassesChanged() +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbNumberOfSourceClassesChanged called"); + mService->fireNumberOfSourceClassesChangedEvent(); +} + +void CAmCommandSenderCAPI::cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbMainConnectionStateChanged called, connectionID=", connectionID, "connectionState=", connectionState); + CommandInterface::am_mainConnectionID_t cID = connectionID; + mService->fireMainConnectionStateChangedEvent(cID, CAmConvert2CAPIType(connectionState)); +} + +void CAmCommandSenderCAPI::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s & soundProperty) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbMainSinkSoundPropertyChanged called, sinkID", sinkID, "SoundProperty.type", soundProperty.type, "SoundProperty.value", soundProperty.value); + CommandInterface::am_MainSoundProperty_s mainSoundProp(CAmConvert2CAPIType(soundProperty.type), soundProperty.value); + mService->fireMainSinkSoundPropertyChangedEvent(sinkID, mainSoundProp); +} + +void CAmCommandSenderCAPI::cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s & SoundProperty) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbMainSourceSoundPropertyChanged called, sourceID", sourceID, "SoundProperty.type", SoundProperty.type, "SoundProperty.value", SoundProperty.value); + CommandInterface::am_MainSoundProperty_s convValue; + CAmConvertMainSoundProperty(SoundProperty, convValue); + mService->fireMainSourceSoundPropertyChangedEvent(sourceID, convValue); +} + +void CAmCommandSenderCAPI::cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s & availability) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkAvailabilityChanged called, sinkID", sinkID, "availability.availability", availability.availability, "SoundProperty.reason", availability.availabilityReason); + CommandInterface::am_Availability_s convAvailability; + CAmConvertAvailablility(availability, convAvailability); + mService->fireSinkAvailabilityChangedEvent(sinkID, convAvailability); +} + +void CAmCommandSenderCAPI::cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s & availability) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSourceAvailabilityChanged called, sourceID", sourceID, "availability.availability", availability.availability, "SoundProperty.reason", availability.availabilityReason); + CommandInterface::am_Availability_s convAvailability; + CAmConvertAvailablility(availability, convAvailability); + mService->fireSourceAvailabilityChangedEvent(sourceID, convAvailability); +} + +void CAmCommandSenderCAPI::cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbVolumeChanged called, sinkID", sinkID, "volume", volume); + mService->fireVolumeChangedEvent(sinkID, volume); +} + +void CAmCommandSenderCAPI::cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkMuteStateChanged called, sinkID", sinkID, "muteState", muteState); + CommandInterface::am_MuteState_e ciMuteState = CAmConvert2CAPIType(muteState); + mService->fireSinkMuteStateChangedEvent(sinkID, ciMuteState); +} + +void CAmCommandSenderCAPI::cbSystemPropertyChanged(const am_SystemProperty_s & SystemProperty) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSystemPropertyChanged called, SystemProperty.type", SystemProperty.type, "SystemProperty.value", SystemProperty.value); + CommandInterface::am_SystemProperty_s convValue; + CAmConvertSystemProperty(SystemProperty, convValue); + mService->fireSystemPropertyChangedEvent(convValue); +} + +void CAmCommandSenderCAPI::cbTimingInformationChanged(const am_mainConnectionID_t mainConnectionID, const am_timeSync_t time) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbTimingInformationChanged called, mainConnectionID=", mainConnectionID, "time=", time); + CommandInterface::am_mainConnectionID_t ciMainConnection = mainConnectionID; + mService->fireTimingInformationChangedEvent(ciMainConnection, time); +} + +void CAmCommandSenderCAPI::getInterfaceVersion(std::string & version) const +{ + version = CommandSendVersion; +} + +void CAmCommandSenderCAPI::cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector& listMainSoundProperties) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkUpdated called, sinkID", sinkID); + CommandInterface::am_MainSoundProperty_l list; + std::for_each(listMainSoundProperties.begin(), listMainSoundProperties.end(), [&](const am_MainSoundProperty_s & ref) { + CommandInterface::am_MainSoundProperty_s prop(CAmConvert2CAPIType(ref.type), ref.value); + list.push_back(prop); + }); + mService->fireSinkUpdatedEvent(sinkID, sinkClassID, list); +} + +void CAmCommandSenderCAPI::cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector& listMainSoundProperties) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSourceUpdated called, sourceID", sourceID); + CommandInterface::am_MainSoundProperty_l list; + std::for_each(listMainSoundProperties.begin(), listMainSoundProperties.end(), [&](const am_MainSoundProperty_s & ref) { + CommandInterface::am_MainSoundProperty_s prop(CAmConvert2CAPIType(ref.type), ref.value); + list.push_back(prop); + }); + mService->fireSourceUpdatedEvent(sourceID, sourceClassID, list); +} + +void CAmCommandSenderCAPI::cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s& notification) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkNotification called, sinkID", sinkID); + CommandInterface::am_NotificationPayload_s ciNnotif(CAmConvert2CAPIType(notification.type), notification.value); + mService->fireSinkNotificationEvent(sinkID, ciNnotif); +} + +void CAmCommandSenderCAPI::cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s& notification) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSourceNotification called, sourceID", sourceID); + CommandInterface::am_NotificationPayload_s ciNnotif(CAmConvert2CAPIType(notification.type), notification.value); + mService->fireSourceNotificationEvent(sourceID, ciNnotif); +} + +void CAmCommandSenderCAPI::cbMainSinkNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSinkMainNotificationConfigurationChanged called, sinkID", sinkID); + org::genivi::audiomanager::am::am_NotificationConfiguration_s ciNotifConfig(CAmConvert2CAPIType(mainNotificationConfiguration.type), + CAmConvert2CAPIType(mainNotificationConfiguration.status), + mainNotificationConfiguration.parameter); + mService->fireMainSinkNotificationConfigurationChangedEvent(sinkID, ciNotifConfig); +} + +void CAmCommandSenderCAPI::cbMainSourceNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration) +{ + RETURN_IF_NOT_READY() + assert((bool)mService); + log(&ctxCommandCAPI, DLT_LOG_INFO, "cbSourceMainNotificationConfigurationChanged called, sourceID", sourceID); + org::genivi::audiomanager::am::am_NotificationConfiguration_s ciNotifConfig(CAmConvert2CAPIType(mainNotificationConfiguration.type), + CAmConvert2CAPIType(mainNotificationConfiguration.status), + mainNotificationConfiguration.parameter); + mService->fireMainSourceNotificationConfigurationChangedEvent(sourceID, ciNotifConfig); +} diff --git a/PluginCommandInterfaceCAPI/src/CAmCommandSenderCommon.cpp b/PluginCommandInterfaceCAPI/src/CAmCommandSenderCommon.cpp new file mode 100644 index 0000000..dca4f50 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src/CAmCommandSenderCommon.cpp @@ -0,0 +1,159 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + + +#include "CAmCommandSenderCommon.h" + +/** + * Utility functions + */ +void CAmConvertAvailablility(const am_Availability_s & amAavailability, CommandInterface::am_Availability_s & result) +{ + result.availability = CAmConvert2CAPIType(amAavailability.availability); + result.availabilityReason = CAmConvert2CAPIType(amAavailability.availabilityReason); +} + +void CAmConvertMainSoundProperty(const am_MainSoundProperty_s & amMainSoundProperty, CommandInterface::am_MainSoundProperty_s & result) +{ + result.type = CAmConvert2CAPIType(amMainSoundProperty.type); + result.value = amMainSoundProperty.value; +} + +void CAmConvertSystemProperty(const am_SystemProperty_s & amSystemProperty, CommandInterface::am_SystemProperty_s & result) +{ + result.type = CAmConvert2CAPIType(amSystemProperty.type); + result.value = amSystemProperty.value; +} + +CommandInterface::am_ClassProperty_e CAmConvert2CAPIType(const am_ClassProperty_e & property) +{ + return CP_MAX==property? + CommandInterface::am_ClassProperty_e::CP_MAX + : + static_cast(property); +} + +CommandInterface::am_SystemPropertyType_e CAmConvert2CAPIType(const am_SystemPropertyType_e & property) +{ + return SYP_MAX==property? + CommandInterface::am_SystemPropertyType_e::SYP_MAX + : + static_cast(property); +} + +CommandInterface::am_Availablility_e CAmConvert2CAPIType(const am_Availability_e & availability) +{ + return (A_MAX==availability)?CommandInterface::am_Availablility_e::A_MAX + : + static_cast(availability); +} + +CommandInterface::am_AvailabilityReason_e CAmConvert2CAPIType(const am_AvailabilityReason_e & availabilityReason) +{ + return (AR_MAX==availabilityReason)?CommandInterface::am_AvailabilityReason_e::AR_MAX + : + static_cast(availabilityReason); +} + +CommandInterface::am_MuteState_e CAmConvert2CAPIType(const am_MuteState_e & muteState) +{ + return MS_MAX==muteState? + CommandInterface::am_MuteState_e::MS_MAX + : + static_cast(muteState); +} + +am_MuteState_e CAmConvertFromCAPIType(const CommandInterface::am_MuteState_e & muteState) +{ + return CommandInterface::am_MuteState_e::MS_MAX==muteState? + MS_MAX:static_cast(muteState); +} + +CommandInterface::am_MainSoundPropertyType_e CAmConvert2CAPIType(const am_MainSoundPropertyType_e & type) +{ + return MSP_MAX==type? + CommandInterface::am_MainSoundPropertyType_e::MSP_MAX + : + static_cast(type); +} +am_MainSoundPropertyType_e CAmConvertFromCAPIType(const CommandInterface::am_MainSoundPropertyType_e & type) +{ + return CommandInterface::am_MainSoundPropertyType_e::MSP_MAX==type? + MSP_MAX:static_cast(type); +} + + + +CommandInterface::am_ConnectionState_e CAmConvert2CAPIType(const am_ConnectionState_e & connectionState) +{ + return CS_MAX==connectionState? + CommandInterface::am_ConnectionState_e::CS_MAX + : + static_cast(connectionState); +} +am_ConnectionState_e CAmConvertFromCAPIType(const CommandInterface::am_ConnectionState_e & connectionState) +{ + return CommandInterface::am_ConnectionState_e::CS_MAX==connectionState? + CS_MAX:static_cast(connectionState); +} + +org::genivi::audiomanager::am::am_NotificationType_e CAmConvert2CAPIType(const am_NotificationType_e & notificationType) +{ + return NT_MAX==notificationType? + org::genivi::audiomanager::am::am_NotificationType_e::NT_MAX + : + static_cast(notificationType); +} +am_NotificationType_e CAmConvertFromCAPIType(const org::genivi::audiomanager::am::am_NotificationType_e & notificationType) +{ + return org::genivi::audiomanager::am::am_NotificationType_e::NT_MAX==notificationType? + NT_MAX:static_cast(notificationType); +} + +org::genivi::audiomanager::am::am_NotificationStatus_e CAmConvert2CAPIType(const am_NotificationStatus_e & notificationStatus) +{ + return NS_MAX==notificationStatus? + org::genivi::audiomanager::am::am_NotificationStatus_e::NS_MAX + : + static_cast(notificationStatus); +} +am_NotificationStatus_e CAmConvertFromCAPIType(const org::genivi::audiomanager::am::am_NotificationStatus_e & notificationStatus) +{ + return org::genivi::audiomanager::am::am_NotificationStatus_e::NS_MAX==notificationStatus? + NS_MAX:static_cast(notificationStatus); +} + +CommandInterface::am_Error_e CAmConvert2CAPIType(const am_Error_e & error) +{ + return E_MAX==error? + CommandInterface::am_Error_e::E_MAX + : + static_cast(error); +} +am_Error_e CAmConvertFromCAPIType(const CommandInterface::am_Error_e & error) +{ + return CommandInterface::am_Error_e::E_MAX==error? + E_MAX:static_cast(error); +} + + +am_SystemPropertyType_e CAmConvertFromCAPIType(const CommandInterface::am_SystemPropertyType_e & propType) +{ + return CommandInterface::am_SystemPropertyType_e::SYP_MAX==propType? + SYP_MAX:static_cast(propType); +} + diff --git a/PluginCommandInterfaceCAPI/src/CAmCommandSenderService.cpp b/PluginCommandInterfaceCAPI/src/CAmCommandSenderService.cpp new file mode 100644 index 0000000..4d463d2 --- /dev/null +++ b/PluginCommandInterfaceCAPI/src/CAmCommandSenderService.cpp @@ -0,0 +1,236 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#include "CAmCommandSenderService.h" +#include +#include +#include "CAmCommandSenderCommon.h" + + +namespace am { + +CAmCommandSenderService::CAmCommandSenderService():mpIAmCommandReceive(NULL) { + // TODO Auto-generated constructor stub + +} + +CAmCommandSenderService::CAmCommandSenderService(IAmCommandReceive *aReceiver):mpIAmCommandReceive(aReceiver) { + // TODO Auto-generated constructor stub + +} + +CAmCommandSenderService::~CAmCommandSenderService() { + // TODO Auto-generated destructor stub +} + +void CAmCommandSenderService::Connect(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_mainConnectionID_t& mainConnectionID) { + assert(mpIAmCommandReceive); + result = CAmConvert2CAPIType(mpIAmCommandReceive->connect(sourceID, sinkID, mainConnectionID)); +} + +void CAmCommandSenderService::Disconnect(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result) { + assert(mpIAmCommandReceive); + result = CAmConvert2CAPIType(mpIAmCommandReceive->disconnect(mainConnectionID)); +} + +void CAmCommandSenderService::SetVolume(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volume, CommandInterface::am_Error_e& result) { + + assert(mpIAmCommandReceive); + result = CAmConvert2CAPIType(mpIAmCommandReceive->setVolume(sinkID, volume)); +} + +void CAmCommandSenderService::VolumeStep(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_mainVolume_t volumeStep, CommandInterface::am_Error_e& result) { + assert(mpIAmCommandReceive); + result = CAmConvert2CAPIType(mpIAmCommandReceive->volumeStep(sinkID, volumeStep)); +} + +void CAmCommandSenderService::SetSinkMuteState(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MuteState_e muteState, CommandInterface::am_Error_e& result) { + assert(mpIAmCommandReceive); + result = CAmConvert2CAPIType(mpIAmCommandReceive->setSinkMuteState(sinkID, CAmConvertFromCAPIType(muteState))); +} + +void CAmCommandSenderService::SetMainSinkSoundProperty(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result) { + assert(mpIAmCommandReceive); + am_MainSoundProperty_s property = {CAmConvertFromCAPIType(soundProperty.type), soundProperty.value}; + result = CAmConvert2CAPIType(mpIAmCommandReceive->setMainSinkSoundProperty(property, sinkID)); +} + +void CAmCommandSenderService::SetMainSourceSoundProperty(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_MainSoundProperty_s soundProperty, CommandInterface::am_Error_e& result) { + assert(mpIAmCommandReceive); + am_MainSoundProperty_s property = {CAmConvertFromCAPIType(soundProperty.type), soundProperty.value}; + result = CAmConvert2CAPIType(mpIAmCommandReceive->setMainSourceSoundProperty(property, sourceID)); +} + +void CAmCommandSenderService::SetSystemProperty(CommandInterface::am_SystemProperty_s soundProperty, CommandInterface::am_Error_e& result) { + assert(mpIAmCommandReceive); + am_SystemProperty_s property = {CAmConvertFromCAPIType(soundProperty.type), soundProperty.value}; + result = CAmConvert2CAPIType(mpIAmCommandReceive->setSystemProperty(property)); +} + +void CAmCommandSenderService::GetListMainConnections(CommandInterface::am_Error_e& result, CommandInterface::am_MainConnectionType_l& listConnections) { + assert(mpIAmCommandReceive); + std::vector list; + result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainConnections(list)); + if(result==CommandInterface::am_Error_e::E_OK) + { + CommandInterface::am_MainConnectionType_s item; + for(std::vector::const_iterator iter = list.begin(); iter!=list.end(); iter++) + { + item.mainConnectionID = iter->mainConnectionID; + item.sourceID = iter->sourceID; + item.sinkID = iter->sinkID; + item.delay = iter->delay; + item.connectionState = CAmConvert2CAPIType(iter->connectionState); + listConnections.push_back (item); + } + } +} + +void CAmCommandSenderService::GetListMainSinks(CommandInterface::am_Error_e& result, CommandInterface::am_SinkType_l& listMainSinks) { + assert(mpIAmCommandReceive); + std::vector list; + result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainSinks(list)); + if(result==CommandInterface::am_Error_e::E_OK) + { + CommandInterface::am_SinkType_s item; + for(std::vector::const_iterator iter = list.begin(); iter!=list.end(); iter++) + { + item.sinkID = iter->sinkID; + item.name = iter->name; + item.sinkClassID = iter->sinkClassID; + item.volume = iter->volume; + item.muteState = CAmConvert2CAPIType(iter->muteState); + CAmConvertAvailablility(iter->availability, item.availability); + listMainSinks.push_back (item); + } + } +} + +void CAmCommandSenderService::GetListMainSources(CommandInterface::am_Error_e& result, CommandInterface::am_SourceType_l& listMainSources) { + assert(mpIAmCommandReceive); + std::vector list; + result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainSources(list)); + if(result==CommandInterface::am_Error_e::E_OK) + { + CommandInterface::am_SourceType_s item; + for(std::vector::const_iterator iter = list.begin(); iter!=list.end(); iter++) + { + item.sourceID = iter->sourceID; + item.name = iter->name; + item.sourceClassID = iter->sourceClassID; + CAmConvertAvailablility(iter->availability, item.availability); + listMainSources.push_back (item); + } + } +} + +void CAmCommandSenderService::GetListMainSinkSoundProperties(CommandInterface::am_sinkID_t sinkID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSoundProperties) { + assert(mpIAmCommandReceive); + std::vector list; + result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainSinkSoundProperties(sinkID, list)); + if(result==CommandInterface::am_Error_e::E_OK) + { + CommandInterface::am_MainSoundProperty_s item; + for(std::vector::const_iterator iter = list.begin(); iter!=list.end(); iter++) + { + item.type = CAmConvert2CAPIType(iter->type); + item.value = iter->value; + listSoundProperties.push_back (item); + } + } +} + +void CAmCommandSenderService::GetListMainSourceSoundProperties(CommandInterface::am_sourceID_t sourceID, CommandInterface::am_Error_e& result, CommandInterface::am_MainSoundProperty_l& listSourceProperties) { + assert(mpIAmCommandReceive); + std::vector list; + result = CAmConvert2CAPIType(mpIAmCommandReceive->getListMainSourceSoundProperties(sourceID, list)); + if(result==CommandInterface::am_Error_e::E_OK) + { + CommandInterface::am_MainSoundProperty_s item; + for(std::vector::const_iterator iter = list.begin(); iter!=list.end(); iter++) + { + item.type = CAmConvert2CAPIType(iter->type); + item.value = iter->value; + listSourceProperties.push_back (item); + } + } +} + +void CAmCommandSenderService::GetListSourceClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SourceClass_l& listSourceClasses) { + assert(mpIAmCommandReceive); + std::vector list; + result = CAmConvert2CAPIType(mpIAmCommandReceive->getListSourceClasses(list)); + if(result==CommandInterface::am_Error_e::E_OK) + { + CommandInterface::am_SourceClass_s item; + for(std::vector::const_iterator iter = list.begin(); iter!=list.end(); iter++) + { + item.sourceClassID = iter->sourceClassID; + item.name = iter->name; + item.listClassProperties.clear(); + std::for_each(iter->listClassProperties.begin(), iter->listClassProperties.end(), [&](const am_ClassProperty_s & ref) { + CommandInterface::am_ClassProperty_s classProp(CAmConvert2CAPIType(ref.classProperty), ref.value); + item.listClassProperties.push_back(classProp); + }); + listSourceClasses.push_back (item); + } + } +} + +void CAmCommandSenderService::GetListSinkClasses(CommandInterface::am_Error_e& result, CommandInterface::am_SinkClass_l& listSinkClasses) { + assert(mpIAmCommandReceive); + std::vector list; + result = CAmConvert2CAPIType(mpIAmCommandReceive->getListSinkClasses(list)); + if(result==CommandInterface::am_Error_e::E_OK) + { + CommandInterface::am_SinkClass_s item; + for(std::vector::const_iterator iter = list.begin(); iter!=list.end(); iter++) + { + item.sinkClassID = iter->sinkClassID; + item.name = iter->name; + item.listClassProperties.clear(); + std::for_each(iter->listClassProperties.begin(), iter->listClassProperties.end(), [&](const am_ClassProperty_s & ref) { + CommandInterface::am_ClassProperty_s classProp(CAmConvert2CAPIType(ref.classProperty), ref.value); + item.listClassProperties.push_back(classProp); + }); + listSinkClasses.push_back (item); + } + } +} + +void CAmCommandSenderService::GetListSystemProperties(CommandInterface::am_Error_e& result, CommandInterface::am_SystemProperty_l& listSystemProperties) { + assert(mpIAmCommandReceive); + std::vector list; + result = CAmConvert2CAPIType(mpIAmCommandReceive->getListSystemProperties(list)); + if(result==CommandInterface::am_Error_e::E_OK) + { + CommandInterface::am_SystemProperty_s item; + for(std::vector::const_iterator iter = list.begin(); iter!=list.end(); iter++) + { + item.type = CAmConvert2CAPIType(iter->type); + item.value = iter->value; + listSystemProperties.push_back (item); + } + } +} + +void CAmCommandSenderService::GetTimingInformation(CommandInterface::am_mainConnectionID_t mainConnectionID, CommandInterface::am_Error_e& result, CommandInterface::am_timeSync_t& delay) { + assert(mpIAmCommandReceive); + result = CAmConvert2CAPIType(mpIAmCommandReceive->getTimingInformation(mainConnectionID, delay)); +} + +} /* namespace am */ diff --git a/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.cpp b/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.cpp new file mode 100644 index 0000000..6f64150 --- /dev/null +++ b/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.cpp @@ -0,0 +1,1101 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#include "CAmCommandSenderCAPITest.h" +#include +#include +#include +#include +#include +#include +#include +#include "TAmPluginTemplate.h" +#include "MockIAmCommandReceive.h" +#include "shared/CAmDltWrapper.h" +#include "../include/CAmCommandSenderCAPI.h" +#include "MockNotificationsClient.h" +#include +#include + + + +using namespace am; +using namespace testing; +using namespace org::genivi::audiomanager; +using namespace CommonAPI; + +static CAmTestsEnvironment* env; + +pthread_cond_t cond = PTHREAD_COND_INITIALIZER; +pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t condPxy = PTHREAD_COND_INITIALIZER; +pthread_mutex_t mutexPxy = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t condSer = PTHREAD_COND_INITIALIZER; +pthread_mutex_t mutexSer = PTHREAD_MUTEX_INITIALIZER; + +void* run_client(void*) +{ + CAmSocketHandler socketHandler; + CAmTestCAPIWrapper wrapper(&socketHandler); + env->mSocketHandlerClient = &socketHandler; + std::shared_ptr factory = wrapper.factory(); + env->mProxy = factory->buildProxy(CAmCommandSenderCAPI::COMMAND_SENDER_SERVICE); + env->mProxy->getProxyStatusEvent().subscribe(std::bind(&CAmTestsEnvironment::onServiceStatusEvent,env,std::placeholders::_1)); + + pthread_mutex_lock(&mutexSer); + env->mIsProxyInitilized = true; + pthread_mutex_unlock(&mutexSer); + pthread_cond_signal(&condSer); + + socketHandler.start_listenting(); + +//Cleanup + env->mProxy.reset(); + env->mSocketHandlerClient = NULL; + + return (NULL); +} + +void* run_service(void*) +{ + CAmSocketHandler socketHandler; + CAmTestCAPIWrapper wrapper(&socketHandler); + CAmCommandSenderCAPI plugin(&wrapper); + env->mpPlugin = &plugin; + env->mSocketHandlerService = &socketHandler; + MockIAmCommandReceive mock; + env->mpCommandReceive = &mock; + if(plugin.startupInterface(env->mpCommandReceive)!=E_OK) + { + logError("CommandSendInterface can't start!"); + } + else + { + plugin.setCommandReady(10); + socketHandler.start_listenting(); + + plugin.setCommandRundown(10); + plugin.tearDownInterface(env->mpCommandReceive); + } + +//Cleanup + env->mpPlugin = NULL; + env->mpCommandReceive = NULL; + env->mSocketHandlerClient = NULL; + + return (NULL); +} + +void* run_listener(void*) +{ + pthread_mutex_lock(&mutexSer); + while (env->mIsProxyInitilized==false) + { + std::cout << "\n\r Intialize proxy..\n\r" ; + pthread_cond_wait(&condSer, &mutexSer); + } + pthread_mutex_unlock(&mutexSer); + + time_t start = time(0); + time_t now = start; + pthread_mutex_lock(&mutexPxy); + while ( env->mIsServiceAvailable==false && now-start <= 15 ) + { + std::cout << " Waiting for proxy..\n\r" ; + struct timespec ts = { 0, 0 }; + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += 5; + pthread_cond_timedwait(&condPxy, &mutexPxy, &ts); + now = time(0); + } + pthread_mutex_unlock(&mutexPxy); + pthread_cond_signal(&cond); + + return NULL; +} + +CAmTestsEnvironment::CAmTestsEnvironment() : + mListenerThread(0), + mServicePThread(0), + mClientPThread(0), + mSocketHandlerService(NULL), + mSocketHandlerClient(NULL), + mIsProxyInitilized(false), + mIsServiceAvailable(false), + mpCommandReceive(NULL), + mpPlugin(NULL) +{ + env=this; + + CAmDltWrapper::instance()->registerApp("capiTest", "capiTest"); + pthread_create(&mListenerThread, NULL, run_listener, NULL); + pthread_create(&mServicePThread, NULL, run_service, NULL); + pthread_create(&mClientPThread, NULL, run_client, NULL); +} + +CAmTestsEnvironment::~CAmTestsEnvironment() +{ + +} + +void CAmTestsEnvironment::SetUp() +{ + pthread_cond_wait(&cond, &mutex); +} + +void CAmTestsEnvironment::TearDown() +{ +// mWrapperClient.factory().reset(); + + mSocketHandlerClient->exit_mainloop(); + pthread_join(mClientPThread, NULL); + mSocketHandlerService->exit_mainloop(); + pthread_join(mServicePThread, NULL); + sleep(1); +} + +void CAmTestsEnvironment::onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus) +{ + std::stringstream avail; + avail << "(" << static_cast(serviceStatus) << ")"; + + logInfo("Service Status changed to ", avail.str()); + std::cout << std::endl << "Service Status changed to " << avail.str() << std::endl; + pthread_mutex_lock(&mutexPxy); + mIsServiceAvailable = (serviceStatus==CommonAPI::AvailabilityStatus::AVAILABLE); + pthread_mutex_unlock(&mutexPxy); + pthread_cond_signal(&condPxy); +} + +int main(int argc, char **argv) +{ + ::testing::InitGoogleTest(&argc, argv); + ::testing::AddGlobalTestEnvironment(new CAmTestsEnvironment); + return RUN_ALL_TESTS(); +} + +CAmCommandSenderCAPITest::CAmCommandSenderCAPITest() +{ + +} + +CAmCommandSenderCAPITest::~CAmCommandSenderCAPITest() +{ + +} + +void CAmCommandSenderCAPITest::SetUp() +{ + ::testing::GTEST_FLAG(throw_on_failure) = false; +} + +void CAmCommandSenderCAPITest::TearDown() +{ + ::testing::GTEST_FLAG(throw_on_failure) = true; +} + +TEST_F(CAmCommandSenderCAPITest, ClientStartupTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +ACTION(returnClientConnect){ +arg2=101; +} + +TEST_F(CAmCommandSenderCAPITest, ConnectTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommandInterface::am_sourceID_t sourceID = 500; + CommandInterface::am_sinkID_t sinkID = 400; + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + CommandInterface::am_mainConnectionID_t mainConnectionID = 0; + + EXPECT_CALL(*env->mpCommandReceive, connect(_, _, _)).WillOnce(DoAll(returnClientConnect(), Return(E_OK))); + env->mProxy->Connect(sourceID, sinkID, callStatus,result, mainConnectionID); + ASSERT_EQ(mainConnectionID, 101); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + EXPECT_CALL(*env->mpCommandReceive, disconnect(mainConnectionID)).WillOnce(Return(am_Error_e::E_OK)); + env->mProxy->Disconnect(mainConnectionID, callStatus, result); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, SetVolumeTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommandInterface::am_mainVolume_t volume = 100; + CommandInterface::am_sinkID_t sinkID = 400; + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, setVolume(sinkID,volume)).WillOnce(Return(E_OK)); + env->mProxy->SetVolume(sinkID, volume, callStatus, result); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, VolumeStepTest) +{ + + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommandInterface::am_mainVolume_t volume = 100; + CommandInterface::am_sinkID_t sinkID = 400; + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, volumeStep(sinkID,volume)).WillOnce(Return(E_OK)); + env->mProxy->VolumeStep(sinkID, volume, callStatus, result); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, SetSinkMuteStateTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommandInterface::am_MuteState_e value = CommandInterface::am_MuteState_e::MS_UNKNOWN; + CommandInterface::am_sinkID_t sinkID = 400; + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, setSinkMuteState(sinkID, am_MuteState_e::MS_UNKNOWN)).WillOnce(Return(E_OK)); + env->mProxy->SetSinkMuteState(sinkID, value, callStatus, result); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, SetMainSinkSoundPropertyTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommandInterface::am_sinkID_t sinkID = 400; + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, setMainSinkSoundProperty(AllOf( + Field(&am_MainSoundProperty_s::value, 3), + Field(&am_MainSoundProperty_s::type, MSP_UNKNOWN)), sinkID)).WillOnce(Return(E_OK)); + CommandInterface::am_MainSoundProperty_s value(CommandInterface::am_MainSoundPropertyType_e::MSP_UNKNOWN, (const int16_t)3); + env->mProxy->SetMainSinkSoundProperty(sinkID, value, callStatus, result); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, SetMainSourceSoundPropertyTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommandInterface::am_sourceID_t sID = 400; + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, setMainSourceSoundProperty(AllOf( + Field(&am_MainSoundProperty_s::value, 3), + Field(&am_MainSoundProperty_s::type, MSP_UNKNOWN)), sID)).WillOnce(Return(E_OK)); + CommandInterface::am_MainSoundProperty_s value(CommandInterface::am_MainSoundPropertyType_e::MSP_UNKNOWN, (const int16_t)3); + env->mProxy->SetMainSourceSoundProperty(sID, value, callStatus, result); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, SetSystemPropertyTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, setSystemProperty(Field(&am_SystemProperty_s::value, 2))).WillOnce(Return(E_OK)); + + CommandInterface::am_SystemProperty_s value(CommandInterface::am_SystemPropertyType_e::SYP_UNKNOWN, (const int16_t)2); + env->mProxy->SetSystemProperty(value, callStatus, result); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +ACTION(returnListConnections){ + std::vector list; + am_MainConnectionType_s listItem; + listItem.mainConnectionID=15; + listItem.sinkID=4; + listItem.sourceID=3; + listItem.connectionState=CS_UNKNOWN; + listItem.delay=34; + list.push_back(listItem); + arg0=list; +} + +TEST_F(CAmCommandSenderCAPITest, GetListMainConnectionsTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, getListMainConnections(_)).WillOnce(DoAll(returnListConnections(), Return(E_OK))); + CommandInterface::am_MainConnectionType_l listConnections; + env->mProxy->GetListMainConnections(callStatus, result, listConnections); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + ASSERT_EQ(1, listConnections.size()); + ASSERT_EQ(15, listConnections.at(0).mainConnectionID); + ASSERT_EQ(4, listConnections.at(0).sinkID); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +ACTION(returnListSinks){ + std::vector list; + am_SinkType_s listItem; + listItem.availability.availability=A_UNAVAILABLE; + listItem.availability.availabilityReason=AR_GENIVI_NOMEDIA; + listItem.muteState=MS_UNMUTED; + listItem.name="mySink"; + listItem.sinkClassID=34; + listItem.sinkID=24; + listItem.volume=124; + list.push_back(listItem); + arg0=list; +} + +TEST_F(CAmCommandSenderCAPITest, GetListMainSinksTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, getListMainSinks(_)).WillOnce(DoAll(returnListSinks(), Return(E_OK))); + CommandInterface::am_SinkType_l listMainSinks; + env->mProxy->GetListMainSinks(callStatus, result, listMainSinks); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + ASSERT_EQ(1, listMainSinks.size()); + ASSERT_EQ(34, listMainSinks.at(0).sinkClassID); + ASSERT_EQ(24, listMainSinks.at(0).sinkID); + ASSERT_EQ(CommandInterface::am_Availablility_e::A_UNAVAILABLE, listMainSinks.at(0).availability.availability); + ASSERT_EQ(CommandInterface::am_AvailabilityReason_e::AR_GENIVI_NOMEDIA, listMainSinks.at(0).availability.availabilityReason); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +ACTION(returnListSources){ + std::vector list; + am_SourceType_s listItem; + listItem.availability.availability=A_MAX; + listItem.availability.availabilityReason=AR_GENIVI_SAMEMEDIA; + listItem.name="MySource"; + listItem.sourceClassID=12; + listItem.sourceID=224; + list.push_back(listItem); + listItem.name="NextSource"; + listItem.sourceID=22; + list.push_back(listItem); + arg0=list; +} +TEST_F(CAmCommandSenderCAPITest, GetListMainSourcesTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, getListMainSources(_)).WillOnce(DoAll(returnListSources(), Return(E_OK))); + CommandInterface::am_SourceType_l list; + env->mProxy->GetListMainSources(callStatus, result, list); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + ASSERT_EQ(2, list.size()); + ASSERT_EQ(12, list.at(0).sourceClassID); + ASSERT_EQ(224, list.at(0).sourceID); + ASSERT_EQ(CommandInterface::am_Availablility_e::A_MAX, list.at(0).availability.availability); + ASSERT_EQ(CommandInterface::am_AvailabilityReason_e::AR_GENIVI_SAMEMEDIA, list.at(0).availability.availabilityReason); + ASSERT_EQ(22, list.at(1).sourceID); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +ACTION(returnListMainSinkSoundProperties){ + std::vector list; + am_MainSoundProperty_s listItem; + listItem.type=MSP_MAX; + listItem.value=223; + list.push_back(listItem); + listItem.type=MSP_MAX; + listItem.value=2; + list.push_back(listItem); + arg1=list; +} + +TEST_F(CAmCommandSenderCAPITest, GetListMainSinkSoundPropertiesTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommandInterface::am_sinkID_t sID = 400; + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, getListMainSinkSoundProperties(sID,_)).WillOnce(DoAll(returnListMainSinkSoundProperties(), Return(E_OK))); + CommandInterface::am_MainSoundProperty_l list; + env->mProxy->GetListMainSinkSoundProperties(sID, callStatus, result, list); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + ASSERT_EQ(2, list.size()); + ASSERT_EQ(223, list.at(0).value); + ASSERT_EQ(CommandInterface::am_MainSoundPropertyType_e::MSP_MAX, list.at(0).type); + ASSERT_EQ(2, list.at(1).value); + ASSERT_EQ(CommandInterface::am_MainSoundPropertyType_e::MSP_MAX, list.at(1).type); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +ACTION(returnListMainSourceSoundProperties){ + std::vector list; + am_MainSoundProperty_s listItem; + listItem.type=MSP_EXAMPLE_MID; + listItem.value=223; + list.push_back(listItem); + listItem.type=MSP_MAX; + listItem.value=2; + list.push_back(listItem); + arg1=list; +} + +TEST_F(CAmCommandSenderCAPITest, GetListMainSourceSoundPropertiesTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommandInterface::am_sourceID_t sID = 400; + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, getListMainSourceSoundProperties(sID,_)).WillOnce(DoAll(returnListMainSourceSoundProperties(), Return(E_OK))); + CommandInterface::am_MainSoundProperty_l list; + env->mProxy->GetListMainSourceSoundProperties(sID, callStatus, result, list); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + ASSERT_EQ(2, list.size()); + ASSERT_EQ(223, list.at(0).value); + ASSERT_EQ(CommandInterface::am_MainSoundPropertyType_e::MSP_EXAMPLE_MID, list.at(0).type); + ASSERT_EQ(2, list.at(1).value); + ASSERT_EQ(CommandInterface::am_MainSoundPropertyType_e::MSP_MAX, list.at(1).type); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +ACTION(returnListSourceClasses){ + std::vector list; + am_SourceClass_s listItem; + am_ClassProperty_s property; + property.classProperty=CP_MAX; + property.value=12; + listItem.name="FirstCLass"; + listItem.sourceClassID=23; + listItem.listClassProperties.push_back(property); + list.push_back(listItem); + listItem.name="SecondCLass"; + listItem.sourceClassID=2; + listItem.listClassProperties.push_back(property); + list.push_back(listItem); + arg0=list; +} + +TEST_F(CAmCommandSenderCAPITest, GetListSourceClassesTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, getListSourceClasses(_)).WillOnce(DoAll(returnListSourceClasses(), Return(E_OK))); + CommandInterface::am_SourceClass_l list; + env->mProxy->GetListSourceClasses(callStatus, result, list); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + ASSERT_EQ(2, list.size()); + + ASSERT_EQ(23, list.at(0).sourceClassID); + ASSERT_EQ(1, list.at(0).listClassProperties.size()); + ASSERT_EQ(CommandInterface::am_ClassProperty_e::CP_MAX, list.at(0).listClassProperties.at(0).classProperty); + + ASSERT_EQ(2, list.at(1).sourceClassID); + ASSERT_EQ(2, list.at(1).listClassProperties.size()); + ASSERT_EQ(CommandInterface::am_ClassProperty_e::CP_MAX, list.at(1).listClassProperties.at(0).classProperty); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +ACTION(returnListSinkClasses){ + std::vector list; + am_SinkClass_s listItem; + am_ClassProperty_s property; + property.classProperty=CP_MAX; + property.value=122; + listItem.name="FirstCLass"; + listItem.sinkClassID=23; + listItem.listClassProperties.push_back(property); + list.push_back(listItem); + listItem.name="SecondCLass"; + listItem.sinkClassID=2; + listItem.listClassProperties.push_back(property); + list.push_back(listItem); + arg0=list; +} + +TEST_F(CAmCommandSenderCAPITest, GetListSinkClassesTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, getListSinkClasses(_)).WillOnce(DoAll(returnListSinkClasses(), Return(E_OK))); + CommandInterface::am_SinkClass_l list; + env->mProxy->GetListSinkClasses(callStatus, result, list); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + ASSERT_EQ(2, list.size()); + + ASSERT_EQ(0, list.at(0).name.compare("FirstCLass")); + ASSERT_EQ(23, list.at(0).sinkClassID); + ASSERT_EQ(1, list.at(0).listClassProperties.size()); + ASSERT_EQ(CommandInterface::am_ClassProperty_e::CP_MAX, list.at(0).listClassProperties.at(0).classProperty); + + ASSERT_EQ(0, list.at(1).name.compare("SecondCLass")); + ASSERT_EQ(2, list.at(1).sinkClassID); + ASSERT_EQ(2, list.at(1).listClassProperties.size()); + ASSERT_EQ(CommandInterface::am_ClassProperty_e::CP_MAX, list.at(1).listClassProperties.at(0).classProperty); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +ACTION(returnListSystemProperties){ + std::vector list; + am_SystemProperty_s listItem; + listItem.type=SYP_MAX; + listItem.value=-2245; + list.push_back(listItem); + arg0=list; +} + +TEST_F(CAmCommandSenderCAPITest, GetListSystemPropertiesTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + CommonAPI::CallStatus callStatus = CommonAPI::CallStatus::NOT_AVAILABLE; + CommandInterface::am_Error_e result = CommandInterface::am_Error_e::E_OK; + + EXPECT_CALL(*env->mpCommandReceive, getListSystemProperties(_)).WillOnce(DoAll(returnListSystemProperties(), Return(E_OK))); + CommandInterface::am_SystemProperty_l list; + env->mProxy->GetListSystemProperties(callStatus, result, list); + ASSERT_EQ(result, CommandInterface::am_Error_e::E_OK); + ASSERT_EQ(1, list.size()); + + ASSERT_EQ(-2245, list.at(0).value); + ASSERT_EQ(CommandInterface::am_SystemPropertyType_e::SYP_MAX, list.at(0).type); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + + +/** + * Signal tests + */ + +#define SIMPLE_THREADS_SYNC_MICROSEC() usleep(50000) + +TEST_F(CAmCommandSenderCAPITest, onNumberOfMainConnectionsChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getNumberOfMainConnectionsChangedEvent().subscribe(std::bind(&MockNotificationsClient::onNumberOfMainConnectionsChangedEvent, std::ref(mock))); + EXPECT_CALL(mock, onNumberOfMainConnectionsChangedEvent()); + am_MainConnectionType_s mainConnection; + env->mpPlugin->cbNewMainConnection(mainConnection); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getNumberOfMainConnectionsChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onNumberOfSourceClassesChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getNumberOfSourceClassesChangedEvent().subscribe( + std::bind(&MockNotificationsClient::onNumberOfSourceClassesChangedEvent, std::ref(mock))); + EXPECT_CALL(mock, onNumberOfSourceClassesChangedEvent()); + env->mpPlugin->cbNumberOfSourceClassesChanged(); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getNumberOfMainConnectionsChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onMainConnectionStateChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getMainConnectionStateChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainConnectionStateChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + EXPECT_CALL(mock, onMainConnectionStateChangedEvent(101, CommandInterface::am_ConnectionState_e::CS_SUSPENDED)); + env->mpPlugin->cbMainConnectionStateChanged(101, CS_SUSPENDED); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getMainConnectionStateChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSourceAddedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSourceAddedEvent().subscribe(std::bind(&MockNotificationsClient::onSourceAddedEvent, std::ref(mock), + std::placeholders::_1)); + CommandInterface::am_SourceType_s destination; + destination.sourceID = 100; + destination.name = "Name"; + destination.availability.availability = CommandInterface::am_Availablility_e::A_MAX; + destination.availability.availabilityReason = CommandInterface::am_AvailabilityReason_e::AR_MAX; + destination.sourceClassID = 200; + + am_SourceType_s origin; + origin.sourceID = 100; + origin.name = "Name"; + origin.availability.availability = A_MAX; + origin.availability.availabilityReason = AR_MAX; + origin.sourceClassID = 200; + EXPECT_CALL(mock, onSourceAddedEvent(destination)); + env->mpPlugin->cbNewSource(origin); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSourceAddedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSourceRemovedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSourceRemovedEvent().subscribe(std::bind(&MockNotificationsClient::onSourceRemovedEvent, std::ref(mock), + std::placeholders::_1)); + am_sourceID_t source = 101; + EXPECT_CALL(mock, onSourceRemovedEvent(source)); + env->mpPlugin->cbRemovedSource(source); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSourceRemovedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onMainSourceSoundPropertyChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getMainSourceSoundPropertyChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainSourceSoundPropertyChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + + am_MainSoundProperty_s soundProperty; + soundProperty.value = 10; + soundProperty.type = am_MainSoundPropertyType_e::MSP_MAX; + + CommandInterface::am_MainSoundProperty_s destination(CommandInterface::am_MainSoundPropertyType_e::MSP_MAX, 10); + + EXPECT_CALL(mock, onMainSourceSoundPropertyChangedEvent(101, destination)); + env->mpPlugin->cbMainSourceSoundPropertyChanged(101, soundProperty); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getMainSourceSoundPropertyChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSourceAvailabilityChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSourceAvailabilityChangedEvent().subscribe(std::bind(&MockNotificationsClient::onSourceAvailabilityChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + + am_Availability_s availability; + availability.availability = A_MAX; + availability.availabilityReason = AR_MAX; + + CommandInterface::am_Availability_s destination(CommandInterface::am_Availablility_e::A_MAX, CommandInterface::am_AvailabilityReason_e::AR_MAX); + + EXPECT_CALL(mock, onSourceAvailabilityChangedEvent(101, destination)); + env->mpPlugin->cbSourceAvailabilityChanged(101, availability); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSourceAvailabilityChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onNumberOfSinkClassesChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getNumberOfSinkClassesChangedEvent().subscribe(std::bind(&MockNotificationsClient::onNumberOfSinkClassesChangedEvent, std::ref(mock))); + EXPECT_CALL(mock, onNumberOfSinkClassesChangedEvent()); + env->mpPlugin->cbNumberOfSinkClassesChanged(); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getNumberOfSinkClassesChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSinkAddedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSinkAddedEvent().subscribe(std::bind(&MockNotificationsClient::onSinkAddedEvent, std::ref(mock), + std::placeholders::_1)); + CommandInterface::am_SinkType_s destination; + destination.sinkID = 100; + destination.name = "Name"; + destination.availability.availability = CommandInterface::am_Availablility_e::A_MAX; + destination.availability.availabilityReason = CommandInterface::am_AvailabilityReason_e::AR_MAX; + destination.muteState = CommandInterface::am_MuteState_e::MS_MAX; + destination.volume = 1; + destination.sinkClassID = 100; + + am_SinkType_s origin; + origin.sinkID = 100; + origin.name = "Name"; + origin.availability.availability = A_MAX; + origin.availability.availabilityReason = AR_MAX; + origin.muteState = am_MuteState_e::MS_MAX; + origin.volume = 1; + origin.sinkClassID = 100; + + EXPECT_CALL(mock, onSinkAddedEvent(destination)); + env->mpPlugin->cbNewSink(origin); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSinkAddedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSinkRemovedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSinkRemovedEvent().subscribe(std::bind(&MockNotificationsClient::onSinkRemovedEvent, std::ref(mock), + std::placeholders::_1)); + EXPECT_CALL(mock, onSinkRemovedEvent(101)); + env->mpPlugin->cbRemovedSink(101); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSinkRemovedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onMainSinkSoundPropertyChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getMainSinkSoundPropertyChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainSinkSoundPropertyChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + + am_MainSoundProperty_s soundProperty; + soundProperty.value = 10; + soundProperty.type = am_MainSoundPropertyType_e::MSP_MAX; + + CommandInterface::am_MainSoundProperty_s destination(CommandInterface::am_MainSoundPropertyType_e::MSP_MAX, 10); + + EXPECT_CALL(mock, onMainSinkSoundPropertyChangedEvent(101, destination)); + env->mpPlugin->cbMainSinkSoundPropertyChanged(101, soundProperty); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getMainSinkSoundPropertyChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSinkAvailabilityChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSinkAvailabilityChangedEvent().subscribe(std::bind(&MockNotificationsClient::onSinkAvailabilityChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + + am_Availability_s availability; + availability.availability = A_MAX; + availability.availabilityReason = AR_MAX; + + CommandInterface::am_Availability_s destination(CommandInterface::am_Availablility_e::A_MAX, CommandInterface::am_AvailabilityReason_e::AR_MAX); + + EXPECT_CALL(mock, onSinkAvailabilityChangedEvent(101, destination)); + env->mpPlugin->cbSinkAvailabilityChanged(101, availability); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSinkAvailabilityChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onVolumeChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getVolumeChangedEvent().subscribe(std::bind(&MockNotificationsClient::onVolumeChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + EXPECT_CALL(mock, onVolumeChangedEvent(101, 4)); + env->mpPlugin->cbVolumeChanged(101, 4); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getVolumeChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSinkMuteStateChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSinkMuteStateChangedEvent().subscribe(std::bind(&MockNotificationsClient::onSinkMuteStateChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + EXPECT_CALL(mock, onSinkMuteStateChangedEvent(101, CommandInterface::am_MuteState_e::MS_MAX)); + env->mpPlugin->cbSinkMuteStateChanged(101, am_MuteState_e::MS_MAX); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSinkMuteStateChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSystemPropertyChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSystemPropertyChangedEvent().subscribe(std::bind(&MockNotificationsClient::onSystemPropertyChangedEvent, std::ref(mock), + std::placeholders::_1)); + + CommandInterface::am_SystemProperty_s value(CommandInterface::am_SystemPropertyType_e::SYP_UNKNOWN, (const int16_t)2); + am_SystemProperty_s systemProperty; + systemProperty.value = 2; + systemProperty.type = am_SystemPropertyType_e::SYP_UNKNOWN; + + EXPECT_CALL(mock, onSystemPropertyChangedEvent(value)); + env->mpPlugin->cbSystemPropertyChanged(systemProperty); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSystemPropertyChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onTimingInformationChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getTimingInformationChangedEvent().subscribe(std::bind(&MockNotificationsClient::onTimingInformationChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + + EXPECT_CALL(mock, onTimingInformationChangedEvent(1, 2)); + env->mpPlugin->cbTimingInformationChanged(1, 2); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getTimingInformationChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSinkUpdatedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSinkUpdatedEvent().subscribe(std::bind(&MockNotificationsClient::onSinkUpdatedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + std::vector listMainSoundProperties; + am_MainSoundProperty_s prop; + prop.value = 1; + prop.type = am_MainSoundPropertyType_e::MSP_MAX; + listMainSoundProperties.push_back(prop); + EXPECT_CALL(mock, onSinkUpdatedEvent(1, 2, _)); + env->mpPlugin->cbSinkUpdated(1, 2, listMainSoundProperties); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSinkUpdatedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSourceUpdatedTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSourceUpdatedEvent().subscribe(std::bind(&MockNotificationsClient::onSourceUpdatedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + std::vector listMainSoundProperties; + am_MainSoundProperty_s prop; + prop.value = 1; + prop.type = am_MainSoundPropertyType_e::MSP_MAX; + listMainSoundProperties.push_back(prop); + EXPECT_CALL(mock, onSourceUpdatedEvent(1, 2, _)); + env->mpPlugin->cbSourceUpdated(1, 2, listMainSoundProperties); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSourceUpdatedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onSinkNotificationEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSinkNotificationEvent().subscribe(std::bind(&MockNotificationsClient::onSinkNotificationEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + am_NotificationPayload_s orig; + orig.type = am_NotificationType_e::NT_MAX; + orig.value = 1; + CommandInterface::am_NotificationPayload_s dest; + dest.type = org::genivi::audiomanager::am::am_NotificationType_e::NT_MAX; + dest.value = 1; + + EXPECT_CALL(mock, onSinkNotificationEvent(1, dest)); + env->mpPlugin->cbSinkNotification(1, orig); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSinkNotificationEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + + +TEST_F(CAmCommandSenderCAPITest, onSourceNotificationEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getSourceNotificationEvent().subscribe(std::bind(&MockNotificationsClient::onSourceNotificationEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + am_NotificationPayload_s orig; + orig.type = am_NotificationType_e::NT_MAX; + orig.value = 1; + CommandInterface::am_NotificationPayload_s dest; + dest.type = org::genivi::audiomanager::am::am_NotificationType_e::NT_MAX; + dest.value = 1; + + EXPECT_CALL(mock, onSourceNotificationEvent(1, dest)); + env->mpPlugin->cbSourceNotification(1, orig); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getSourceNotificationEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onMainSinkNotificationConfigurationChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getMainSinkNotificationConfigurationChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainSinkNotificationConfigurationChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + am_NotificationConfiguration_s orig; + orig.type = am_NotificationType_e::NT_MAX; + orig.parameter = 1; + orig.status = am_NotificationStatus_e::NS_MAX; + org::genivi::audiomanager::am::am_NotificationConfiguration_s dest; + dest.type = org::genivi::audiomanager::am::am_NotificationType_e::NT_MAX; + dest.parameter = 1; + dest.status = org::genivi::audiomanager::am::am_NotificationStatus_e::NS_MAX; + + EXPECT_CALL(mock, onMainSinkNotificationConfigurationChangedEvent(1, dest)); + env->mpPlugin->cbMainSinkNotificationConfigurationChanged(1, orig); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getMainSinkNotificationConfigurationChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + +TEST_F(CAmCommandSenderCAPITest, onMainSourceNotificationConfigurationChangedEventTest) +{ + ASSERT_TRUE(env->mIsServiceAvailable); + if(env->mIsServiceAvailable) + { + MockNotificationsClient mock; + auto subscription = env->mProxy->getMainSourceNotificationConfigurationChangedEvent().subscribe(std::bind(&MockNotificationsClient::onMainSourceNotificationConfigurationChangedEvent, std::ref(mock), + std::placeholders::_1, std::placeholders::_2)); + am_NotificationConfiguration_s orig; + orig.type = am_NotificationType_e::NT_MAX; + orig.parameter = 1; + orig.status = am_NotificationStatus_e::NS_MAX; + org::genivi::audiomanager::am::am_NotificationConfiguration_s dest; + dest.type = org::genivi::audiomanager::am::am_NotificationType_e::NT_MAX; + dest.parameter = 1; + dest.status = org::genivi::audiomanager::am::am_NotificationStatus_e::NS_MAX; + + EXPECT_CALL(mock, onMainSourceNotificationConfigurationChangedEvent(1, dest)); + env->mpPlugin->cbMainSourceNotificationConfigurationChanged(1, orig); + SIMPLE_THREADS_SYNC_MICROSEC(); + env->mProxy->getMainSourceNotificationConfigurationChangedEvent().unsubscribe(subscription); + } + EXPECT_TRUE(Mock::VerifyAndClearExpectations(env->mpCommandReceive)); +} + diff --git a/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.h b/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.h new file mode 100644 index 0000000..21aafe8 --- /dev/null +++ b/PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.h @@ -0,0 +1,77 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#ifndef COMMANDPLUGININTERFACETEST_H_ +#define COMMANDPLUGININTERFACETEST_H_ + +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "shared/CAmSocketHandler.h" +#include "CAmTestCAPIWrapper.h" +#include "../include/CAmCommandSenderCAPI.h" +#include "MockIAmCommandReceive.h" +#include <../src-gen/org/genivi/audiomanager/CommandInterfaceProxy.h> + +#define UNIT_TEST 1 + +using namespace testing; +using namespace CommonAPI; +namespace am { + +class CAmCommandSenderDbusBackdoor; +class IAmCommandSend; + +class CAmTestsEnvironment : public ::testing::Environment +{ + pthread_t mListenerThread; + pthread_t mServicePThread; + pthread_t mClientPThread; + +public: + CAmSocketHandler *mSocketHandlerService; + CAmSocketHandler *mSocketHandlerClient; + bool mIsProxyInitilized; + bool mIsServiceAvailable; + MockIAmCommandReceive *mpCommandReceive; + CAmCommandSenderCAPI *mpPlugin; + + std::shared_ptr > mProxy; + + CAmTestsEnvironment(); + ~CAmTestsEnvironment(); + void SetUp(); + // Override this to define how to tear down the environment. + void TearDown(); + void onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus); +}; + + +class CAmCommandSenderCAPITest :public ::testing::Test +{ + +public: + CAmCommandSenderCAPITest(); + ~CAmCommandSenderCAPITest(); + + void SetUp(); + void TearDown(); + +}; + +} + +#endif /* COMMANDPLUGININTERFACETEST_H_ */ diff --git a/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.cpp b/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.cpp new file mode 100644 index 0000000..6134d62 --- /dev/null +++ b/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.cpp @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#include "CAmTestCAPIWrapper.h" + +namespace am { + +CAmTestCAPIWrapper::CAmTestCAPIWrapper(CAmSocketHandler* socketHandler):CAmCommonAPIWrapper(socketHandler) +{ + +} + +CAmTestCAPIWrapper::~CAmTestCAPIWrapper() { + // TODO Auto-generated destructor stub +} + +} /* namespace am */ diff --git a/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.h b/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.h new file mode 100644 index 0000000..90499f9 --- /dev/null +++ b/PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.h @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#ifndef CAMTESTCAPIWRAPPER_H_ +#define CAMTESTCAPIWRAPPER_H_ + +#include "shared/CAmCommonAPIWrapper.h" + +namespace am { + +class CAmTestCAPIWrapper: public am::CAmCommonAPIWrapper { +public: + CAmTestCAPIWrapper(CAmSocketHandler* socketHandler); + virtual ~CAmTestCAPIWrapper(); +}; + +} /* namespace am */ +#endif /* CAMTESTCAPIWRAPPER_H_ */ diff --git a/PluginCommandInterfaceCAPI/test/CMakeLists.txt b/PluginCommandInterfaceCAPI/test/CMakeLists.txt new file mode 100644 index 0000000..acfc1cf --- /dev/null +++ b/PluginCommandInterfaceCAPI/test/CMakeLists.txt @@ -0,0 +1,105 @@ +# Copyright (c) 2012 GENIVI Alliance +# Copyright (c) 2012 BMW +# +# author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 +# +# 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. +# +# For further information see http://www.genivi.org/. +# + +cmake_minimum_required(VERSION 2.6) + +PROJECT(CAmCommandSenderCAPITests) + +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -g -DUNIT_TEST=1 -DDLT_CONTEXT=AudioManager") + +string (REPLACE "-g -Wall -Wextra" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +string (REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + +set(STD_INCLUDE_DIRS "/usr/include") +set(EXECUTABLE_OUTPUT_PATH ${TEST_EXECUTABLE_OUTPUT_PATH}) + +FIND_PACKAGE(Threads) +FIND_PACKAGE(PkgConfig) +FIND_PACKAGE(PythonLibs REQUIRED) +pkg_check_modules(PC_COMMON REQUIRED CommonAPI) +pkg_check_modules(PC_COMMON_DBUS REQUIRED CommonAPI-DBus) + +IF(WITH_DLT) + pkg_check_modules(DLT REQUIRED automotive-dlt>=2.2.0) +ENDIF(WITH_DLT) + +INCLUDE_DIRECTORIES( + ${STD_INCLUDE_DIRS} + ${CMAKE_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${AUDIO_INCLUDE_FOLDER} + ${CMAKE_SOURCE_DIR} + ${DLT_INCLUDE_DIRS} + ${PC_COMMON_INCLUDE_DIRS} + ${PC_COMMON_DBUS_INCLUDE_DIRS} + ${INCLUDE_FOLDER} + ${PYTHON_INCLUDE_DIRS} + ${GOOGLE_TEST_INCLUDE_DIR} + ${GMOCK_INCLUDE_DIR} + "../../AudioManagerDaemon/include" + "../include" +) + +link_directories( + ${LINK_DIRECTORIES} + ${PC_COMMON_LIBRARY_DIRS} + ${PC_COMMON_DBUS_LIBRARY_DIRS} +) + +file(GLOB CAPI_PLUGIN_INTERFACE_SRCS_CXX + "../../AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp" + "../../AudioManagerDaemon/src/CAmSocketHandler.cpp" + "../../AudioManagerDaemon/src/CAmDltWrapper.cpp" + "../src/*.cpp" + "CAmCommandSenderCAPITest.cpp" + "CAmTestCAPIWrapper.cpp" + "CAmCommandSenderCommon.cpp" +) + +file(GLOB_RECURSE CAPI_PLUGIN_INTERFACE_GEN_SRCS_CXX + "../src-gen/*.cpp" +) + +ADD_EXECUTABLE(AmCommandSenderCAPITest ${CAPI_PLUGIN_INTERFACE_SRCS_CXX} ${CAPI_PLUGIN_INTERFACE_GEN_SRCS_CXX}) + +TARGET_LINK_LIBRARIES(AmCommandSenderCAPITest + ${DLT_LIBRARIES} + ${DBUS_LIBRARY} + ${CMAKE_DL_LIBS} + ${CMAKE_THREAD_LIBS_INIT} + ${PYTHON_LIBRARY} + ${PC_GSTREAMER_LIBRARIES} + ${PC_COMMON_LIBRARIES} + ${PC_COMMON_DBUS_LIBRARIES} + gtest + gmock +) + +CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf ${EXECUTABLE_OUTPUT_PATH}/AmCommandSenderCAPITest_dbus.conf) + +INSTALL(TARGETS AmCommandSenderCAPITest + DESTINATION "~/AudioManagerTest/" + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ + COMPONENT tests +) + +#execute_process( +# COMMAND cp "${CMAKE_SOURCE_DIR}/PluginCommandInterfaceCAPI/fidls/PluginCommandInterfaceCAPI_dbus.conf" ${EXECUTABLE_OUTPUT_PATH}) + +SET(ADD_DEPEND "audiomanager-bin" "sqlite3(>=3.6.22)" "dlt" "gtest" "libpthread-stubs0") +set_property(GLOBAL APPEND PROPERTY tests_prop "${ADD_DEPEND}") + diff --git a/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h b/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h new file mode 100644 index 0000000..23524e1 --- /dev/null +++ b/PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + +#ifndef MOCKCOMMANDRECEIVENTERFACE_H_ +#define MOCKCOMMANDRECEIVENTERFACE_H_ + +#include "command/IAmCommandReceive.h" +#include "gtest/gtest.h" +#include "gmock/gmock.h" + +namespace am { + +class MockIAmCommandReceive : public IAmCommandReceive { + public: + MOCK_CONST_METHOD1(getInterfaceVersion, + void(std::string& version)); + MOCK_METHOD3(connect, + am_Error_e(const am_sourceID_t sourceID, const am_sinkID_t sinkID, am_mainConnectionID_t& mainConnectionID)); + MOCK_METHOD1(disconnect, + am_Error_e(const am_mainConnectionID_t mainConnectionID)); + MOCK_METHOD2(setVolume, + am_Error_e(const am_sinkID_t sinkID, const am_mainVolume_t volume)); + MOCK_METHOD2(volumeStep, + am_Error_e(const am_sinkID_t sinkID, const int16_t volumeStep)); + MOCK_METHOD2(setSinkMuteState, + am_Error_e(const am_sinkID_t sinkID, const am_MuteState_e muteState)); + MOCK_METHOD2(setMainSinkSoundProperty, + am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sinkID_t sinkID)); + MOCK_METHOD2(setMainSourceSoundProperty, + am_Error_e(const am_MainSoundProperty_s& soundProperty, const am_sourceID_t sourceID)); + MOCK_METHOD1(setSystemProperty, + am_Error_e(const am_SystemProperty_s& property)); + MOCK_CONST_METHOD1(getListMainConnections, + am_Error_e(std::vector& listConnections)); + MOCK_CONST_METHOD1(getListMainSinks, + am_Error_e(std::vector& listMainSinks)); + MOCK_CONST_METHOD1(getListMainSources, + am_Error_e(std::vector& listMainSources)); + MOCK_CONST_METHOD2(getListMainSinkSoundProperties, + am_Error_e(const am_sinkID_t sinkID, std::vector& listSoundProperties)); + MOCK_CONST_METHOD2(getListMainSourceSoundProperties, + am_Error_e(const am_sourceID_t sourceID, std::vector& listSourceProperties)); + MOCK_CONST_METHOD1(getListSourceClasses, + am_Error_e(std::vector& listSourceClasses)); + MOCK_CONST_METHOD1(getListSinkClasses, + am_Error_e(std::vector& listSinkClasses)); + MOCK_CONST_METHOD1(getListSystemProperties, + am_Error_e(std::vector& listSystemProperties)); + MOCK_CONST_METHOD2(getTimingInformation, + am_Error_e(const am_mainConnectionID_t mainConnectionID, am_timeSync_t& delay)); + MOCK_CONST_METHOD1(getDBusConnectionWrapper, + am_Error_e(CAmDbusWrapper*& dbusConnectionWrapper)); + MOCK_CONST_METHOD1(getSocketHandler, + am_Error_e(CAmSocketHandler*& socketHandler)); + MOCK_METHOD2(confirmCommandReady, + void(const uint16_t handle, const am_Error_e error)); + MOCK_METHOD2(confirmCommandRundown, + void(const uint16_t handle, const am_Error_e error)); + MOCK_CONST_METHOD2(getListMainSinkNotificationConfigurations, + am_Error_e(const am_sinkID_t sinkID, std::vector& listMainNotificationConfigurations)); + MOCK_CONST_METHOD2(getListMainSourceNotificationConfigurations, + am_Error_e(const am_sourceID_t sourceID, std::vector& listMainNotificationConfigurations)); + MOCK_METHOD2(setMainSinkNotificationConfiguration, + am_Error_e(const am_sinkID_t sinkID, const am_NotificationConfiguration_s& mainNotificationConfiguration)); + MOCK_METHOD2(setMainSourceNotificationConfiguration, + am_Error_e(const am_sourceID_t sourceID, const am_NotificationConfiguration_s& mainNotificationConfiguration)); + + +}; + +} // namespace am +#endif /* MOCKCOMMANDRECEIVENTERFACE_H_ */ diff --git a/PluginCommandInterfaceCAPI/test/MockNotificationsClient.h b/PluginCommandInterfaceCAPI/test/MockNotificationsClient.h new file mode 100644 index 0000000..8ab2e5e --- /dev/null +++ b/PluginCommandInterfaceCAPI/test/MockNotificationsClient.h @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2012 BMW + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \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. + * + * For further information see http://www.genivi.org/. + */ + + +#ifndef MOCKNOTIFICATIONSCLIENT_H_ +#define MOCKNOTIFICATIONSCLIENT_H_ + +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include + + +namespace am { +using namespace testing; +using namespace CommonAPI; +using namespace org::genivi::audiomanager; + +class IAmNotificationsClient +{ +public: + IAmNotificationsClient() + {} + + virtual ~IAmNotificationsClient() + {} + virtual void onNumberOfMainConnectionsChangedEvent() = 0; + virtual void onNumberOfSourceClassesChangedEvent() = 0; + virtual void onMainConnectionStateChangedEvent(CommandInterface::am_mainConnectionID_t, CommandInterface::am_ConnectionState_e) = 0; + virtual void onSourceAddedEvent(const CommandInterface::am_SourceType_s &) = 0; + virtual void onSourceRemovedEvent(CommandInterface::am_sourceID_t) = 0; + virtual void onMainSourceSoundPropertyChangedEvent(CommandInterface::am_sourceID_t, const CommandInterface::am_MainSoundProperty_s & ) = 0; + virtual void onSourceAvailabilityChangedEvent(CommandInterface::am_sourceID_t, const CommandInterface::am_Availability_s &) = 0; + virtual void onNumberOfSinkClassesChangedEvent() = 0; + virtual void onSinkAddedEvent(const CommandInterface::am_SinkType_s &) = 0; + virtual void onSinkRemovedEvent(CommandInterface::am_sinkID_t) = 0; + virtual void onMainSinkSoundPropertyChangedEvent(CommandInterface::am_sinkID_t, const CommandInterface::am_MainSoundProperty_s &) = 0; + virtual void onSinkAvailabilityChangedEvent(CommandInterface::am_sinkID_t, const CommandInterface::am_Availability_s &) = 0; + virtual void onVolumeChangedEvent(CommandInterface::am_sinkID_t, CommandInterface::am_mainVolume_t) = 0; + virtual void onSinkMuteStateChangedEvent(CommandInterface::am_sinkID_t, CommandInterface::am_MuteState_e) = 0; + virtual void onSystemPropertyChangedEvent(const CommandInterface::am_SystemProperty_s &) = 0; + virtual void onTimingInformationChangedEvent(CommandInterface::am_mainConnectionID_t, CommandInterface::am_timeSync_t) = 0; + virtual void onSinkUpdatedEvent(CommandInterface::am_sinkID_t, CommandInterface::am_sinkClass_t, const CommandInterface::am_MainSoundProperty_l &) = 0; + virtual void onSourceUpdatedEvent(CommandInterface::am_sourceID_t, CommandInterface::am_sourceClass_t, const CommandInterface::am_MainSoundProperty_l &) = 0; + virtual void onSinkNotificationEvent(CommandInterface::am_sinkID_t, const CommandInterface::am_NotificationPayload_s & ) = 0; + virtual void onSourceNotificationEvent(CommandInterface::am_sourceID_t, const CommandInterface::am_NotificationPayload_s &) = 0; + virtual void onMainSinkNotificationConfigurationChangedEvent(CommandInterface::am_sinkID_t, const org::genivi::audiomanager::am::am_NotificationConfiguration_s &) = 0; + virtual void onMainSourceNotificationConfigurationChangedEvent(CommandInterface::am_sourceID_t, const org::genivi::audiomanager::am::am_NotificationConfiguration_s &) = 0; +}; + +class MockNotificationsClient : public IAmNotificationsClient { + public: + MOCK_METHOD0(onNumberOfMainConnectionsChangedEvent, + void()); + MOCK_METHOD0(onNumberOfSourceClassesChangedEvent, void()); + MOCK_METHOD2(onMainConnectionStateChangedEvent, + void(CommandInterface::am_mainConnectionID_t mcID, CommandInterface::am_ConnectionState_e cs)); + MOCK_METHOD1(onSourceAddedEvent, void(const CommandInterface::am_SourceType_s & st)); + MOCK_METHOD1(onSourceRemovedEvent, void(CommandInterface::am_sourceID_t sid)); + MOCK_METHOD2(onMainSourceSoundPropertyChangedEvent, + void(CommandInterface::am_sourceID_t sid, const CommandInterface::am_MainSoundProperty_s & msp) ); + MOCK_METHOD2(onSourceAvailabilityChangedEvent, + void(CommandInterface::am_sourceID_t st, const CommandInterface::am_Availability_s & a) ); + MOCK_METHOD0(onNumberOfSinkClassesChangedEvent, + void()); + MOCK_METHOD1(onSinkAddedEvent, + void(const CommandInterface::am_SinkType_s & st)); + MOCK_METHOD1(onSinkRemovedEvent, + void(CommandInterface::am_sinkID_t sid)); + MOCK_METHOD2(onMainSinkSoundPropertyChangedEvent, + void(CommandInterface::am_sinkID_t sid, const CommandInterface::am_MainSoundProperty_s & msp) ); + MOCK_METHOD2(onSinkAvailabilityChangedEvent, + void(CommandInterface::am_sinkID_t sid, const CommandInterface::am_Availability_s & a) ); + MOCK_METHOD2(onVolumeChangedEvent, + void(CommandInterface::am_sinkID_t sid, CommandInterface::am_mainVolume_t mv) ); + MOCK_METHOD2(onSinkMuteStateChangedEvent, + void(CommandInterface::am_sinkID_t sid, CommandInterface::am_MuteState_e ms) ); + MOCK_METHOD1(onSystemPropertyChangedEvent, + void(const CommandInterface::am_SystemProperty_s & sp)); + MOCK_METHOD2(onTimingInformationChangedEvent, + void(CommandInterface::am_mainConnectionID_t cid, CommandInterface::am_timeSync_t ts) ); + MOCK_METHOD3(onSinkUpdatedEvent, + void(CommandInterface::am_sinkID_t sid, CommandInterface::am_sinkClass_t sc, const CommandInterface::am_MainSoundProperty_l & msp) ); + MOCK_METHOD3(onSourceUpdatedEvent, + void(CommandInterface::am_sourceID_t sid, CommandInterface::am_sourceClass_t sc, const CommandInterface::am_MainSoundProperty_l & msp) ); + MOCK_METHOD2(onSinkNotificationEvent, + void(CommandInterface::am_sinkID_t sid, const CommandInterface::am_NotificationPayload_s & np)); + MOCK_METHOD2(onSourceNotificationEvent, + void(CommandInterface::am_sourceID_t sid, const CommandInterface::am_NotificationPayload_s & np) ); + MOCK_METHOD2(onMainSinkNotificationConfigurationChangedEvent, + void(CommandInterface::am_sinkID_t sid, const org::genivi::audiomanager::am::am_NotificationConfiguration_s & nc) ); + MOCK_METHOD2(onMainSourceNotificationConfigurationChangedEvent, + void(CommandInterface::am_sourceID_t sid, const org::genivi::audiomanager::am::am_NotificationConfiguration_s & nc)); +}; + +} // namespace am +#endif /* MOCKCOMMANDRECEIVENTERFACE_H_ */ -- cgit v1.2.1