summaryrefslogtreecommitdiff
path: root/PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp')
-rw-r--r--PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp617
1 files changed, 291 insertions, 326 deletions
diff --git a/PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp b/PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp
index 6999bc1..5336626 100644
--- a/PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp
+++ b/PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp
@@ -1,27 +1,27 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger DbusPlugin
-*
-* \file CommandReceiverShadow.cpp
-*
-* \date 20-Oct-2011 3:42:04 PM
-* \author Christian Mueller (christian.ei.mueller@bmw.de)
-*
-* \section License
-* GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
-* Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
-*
-* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
-* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
-* You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
-* Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
-* Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
-* As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
-* Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
-*
-* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
-*/
+ * Copyright (C) 2011, BMW AG
+ *
+ * GeniviAudioMananger DbusPlugin
+ *
+ * \file CommandReceiverShadow.cpp
+ *
+ * \date 20-Oct-2011 3:42:04 PM
+ * \author Christian Mueller (christian.ei.mueller@bmw.de)
+ *
+ * \section License
+ * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause)
+ * Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de
+ *
+ * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation.
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details.
+ * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>.
+ * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense.
+ * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception.
+ * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned.
+ * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.
+ *
+ * THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
+ */
#include <audiomanagertypes.h>
#include <string>
@@ -39,345 +39,311 @@ DLT_IMPORT_CONTEXT(DLT_CONTEXT)
*/
static DBusObjectPathVTable gObjectPathVTable;
-CommandReceiverShadow::CommandReceiverShadow()
-: mCommandReceiveInterface(NULL),
- mDBusWrapper(NULL),
- mFunctionMap(createMap()),
- mDBUSMessageHandler()
+CommandReceiverShadow::CommandReceiverShadow() :
+ mCommandReceiveInterface(NULL), //
+ mDBusWrapper(NULL), //
+ mFunctionMap(createMap()), //
+ mDBUSMessageHandler()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow constructed"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow constructed"));
}
CommandReceiverShadow::~CommandReceiverShadow()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow destructed"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow destructed"));
}
void CommandReceiverShadow::connect(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::connect called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sourceID_t sourceID=(am_sourceID_t)mDBUSMessageHandler.getUInt();
- am_sinkID_t sinkID=(am_sinkID_t)mDBUSMessageHandler.getUInt();
- am_mainConnectionID_t mainConnectionID=0;
- am_Error_e returnCode=mCommandReceiveInterface->connect(sourceID,sinkID,mainConnectionID);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append((dbus_uint16_t)mainConnectionID);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::connect called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ am_sourceID_t sourceID = (am_sourceID_t) mDBUSMessageHandler.getUInt();
+ am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
+ am_mainConnectionID_t mainConnectionID = 0;
+ am_Error_e returnCode = mCommandReceiveInterface->connect(sourceID, sinkID, mainConnectionID);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append((dbus_uint16_t) mainConnectionID);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::disconnect(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::disconnect called"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::disconnect called"));
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
- mDBUSMessageHandler.initReceive(msg);
- am_mainConnectionID_t mainConnnectionID=(am_mainConnectionID_t)mDBUSMessageHandler.getUInt();
- am_Error_e returnCode=mCommandReceiveInterface->disconnect(mainConnnectionID);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initReceive(msg);
+ am_mainConnectionID_t mainConnnectionID = (am_mainConnectionID_t) mDBUSMessageHandler.getUInt();
+ am_Error_e returnCode = mCommandReceiveInterface->disconnect(mainConnnectionID);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::setVolume(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setVolume called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID=(am_sinkID_t)mDBUSMessageHandler.getUInt();
- am_volume_t volume=(am_volume_t)mDBUSMessageHandler.getInt();
- am_Error_e returnCode=mCommandReceiveInterface->setVolume(sinkID,volume);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setVolume called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
+ am_volume_t volume = (am_volume_t) mDBUSMessageHandler.getInt();
+ am_Error_e returnCode = mCommandReceiveInterface->setVolume(sinkID, volume);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::volumeStep(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::volumeStep called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID=(am_sinkID_t)mDBUSMessageHandler.getUInt();
- int16_t volumeStep=(int16_t)mDBUSMessageHandler.getInt();
- am_Error_e returnCode=mCommandReceiveInterface->volumeStep(sinkID,volumeStep);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::volumeStep called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
+ int16_t volumeStep = (int16_t) mDBUSMessageHandler.getInt();
+ am_Error_e returnCode = mCommandReceiveInterface->volumeStep(sinkID, volumeStep);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::setSinkMuteState(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setSinkMuteState called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID=(am_sinkID_t)mDBUSMessageHandler.getUInt();
- am_MuteState_e muteState=(am_MuteState_e)mDBUSMessageHandler.getInt();
- am_Error_e returnCode=mCommandReceiveInterface->setSinkMuteState(sinkID,muteState);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setSinkMuteState called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
+ am_MuteState_e muteState = (am_MuteState_e) mDBUSMessageHandler.getInt();
+ am_Error_e returnCode = mCommandReceiveInterface->setSinkMuteState(sinkID, muteState);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::setMainSinkSoundProperty(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setMainSinkSoundProperty called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID=(am_sinkID_t)mDBUSMessageHandler.getUInt();
- dbus_int16_t type=0;
- dbus_int16_t value=0;
- mDBUSMessageHandler.getProperty(type,value);
- am_MainSoundProperty_s mainSoundProperty;
- mainSoundProperty.type=(am_MainSoundPropertyType_e)type;
- mainSoundProperty.value=(int32_t)value;
- am_Error_e returnCode=mCommandReceiveInterface->setMainSinkSoundProperty(mainSoundProperty,sinkID);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setMainSinkSoundProperty called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
+ dbus_int16_t type = 0;
+ dbus_int16_t value = 0;
+ mDBUSMessageHandler.getProperty(type, value);
+ am_MainSoundProperty_s mainSoundProperty;
+ mainSoundProperty.type = (am_MainSoundPropertyType_e) type;
+ mainSoundProperty.value = (int32_t) value;
+ am_Error_e returnCode = mCommandReceiveInterface->setMainSinkSoundProperty(mainSoundProperty, sinkID);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::setMainSourceSoundProperty(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setMainSourceSoundProperty called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sourceID_t sourceID=(am_sinkID_t)mDBUSMessageHandler.getUInt();
- dbus_int16_t type=0;
- dbus_int16_t value=0;
- mDBUSMessageHandler.getProperty(type,value);
- am_MainSoundProperty_s mainSoundProperty;
- mainSoundProperty.type=(am_MainSoundPropertyType_e)type;
- mainSoundProperty.value=(int32_t)value;
- am_Error_e returnCode=mCommandReceiveInterface->setMainSourceSoundProperty(mainSoundProperty,sourceID);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setMainSourceSoundProperty called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ am_sourceID_t sourceID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
+ dbus_int16_t type = 0;
+ dbus_int16_t value = 0;
+ mDBUSMessageHandler.getProperty(type, value);
+ am_MainSoundProperty_s mainSoundProperty;
+ mainSoundProperty.type = (am_MainSoundPropertyType_e) type;
+ mainSoundProperty.value = (int32_t) value;
+ am_Error_e returnCode = mCommandReceiveInterface->setMainSourceSoundProperty(mainSoundProperty, sourceID);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::setSystemProperty(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setSystemProperty called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- dbus_int16_t type=0;
- dbus_int16_t value=0;
- mDBUSMessageHandler.getProperty(type,value);
- am_SystemProperty_s systemProperty;
- systemProperty.type=(am_SystemPropertyType_e)type;
- systemProperty.value=(int32_t)value;
- am_Error_e returnCode=mCommandReceiveInterface->setSystemProperty(systemProperty);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::setSystemProperty called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ dbus_int16_t type = 0;
+ dbus_int16_t value = 0;
+ mDBUSMessageHandler.getProperty(type, value);
+ am_SystemProperty_s systemProperty;
+ systemProperty.type = (am_SystemPropertyType_e) type;
+ systemProperty.value = (int32_t) value;
+ am_Error_e returnCode = mCommandReceiveInterface->setSystemProperty(systemProperty);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::getListMainConnections(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainConnections called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
- std::vector<am_MainConnectionType_s> listMainConnections;
- am_Error_e returnCode=mCommandReceiveInterface->getListMainConnections(listMainConnections);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append(listMainConnections);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainConnections called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+ std::vector<am_MainConnectionType_s> listMainConnections;
+ am_Error_e returnCode = mCommandReceiveInterface->getListMainConnections(listMainConnections);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append(listMainConnections);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::getListMainSinks(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSinks called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
- std::vector<am_SinkType_s> listSinks;
- am_Error_e returnCode=mCommandReceiveInterface->getListMainSinks(listSinks);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append(listSinks);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSinks called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+ std::vector<am_SinkType_s> listSinks;
+ am_Error_e returnCode = mCommandReceiveInterface->getListMainSinks(listSinks);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append(listSinks);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::getListMainSources(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSources called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
- std::vector<am_SourceType_s> listSources;
- am_Error_e returnCode=mCommandReceiveInterface->getListMainSources(listSources);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append(listSources);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSources called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+ std::vector<am_SourceType_s> listSources;
+ am_Error_e returnCode = mCommandReceiveInterface->getListMainSources(listSources);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append(listSources);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::getListMainSinkSoundProperties(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSinkSoundProperties called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sinkID_t sinkID=(am_sinkID_t)mDBUSMessageHandler.getUInt();
- std::vector<am_MainSoundProperty_s> listSinkSoundProperties;
- am_Error_e returnCode=mCommandReceiveInterface->getListMainSinkSoundProperties(sinkID,listSinkSoundProperties);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append(listSinkSoundProperties);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSinkSoundProperties called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ am_sinkID_t sinkID = (am_sinkID_t) mDBUSMessageHandler.getUInt();
+ std::vector<am_MainSoundProperty_s> listSinkSoundProperties;
+ am_Error_e returnCode = mCommandReceiveInterface->getListMainSinkSoundProperties(sinkID, listSinkSoundProperties);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append(listSinkSoundProperties);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::getListMainSourceSoundProperties(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSourceSoundProperties called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_sourceID_t sourceID=(am_sourceID_t)mDBUSMessageHandler.getUInt();
- std::vector<am_MainSoundProperty_s> listSinkSoundProperties;
- am_Error_e returnCode=mCommandReceiveInterface->getListMainSourceSoundProperties(sourceID,listSinkSoundProperties);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append(listSinkSoundProperties);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListMainSourceSoundProperties called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ am_sourceID_t sourceID = (am_sourceID_t) mDBUSMessageHandler.getUInt();
+ std::vector<am_MainSoundProperty_s> listSinkSoundProperties;
+ am_Error_e returnCode = mCommandReceiveInterface->getListMainSourceSoundProperties(sourceID, listSinkSoundProperties);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append(listSinkSoundProperties);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::getListSourceClasses(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListSourceClasses called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
- std::vector<am_SourceClass_s> listSourceClasses;
- am_Error_e returnCode=mCommandReceiveInterface->getListSourceClasses(listSourceClasses);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append(listSourceClasses);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListSourceClasses called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+ std::vector<am_SourceClass_s> listSourceClasses;
+ am_Error_e returnCode = mCommandReceiveInterface->getListSourceClasses(listSourceClasses);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append(listSourceClasses);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::getListSinkClasses(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListSinkClasses called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
- std::vector<am_SinkClass_s> listSinkClasses;
- am_Error_e returnCode=mCommandReceiveInterface->getListSinkClasses(listSinkClasses);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append(listSinkClasses);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListSinkClasses called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+ std::vector<am_SinkClass_s> listSinkClasses;
+ am_Error_e returnCode = mCommandReceiveInterface->getListSinkClasses(listSinkClasses);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append(listSinkClasses);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::getListSystemProperties(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListSystemProperties called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
- std::vector<am_SystemProperty_s> listSystemProperties;
- am_Error_e returnCode=mCommandReceiveInterface->getListSystemProperties(listSystemProperties);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append(listSystemProperties);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getListSystemProperties called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+ std::vector<am_SystemProperty_s> listSystemProperties;
+ am_Error_e returnCode = mCommandReceiveInterface->getListSystemProperties(listSystemProperties);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append(listSystemProperties);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void CommandReceiverShadow::getTimingInformation(DBusConnection *conn, DBusMessage *msg)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getTimingInformation called"));
-
- (void) conn;
- assert(mCommandReceiveInterface!=NULL);
-
- mDBUSMessageHandler.initReceive(msg);
- am_mainConnectionID_t mainConnectionID=(am_mainConnectionID_t)mDBUSMessageHandler.getUInt();
- am_timeSync_t delay=0;
- am_Error_e returnCode=mCommandReceiveInterface->getTimingInformation(mainConnectionID,delay);
- mDBUSMessageHandler.initReply(msg);
- mDBUSMessageHandler.append((dbus_int16_t)returnCode);
- mDBUSMessageHandler.append((dbus_int16_t)delay);
- mDBUSMessageHandler.sendMessage();
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("CommandReceiverShadow::getTimingInformation called"));
+
+ (void) conn;
+ assert(mCommandReceiveInterface!=NULL);
+
+ mDBUSMessageHandler.initReceive(msg);
+ am_mainConnectionID_t mainConnectionID = (am_mainConnectionID_t) mDBUSMessageHandler.getUInt();
+ am_timeSync_t delay = 0;
+ am_Error_e returnCode = mCommandReceiveInterface->getTimingInformation(mainConnectionID, delay);
+ mDBUSMessageHandler.initReply(msg);
+ mDBUSMessageHandler.append((dbus_int16_t) returnCode);
+ mDBUSMessageHandler.append((dbus_int16_t) delay);
+ mDBUSMessageHandler.sendMessage();
}
-
-
DBusHandlerResult CommandReceiverShadow::receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data)
{
- assert(conn!=NULL);
- assert(msg!=NULL);
- assert(user_data!=NULL);
- CommandReceiverShadow* reference=(CommandReceiverShadow*) user_data;
- return (reference->receiveCallbackDelegate(conn,msg));
+ assert(conn!=NULL);
+ assert(msg!=NULL);
+ assert(user_data!=NULL);
+ CommandReceiverShadow* reference = (CommandReceiverShadow*) user_data;
+ return (reference->receiveCallbackDelegate(conn, msg));
}
void CommandReceiverShadow::sendIntrospection(DBusConnection *conn, DBusMessage *msg)
{
- assert(conn!=NULL);
- assert(msg!=NULL);
+ assert(conn!=NULL);
+ assert(msg!=NULL);
DBusMessage* reply;
DBusMessageIter args;
dbus_uint32_t serial = 0;
@@ -393,13 +359,13 @@ void CommandReceiverShadow::sendIntrospection(DBusConnection *conn, DBusMessage
dbus_message_iter_init_append(reply, &args);
if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &string))
{
- // DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBUS handler Out Of Memory!"));
+ // DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBUS handler Out Of Memory!"));
}
// send the reply && flush the connection
if (!dbus_connection_send(conn, reply, &serial))
{
- // DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBUS handler Out Of Memory!"));
+ // DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBUS handler Out Of Memory!"));
}
dbus_connection_flush(conn);
@@ -409,68 +375,67 @@ void CommandReceiverShadow::sendIntrospection(DBusConnection *conn, DBusMessage
DBusHandlerResult CommandReceiverShadow::receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg)
{
- //DLT_LOG(dMain, DLT_LOG_INFO, DLT_STRING("message received"));
+ //DLT_LOG(dMain, DLT_LOG_INFO, DLT_STRING("message received"));
- if (dbus_message_is_method_call(msg, DBUS_INTERFACE_INTROSPECTABLE, "Introspect")) {
- sendIntrospection(conn,msg);
- return (DBUS_HANDLER_RESULT_HANDLED);
- }
+ if (dbus_message_is_method_call(msg, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
+ {
+ sendIntrospection(conn, msg);
+ return (DBUS_HANDLER_RESULT_HANDLED);
+ }
- functionMap_t::iterator iter = mFunctionMap.begin();
- std::string k(dbus_message_get_member(msg));
- iter=mFunctionMap.find(k);
+ functionMap_t::iterator iter = mFunctionMap.begin();
+ std::string k(dbus_message_get_member(msg));
+ iter = mFunctionMap.find(k);
if (iter != mFunctionMap.end())
{
- std::string p(iter->first);
- CallBackMethod cb=iter->second;
- (this->*cb)(conn,msg);
- return (DBUS_HANDLER_RESULT_HANDLED);
+ std::string p(iter->first);
+ CallBackMethod cb = iter->second;
+ (this->*cb)(conn, msg);
+ return (DBUS_HANDLER_RESULT_HANDLED);
}
- return (DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
+ return (DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
}
void CommandReceiverShadow::setCommandReceiver(CommandReceiveInterface*& receiver)
{
- assert(receiver!=NULL);
- mCommandReceiveInterface=receiver;
+ assert(receiver!=NULL);
+ mCommandReceiveInterface = receiver;
- gObjectPathVTable.message_function=CommandReceiverShadow::receiveCallback;
+ gObjectPathVTable.message_function = CommandReceiverShadow::receiveCallback;
- DBusConnection* connection;
- mCommandReceiveInterface->getDBusConnectionWrapper(mDBusWrapper);
- assert(mDBusWrapper!=NULL);
+ DBusConnection* connection;
+ mCommandReceiveInterface->getDBusConnectionWrapper(mDBusWrapper);
+ assert(mDBusWrapper!=NULL);
- mDBusWrapper->getDBusConnection(connection);
- assert(connection!=NULL);
- mDBUSMessageHandler.setDBusConnection(connection);
+ mDBusWrapper->getDBusConnection(connection);
+ assert(connection!=NULL);
+ mDBUSMessageHandler.setDBusConnection(connection);
- std::string path(MY_NODE);
- mDBusWrapper->registerCallback(&gObjectPathVTable,path,this);
+ std::string path(MY_NODE);
+ mDBusWrapper->registerCallback(&gObjectPathVTable, path, this);
}
CommandReceiverShadow::functionMap_t CommandReceiverShadow::createMap()
{
- functionMap_t m;
- m["Connect"]=&CommandReceiverShadow::connect ;
- m["Disconnect"]=&CommandReceiverShadow::disconnect ;
- m["SetVolume"]=&CommandReceiverShadow::setVolume ;
- m["VolumeStep"]=&CommandReceiverShadow::volumeStep ;
- m["SetSinkMuteState"]=&CommandReceiverShadow::setSinkMuteState ;
- m["SetMainSinkSoundProperty"]=&CommandReceiverShadow::setMainSinkSoundProperty ;
- m["SetMainSourceSoundProperty"]=&CommandReceiverShadow::setMainSourceSoundProperty ;
- m["GetListMainConnections"]=&CommandReceiverShadow::getListMainConnections ;
- m["GetListMainSinks"]=&CommandReceiverShadow::getListMainSinks ;
- m["GetListMainSources"]=&CommandReceiverShadow::getListMainSources ;
- m["GetListMainSinkSoundProperties"]=&CommandReceiverShadow::getListMainSinkSoundProperties ;
- m["GetListMainSourceSoundProperties"]=&CommandReceiverShadow::getListMainSourceSoundProperties ;
- m["GetListSourceClasses"]=&CommandReceiverShadow::getListSourceClasses ;
- m["GetListSinkClasses"]=&CommandReceiverShadow::getListSinkClasses ;
- m["GetListSystemProperties"]=&CommandReceiverShadow::getListSystemProperties ;
- m["GetTimingInformation"]=&CommandReceiverShadow::getTimingInformation ;
- m["SetSystemProperty"]=&CommandReceiverShadow::setSystemProperty ;
- return (m);
+ functionMap_t m;
+ m["Connect"] = &CommandReceiverShadow::connect;
+ m["Disconnect"] = &CommandReceiverShadow::disconnect;
+ m["SetVolume"] = &CommandReceiverShadow::setVolume;
+ m["VolumeStep"] = &CommandReceiverShadow::volumeStep;
+ m["SetSinkMuteState"] = &CommandReceiverShadow::setSinkMuteState;
+ m["SetMainSinkSoundProperty"] = &CommandReceiverShadow::setMainSinkSoundProperty;
+ m["SetMainSourceSoundProperty"] = &CommandReceiverShadow::setMainSourceSoundProperty;
+ m["GetListMainConnections"] = &CommandReceiverShadow::getListMainConnections;
+ m["GetListMainSinks"] = &CommandReceiverShadow::getListMainSinks;
+ m["GetListMainSources"] = &CommandReceiverShadow::getListMainSources;
+ m["GetListMainSinkSoundProperties"] = &CommandReceiverShadow::getListMainSinkSoundProperties;
+ m["GetListMainSourceSoundProperties"] = &CommandReceiverShadow::getListMainSourceSoundProperties;
+ m["GetListSourceClasses"] = &CommandReceiverShadow::getListSourceClasses;
+ m["GetListSinkClasses"] = &CommandReceiverShadow::getListSinkClasses;
+ m["GetListSystemProperties"] = &CommandReceiverShadow::getListSystemProperties;
+ m["GetTimingInformation"] = &CommandReceiverShadow::getTimingInformation;
+ m["SetSystemProperty"] = &CommandReceiverShadow::setSystemProperty;
+ return (m);
}
-
-