diff options
Diffstat (limited to 'PluginCommandInterfaceDbus')
12 files changed, 401 insertions, 83 deletions
diff --git a/PluginCommandInterfaceDbus/cmake/config.cmake b/PluginCommandInterfaceDbus/cmake/config.cmake index 35c9aeb..6b8c553 100644 --- a/PluginCommandInterfaceDbus/cmake/config.cmake +++ b/PluginCommandInterfaceDbus/cmake/config.cmake @@ -2,5 +2,6 @@ #define _COMMANDDBUS_CONFIG_H #cmakedefine COMMAND_DBUS_INTROSPECTION_FILE "@COMMAND_DBUS_INTROSPECTION_FILE@" +#cmakedefine LIBRARY_OUTPUT_PATH "@LIBRARY_OUTPUT_PATH@" #endif /* _COMMANDDBUS_CONFIG_H */ diff --git a/PluginCommandInterfaceDbus/include/CAmCommandSenderDbus.h b/PluginCommandInterfaceDbus/include/CAmCommandSenderDbus.h index cb3edcc..d8a2a0c 100644 --- a/PluginCommandInterfaceDbus/include/CAmCommandSenderDbus.h +++ b/PluginCommandInterfaceDbus/include/CAmCommandSenderDbus.h @@ -65,6 +65,12 @@ public: 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<am_MainSoundProperty_s>& listMainSoundProperties); + void cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& 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 cbSinkMainNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s mainNotificationConfiguration); + void cbSourceMainNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s mainNotificationConfiguration); #ifdef UNIT_TEST friend class CAmCommandSenderDbusBackdoor; diff --git a/PluginCommandInterfaceDbus/include/CAmDbusMessageHandler.h b/PluginCommandInterfaceDbus/include/CAmDbusMessageHandler.h index 4cada87..582bf51 100644 --- a/PluginCommandInterfaceDbus/include/CAmDbusMessageHandler.h +++ b/PluginCommandInterfaceDbus/include/CAmDbusMessageHandler.h @@ -80,6 +80,7 @@ public: double getDouble(); char* getString(); void getProperty(dbus_int16_t& type, dbus_int16_t& value); + void getNotificationConfiguration(dbus_int16_t& notificationType, dbus_int16_t& notificationStatus, dbus_int16_t& notificationParameter); /** * the overloaded append function appends different datatypes to the dbusmessage @@ -101,6 +102,9 @@ public: void append(const std::vector<am::am_SourceClass_s>& listSourceClasses); void append(const std::vector<am::am_SinkClass_s>& listSinkClasses); void append(const std::vector<am::am_SystemProperty_s>& listSystemProperties); + void append(const std::vector<am::am_NotificationConfiguration_s>& listNotifications); + void append(const am::am_NotificationPayload_s& notificationPayload); + void append(const am::am_NotificationConfiguration_s& notificationConfiguration); private: diff --git a/PluginCommandInterfaceDbus/include/CommandInterface.xml b/PluginCommandInterfaceDbus/include/CommandInterface.xml index f6f07a0..5eb51c7 100644 --- a/PluginCommandInterfaceDbus/include/CommandInterface.xml +++ b/PluginCommandInterfaceDbus/include/CommandInterface.xml @@ -5,7 +5,6 @@ <node>
<interface name="org.genivi.audiomanager.CommandInterface">
-
<method name="Connect">
<arg type="q" name="sourceID" direction="in"/>
<arg type="q" name="sinkID" direction="in"/>
@@ -92,7 +91,7 @@ <method name="GetListSystemProperties">
<arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
- <arg type="a(nn)" name="listSystemProperties" direction="in"/> <!-- am_SystemProperty_e type; int16_t value; -->
+ <arg type="a(nn)" name="listSystemProperties" direction="out"/> <!-- am_SystemProperty_e type; int16_t value; -->
</method>
<method name="GetTimingInformation">
@@ -100,24 +99,35 @@ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
<arg type="n" name="delay" direction="out"/>
</method>
+
+ <method name="GetListSinkMainNotificationConfigurations">
+ <arg type="q" name="sinkID" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(nnn)" name="listMainNotificationConfigurations" direction="out"/> <!-- am_am_notification_e type; am_NotificationStatus_e status; int16t parameter; -->
+ </method>
+
+ <method name="GetListSourceMainNotificationConfigurations">
+ <arg type="q" name="sourceID" direction="in"/>
+ <arg type="n" name="result" direction="out"/> <!-- method return code (am_Error_e) -->
+ <arg type="a(nnn)" name="listMainNotificationConfigurations" direction="out"/> <!-- am_am_notification_e type; am_NotificationStatus_e status; int16t parameter; -->
+ </method>
- <signal name="NumberOfMainConnectionsChanged">
- </signal>
+ <signal name="NumberOfMainConnectionsChanged"></signal>
- <signal name="SinkAdded">
- <arg type="(qs(nn)nnq)" name="newSink" direction="out"/><!-- am_sinkID_t sinkID; std::string name; am_Availability_s availability; am_mainVolume_t volume; am_MuteState_e muteState; am_sinkClass_t sinkClassID; -->
+ <signal name="SinkAdded">
+ <arg type="(qs(nn)nnq)" name="newSink" direction="out"/> <!-- am_sinkID_t sinkID; std::string name; am_Availability_s availability; am_mainVolume_t volume; am_MuteState_e muteState; am_sinkClass_t sinkClassID; -->
</signal>
- <signal name="SinkRemoved">
+ <signal name="SinkRemoved">
<arg type="q" name="removedSinkID" direction="out"/>
</signal>
- <signal name="SourceAdded">
- <arg type="(qs(nn)q)" name="newSource" direction="out"/><!-- am_sourceID_t sourceID; std::string name; am_Availability_s availability; am_sourceClass_t sourceClassID; -->
+ <signal name="SourceAdded">
+ <arg type="(qs(nn)q)" name="newSource" direction="out"/> <!-- am_sourceID_t sourceID; std::string name; am_Availability_s availability; am_sourceClass_t sourceClassID; -->
</signal>
- <signal name="SourceRemoved">
- <arg type="q" name="removedSourceID" direction="out"/>
+ <signal name="SourceRemoved">
+ <arg type="q" name="removedSourceID" direction="out"/>
</signal>
<signal name="NumberOfSinkClassesChanged">
@@ -169,6 +179,38 @@ <arg type="q" name="mainConnection" direction="out"/>
<arg type="n" name="time" direction="out"/>
</signal>
-
+
+ <signal name="SinkUpdated">
+ <arg type="q" name="sinkID" direction="out"/>
+ <arg type="q" name="sinkClassID" direction="out"/>
+ <arg type="a(nn)" name="listMainSinkProperties" direction="out"/> <!-- am_MainSoundPropertyType_e type; int16_t value; -->
+ </signal>
+
+ <signal name="SourceUpdated">
+ <arg type="q" name="sourceID" direction="out"/>
+ <arg type="q" name="sourceClassID" direction="out"/>
+ <arg type="a(nn)" name="listMainSinkProperties" direction="out"/> <!-- am_MainSoundPropertyType_e type; int16_t value; -->
+ </signal>
+
+ <signal name="SourceNotification">
+ <arg type="q" name="sourceID" direction="out"/>
+ <arg type="(nn)" name="notificationPayload" direction="out"/> <!-- am_notification_e type; int16_t value; -->
+ </signal>
+
+ <signal name="SinkNotification">
+ <arg type="q" name="sinkID" direction="out"/>
+ <arg type="(nn)" name="notificationPayload" direction="out"/> <!-- am_notification_e type; int16_t value; -->
+ </signal>
+
+ <signal name="SinkMainNotificationConfigurationChanged">
+ <arg type="q" name="sinkID" direction="out"/>
+ <arg type="(nnn)" name="mainNotificationConfiguration" direction="out"/> <!-- am_am_notification_e type; am_NotificationStatus_e status; int16t parameter; -->
+ </signal>
+
+ <signal name="SourceMainNotificationConfigurationChanged">
+ <arg type="q" name="sourceID" direction="out"/>
+ <arg type="(nnn)" name="mainNotificationConfiguration" direction="out"/> <!-- am_am_notification_e type; am_NotificationStatus_e status; int16t parameter; -->
+ </signal>
+
</interface>
</node>
diff --git a/PluginCommandInterfaceDbus/include/IAmCommandReceiverShadow.h b/PluginCommandInterfaceDbus/include/IAmCommandReceiverShadow.h index 758266d..c582ee6 100644 --- a/PluginCommandInterfaceDbus/include/IAmCommandReceiverShadow.h +++ b/PluginCommandInterfaceDbus/include/IAmCommandReceiverShadow.h @@ -59,6 +59,10 @@ public: void getListSinkClasses(DBusConnection *conn, DBusMessage *msg); void getListSystemProperties(DBusConnection *conn, DBusMessage *msg); void getTimingInformation(DBusConnection *conn, DBusMessage *msg); + void getListSinkMainNotificationConfigurations(DBusConnection *conn, DBusMessage *msg); + void getListSourceMainNotificationConfigurations(DBusConnection *conn, DBusMessage *msg); + void setSinkMainNotificationConfiguration(DBusConnection *conn, DBusMessage *msg); + void setSourceMainNotificationConfiguration(DBusConnection *conn, DBusMessage *msg); /** * sets the pointer to the CommandReceiveInterface and registers Callback diff --git a/PluginCommandInterfaceDbus/include/configCommandDbus.h b/PluginCommandInterfaceDbus/include/configCommandDbus.h index 685d911..369beea 100644 --- a/PluginCommandInterfaceDbus/include/configCommandDbus.h +++ b/PluginCommandInterfaceDbus/include/configCommandDbus.h @@ -1,6 +1,7 @@ #ifndef _COMMANDDBUS_CONFIG_H #define _COMMANDDBUS_CONFIG_H -#define COMMAND_DBUS_INTROSPECTION_FILE "/usr/share/audiomanager/CommandInterface.xml" +#define COMMAND_DBUS_INTROSPECTION_FILE "/home/christian/workspace/AudioManager/bin/CommandInterface.xml" +#define LIBRARY_OUTPUT_PATH "/home/christian/workspace/AudioManager/bin/plugins/command" #endif /* _COMMANDDBUS_CONFIG_H */ diff --git a/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp b/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp index 05b829b..3705c0d 100644 --- a/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp +++ b/PluginCommandInterfaceDbus/src/CAmCommandSenderDbus.cpp @@ -82,14 +82,14 @@ void CAmCommandSenderDbus::setCommandReady(const uint16_t handle) //todo:implement handle handling log(&commandDbus, DLT_LOG_INFO, "cbCommunicationReady called"); mReady = true; - mpIAmCommandReceive->confirmCommandReady(handle); + mpIAmCommandReceive->confirmCommandReady(handle,E_OK); } void CAmCommandSenderDbus::setCommandRundown(const uint16_t handle) { log(&commandDbus, DLT_LOG_INFO, "cbCommunicationRundown called"); mReady = false; - mpIAmCommandReceive->confirmCommandRundown(handle); + mpIAmCommandReceive->confirmCommandRundown(handle,E_OK); /** * todo: implement DbusCommandSender::cbCommunicationRundown() */ @@ -320,3 +320,82 @@ void CAmCommandSenderDbus::getInterfaceVersion(std::string & version) const version = CommandSendVersion; } +void am::CAmCommandSenderDbus::cbSinkUpdated(const am_sinkID_t sinkID, const am_sinkClass_t sinkClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) +{ + log(&commandDbus, DLT_LOG_INFO, "cbSinkUpdated called, sinkID", sinkID); + + if (mReady) + { + mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkUpdated")); + mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sinkID)); + mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sinkClassID)); + mCAmDbusMessageHandler.append(listMainSoundProperties); + mCAmDbusMessageHandler.sendMessage(); + } +} + +void am::CAmCommandSenderDbus::cbSourceUpdated(const am_sourceID_t sourceID, const am_sourceClass_t sourceClassID, const std::vector<am_MainSoundProperty_s>& listMainSoundProperties) +{ + log(&commandDbus, DLT_LOG_INFO, "cbSourceUpdated called, sourceID", sourceID); + + if (mReady) + { + mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkUpdated")); + mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sourceID)); + mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sourceClassID)); + mCAmDbusMessageHandler.append(listMainSoundProperties); + mCAmDbusMessageHandler.sendMessage(); + } +} + +void am::CAmCommandSenderDbus::cbSinkNotification(const am_sinkID_t sinkID, const am_NotificationPayload_s notification) +{ + log(&commandDbus, DLT_LOG_INFO, "cbSinkNotification called, sinkID", sinkID); + + if (mReady) + { + mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkNotification")); + mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sinkID)); + mCAmDbusMessageHandler.append(notification); + mCAmDbusMessageHandler.sendMessage(); + } +} + +void am::CAmCommandSenderDbus::cbSourceNotification(const am_sourceID_t sourceID, const am_NotificationPayload_s notification) +{ + log(&commandDbus, DLT_LOG_INFO, "cbSourceNotification called, sourceID", sourceID); + + if (mReady) + { + mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SourceNotification")); + mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sourceID)); + mCAmDbusMessageHandler.append(notification); + mCAmDbusMessageHandler.sendMessage(); + } +} + +void am::CAmCommandSenderDbus::cbSinkMainNotificationConfigurationChanged(const am_sinkID_t sinkID, const am_NotificationConfiguration_s mainNotificationConfiguration) +{ + log(&commandDbus, DLT_LOG_INFO, "cbSinkMainNotificationConfigurationChanged called, sinkID", sinkID); + + if (mReady) + { + mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkMainNotificationConfigurationChanged")); + mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sinkID)); + mCAmDbusMessageHandler.append(mainNotificationConfiguration); + mCAmDbusMessageHandler.sendMessage(); + } +} + +void am::CAmCommandSenderDbus::cbSourceMainNotificationConfigurationChanged(const am_sourceID_t sourceID, const am_NotificationConfiguration_s mainNotificationConfiguration) +{ + log(&commandDbus, DLT_LOG_INFO, "cbSourceMainNotificationConfigurationChanged called, sourceID", sourceID); + + if (mReady) + { + mCAmDbusMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkMainNotificationConfigurationChanged")); + mCAmDbusMessageHandler.append(static_cast<dbus_uint16_t>(sourceID)); + mCAmDbusMessageHandler.append(mainNotificationConfiguration); + mCAmDbusMessageHandler.sendMessage(); + } +} diff --git a/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp b/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp index f7cf4d6..55169b2 100644 --- a/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp +++ b/PluginCommandInterfaceDbus/src/CAmDbusMessageHandler.cpp @@ -622,4 +622,87 @@ void CAmDbusMessageHandler::append(const std::vector<am::am_SystemProperty_s> & mErrorMsg = "Cannot create reply!"; } } + +void CAmDbusMessageHandler::getNotificationConfiguration(dbus_int16_t& notificationType, dbus_int16_t& notificationStatus, dbus_int16_t& notificationParameter) +{ + DBusMessageIter arrayIter; + if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter)) + { + log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::getProperty DBUS handler argument is no array!"); + mErrorName = std::string(DBUS_ERROR_INVALID_ARGS); + mErrorMsg = "DBus argument is no array"; + } + else + { + dbus_message_iter_recurse(&mDBusMessageIter, &arrayIter); + dbus_message_iter_get_basic(&arrayIter, ¬ificationType); + dbus_message_iter_next(&arrayIter); + dbus_message_iter_get_basic(&arrayIter, ¬ificationStatus); + dbus_message_iter_next(&arrayIter); + dbus_message_iter_get_basic(&arrayIter, ¬ificationParameter); + dbus_message_iter_next(&mDBusMessageIter); + } +} + +void CAmDbusMessageHandler::append(const std::vector<am::am_NotificationConfiguration_s>& listNotifications) +{ + DBusMessageIter arrayIter; + DBusMessageIter structIter; + std::vector<am::am_NotificationConfiguration_s>::const_iterator listIterator = listNotifications.begin(); + dbus_bool_t success = true; + + success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nnn)", &arrayIter); + for (; listIterator < listNotifications.end(); ++listIterator) + { + success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter); + success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->notificationType); + success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->notificationStatus); + success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->notificationParameter); + success = success && dbus_message_iter_close_container(&arrayIter, &structIter); + } + success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter); + + if (!success) + { + log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!"); + mErrorName = std::string(DBUS_ERROR_NO_MEMORY); + mErrorMsg = "Cannot create reply!"; + } +} + +void CAmDbusMessageHandler::append(const am::am_NotificationPayload_s& notificationPayload) +{ + DBusMessageIter structIter; + dbus_bool_t success = true; + success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter); + success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, ¬ificationPayload.notificationType); + success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, ¬ificationPayload.notificationValue); + success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter); + + if (!success) + { + log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!"); + mErrorName = std::string(DBUS_ERROR_NO_MEMORY); + mErrorMsg = "Cannot create reply!"; + } +} + +void CAmDbusMessageHandler::append(const am::am_NotificationConfiguration_s& notificationConfiguration) +{ + DBusMessageIter structIter; + dbus_bool_t success = true; + success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structIter); + success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, ¬ificationConfiguration.notificationType); + success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, ¬ificationConfiguration.notificationStatus); + success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, ¬ificationConfiguration.notificationParameter); + success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter); + + if (!success) + { + log(&commandDbus, DLT_LOG_ERROR, "DBusMessageHandler::append Cannot allocate DBus message!"); + mErrorName = std::string(DBUS_ERROR_NO_MEMORY); + mErrorMsg = "Cannot create reply!"; + } +} + } diff --git a/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp b/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp index 7322b99..42a669d 100644 --- a/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp +++ b/PluginCommandInterfaceDbus/src/IAmCommandReceiverShadow.cpp @@ -416,6 +416,87 @@ void IAmCommandReceiverShadow::setCommandReceiver(IAmCommandReceive*& receiver) mpCAmDbusWrapper->registerCallback(&gObjectPathVTable, path, this); } +void am::IAmCommandReceiverShadow::getListSinkMainNotificationConfigurations(DBusConnection* conn, DBusMessage* msg) +{ + log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListSinkMainNotificationConfigurations called"); + + (void) conn; + assert(mpIAmCommandReceive!=NULL); + + mDBUSMessageHandler.initReceive(msg); + am_sinkID_t sinkID = static_cast<am_sinkID_t>(mDBUSMessageHandler.getUInt()); + std::vector<am_NotificationConfiguration_s> listNotificationConfigurations; + am_Error_e returnCode = mpIAmCommandReceive->getListSinkMainNotificationConfigurations(sinkID,listNotificationConfigurations); + mDBUSMessageHandler.initReply(msg); + mDBUSMessageHandler.append((dbus_int16_t) returnCode); + mDBUSMessageHandler.append(listNotificationConfigurations); + mDBUSMessageHandler.sendMessage(); +} + +void am::IAmCommandReceiverShadow::getListSourceMainNotificationConfigurations(DBusConnection* conn, DBusMessage* msg) +{ + log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::getListSourceMainNotificationConfigurations called"); + + (void) conn; + assert(mpIAmCommandReceive!=NULL); + + mDBUSMessageHandler.initReceive(msg); + am_sourceID_t sourceID = static_cast<am_sourceID_t>(mDBUSMessageHandler.getUInt()); + std::vector<am_NotificationConfiguration_s> listNotificationConfigurations; + am_Error_e returnCode = mpIAmCommandReceive->getListSourceMainNotificationConfigurations(sourceID,listNotificationConfigurations); + mDBUSMessageHandler.initReply(msg); + mDBUSMessageHandler.append((dbus_int16_t) returnCode); + mDBUSMessageHandler.append(listNotificationConfigurations); + mDBUSMessageHandler.sendMessage(); + +} + +void am::IAmCommandReceiverShadow::setSinkMainNotificationConfiguration(DBusConnection* conn, DBusMessage* msg) +{ + log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::setSinkMainNotificationConfiguration called"); + + (void) conn; + assert(mpIAmCommandReceive!=NULL); + + mDBUSMessageHandler.initReceive(msg); + am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt(); + dbus_int16_t type = 0; + dbus_int16_t status = 0; + dbus_int16_t parameter = 0; + mDBUSMessageHandler.getNotificationConfiguration(type, status, parameter); + am_NotificationConfiguration_s mainNotificationConfiguration; + mainNotificationConfiguration.notificationType = static_cast<am_NotificationType_e> (type); + mainNotificationConfiguration.notificationStatus = static_cast<am_NotificationStatus_e> (status); + mainNotificationConfiguration.notificationParameter = static_cast<int16_t>(parameter); + am_Error_e returnCode = mpIAmCommandReceive->setSinkMainNotificationConfiguration(sinkID,mainNotificationConfiguration); + mDBUSMessageHandler.initReply(msg); + mDBUSMessageHandler.append((dbus_int16_t) returnCode); + mDBUSMessageHandler.sendMessage(); +} + +void am::IAmCommandReceiverShadow::setSourceMainNotificationConfiguration(DBusConnection* conn, DBusMessage* msg) +{ + log(&commandDbus, DLT_LOG_INFO, "CommandReceiverShadow::setSourceMainNotificationConfiguration called"); + + (void) conn; + assert(mpIAmCommandReceive!=NULL); + + mDBUSMessageHandler.initReceive(msg); + am_sourceID_t sourceID = (am_sourceID_t) mDBUSMessageHandler.getUInt(); + dbus_int16_t type = 0; + dbus_int16_t status = 0; + dbus_int16_t parameter = 0; + mDBUSMessageHandler.getNotificationConfiguration(type, status, parameter); + am_NotificationConfiguration_s mainNotificationConfiguration; + mainNotificationConfiguration.notificationType = static_cast<am_NotificationType_e> (type); + mainNotificationConfiguration.notificationStatus = static_cast<am_NotificationStatus_e> (status); + mainNotificationConfiguration.notificationParameter = static_cast<int16_t>(parameter); + am_Error_e returnCode = mpIAmCommandReceive->setSourceMainNotificationConfiguration(sourceID,mainNotificationConfiguration); + mDBUSMessageHandler.initReply(msg); + mDBUSMessageHandler.append((dbus_int16_t) returnCode); + mDBUSMessageHandler.sendMessage(); +} + IAmCommandReceiverShadow::functionMap_t IAmCommandReceiverShadow::createMap() { functionMap_t m; @@ -436,6 +517,10 @@ IAmCommandReceiverShadow::functionMap_t IAmCommandReceiverShadow::createMap() m["GetListSystemProperties"] = &IAmCommandReceiverShadow::getListSystemProperties; m["GetTimingInformation"] = &IAmCommandReceiverShadow::getTimingInformation; m["SetSystemProperty"] = &IAmCommandReceiverShadow::setSystemProperty; + m["getListSinkMainNotificationConfigurations"] = &IAmCommandReceiverShadow::getListSinkMainNotificationConfigurations; + m["getListSourceMainNotificationConfigurations"] = &IAmCommandReceiverShadow::getListSourceMainNotificationConfigurations; + m["setSinkMainNotificationConfiguration"] = &IAmCommandReceiverShadow::setSinkMainNotificationConfiguration; + m["setSourceMainNotificationConfiguration"] = & IAmCommandReceiverShadow::setSourceMainNotificationConfiguration; return (m); } diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp index 052c46f..3065e1f 100644 --- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp +++ b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusSignalTest.cpp @@ -29,6 +29,7 @@ #include "../include/CAmDbusMessageHandler.h" #include "../../AudioManagerDaemon/include/TAmPluginTemplate.h" #include "shared/CAmDltWrapper.h" +#include "configCommandDbus.h" using namespace am; using namespace testing; @@ -46,7 +47,7 @@ CAmCommandSenderDbusSignalTest::~CAmCommandSenderDbusSignalTest() void* NumberOfMainConnectionsChanged(void* ppCommandSend) { - sleep(1); + sleep(3); IAmCommandSend* sender=static_cast<IAmCommandSend*>(ppCommandSend); am_MainConnectionType_s mainConnection; sender->cbNewMainConnection(mainConnection); @@ -225,12 +226,13 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) IAmCommandSend* (*createFunc)(); void* tempLibHandle = NULL; - std::string libname("../plugins/command/libPluginCommandInterfaceDbus.so"); + std::string libname(LIBRARY_OUTPUT_PATH); + libname.append("/libPluginCommandInterfaceDbus.so"); createFunc = getCreateFunction<IAmCommandSend*()>(libname, tempLibHandle); if (!createFunc) { - logError("CommandSendInterface Test Entry point of RoutingPlugin not found"); + logError("CommandSendInterface Test Entry point of CommandPlugin not found"); exit(1); } @@ -238,13 +240,13 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) if (!ppCommandSend) { - logError("CommandSendInterface Test RoutingPlugin initialization failed. Entry Function not callable"); + logError("CommandSendInterface Test CommandPlugin initialization failed. Entry Function not callable"); exit(1); } // ok, here we give the DBusWrapper pointer to the Plugin and start the interface EXPECT_CALL(pReceiveInterface,getDBusConnectionWrapper(_)).WillRepeatedly(DoAll(SetArgReferee<0>(&pDBusWrapper), Return(E_OK))); - EXPECT_CALL(pReceiveInterface, confirmCommandReady(10)); + EXPECT_CALL(pReceiveInterface, confirmCommandReady(10,_)); ppCommandSend->startupInterface(&pReceiveInterface); ppCommandSend->setCommandReady(10); @@ -256,13 +258,15 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) "import gobject\n" "import dbus\n" "import dbus.mainloop.glib\n" + "print('Started thread') \n" "loop = gobject.MainLoop()\n" "def catchsignal(*arg, **kwarg):\n" " print ('Caught NumberOfMainConnectionsChanged') \n" " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchsignal, signal_name='NumberOfMainConnectionsChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchsignal, signal_name='NumberOfMainConnectionsChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" + "print('Started thread') \n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -282,7 +286,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchSinkAdded, signal_name='SinkAdded', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchSinkAdded, signal_name='SinkAdded', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -311,7 +315,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchSinkRemoved, signal_name='SinkRemoved', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchSinkRemoved, signal_name='SinkRemoved', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -341,7 +345,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchSourceAdded, signal_name='SourceAdded', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchSourceAdded, signal_name='SourceAdded', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -370,7 +374,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchSourceRemoved, signal_name='SourceRemoved', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchSourceRemoved, signal_name='SourceRemoved', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -396,7 +400,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchNumberOfSinkClassesChanged, signal_name='NumberOfSinkClassesChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchNumberOfSinkClassesChanged, signal_name='NumberOfSinkClassesChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -412,7 +416,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(CatchNumberOfSourceClassesChanged, signal_name='NumberOfSourceClassesChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(CatchNumberOfSourceClassesChanged, signal_name='NumberOfSourceClassesChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -435,7 +439,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchMainConnectionStateChanged, signal_name='MainConnectionStateChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchMainConnectionStateChanged, signal_name='MainConnectionStateChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -477,7 +481,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchMainSinkSoundPropertyChanged, signal_name='MainSinkSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchMainSinkSoundPropertyChanged, signal_name='MainSinkSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -518,7 +522,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchMainSourceSoundPropertyChanged, signal_name='MainSourceSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchMainSourceSoundPropertyChanged, signal_name='MainSourceSoundPropertyChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -559,7 +563,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchSinkAvailabilityChanged, signal_name='SinkAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchSinkAvailabilityChanged, signal_name='SinkAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -600,7 +604,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchSourceAvailability, signal_name='SourceAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchSourceAvailability, signal_name='SourceAvailabilityChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -641,7 +645,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchVolumeChanged, signal_name='VolumeChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchVolumeChanged, signal_name='VolumeChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -683,7 +687,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchSinkMuteStateChanged, signal_name='SinkMuteStateChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchSinkMuteStateChanged, signal_name='SinkMuteStateChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -724,7 +728,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchSystemPropertyChanged, signal_name='SystemPropertyChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchSystemPropertyChanged, signal_name='SystemPropertyChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); @@ -756,7 +760,7 @@ TEST_F(CAmCommandSenderDbusSignalTest,cbSourceAvailabilityChanged) " loop.quit()\n" "dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)\n" "bus = dbus.SessionBus()\n" - "bus.add_signal_receiver(catchTimingInformationChanged, signal_name='TimingInformationChanged', dbus_interface = 'org.genivi.audiomanager', message_keyword='dbus_message')\n" + "bus.add_signal_receiver(catchTimingInformationChanged, signal_name='TimingInformationChanged', dbus_interface = 'org.genivi.audiomanager.CommandInterface', message_keyword='dbus_message')\n" "loop.run()\n", NULL); pthread_join(pythonloop, NULL); diff --git a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp index 9156b77..932001a 100644 --- a/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp +++ b/PluginCommandInterfaceDbus/test/CAmCommandSenderDbusTest.cpp @@ -122,7 +122,7 @@ ACTION(returnListSourceClasses){ std::vector<am::am_SourceClass_s> list; am::am_SourceClass_s listItem; am::am_ClassProperty_s property; -property.classProperty=CP_MAX; +property.classProperty=static_cast<am_ClassProperty_e>(2); property.value=12; listItem.name="FirstCLass"; listItem.sourceClassID=23; @@ -139,7 +139,7 @@ ACTION(returnListSinkClasses){ std::vector<am::am_SinkClass_s> list; am::am_SinkClass_s listItem; am::am_ClassProperty_s property; -property.classProperty=CP_MAX; +property.classProperty=static_cast<am_ClassProperty_e>(1); property.value=122; listItem.name="FirstCLass"; listItem.sinkClassID=2123; @@ -202,7 +202,7 @@ TEST_F(CAmCommandSenderDbusTest, MessageTest) // ok, here we give the DBusWrapper pointer to the Plugin and start the interface EXPECT_CALL(pReceiveInterface,getDBusConnectionWrapper(_)).WillRepeatedly(DoAll(SetArgReferee<0>(&pDBusWrapper), Return(E_OK))); - EXPECT_CALL(pReceiveInterface, confirmCommandReady(10)); + EXPECT_CALL(pReceiveInterface, confirmCommandReady(10,E_OK)); ppCommandSend->startupInterface(&pReceiveInterface); ppCommandSend->setCommandReady(10); diff --git a/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h b/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h index 0949bf0..ce1dcc4 100644 --- a/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h +++ b/PluginCommandInterfaceDbus/test/MockIAmCommandReceive.h @@ -26,50 +26,59 @@ namespace am { class MockIAmCommandReceive : public IAmCommandReceive { public: - 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<am_MainConnectionType_s>& listConnections)); - MOCK_CONST_METHOD1(getListMainSinks, - am_Error_e(std::vector<am_SinkType_s>& listMainSinks)); - MOCK_CONST_METHOD1(getListMainSources, - am_Error_e(std::vector<am_SourceType_s>& listMainSources)); - MOCK_CONST_METHOD2(getListMainSinkSoundProperties, - am_Error_e(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties)); - MOCK_CONST_METHOD2(getListMainSourceSoundProperties, - am_Error_e(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties)); - MOCK_CONST_METHOD1(getListSourceClasses, - am_Error_e(std::vector<am_SourceClass_s>& listSourceClasses)); - MOCK_CONST_METHOD1(getListSinkClasses, - am_Error_e(std::vector<am_SinkClass_s>& listSinkClasses)); - MOCK_CONST_METHOD1(getListSystemProperties, - am_Error_e(std::vector<am_SystemProperty_s>& 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_CONST_METHOD1(getInterfaceVersion, - void(std::string& version)); - MOCK_METHOD1(confirmCommandReady, - void(const uint16_t handle)); - MOCK_METHOD1(confirmCommandRundown, - void(const uint16_t handle)); + 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<am_MainConnectionType_s>& listConnections)); + MOCK_CONST_METHOD1(getListMainSinks, + am_Error_e(std::vector<am_SinkType_s>& listMainSinks)); + MOCK_CONST_METHOD1(getListMainSources, + am_Error_e(std::vector<am_SourceType_s>& listMainSources)); + MOCK_CONST_METHOD2(getListMainSinkSoundProperties, + am_Error_e(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundProperties)); + MOCK_CONST_METHOD2(getListMainSourceSoundProperties, + am_Error_e(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSourceProperties)); + MOCK_CONST_METHOD1(getListSourceClasses, + am_Error_e(std::vector<am_SourceClass_s>& listSourceClasses)); + MOCK_CONST_METHOD1(getListSinkClasses, + am_Error_e(std::vector<am_SinkClass_s>& listSinkClasses)); + MOCK_CONST_METHOD1(getListSystemProperties, + am_Error_e(std::vector<am_SystemProperty_s>& 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(getListSinkMainNotificationConfigurations, + am_Error_e(const am_sinkID_t sinkID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations)); + MOCK_CONST_METHOD2(getListSourceMainNotificationConfigurations, + am_Error_e(const am_sourceID_t sourceID, std::vector<am_NotificationConfiguration_s>& listMainNotificationConfigurations)); + MOCK_METHOD2(setSinkMainNotificationConfiguration, + am_Error_e(const am_sinkID_t sinkID, const am_NotificationConfiguration_s mainNotificationConfiguration)); + MOCK_METHOD2(setSourceMainNotificationConfiguration, + am_Error_e(const am_sourceID_t sourceID, const am_NotificationConfiguration_s mainNotificationConfiguration)); + }; } // namespace am |