summaryrefslogtreecommitdiff
path: root/PluginCommandInterfaceDbus
diff options
context:
space:
mode:
authorchristian mueller <christian.ei.mueller@bmw.de>2012-01-24 17:04:42 +0100
committerchristian mueller <christian.ei.mueller@bmw.de>2012-01-24 17:04:42 +0100
commit4fe50302a695c625d5161b538da771b2c36bd33e (patch)
tree79d9fb949d626b19ac0d933a637b4881af31114e /PluginCommandInterfaceDbus
parent80213f17291e5b58c733de09f06439d71640d2e2 (diff)
downloadaudiomanager-4fe50302a695c625d5161b538da771b2c36bd33e.tar.gz
* formatting all the source code with eclipse source code style
* added used xml to the project
Diffstat (limited to 'PluginCommandInterfaceDbus')
-rw-r--r--PluginCommandInterfaceDbus/include/CommandReceiverShadow.h156
-rw-r--r--PluginCommandInterfaceDbus/include/DBusCommandSender.h161
-rw-r--r--PluginCommandInterfaceDbus/include/DBusMessageHandler.h53
-rw-r--r--PluginCommandInterfaceDbus/include/mainpage.h1
-rw-r--r--PluginCommandInterfaceDbus/src/CommandReceiverShadow.cpp617
-rw-r--r--PluginCommandInterfaceDbus/src/DBusCommandSender.cpp366
-rw-r--r--PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp577
-rw-r--r--PluginCommandInterfaceDbus/test/config.h17
8 files changed, 916 insertions, 1032 deletions
diff --git a/PluginCommandInterfaceDbus/include/CommandReceiverShadow.h b/PluginCommandInterfaceDbus/include/CommandReceiverShadow.h
index 48745b4..ab09bf1 100644
--- a/PluginCommandInterfaceDbus/include/CommandReceiverShadow.h
+++ b/PluginCommandInterfaceDbus/include/CommandReceiverShadow.h
@@ -1,27 +1,27 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger DbusPlugin
-*
-* \file CommandReceiverShadow.h
-*
-* \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.h
+ *
+ * \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
+ */
#ifndef COMMANDRECEIVERSHADOW_H_
#define COMMANDRECEIVERSHADOW_H_
@@ -34,7 +34,8 @@
#include <map>
#include "DBusMessageHandler.h"
-namespace am {
+namespace am
+{
class CommandReceiverShadow;
@@ -43,66 +44,67 @@ typedef void (CommandReceiverShadow::*CallBackMethod)(DBusConnection *connection
/**
* receives the DBus Callbacks, marhsalls and demarshalls the parameters and calls CommandReceive
*/
-class CommandReceiverShadow {
+class CommandReceiverShadow
+{
public:
- CommandReceiverShadow();
- virtual ~CommandReceiverShadow();
- void connect(DBusConnection *conn, DBusMessage *msg) ;
- void disconnect(DBusConnection *conn, DBusMessage *msg) ;
- void setVolume(DBusConnection *conn, DBusMessage *msg) ;
- void volumeStep(DBusConnection *conn, DBusMessage *msg) ;
- void setSinkMuteState(DBusConnection *conn, DBusMessage *msg) ;
- void setMainSinkSoundProperty(DBusConnection *conn, DBusMessage *msg) ;
- void setMainSourceSoundProperty(DBusConnection *conn, DBusMessage *msg) ;
- void setSystemProperty(DBusConnection *conn, DBusMessage *msg) ;
- void getListMainConnections(DBusConnection *conn, DBusMessage *msg) ;
- void getListMainSinks(DBusConnection *conn, DBusMessage *msg) ;
- void getListMainSources(DBusConnection *conn, DBusMessage *msg) ;
- void getListMainSinkSoundProperties(DBusConnection *conn, DBusMessage *msg) ;
- void getListMainSourceSoundProperties(DBusConnection *conn, DBusMessage *msg) ;
- void getListSourceClasses(DBusConnection *conn, DBusMessage *msg) ;
- void getListSinkClasses(DBusConnection *conn, DBusMessage *msg) ;
- void getListSystemProperties(DBusConnection *conn, DBusMessage *msg) ;
- void getTimingInformation(DBusConnection *conn, DBusMessage *msg) ;
+ CommandReceiverShadow();
+ virtual ~CommandReceiverShadow();
+ void connect(DBusConnection *conn, DBusMessage *msg);
+ void disconnect(DBusConnection *conn, DBusMessage *msg);
+ void setVolume(DBusConnection *conn, DBusMessage *msg);
+ void volumeStep(DBusConnection *conn, DBusMessage *msg);
+ void setSinkMuteState(DBusConnection *conn, DBusMessage *msg);
+ void setMainSinkSoundProperty(DBusConnection *conn, DBusMessage *msg);
+ void setMainSourceSoundProperty(DBusConnection *conn, DBusMessage *msg);
+ void setSystemProperty(DBusConnection *conn, DBusMessage *msg);
+ void getListMainConnections(DBusConnection *conn, DBusMessage *msg);
+ void getListMainSinks(DBusConnection *conn, DBusMessage *msg);
+ void getListMainSources(DBusConnection *conn, DBusMessage *msg);
+ void getListMainSinkSoundProperties(DBusConnection *conn, DBusMessage *msg);
+ void getListMainSourceSoundProperties(DBusConnection *conn, DBusMessage *msg);
+ void getListSourceClasses(DBusConnection *conn, DBusMessage *msg);
+ void getListSinkClasses(DBusConnection *conn, DBusMessage *msg);
+ void getListSystemProperties(DBusConnection *conn, DBusMessage *msg);
+ void getTimingInformation(DBusConnection *conn, DBusMessage *msg);
- /**
- * sets the pointer to the CommandReceiveInterface and registers Callback
- * @param receiver
- */
- void setCommandReceiver(CommandReceiveInterface*& receiver);
+ /**
+ * sets the pointer to the CommandReceiveInterface and registers Callback
+ * @param receiver
+ */
+ void setCommandReceiver(CommandReceiveInterface*& receiver);
private:
- CommandReceiveInterface* mCommandReceiveInterface;
- DBusWrapper* mDBusWrapper;
- typedef std::map<std::string,CallBackMethod> functionMap_t;
- functionMap_t mFunctionMap;
- DBusMessageHandler mDBUSMessageHandler;
+ CommandReceiveInterface* mCommandReceiveInterface;
+ DBusWrapper* mDBusWrapper;
+ typedef std::map<std::string, CallBackMethod> functionMap_t;
+ functionMap_t mFunctionMap;
+ DBusMessageHandler mDBUSMessageHandler;
- /**
- * receives a callback whenever the path of the plugin is called
- */
- static DBusHandlerResult receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
+ /**
+ * receives a callback whenever the path of the plugin is called
+ */
+ static DBusHandlerResult receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
- /**
- * dynamic delegate that handles the Callback of the static receiveCallback
- * @param conn DBus connection
- * @param msg DBus message
- * @param user_data pointer to instance of CommandReceiverShadow
- * @return
- */
- DBusHandlerResult receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg);
+ /**
+ * dynamic delegate that handles the Callback of the static receiveCallback
+ * @param conn DBus connection
+ * @param msg DBus message
+ * @param user_data pointer to instance of CommandReceiverShadow
+ * @return
+ */
+ DBusHandlerResult receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg);
- /**
- * sends out introspectiondata read from an xml file.
- * @param conn
- * @param msg
- */
- void sendIntrospection(DBusConnection* conn, DBusMessage* msg) ;
+ /**
+ * sends out introspectiondata read from an xml file.
+ * @param conn
+ * @param msg
+ */
+ void sendIntrospection(DBusConnection* conn, DBusMessage* msg);
- /**
- * creates the function map needed to combine DBus messages and function adresses
- * @return the map
- */
- functionMap_t createMap();
+ /**
+ * creates the function map needed to combine DBus messages and function adresses
+ * @return the map
+ */
+ functionMap_t createMap();
};
}
diff --git a/PluginCommandInterfaceDbus/include/DBusCommandSender.h b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
index 4e73c66..3a01c14 100644
--- a/PluginCommandInterfaceDbus/include/DBusCommandSender.h
+++ b/PluginCommandInterfaceDbus/include/DBusCommandSender.h
@@ -1,28 +1,27 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger DbusPlugin
-*
-* \file CommandSender.h
-*
-* \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 CommandSender.h
+ *
+ * \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
+ */
#ifndef DBUSCOMMANDSENDER_H_
#define DBUSCOMMANDSENDER_H_
@@ -38,77 +37,79 @@
#include "DBusMessageHandler.h"
#include "CommandReceiverShadow.h"
-namespace am {
+namespace am
+{
-const char MY_NODE[]="CommandInterface";
+const char MY_NODE[] = "CommandInterface";
/**
* Dbus Implementation of CommandSendInterface
*/
-class DbusCommandSender: public CommandSendInterface {
+class DbusCommandSender: public CommandSendInterface
+{
public:
- DbusCommandSender();
- virtual ~DbusCommandSender();
- am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface) ;
- am_Error_e stopInterface() ;
- am_Error_e cbCommunicationReady() ;
- am_Error_e cbCommunicationRundown() ;
- void cbNumberOfMainConnectionsChanged() ;
- void cbNumberOfSinksChanged() ;
- void cbNumberOfSourcesChanged() ;
- 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_timeSync_t time, const am_mainConnectionID_t mainConnectionID) ;
- uint16_t getInterfaceVersion() const;
+ DbusCommandSender();
+ virtual ~DbusCommandSender();
+ am_Error_e startupInterface(CommandReceiveInterface* commandreceiveinterface);
+ am_Error_e stopInterface();
+ am_Error_e cbCommunicationReady();
+ am_Error_e cbCommunicationRundown();
+ void cbNumberOfMainConnectionsChanged();
+ void cbNumberOfSinksChanged();
+ void cbNumberOfSourcesChanged();
+ 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_timeSync_t time, const am_mainConnectionID_t mainConnectionID);
+ uint16_t getInterfaceVersion() const;
#ifdef UNIT_TEST
friend class DbusCommandInterfaceBackdoor;
#endif
private:
- DBusMessageHandler mDBUSMessageHandler;
- CommandReceiverShadow mCommandReceiverShadow;
- DBusWrapper* mDBusWrapper;
- CommandReceiveInterface* mCommandReceiveInterface;
+ DBusMessageHandler mDBUSMessageHandler;
+ CommandReceiverShadow mCommandReceiverShadow;
+ DBusWrapper* mDBusWrapper;
+ CommandReceiveInterface* mCommandReceiveInterface;
- /**
- * list of sinks, needed to send out only deltas
- */
- std::vector<am_SinkType_s> mlistSinks;
+ /**
+ * list of sinks, needed to send out only deltas
+ */
+ std::vector<am_SinkType_s> mlistSinks;
- /**
- * list of sources, needed to send out only deltas
- */
- std::vector<am_SourceType_s> mlistSources;
+ /**
+ * list of sources, needed to send out only deltas
+ */
+ std::vector<am_SourceType_s> 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_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);
- }
- };
+ /**
+ * 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);
+ }
+ };
};
diff --git a/PluginCommandInterfaceDbus/include/DBusMessageHandler.h b/PluginCommandInterfaceDbus/include/DBusMessageHandler.h
index db80532..73989bb 100644
--- a/PluginCommandInterfaceDbus/include/DBusMessageHandler.h
+++ b/PluginCommandInterfaceDbus/include/DBusMessageHandler.h
@@ -1,32 +1,31 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger DbusPlugin
-*
-* \file DBusMessageHandler
-*
-* \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 DBusMessageHandler
+ *
+ * \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
+ */
#ifndef _DBUSMESSAGEHANDLER_H_
#define _DBUSMESSAGEHANDLER_H_
-
#include <audiomanagertypes.h>
#include <dbus/dbus.h>
#include <dlt/dlt.h>
@@ -35,8 +34,8 @@
#include <string>
#include <list>
-namespace am{
-
+namespace am
+{
/**
* handles DBus Messages, is used to extract & append parameters and send messages
@@ -44,7 +43,7 @@ namespace am{
class DBusMessageHandler
{
public:
- DBusMessageHandler();
+ DBusMessageHandler();
~DBusMessageHandler();
/**
diff --git a/PluginCommandInterfaceDbus/include/mainpage.h b/PluginCommandInterfaceDbus/include/mainpage.h
index 19789d0..8a2848c 100644
--- a/PluginCommandInterfaceDbus/include/mainpage.h
+++ b/PluginCommandInterfaceDbus/include/mainpage.h
@@ -29,5 +29,4 @@
#ifndef MAINPAGE_H_
#define MAINPAGE_H_
-
#endif /* MAINPAGE_H_ */
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);
}
-
-
diff --git a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
index 1387779..bbc2778 100644
--- a/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
+++ b/PluginCommandInterfaceDbus/src/DBusCommandSender.cpp
@@ -1,28 +1,27 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger DbusPlugin
-*
-* \file CommandSender.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 CommandSender.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 <command/CommandReceiveInterface.h>
#include <dbus/DBusWrapper.h>
@@ -44,7 +43,7 @@ DLT_DECLARE_CONTEXT(DLT_CONTEXT)
*/
extern "C" CommandSendInterface* PluginCommandInterfaceDbusFactory()
{
- return (new DbusCommandSender());
+ return (new DbusCommandSender());
}
/**
@@ -55,282 +54,233 @@ extern "C" void destroyRoutingPluginInterfaceDbus(CommandSendInterface* commandS
delete commandSendInterface;
}
-
-DbusCommandSender::DbusCommandSender()
-: mDBUSMessageHandler(),
- mCommandReceiverShadow(),
- mDBusWrapper(NULL),
- mCommandReceiveInterface(NULL)
+DbusCommandSender::DbusCommandSender() :
+ mDBUSMessageHandler(), //
+ mCommandReceiverShadow(), //
+ mDBusWrapper(NULL), //
+ mCommandReceiveInterface(NULL)
{
- DLT_REGISTER_CONTEXT(DLT_CONTEXT,"DBP","DBus Plugin");
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("DbusCommandSender constructed"));
+ DLT_REGISTER_CONTEXT(DLT_CONTEXT, "DBP", "DBus Plugin");
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("DbusCommandSender constructed"));
}
DbusCommandSender::~DbusCommandSender()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("DbusCommandSender destructed"));
- DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("DbusCommandSender destructed"));
+ DLT_UNREGISTER_CONTEXT(DLT_CONTEXT);
}
am_Error_e DbusCommandSender::startupInterface(CommandReceiveInterface* commandreceiveinterface)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("startupInterface called"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("startupInterface called"));
- mCommandReceiveInterface=commandreceiveinterface;
- mCommandReceiverShadow.setCommandReceiver(mCommandReceiveInterface);
- mCommandReceiveInterface->getDBusConnectionWrapper(mDBusWrapper);
- assert(mDBusWrapper!=NULL);
- return (E_OK);
+ mCommandReceiveInterface = commandreceiveinterface;
+ mCommandReceiverShadow.setCommandReceiver(mCommandReceiveInterface);
+ mCommandReceiveInterface->getDBusConnectionWrapper(mDBusWrapper);
+ assert(mDBusWrapper!=NULL);
+ return (E_OK);
}
-
-
am_Error_e DbusCommandSender::stopInterface()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("stopInterface called"));
- /**
- * todo: finish DbusCommandSender::stopInterface(), what needs to be done?
- */
- return(E_OK);
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("stopInterface called"));
+ /**
+ * todo: finish DbusCommandSender::stopInterface(), what needs to be done?
+ */
+ return (E_OK);
}
-
-
am_Error_e DbusCommandSender::cbCommunicationReady()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbCommunicationReady called"));
- /**
- * todo: implement DbusCommandSender::cbCommunicationReady()
- */
- return E_NOT_USED;
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbCommunicationReady called"));
+ /**
+ * todo: implement DbusCommandSender::cbCommunicationReady()
+ */
+ return E_NOT_USED;
}
-
-
am_Error_e DbusCommandSender::cbCommunicationRundown()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbCommunicationRundown called"));
- /**
- * todo: implement DbusCommandSender::cbCommunicationRundown()
- */
- return E_NOT_USED;
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbCommunicationRundown called"));
+ /**
+ * todo: implement DbusCommandSender::cbCommunicationRundown()
+ */
+ return E_NOT_USED;
}
-
-
void DbusCommandSender::cbNumberOfMainConnectionsChanged()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbNumberOfMainConnectionsChanged called"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfMainConnectionsChanged called"));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("NumberOfMainConnectionsChanged"));
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfMainConnectionsChanged"));
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbNumberOfSinksChanged()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbNumberOfSinksChanged called"));
-
- std::vector<am_SinkType_s> newListSinks;
- std::vector<am_SinkType_s> diffList;
- mCommandReceiveInterface->getListMainSinks(newListSinks);
- std::sort(newListSinks.begin(),newListSinks.end(),sortBySinkID());
- std::set_symmetric_difference(newListSinks.begin(),newListSinks.end(),mlistSinks.begin(),mlistSinks.end(),std::back_inserter(diffList), sortBySinkID());
- assert(diffList.size()==1);
- if (newListSinks.size()>mlistSinks.size())
- {
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),"SinkAdded");
- mDBUSMessageHandler.append(diffList[0]);
-
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("send signal SinkAdded"));
- }
- else
- {
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),"SinkRemoved");
- mDBUSMessageHandler.append(diffList.begin()->sinkID);
-
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("send signal SinkRemoved"));
- }
-
- mDBUSMessageHandler.sendMessage();
- mlistSinks=newListSinks;
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfSinksChanged called"));
+
+ std::vector<am_SinkType_s> newListSinks;
+ std::vector<am_SinkType_s> diffList;
+ mCommandReceiveInterface->getListMainSinks(newListSinks);
+ std::sort(newListSinks.begin(), newListSinks.end(), sortBySinkID());
+ std::set_symmetric_difference(newListSinks.begin(), newListSinks.end(), mlistSinks.begin(), mlistSinks.end(), std::back_inserter(diffList), sortBySinkID());
+ assert(diffList.size()==1);
+ if (newListSinks.size() > mlistSinks.size())
+ {
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SinkAdded");
+ mDBUSMessageHandler.append(diffList[0]);
+
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("send signal SinkAdded"));
+ }
+ else
+ {
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SinkRemoved");
+ mDBUSMessageHandler.append(diffList.begin()->sinkID);
+
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("send signal SinkRemoved"));
+ }
+
+ mDBUSMessageHandler.sendMessage();
+ mlistSinks = newListSinks;
}
-
-
void DbusCommandSender::cbNumberOfSourcesChanged()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbNumberOfSourcesChanged called"));
-
- std::vector<am_SourceType_s> newlistSources;
- std::vector<am_SourceType_s> diffList;
- mCommandReceiveInterface->getListMainSources(newlistSources);
- std::sort(newlistSources.begin(),newlistSources.end(),sortBySourceID());
- std::set_symmetric_difference(newlistSources.begin(),newlistSources.end(),mlistSources.begin(),mlistSources.end(),std::back_inserter(diffList), sortBySourceID());
- assert(diffList.size()==1);
- if (newlistSources.size()>mlistSources.size())
- {
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),"SourceAdded");
- mDBUSMessageHandler.append(diffList[0]);
-
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("send signal SourceAdded"));
- }
- else
- {
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),"SourceRemoved");
- mDBUSMessageHandler.append((dbus_uint16_t)diffList.begin()->sourceID);
-
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("send signal SourceRemoved"));
- }
-
- mDBUSMessageHandler.sendMessage();
- mlistSources=newlistSources;
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfSourcesChanged called"));
+
+ std::vector<am_SourceType_s> newlistSources;
+ std::vector<am_SourceType_s> diffList;
+ mCommandReceiveInterface->getListMainSources(newlistSources);
+ std::sort(newlistSources.begin(), newlistSources.end(), sortBySourceID());
+ std::set_symmetric_difference(newlistSources.begin(), newlistSources.end(), mlistSources.begin(), mlistSources.end(), std::back_inserter(diffList), sortBySourceID());
+ assert(diffList.size()==1);
+ if (newlistSources.size() > mlistSources.size())
+ {
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SourceAdded");
+ mDBUSMessageHandler.append(diffList[0]);
+
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("send signal SourceAdded"));
+ }
+ else
+ {
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), "SourceRemoved");
+ mDBUSMessageHandler.append((dbus_uint16_t) diffList.begin()->sourceID);
+
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("send signal SourceRemoved"));
+ }
+
+ mDBUSMessageHandler.sendMessage();
+ mlistSources = newlistSources;
}
-
void DbusCommandSender::cbNumberOfSinkClassesChanged()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbNumberOfSinkClassesChanged called"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfSinkClassesChanged called"));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("NumberOfSinkClassesChanged"));
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfSinkClassesChanged"));
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbNumberOfSourceClassesChanged()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbNumberOfSourceClassesChanged called"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbNumberOfSourceClassesChanged called"));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("NumberOfSourceClassesChanged"));
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("NumberOfSourceClassesChanged"));
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbMainConnectionStateChanged(const am_mainConnectionID_t connectionID, const am_ConnectionState_e connectionState)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbMainConnectionStateChanged called, connectionID"),DLT_INT16(connectionID),DLT_STRING("connectionState"),DLT_INT16(connectionState));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbMainConnectionStateChanged called, connectionID"), DLT_INT16(connectionID), DLT_STRING("connectionState"), DLT_INT16(connectionState));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("MainConnectionStateChanged"));
- mDBUSMessageHandler.append((dbus_uint16_t)connectionID);
- mDBUSMessageHandler.append((dbus_int16_t)connectionState);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("MainConnectionStateChanged"));
+ mDBUSMessageHandler.append((dbus_uint16_t) connectionID);
+ mDBUSMessageHandler.append((dbus_int16_t) connectionState);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbMainSinkSoundPropertyChanged(const am_sinkID_t sinkID, const am_MainSoundProperty_s SoundProperty)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbMainSinkSoundPropertyChanged called, sinkID"),DLT_INT16(sinkID),DLT_STRING("SoundProperty.type"),DLT_INT16(SoundProperty.type),DLT_STRING("SoundProperty.value"),DLT_INT16(SoundProperty.value));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbMainSinkSoundPropertyChanged called, sinkID"), DLT_INT16(sinkID), DLT_STRING("SoundProperty.type"), DLT_INT16(SoundProperty.type), DLT_STRING("SoundProperty.value"), DLT_INT16(SoundProperty.value));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("MainSinkSoundPropertyChanged"));
- mDBUSMessageHandler.append((dbus_uint16_t)sinkID);
- mDBUSMessageHandler.append(SoundProperty);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("MainSinkSoundPropertyChanged"));
+ mDBUSMessageHandler.append((dbus_uint16_t) sinkID);
+ mDBUSMessageHandler.append(SoundProperty);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbMainSourceSoundPropertyChanged(const am_sourceID_t sourceID, const am_MainSoundProperty_s & SoundProperty)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbMainSourceSoundPropertyChanged called, sourceID"),DLT_INT16(sourceID),DLT_STRING("SoundProperty.type"),DLT_INT16(SoundProperty.type),DLT_STRING("SoundProperty.value"),DLT_INT16(SoundProperty.value));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbMainSourceSoundPropertyChanged called, sourceID"), DLT_INT16(sourceID), DLT_STRING("SoundProperty.type"), DLT_INT16(SoundProperty.type), DLT_STRING("SoundProperty.value"), DLT_INT16(SoundProperty.value));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("MainSourceSoundPropertyChanged"));
- mDBUSMessageHandler.append((dbus_uint16_t)sourceID);
- mDBUSMessageHandler.append(SoundProperty);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("MainSourceSoundPropertyChanged"));
+ mDBUSMessageHandler.append((dbus_uint16_t) sourceID);
+ mDBUSMessageHandler.append(SoundProperty);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbSinkAvailabilityChanged(const am_sinkID_t sinkID, const am_Availability_s & availability)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbSinkAvailabilityChanged called, sinkID"),DLT_INT16(sinkID),DLT_STRING("availability.availability"),DLT_INT16(availability.availability),DLT_STRING("SoundProperty.reason"),DLT_INT16(availability.availabilityReason));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbSinkAvailabilityChanged called, sinkID"), DLT_INT16(sinkID), DLT_STRING("availability.availability"), DLT_INT16(availability.availability), DLT_STRING("SoundProperty.reason"), DLT_INT16(availability.availabilityReason));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("SinkAvailabilityChanged"));
- mDBUSMessageHandler.append((dbus_uint16_t)sinkID);
- mDBUSMessageHandler.append(availability);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkAvailabilityChanged"));
+ mDBUSMessageHandler.append((dbus_uint16_t) sinkID);
+ mDBUSMessageHandler.append(availability);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbSourceAvailabilityChanged(const am_sourceID_t sourceID, const am_Availability_s & availability)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbSourceAvailabilityChanged called, sourceID"),DLT_INT16(sourceID),DLT_STRING("availability.availability"),DLT_INT16(availability.availability),DLT_STRING("SoundProperty.reason"),DLT_INT16(availability.availabilityReason));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbSourceAvailabilityChanged called, sourceID"), DLT_INT16(sourceID), DLT_STRING("availability.availability"), DLT_INT16(availability.availability), DLT_STRING("SoundProperty.reason"), DLT_INT16(availability.availabilityReason));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("SourceAvailabilityChanged"));
- mDBUSMessageHandler.append((dbus_uint16_t)sourceID);
- mDBUSMessageHandler.append(availability);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("SourceAvailabilityChanged"));
+ mDBUSMessageHandler.append((dbus_uint16_t) sourceID);
+ mDBUSMessageHandler.append(availability);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbVolumeChanged(const am_sinkID_t sinkID, const am_mainVolume_t volume)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbVolumeChanged called, sinkID"),DLT_INT16(sinkID),DLT_STRING("volume"),DLT_INT16(volume));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbVolumeChanged called, sinkID"), DLT_INT16(sinkID), DLT_STRING("volume"), DLT_INT16(volume));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("VolumeChanged"));
- mDBUSMessageHandler.append((dbus_uint16_t)sinkID);
- mDBUSMessageHandler.append((dbus_int16_t)volume);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("VolumeChanged"));
+ mDBUSMessageHandler.append((dbus_uint16_t) sinkID);
+ mDBUSMessageHandler.append((dbus_int16_t) volume);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbSinkMuteStateChanged(const am_sinkID_t sinkID, const am_MuteState_e muteState)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbSinkMuteStateChanged called, sinkID"),DLT_INT16(sinkID),DLT_STRING("muteState"),DLT_INT16(muteState));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbSinkMuteStateChanged called, sinkID"), DLT_INT16(sinkID), DLT_STRING("muteState"), DLT_INT16(muteState));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("SinkMuteStateChanged"));
- mDBUSMessageHandler.append((dbus_uint16_t)sinkID);
- mDBUSMessageHandler.append((dbus_int16_t)muteState);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("SinkMuteStateChanged"));
+ mDBUSMessageHandler.append((dbus_uint16_t) sinkID);
+ mDBUSMessageHandler.append((dbus_int16_t) muteState);
+ mDBUSMessageHandler.sendMessage();
}
-
-
void DbusCommandSender::cbSystemPropertyChanged(const am_SystemProperty_s & SystemProperty)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbSystemPropertyChanged called, SystemProperty.type"),DLT_INT16(SystemProperty.type),DLT_STRING("SystemProperty.value"),DLT_INT16(SystemProperty.value));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbSystemPropertyChanged called, SystemProperty.type"), DLT_INT16(SystemProperty.type), DLT_STRING("SystemProperty.value"), DLT_INT16(SystemProperty.value));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("SystemPropertyChanged"));
- mDBUSMessageHandler.append(SystemProperty);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("SystemPropertyChanged"));
+ mDBUSMessageHandler.append(SystemProperty);
+ mDBUSMessageHandler.sendMessage();
}
void am::DbusCommandSender::cbTimingInformationChanged(const am_timeSync_t time, const am_mainConnectionID_t mainConnectionID)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("cbTimingInformationChanged called, mainConnectionID"),DLT_INT16(mainConnectionID),DLT_STRING("time"),DLT_INT16(time));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("cbTimingInformationChanged called, mainConnectionID"), DLT_INT16(mainConnectionID), DLT_STRING("time"), DLT_INT16(time));
- mDBUSMessageHandler.initSignal(std::string(MY_NODE),std::string("TimingInformationChanged"));
- mDBUSMessageHandler.append((dbus_uint16_t)mainConnectionID);
- mDBUSMessageHandler.append((dbus_int16_t)time);
- mDBUSMessageHandler.sendMessage();
+ mDBUSMessageHandler.initSignal(std::string(MY_NODE), std::string("TimingInformationChanged"));
+ mDBUSMessageHandler.append((dbus_uint16_t) mainConnectionID);
+ mDBUSMessageHandler.append((dbus_int16_t) time);
+ mDBUSMessageHandler.sendMessage();
}
-
-
uint16_t DbusCommandSender::getInterfaceVersion() const
{
- return (CommandSendVersion);
+ return (CommandSendVersion);
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp b/PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp
index adc157f..d6f2ee1 100644
--- a/PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp
+++ b/PluginCommandInterfaceDbus/src/DBusMessageHandler.cpp
@@ -1,27 +1,27 @@
/**
-* Copyright (C) 2011, BMW AG
-*
-* GeniviAudioMananger DbusPlugin
-*
-* \file DBusMessageHandler.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 DBusMessageHandler.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 <config.h>
#include "DBusMessageHandler.h"
#include "DBusCommandSender.h"
@@ -34,79 +34,81 @@ using namespace am;
DLT_IMPORT_CONTEXT(DLT_CONTEXT)
-DBusMessageHandler::DBusMessageHandler()
-: mDBusMessageIter(),
- mDBusError(),
- mSerial(0),
- mErrorName(""),
- mErrorMsg(""),
- mDbusMessage(NULL),
- mReveiveMessage(NULL),
- mDBusConnection(NULL)
+DBusMessageHandler::DBusMessageHandler() :
+ mDBusMessageIter(), //
+ mDBusError(), //
+ mSerial(0), //
+ mErrorName(""), //
+ mErrorMsg(""), //
+ mDbusMessage(NULL), //
+ mReveiveMessage(NULL), //
+ mDBusConnection(NULL)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("DBUSMessageHandler constructed"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("DBUSMessageHandler constructed"));
}
DBusMessageHandler::~DBusMessageHandler()
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_INFO, DLT_STRING("DBUSMessageHandler destructed"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_INFO, DLT_STRING("DBUSMessageHandler destructed"));
}
void DBusMessageHandler::initReceive(DBusMessage* msg)
{
- assert(msg!=NULL);
- mReveiveMessage=msg;
+ assert(msg!=NULL);
+ mReveiveMessage = msg;
if (!dbus_message_iter_init(msg, &mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::initReceive DBus Message has no arguments!"));
- mErrorName=std::string(DBUS_ERROR_INVALID_ARGS);
- mErrorMsg="DBUS Message has no arguments!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::initReceive DBus Message has no arguments!"));
+ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+ mErrorMsg = "DBUS Message has no arguments!";
}
}
void DBusMessageHandler::initReply(DBusMessage* msg)
{
- assert(msg!=NULL);
+ assert(msg!=NULL);
mDbusMessage = dbus_message_new_method_return(msg);
- if (mDbusMessage==NULL) {
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::initReply Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ if (mDbusMessage == NULL)
+ {
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::initReply Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
dbus_message_iter_init_append(mDbusMessage, &mDBusMessageIter);
}
void DBusMessageHandler::initSignal(std::string path, std::string signalName)
{
- assert(!path.empty());
- assert(!signalName.empty());
- std::string completePath=std::string(DBUS_SERVICE_OBJECT_PATH)+"/"+path;
- mDbusMessage=dbus_message_new_signal(completePath.c_str(),DBUS_SERVICE_PREFIX,signalName.c_str());
-
- if (mDbusMessage == NULL)
- {
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::initSignal Cannot allocate DBus message!"));
- }
+ assert(!path.empty());
+ assert(!signalName.empty());
+ std::string completePath = std::string(DBUS_SERVICE_OBJECT_PATH) + "/" + path;
+ mDbusMessage = dbus_message_new_signal(completePath.c_str(), DBUS_SERVICE_PREFIX, signalName.c_str());
+
+ if (mDbusMessage == NULL)
+ {
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::initSignal Cannot allocate DBus message!"));
+ }
dbus_message_iter_init_append(mDbusMessage, &mDBusMessageIter);
}
void DBusMessageHandler::sendMessage()
{
- assert(mDBusConnection!=NULL);
- if(mReveiveMessage!=0)
- {
- mSerial=dbus_message_get_serial(mReveiveMessage);
- }
- else
- {
- mSerial=1;
- }
- if (!mErrorName.empty()) {
- mDbusMessage = dbus_message_new_error(mReveiveMessage, mErrorName.c_str(), mErrorMsg.c_str());
- }
+ assert(mDBusConnection!=NULL);
+ if (mReveiveMessage != 0)
+ {
+ mSerial = dbus_message_get_serial(mReveiveMessage);
+ }
+ else
+ {
+ mSerial = 1;
+ }
+ if (!mErrorName.empty())
+ {
+ mDbusMessage = dbus_message_new_error(mReveiveMessage, mErrorName.c_str(), mErrorMsg.c_str());
+ }
if (!dbus_connection_send(mDBusConnection, mDbusMessage, &mSerial))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::sendMessage cannot send message!"));
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::sendMessage cannot send message!"));
}
dbus_connection_flush(mDBusConnection);
dbus_message_unref(mDbusMessage);
@@ -115,13 +117,13 @@ void DBusMessageHandler::sendMessage()
char* DBusMessageHandler::getString()
{
- char* param=NULL;
+ char* param = NULL;
if (DBUS_TYPE_STRING != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getString DBUS handler argument is no String!"));
- mErrorName=std::string(DBUS_ERROR_INVALID_ARGS);
- mErrorMsg="DBus argument is no string";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getString DBUS handler argument is no String!"));
+ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+ mErrorMsg = "DBus argument is no string";
}
else
{
@@ -133,13 +135,13 @@ char* DBusMessageHandler::getString()
dbus_bool_t DBusMessageHandler::getBool()
{
- dbus_bool_t boolparam=false;
+ dbus_bool_t boolparam = false;
if (DBUS_TYPE_BOOLEAN != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getBool DBUS handler argument is no bool!"));
- mErrorName=std::string(DBUS_ERROR_INVALID_ARGS);
- mErrorMsg="DBus argument is no bool";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getBool DBUS handler argument is no bool!"));
+ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+ mErrorMsg = "DBus argument is no bool";
}
else
{
@@ -155,9 +157,9 @@ char DBusMessageHandler::getByte()
if (DBUS_TYPE_BYTE != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getByte DBUS handler argument is no byte!"));
- mErrorName=std::string(DBUS_ERROR_INVALID_ARGS);
- mErrorMsg="DBus argument is no byte";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getByte DBUS handler argument is no byte!"));
+ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+ mErrorMsg = "DBus argument is no byte";
}
else
{
@@ -177,9 +179,9 @@ dbus_uint16_t DBusMessageHandler::getUInt()
if (DBUS_TYPE_UINT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter))
#endif
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getUInt DBUS handler argument is no uint16_t!"));
- mErrorName=std::string(DBUS_ERROR_INVALID_ARGS);
- mErrorMsg="DBus argument is no uint16_t";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getUInt DBUS handler argument is no uint16_t!"));
+ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+ mErrorMsg = "DBus argument is no uint16_t";
}
else
{
@@ -199,9 +201,9 @@ dbus_int16_t DBusMessageHandler::getInt()
if (DBUS_TYPE_INT16 != dbus_message_iter_get_arg_type(&mDBusMessageIter))
#endif
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getInt DBUS handler argument is no int16_t!"));
- mErrorName=std::string(DBUS_ERROR_INVALID_ARGS);
- mErrorMsg="DBus argument is no int16_t";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getInt DBUS handler argument is no int16_t!"));
+ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+ mErrorMsg = "DBus argument is no int16_t";
}
else
{
@@ -216,9 +218,9 @@ double DBusMessageHandler::getDouble()
double param;
if (DBUS_TYPE_DOUBLE != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getDouble DBUS handler argument is no double!"));
- mErrorName=std::string(DBUS_ERROR_INVALID_ARGS);
- mErrorMsg="DBus argument is no double";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getDouble DBUS handler argument is no double!"));
+ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+ mErrorMsg = "DBus argument is no double";
}
else
{
@@ -230,12 +232,12 @@ double DBusMessageHandler::getDouble()
void DBusMessageHandler::getProperty(dbus_int16_t & type, dbus_int16_t & value)
{
- DBusMessageIter arrayIter;
+ DBusMessageIter arrayIter;
if (DBUS_TYPE_STRUCT != dbus_message_iter_get_arg_type(&mDBusMessageIter))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getProperty DBUS handler argument is no array!"));
- mErrorName=std::string(DBUS_ERROR_INVALID_ARGS);
- mErrorMsg="DBus argument is no array";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::getProperty DBUS handler argument is no array!"));
+ mErrorName = std::string(DBUS_ERROR_INVALID_ARGS);
+ mErrorMsg = "DBus argument is no array";
}
else
{
@@ -249,23 +251,22 @@ void DBusMessageHandler::getProperty(dbus_int16_t & type, dbus_int16_t & value)
void DBusMessageHandler::append(bool toAppend)
{
- dbus_bool_t mybool=toAppend;
+ dbus_bool_t mybool = toAppend;
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BOOLEAN, &mybool))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
-
void DBusMessageHandler::append(double toAppend)
{
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_DOUBLE, &toAppend))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
@@ -273,20 +274,19 @@ void DBusMessageHandler::append(char toAppend)
{
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_BYTE, &toAppend))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
-
void DBusMessageHandler::append(dbus_int16_t toAppend)
{
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_INT16, &toAppend))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
@@ -294,42 +294,42 @@ void DBusMessageHandler::append(dbus_uint16_t toAppend)
{
if (!dbus_message_iter_append_basic(&mDBusMessageIter, DBUS_TYPE_UINT16, &toAppend))
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
void DBusMessageHandler::setDBusConnection(DBusConnection *& connection)
{
- assert(connection!=NULL);
- mDBusConnection=connection;
+ assert(connection!=NULL);
+ mDBusConnection = connection;
}
void DBusMessageHandler::append(const am::am_SinkType_s& sinkType)
{
DBusMessageIter structIter;
DBusMessageIter structAvailIter;
- 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_UINT16, &sinkType.sinkID);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &sinkType.name);
+ 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_UINT16, &sinkType.sinkID);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &sinkType.name);
- success=success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
- success=success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sinkType.availability.availability);
- success=success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sinkType.availability.availabilityReason);
- success=success && dbus_message_iter_close_container(&structIter, &structAvailIter);
+ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
+ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sinkType.availability.availability);
+ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sinkType.availability.availabilityReason);
+ success = success && dbus_message_iter_close_container(&structIter, &structAvailIter);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &sinkType.volume);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &sinkType.muteState);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sinkType.sinkClassID);
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &sinkType.volume);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &sinkType.muteState);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sinkType.sinkClassID);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
@@ -337,75 +337,75 @@ void DBusMessageHandler::append(const am::am_SourceType_s & sourceType)
{
DBusMessageIter structIter;
DBusMessageIter structAvailIter;
- 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_UINT16, &sourceType.sourceID);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &sourceType.name);
+ 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_UINT16, &sourceType.sourceID);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &sourceType.name);
- success=success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
- success=success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sourceType.availability.availability);
- success=success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sourceType.availability.availabilityReason);
- success=success && dbus_message_iter_close_container(&structIter, &structAvailIter);
+ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
+ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sourceType.availability.availability);
+ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &sourceType.availability.availabilityReason);
+ success = success && dbus_message_iter_close_container(&structIter, &structAvailIter);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sourceType.sourceClassID);
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &sourceType.sourceClassID);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
void DBusMessageHandler::append(const am::am_MainSoundProperty_s mainSoundProperty)
{
- 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, &mainSoundProperty.type);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &mainSoundProperty.value);
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
+ 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, &mainSoundProperty.type);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &mainSoundProperty.value);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
void DBusMessageHandler::append(const am::am_Availability_s & availability)
{
DBusMessageIter structAvailIter;
- dbus_bool_t success=true;
- success=success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT,NULL, &structAvailIter);
- success=success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &availability.availability);
- success=success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &availability.availabilityReason);
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &structAvailIter);
+ dbus_bool_t success = true;
+ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_STRUCT, NULL, &structAvailIter);
+ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &availability.availability);
+ success = success && dbus_message_iter_append_basic(&structAvailIter, DBUS_TYPE_INT16, &availability.availabilityReason);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structAvailIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
void DBusMessageHandler::append(const am::am_SystemProperty_s & SystemProperty)
{
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, &SystemProperty.type);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &SystemProperty.value);
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &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, &SystemProperty.type);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &SystemProperty.value);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &structIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
@@ -413,27 +413,27 @@ void DBusMessageHandler::append(const std::vector<am::am_MainConnectionType_s>&
{
DBusMessageIter arrayIter;
DBusMessageIter structIter;
- std::vector<am::am_MainConnectionType_s>::const_iterator listIterator=listMainConnections.begin();
- dbus_bool_t success=true;
+ std::vector<am::am_MainConnectionType_s>::const_iterator listIterator = listMainConnections.begin();
+ dbus_bool_t success = true;
- success=success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qqqnn)", &arrayIter);
- for(;listIterator<listMainConnections.end();++listIterator)
+ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qqqnn)", &arrayIter);
+ for (; listIterator < listMainConnections.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_UINT16, &listIterator->mainConnectionID);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceID);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkID);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->delay);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->connectionState);
- success=success && dbus_message_iter_close_container(&arrayIter, &structIter);
+ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->mainConnectionID);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceID);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkID);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->delay);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->connectionState);
+ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
}
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
@@ -442,64 +442,62 @@ void DBusMessageHandler::append(const std::vector<am::am_SinkType_s> & listMainS
DBusMessageIter arrayIter;
DBusMessageIter structIter;
DBusMessageIter availIter;
- std::vector<am::am_SinkType_s>::const_iterator listIterator=listMainSinks.begin();
- dbus_bool_t success=true;
-
- success=success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qs(nn)nnq)", &arrayIter);
- for(;listIterator<listMainSinks.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_UINT16, &listIterator->sinkID);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
- success=success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &availIter);
- success=success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availability);
- success=success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availabilityReason);
- success=success && dbus_message_iter_close_container(&structIter, &availIter);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->volume);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->muteState);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkClassID);
- success=success && dbus_message_iter_close_container(&arrayIter, &structIter);
- }
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+ std::vector<am::am_SinkType_s>::const_iterator listIterator = listMainSinks.begin();
+ dbus_bool_t success = true;
+
+ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qs(nn)nnq)", &arrayIter);
+ for (; listIterator < listMainSinks.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_UINT16, &listIterator->sinkID);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
+ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &availIter);
+ success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availability);
+ success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availabilityReason);
+ success = success && dbus_message_iter_close_container(&structIter, &availIter);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->volume);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->muteState);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkClassID);
+ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
+ }
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
-
-
void DBusMessageHandler::append(const std::vector<am::am_SourceType_s> & listMainSources)
{
DBusMessageIter arrayIter;
DBusMessageIter structIter;
DBusMessageIter availIter;
- std::vector<am::am_SourceType_s>::const_iterator listIterator=listMainSources.begin();
- dbus_bool_t success=true;
+ std::vector<am::am_SourceType_s>::const_iterator listIterator = listMainSources.begin();
+ dbus_bool_t success = true;
- success=success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qs(nn)q)", &arrayIter);
- for(;listIterator<listMainSources.end();++listIterator)
+ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qs(nn)q)", &arrayIter);
+ for (; listIterator < listMainSources.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_UINT16, &listIterator->sourceID);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
- success=success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &availIter);
- success=success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availability);
- success=success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availabilityReason);
- success=success && dbus_message_iter_close_container(&structIter, &availIter);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceClassID);
- success=success && dbus_message_iter_close_container(&arrayIter, &structIter);
+ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceID);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
+ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_STRUCT, NULL, &availIter);
+ success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availability);
+ success = success && dbus_message_iter_append_basic(&availIter, DBUS_TYPE_INT16, &listIterator->availability.availabilityReason);
+ success = success && dbus_message_iter_close_container(&structIter, &availIter);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceClassID);
+ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
}
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
@@ -507,24 +505,24 @@ void DBusMessageHandler::append(const std::vector<am::am_MainSoundProperty_s> &
{
DBusMessageIter arrayIter;
DBusMessageIter structIter;
- std::vector<am::am_MainSoundProperty_s>::const_iterator listIterator=listMainSoundProperties.begin();
- dbus_bool_t success=true;
+ std::vector<am::am_MainSoundProperty_s>::const_iterator listIterator = listMainSoundProperties.begin();
+ dbus_bool_t success = true;
- success=success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
- for(;listIterator<listMainSoundProperties.end();++listIterator)
+ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
+ for (; listIterator < listMainSoundProperties.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->type);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
- success=success && dbus_message_iter_close_container(&arrayIter, &structIter);
+ 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->type);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
+ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
}
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
@@ -534,35 +532,35 @@ void DBusMessageHandler::append(const std::vector<am::am_SourceClass_s> & listSo
DBusMessageIter structIter;
DBusMessageIter propIter;
DBusMessageIter innerIter;
- std::vector<am::am_SourceClass_s>::const_iterator listIterator=listSourceClasses.begin();
- dbus_bool_t success=true;
+ std::vector<am::am_SourceClass_s>::const_iterator listIterator = listSourceClasses.begin();
+ dbus_bool_t success = true;
- success=success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qsa(nn))", &arrayIter);
- for(;listIterator<listSourceClasses.end();++listIterator)
+ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qsa(nn))", &arrayIter);
+ for (; listIterator < listSourceClasses.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_UINT16, &listIterator->sourceClassID);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
- success=success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_ARRAY, "(nn)", &innerIter);
+ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sourceClassID);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
+ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_ARRAY, "(nn)", &innerIter);
- std::vector<am::am_ClassProperty_s>::const_iterator listInnerIterator=listIterator->listClassProperties.begin();
- for(;listInnerIterator<listIterator->listClassProperties.end();++listInnerIterator)
+ std::vector<am::am_ClassProperty_s>::const_iterator listInnerIterator = listIterator->listClassProperties.begin();
+ for (; listInnerIterator < listIterator->listClassProperties.end(); ++listInnerIterator)
{
- success=success && dbus_message_iter_open_container(&innerIter, DBUS_TYPE_STRUCT, NULL, &propIter);
- success=success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->classProperty);
- success=success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->value);
- success=success && dbus_message_iter_close_container(&innerIter, &propIter);
+ success = success && dbus_message_iter_open_container(&innerIter, DBUS_TYPE_STRUCT, NULL, &propIter);
+ success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->classProperty);
+ success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->value);
+ success = success && dbus_message_iter_close_container(&innerIter, &propIter);
}
- success=success && dbus_message_iter_close_container(&structIter, &innerIter);
- success=success && dbus_message_iter_close_container(&arrayIter, &structIter);
+ success = success && dbus_message_iter_close_container(&structIter, &innerIter);
+ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
}
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
@@ -572,35 +570,35 @@ void DBusMessageHandler::append(const std::vector<am::am_SinkClass_s> & listSink
DBusMessageIter structIter;
DBusMessageIter propIter;
DBusMessageIter innerIter;
- std::vector<am::am_SinkClass_s>::const_iterator listIterator=listSinkClasses.begin();
- dbus_bool_t success=true;
+ std::vector<am::am_SinkClass_s>::const_iterator listIterator = listSinkClasses.begin();
+ dbus_bool_t success = true;
- success=success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qsa(nn))", &arrayIter);
- for(;listIterator<listSinkClasses.end();++listIterator)
+ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(qsa(nn))", &arrayIter);
+ for (; listIterator < listSinkClasses.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_UINT16, &listIterator->sinkClassID);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
- success=success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_ARRAY, "(nn)", &innerIter);
+ success = success && dbus_message_iter_open_container(&arrayIter, DBUS_TYPE_STRUCT, NULL, &structIter);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_UINT16, &listIterator->sinkClassID);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_STRING, &listIterator->name);
+ success = success && dbus_message_iter_open_container(&structIter, DBUS_TYPE_ARRAY, "(nn)", &innerIter);
- std::vector<am::am_ClassProperty_s>::const_iterator listInnerIterator=listIterator->listClassProperties.begin();
- for(;listInnerIterator<listIterator->listClassProperties.end();++listInnerIterator)
+ std::vector<am::am_ClassProperty_s>::const_iterator listInnerIterator = listIterator->listClassProperties.begin();
+ for (; listInnerIterator < listIterator->listClassProperties.end(); ++listInnerIterator)
{
- success=success && dbus_message_iter_open_container(&innerIter, DBUS_TYPE_STRUCT, NULL, &propIter);
- success=success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->classProperty);
- success=success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->value);
- success=success && dbus_message_iter_close_container(&innerIter, &propIter);
+ success = success && dbus_message_iter_open_container(&innerIter, DBUS_TYPE_STRUCT, NULL, &propIter);
+ success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->classProperty);
+ success = success && dbus_message_iter_append_basic(&propIter, DBUS_TYPE_INT16, &listInnerIterator->value);
+ success = success && dbus_message_iter_close_container(&innerIter, &propIter);
}
- success=success && dbus_message_iter_close_container(&structIter, &innerIter);
- success=success && dbus_message_iter_close_container(&arrayIter, &structIter);
+ success = success && dbus_message_iter_close_container(&structIter, &innerIter);
+ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
}
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
@@ -608,37 +606,24 @@ void DBusMessageHandler::append(const std::vector<am::am_SystemProperty_s> & lis
{
DBusMessageIter arrayIter;
DBusMessageIter structIter;
- std::vector<am::am_SystemProperty_s>::const_iterator listIterator=listSystemProperties.begin();
- dbus_bool_t success=true;
+ std::vector<am::am_SystemProperty_s>::const_iterator listIterator = listSystemProperties.begin();
+ dbus_bool_t success = true;
- success=success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
- for(;listIterator<listSystemProperties.end();++listIterator)
+ success = success && dbus_message_iter_open_container(&mDBusMessageIter, DBUS_TYPE_ARRAY, "(nn)", &arrayIter);
+ for (; listIterator < listSystemProperties.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->type);
- success=success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
- success=success && dbus_message_iter_close_container(&arrayIter, &structIter);
+ 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->type);
+ success = success && dbus_message_iter_append_basic(&structIter, DBUS_TYPE_INT16, &listIterator->value);
+ success = success && dbus_message_iter_close_container(&arrayIter, &structIter);
}
- success=success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
+ success = success && dbus_message_iter_close_container(&mDBusMessageIter, &arrayIter);
if (!success)
{
- DLT_LOG(DLT_CONTEXT,DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
- mErrorName=std::string(DBUS_ERROR_NO_MEMORY);
- mErrorMsg="Cannot create reply!";
+ DLT_LOG(DLT_CONTEXT, DLT_LOG_ERROR, DLT_STRING("DBusMessageHandler::append Cannot allocate DBus message!"));
+ mErrorName = std::string(DBUS_ERROR_NO_MEMORY);
+ mErrorMsg = "Cannot create reply!";
}
}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/PluginCommandInterfaceDbus/test/config.h b/PluginCommandInterfaceDbus/test/config.h
deleted file mode 100644
index ea737e0..0000000
--- a/PluginCommandInterfaceDbus/test/config.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _CONFIG_H
-#define _CONFIG_H
-
-#define WITH_DBUS_WRAPPER
-#define WITH_SOCKETHANDLER_LOOP
-/* #undef WITH_SIMPLEDBUS_LOOP */
-
-#define DEFAULT_PLUGIN_COMMAND_DIR "/home/christian/workspace/gitserver/bin/plugins/command"
-#define DEFAULT_PLUGIN_ROUTING_DIR "/home/christian/workspace/gitserver/bin/plugins/routing"
-#define CONTROLLER_PLUGIN "/home/christian/workspace/gitserver/bin/plugins/control/libPluginControlInterface.so"
-
-#define DBUS_SERVICE_PREFIX "org.genivi.audiomanager"
-#define DBUS_SERVICE_OBJECT_PATH "/org/genivi/audiomanager"
-
-#define INTROSPECTION_COMMAND_XML_FILE "/home/christian/workspace/gitserver/includes/dbus/CommandInterface.xml"
-
-#endif /* _CONFIG_H */