From a2edae5cee4254b933f42399edc0e092abd4f5cf Mon Sep 17 00:00:00 2001 From: Aleksandar Donchev Date: Mon, 2 Sep 2013 11:57:28 +0200 Subject: *PluginCommandInterfaceCAPI, PluginRoutingInterfaceCAPI, NodeStateCommunicatorCAPI with unit tests first version. Choosing between DBUS and Common-API via cmake. CommonAPI - legacy support for DBus properties (Set 1) Signed-off-by: Christian Linke (cherry picked from commit ea96ef59e29466667c90b506426e2a5a9cdb82d2) --- AudioManagerDaemon/CMakeLists.txt | 84 +- ...odel_org.genivi.NodeStateManager.Consumer.fdepl | 6 + ...model_org.genivi.NodeStateManager.Consumer.fidl | 127 ++ ....genivi.NodeStateManager.LifecycleConsumer.fidl | 16 + .../fidls/NodeStateManager_dbus.conf | 33 + AudioManagerDaemon/fidls/amTypes.fidl | 330 +++ .../include/CAmNodeStateCommunicator.h | 66 +- .../include/CAmNodeStateCommunicatorCAPI.h | 101 + .../include/CAmNodeStateCommunicatorDBus.h | 63 + AudioManagerDaemon/include/TAmPluginTemplate.h | 3 +- .../genivi/NodeStateManager/Consumer/Consumer.h | 70 + .../Consumer/ConsumerDBusProxy.cpp | 292 +++ .../NodeStateManager/Consumer/ConsumerDBusProxy.h | 114 + .../Consumer/ConsumerDBusStubAdapter.cpp | 374 ++++ .../Consumer/ConsumerDBusStubAdapter.h | 68 + .../NodeStateManager/Consumer/ConsumerProxy.h | 619 ++++++ .../NodeStateManager/Consumer/ConsumerProxyBase.h | 114 + .../NodeStateManager/Consumer/ConsumerStub.h | 170 ++ .../Consumer/ConsumerStubDefault.cpp | 240 +++ .../Consumer/ConsumerStubDefault.h | 141 ++ .../LifeCycleConsumer/LifeCycleConsumer.h | 70 + .../LifeCycleConsumerDBusProxy.cpp | 82 + .../LifeCycleConsumer/LifeCycleConsumerDBusProxy.h | 68 + .../LifeCycleConsumerDBusStubAdapter.cpp | 82 + .../LifeCycleConsumerDBusStubAdapter.h | 61 + .../LifeCycleConsumer/LifeCycleConsumerProxy.h | 166 ++ .../LifeCycleConsumer/LifeCycleConsumerProxyBase.h | 58 + .../LifeCycleConsumer/LifeCycleConsumerStub.h | 93 + .../LifeCycleConsumerStubDefault.cpp | 51 + .../LifeCycleConsumerStubDefault.h | 74 + AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp | 275 +++ AudioManagerDaemon/src/CAmDatabaseHandlerMap.cpp | 2 +- AudioManagerDaemon/src/CAmDbusWrapper.cpp | 2 +- .../src/CAmNodeStateCommunicator.cpp | 783 ------- .../src/CAmNodeStateCommunicatorCAPI.cpp | 361 ++++ .../src/CAmNodeStateCommunicatorDBus.cpp | 776 +++++++ AudioManagerDaemon/src/CAmRoutingReceiver.cpp | 4 +- AudioManagerDaemon/src/main.cpp | 45 +- .../test/AmControlInterfaceTest/CMakeLists.txt | 2 +- .../test/AmDatabaseHandlerTest/CMakeLists.txt | 2 +- .../test/AmMapHandlerTest/CMakeLists.txt | 2 +- .../CAmNodeStateCommunicatorTest.cpp | 262 +++ .../CAmNodeStateCommunicatorTest.h | 65 + .../AmNodeStateCommunicatorCAPITest/CMakeLists.txt | 119 + .../test/AmNodeStateCommunicatorCAPITest/nsm.py | 179 ++ .../org.genivi.NodeStateManager.Consumer.xml | 259 +++ .../AmNodeStateCommunicatorCAPITest/send2nsm.py | 68 + .../CAmNodeStateCommunicatorTest.cpp | 248 +++ .../CAmNodeStateCommunicatorTest.h | 61 + .../AmNodeStateCommunicatorDBusTest/CMakeLists.txt | 111 + .../test/AmNodeStateCommunicatorDBusTest/nsm.py | 179 ++ .../org.genivi.NodeStateManager.Consumer.xml | 259 +++ .../AmNodeStateCommunicatorDBusTest/send2nsm.py | 68 + .../CAmNodeStateCommunicatorTest.cpp | 243 --- .../CAmNodeStateCommunicatorTest.h | 61 - .../AmNodeStateCommunicatorTest/CMakeLists.txt | 111 - .../test/AmNodeStateCommunicatorTest/nsm.py | 179 -- .../org.genivi.NodeStateManager.Consumer.xml | 259 --- .../test/AmNodeStateCommunicatorTest/send2nsm.py | 68 - .../test/AmRouterMapTest/CMakeLists.txt | 6 +- .../test/AmRouterTest/CMakeLists.txt | 6 +- .../test/AmRoutingInterfaceTest/CMakeLists.txt | 6 +- .../test/AmTelnetServerTest/CMakeLists.txt | 6 +- AudioManagerDaemon/test/CAmCommonFunctions.cpp | 2 +- AudioManagerDaemon/test/CMakeLists.txt | 7 +- CMakeLists.txt | 65 +- PluginCommandInterfaceCAPI/CMakeLists.txt | 99 + PluginCommandInterfaceCAPI/cmake/config.cmake | 4 + .../fidl/CommandInterface.fdepl | 6 + .../fidl/CommandInterface.fidl | 723 +++++++ .../fidl/PluginCommandInterfaceCAPI_dbus.conf | 8 + PluginCommandInterfaceCAPI/fidl/amTypes.fidl | 329 +++ .../include/CAmCommandSenderCAPI.h | 120 ++ .../include/CAmCommandSenderCommon.h | 61 + .../include/CAmCommandSenderService.h | 74 + .../include/configCommandCAPI.h | 4 + .../org/genivi/audiomanager/CommandInterface.cpp | 332 +++ .../org/genivi/audiomanager/CommandInterface.h | 820 +++++++ .../audiomanager/CommandInterfaceDBusProxy.cpp | 458 ++++ .../audiomanager/CommandInterfaceDBusProxy.h | 157 ++ .../CommandInterfaceDBusStubAdapter.cpp | 521 +++++ .../audiomanager/CommandInterfaceDBusStubAdapter.h | 79 + .../genivi/audiomanager/CommandInterfaceProxy.h | 794 +++++++ .../audiomanager/CommandInterfaceProxyBase.h | 170 ++ .../org/genivi/audiomanager/CommandInterfaceStub.h | 282 +++ .../audiomanager/CommandInterfaceStubDefault.cpp | 177 ++ .../audiomanager/CommandInterfaceStubDefault.h | 124 ++ .../src-gen/org/genivi/audiomanager/am.cpp | 477 ++++ .../src-gen/org/genivi/audiomanager/am.h | 1515 +++++++++++++ .../src/CAmCommandSenderCAPI.cpp | 364 ++++ .../src/CAmCommandSenderCommon.cpp | 159 ++ .../src/CAmCommandSenderService.cpp | 236 ++ .../test/CAmCommandSenderCAPITest.cpp | 1101 ++++++++++ .../test/CAmCommandSenderCAPITest.h | 77 + .../test/CAmTestCAPIWrapper.cpp | 31 + .../test/CAmTestCAPIWrapper.h | 32 + PluginCommandInterfaceCAPI/test/CMakeLists.txt | 105 + .../test/MockIAmCommandReceive.h | 86 + .../test/MockNotificationsClient.h | 110 + PluginCommandInterfaceDbus/CMakeLists.txt | 2 +- .../include/CAmCommandSenderDbus.h | 2 +- .../include/configCommandDbus.h | 4 +- PluginControlInterface/CMakeLists.txt | 2 +- PluginRoutingInterfaceAsync/CMakeLists.txt | 2 +- .../src/CAmRoutingSenderAsync.cpp | 17 +- PluginRoutingInterfaceCAPI/CMakeLists.txt | 97 + PluginRoutingInterfaceCAPI/cmake/config.cmake | 6 + .../fidl/PluginRoutingInterfaceCAPI_dbus.conf | 8 + .../fidl/RoutingInterface.fidl | 462 ++++ PluginRoutingInterfaceCAPI/fidl/RoutingSender.fidl | 158 ++ PluginRoutingInterfaceCAPI/fidl/amTypes.fidl | 399 ++++ PluginRoutingInterfaceCAPI/fidl/deployment.fdepl | 9 + PluginRoutingInterfaceCAPI/include/CAmLookupData.h | 204 ++ .../include/CAmRoutingSenderCAPI.h | 103 + .../include/CAmRoutingSenderCommon.h | 59 + .../include/CAmRoutingService.h | 148 ++ .../include/configRoutingCAPI.h | 6 + .../org/genivi/audiomanager/RoutingInterface.h | 66 + .../audiomanager/RoutingInterfaceDBusProxy.cpp | 920 ++++++++ .../audiomanager/RoutingInterfaceDBusProxy.h | 201 ++ .../RoutingInterfaceDBusStubAdapter.cpp | 562 +++++ .../audiomanager/RoutingInterfaceDBusStubAdapter.h | 59 + .../genivi/audiomanager/RoutingInterfaceProxy.h | 1594 ++++++++++++++ .../audiomanager/RoutingInterfaceProxyBase.h | 242 +++ .../org/genivi/audiomanager/RoutingInterfaceStub.h | 198 ++ .../audiomanager/RoutingInterfaceStubDefault.cpp | 229 ++ .../audiomanager/RoutingInterfaceStubDefault.h | 160 ++ .../org/genivi/audiomanager/RoutingSender.h | 66 + .../genivi/audiomanager/RoutingSenderDBusProxy.cpp | 344 +++ .../genivi/audiomanager/RoutingSenderDBusProxy.h | 106 + .../audiomanager/RoutingSenderDBusStubAdapter.cpp | 237 ++ .../audiomanager/RoutingSenderDBusStubAdapter.h | 57 + .../org/genivi/audiomanager/RoutingSenderProxy.h | 611 ++++++ .../genivi/audiomanager/RoutingSenderProxyBase.h | 116 + .../org/genivi/audiomanager/RoutingSenderStub.h | 123 ++ .../audiomanager/RoutingSenderStubDefault.cpp | 103 + .../genivi/audiomanager/RoutingSenderStubDefault.h | 98 + .../src-gen/org/genivi/audiomanager/am_gen.cpp | 587 +++++ .../src-gen/org/genivi/audiomanager/am_gen.h | 1764 +++++++++++++++ PluginRoutingInterfaceCAPI/src/CAmLookupData.cpp | 669 ++++++ .../src/CAmRoutingSenderCAPI.cpp | 266 +++ .../src/CAmRoutingSenderCommon.cpp | 282 +++ .../src/CAmRoutingService.cpp | 435 ++++ .../test/CAmRoutingInterfaceCAPITests.cpp | 2269 ++++++++++++++++++++ .../test/CAmRoutingInterfaceCAPITests.h | 104 + .../test/CAmRoutingSenderService.cpp | 225 ++ .../test/CAmRoutingSenderService.h | 112 + .../test/CAmTestCAPIWrapper.cpp | 31 + .../test/CAmTestCAPIWrapper.h | 32 + PluginRoutingInterfaceCAPI/test/CMakeLists.txt | 135 ++ .../test/IAmRoutingSenderBackdoor.cpp | 87 + .../test/IAmRoutingSenderBackdoor.h | 53 + .../test/MockIAmRoutingReceive.h | 126 ++ .../test/RoutingSender_dbus.conf | 8 + .../cmake/AmRoutingInterfaceCAPITests_dbus.conf.in | 3 + .../test/cmake/CAmRoutingSenderService.h.in | 112 + .../test/cmake/RoutingSender_dbus.conf.in | 8 + PluginRoutingInterfaceCAPI/test/cmake/config.cmake | 8 + PluginRoutingInterfaceDbus/CMakeLists.txt | 4 +- .../include/CAmRoutingSenderDbus.h | 3 + .../include/RoutingReceiver.xml | 9 +- .../include/configRoutingDbus.h | 2 +- .../src/CAmRoutingSenderDbus.cpp | 42 +- .../src/IAmRoutingReceiverShadow.cpp | 3 +- cmake/FindCommonAPI.cmake | 102 + cmake/FindCommonAPI_DBus.cmake | 85 + cmake/config.cmake | 2 + include/projecttypes.h | 93 +- include/shared/CAmCommonAPIWrapper.h | 142 ++ 169 files changed, 32352 insertions(+), 1853 deletions(-) create mode 100644 AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fdepl create mode 100755 AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl create mode 100755 AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.LifecycleConsumer.fidl create mode 100755 AudioManagerDaemon/fidls/NodeStateManager_dbus.conf create mode 100755 AudioManagerDaemon/fidls/amTypes.fidl create mode 100644 AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h create mode 100644 AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxyBase.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStub.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumer.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxy.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxyBase.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStub.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.h create mode 100644 AudioManagerDaemon/src/CAmCommonAPIWrapper.cpp delete mode 100644 AudioManagerDaemon/src/CAmNodeStateCommunicator.cpp create mode 100644 AudioManagerDaemon/src/CAmNodeStateCommunicatorCAPI.cpp create mode 100644 AudioManagerDaemon/src/CAmNodeStateCommunicatorDBus.cpp create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.cpp create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CAmNodeStateCommunicatorTest.h create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/CMakeLists.txt create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/nsm.py create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/org.genivi.NodeStateManager.Consumer.xml create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorCAPITest/send2nsm.py create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.cpp create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CAmNodeStateCommunicatorTest.h create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/CMakeLists.txt create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/nsm.py create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/org.genivi.NodeStateManager.Consumer.xml create mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorDBusTest/send2nsm.py delete mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CAmNodeStateCommunicatorTest.cpp delete mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CAmNodeStateCommunicatorTest.h delete mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorTest/CMakeLists.txt delete mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorTest/nsm.py delete mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorTest/org.genivi.NodeStateManager.Consumer.xml delete mode 100644 AudioManagerDaemon/test/AmNodeStateCommunicatorTest/send2nsm.py create mode 100644 PluginCommandInterfaceCAPI/CMakeLists.txt create mode 100644 PluginCommandInterfaceCAPI/cmake/config.cmake create mode 100644 PluginCommandInterfaceCAPI/fidl/CommandInterface.fdepl create mode 100755 PluginCommandInterfaceCAPI/fidl/CommandInterface.fidl create mode 100644 PluginCommandInterfaceCAPI/fidl/PluginCommandInterfaceCAPI_dbus.conf create mode 100755 PluginCommandInterfaceCAPI/fidl/amTypes.fidl create mode 100644 PluginCommandInterfaceCAPI/include/CAmCommandSenderCAPI.h create mode 100644 PluginCommandInterfaceCAPI/include/CAmCommandSenderCommon.h create mode 100644 PluginCommandInterfaceCAPI/include/CAmCommandSenderService.h create mode 100644 PluginCommandInterfaceCAPI/include/configCommandCAPI.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterface.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusProxy.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceDBusStubAdapter.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxy.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceProxyBase.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStub.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/CommandInterfaceStubDefault.h create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.cpp create mode 100644 PluginCommandInterfaceCAPI/src-gen/org/genivi/audiomanager/am.h create mode 100644 PluginCommandInterfaceCAPI/src/CAmCommandSenderCAPI.cpp create mode 100644 PluginCommandInterfaceCAPI/src/CAmCommandSenderCommon.cpp create mode 100644 PluginCommandInterfaceCAPI/src/CAmCommandSenderService.cpp create mode 100644 PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.cpp create mode 100644 PluginCommandInterfaceCAPI/test/CAmCommandSenderCAPITest.h create mode 100644 PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.cpp create mode 100644 PluginCommandInterfaceCAPI/test/CAmTestCAPIWrapper.h create mode 100644 PluginCommandInterfaceCAPI/test/CMakeLists.txt create mode 100644 PluginCommandInterfaceCAPI/test/MockIAmCommandReceive.h create mode 100644 PluginCommandInterfaceCAPI/test/MockNotificationsClient.h create mode 100644 PluginRoutingInterfaceCAPI/CMakeLists.txt create mode 100644 PluginRoutingInterfaceCAPI/cmake/config.cmake create mode 100755 PluginRoutingInterfaceCAPI/fidl/PluginRoutingInterfaceCAPI_dbus.conf create mode 100644 PluginRoutingInterfaceCAPI/fidl/RoutingInterface.fidl create mode 100755 PluginRoutingInterfaceCAPI/fidl/RoutingSender.fidl create mode 100755 PluginRoutingInterfaceCAPI/fidl/amTypes.fidl create mode 100644 PluginRoutingInterfaceCAPI/fidl/deployment.fdepl create mode 100644 PluginRoutingInterfaceCAPI/include/CAmLookupData.h create mode 100644 PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCAPI.h create mode 100644 PluginRoutingInterfaceCAPI/include/CAmRoutingSenderCommon.h create mode 100644 PluginRoutingInterfaceCAPI/include/CAmRoutingService.h create mode 100644 PluginRoutingInterfaceCAPI/include/configRoutingCAPI.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterface.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterfaceDBusProxy.cpp create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterfaceDBusProxy.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterfaceDBusStubAdapter.cpp create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterfaceDBusStubAdapter.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterfaceProxy.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterfaceProxyBase.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterfaceStub.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterfaceStubDefault.cpp create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingInterfaceStubDefault.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSender.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSenderDBusProxy.cpp create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSenderDBusProxy.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSenderDBusStubAdapter.cpp create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSenderDBusStubAdapter.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSenderProxy.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSenderProxyBase.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSenderStub.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSenderStubDefault.cpp create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/RoutingSenderStubDefault.h create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/am_gen.cpp create mode 100644 PluginRoutingInterfaceCAPI/src-gen/org/genivi/audiomanager/am_gen.h create mode 100644 PluginRoutingInterfaceCAPI/src/CAmLookupData.cpp create mode 100644 PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCAPI.cpp create mode 100644 PluginRoutingInterfaceCAPI/src/CAmRoutingSenderCommon.cpp create mode 100644 PluginRoutingInterfaceCAPI/src/CAmRoutingService.cpp create mode 100644 PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.cpp create mode 100644 PluginRoutingInterfaceCAPI/test/CAmRoutingInterfaceCAPITests.h create mode 100644 PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.cpp create mode 100644 PluginRoutingInterfaceCAPI/test/CAmRoutingSenderService.h create mode 100644 PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.cpp create mode 100644 PluginRoutingInterfaceCAPI/test/CAmTestCAPIWrapper.h create mode 100644 PluginRoutingInterfaceCAPI/test/CMakeLists.txt create mode 100644 PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.cpp create mode 100644 PluginRoutingInterfaceCAPI/test/IAmRoutingSenderBackdoor.h create mode 100644 PluginRoutingInterfaceCAPI/test/MockIAmRoutingReceive.h create mode 100755 PluginRoutingInterfaceCAPI/test/RoutingSender_dbus.conf create mode 100755 PluginRoutingInterfaceCAPI/test/cmake/AmRoutingInterfaceCAPITests_dbus.conf.in create mode 100644 PluginRoutingInterfaceCAPI/test/cmake/CAmRoutingSenderService.h.in create mode 100755 PluginRoutingInterfaceCAPI/test/cmake/RoutingSender_dbus.conf.in create mode 100644 PluginRoutingInterfaceCAPI/test/cmake/config.cmake create mode 100644 cmake/FindCommonAPI.cmake create mode 100644 cmake/FindCommonAPI_DBus.cmake mode change 100755 => 100644 include/projecttypes.h create mode 100644 include/shared/CAmCommonAPIWrapper.h diff --git a/AudioManagerDaemon/CMakeLists.txt b/AudioManagerDaemon/CMakeLists.txt index 66931f7..c122841 100644 --- a/AudioManagerDaemon/CMakeLists.txt +++ b/AudioManagerDaemon/CMakeLists.txt @@ -44,6 +44,11 @@ ENDIF(WITH_DBUS_WRAPPER) FIND_PACKAGE(NSM REQUIRED) +IF(WITH_CAPI_WRAPPER) + FIND_PACKAGE(CommonAPI REQUIRED) + FIND_PACKAGE(CommonAPI_DBus REQUIRED) +ENDIF(WITH_CAPI_WRAPPER) + SET(AUDIOMAN_SRCS_CXX src/main.cpp src/CAmCommandReceiver.cpp @@ -56,6 +61,7 @@ SET(AUDIOMAN_SRCS_CXX src/CAmRouter.cpp src/CAmSocketHandler.cpp src/CAmDltWrapper.cpp + src/CAmLog.cpp ) # Preallocation variable for the map. @@ -95,11 +101,25 @@ IF(WITH_DBUS_WRAPPER) ) ENDIF(WITH_DBUS_WRAPPER) -IF(WITH_NSM) +IF(WITH_CAPI_WRAPPER) SET (AUDIOMAN_SRCS_CXX ${AUDIOMAN_SRCS_CXX} - src/CAmNodeStateCommunicator.cpp + src/CAmCommonAPIWrapper.cpp ) +ENDIF(WITH_CAPI_WRAPPER) + +IF(WITH_NSM) + IF(WITH_DBUS_WRAPPER) + SET (AUDIOMAN_SRCS_CXX + ${AUDIOMAN_SRCS_CXX} + src/CAmNodeStateCommunicatorDBus.cpp + ) + ELSE(WITH_DBUS_WRAPPER) + SET (AUDIOMAN_SRCS_CXX + ${AUDIOMAN_SRCS_CXX} + src/CAmNodeStateCommunicatorCAPI.cpp + ) + ENDIF(WITH_DBUS_WRAPPER) ENDIF(WITH_NSM) IF(WITH_DATABASE_STORAGE) @@ -123,6 +143,14 @@ INCLUDE_DIRECTORIES( ${NSM_INCLUDE_DIR} ) +IF(WITH_CAPI_WRAPPER) +INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} + ${COMMON_API_INCLUDE_DIRS} + ${COMMON_API_DBUS_INCLUDE_DIRS} + ${COMMON_API_GEN_INCLUDE_DIR} +) +ENDIF(WITH_CAPI_WRAPPER) + IF(WITH_DLT) INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${DLT_INCLUDE_DIRS} @@ -136,22 +164,27 @@ INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ) ENDIF(WITH_DBUS_WRAPPER) -ADD_EXECUTABLE(AudioManager ${AUDIOMAN_SRCS_CXX}) +file(GLOB ${AUDIOMAN_SRCS_CXX} ${COMMON_API_GEN_SOURCES}) -IF(WITH_DBUS_WRAPPER) +ADD_EXECUTABLE(AudioManager ${AUDIOMAN_SRCS_CXX} ${COMMON_API_GEN_SOURCES}) + +TARGET_LINK_LIBRARIES(AudioManager + ${SQLITE_LIBRARIES} + ${CMAKE_DL_LIBS} + ) + + IF(WITH_DBUS_WRAPPER) TARGET_LINK_LIBRARIES(AudioManager - ${SQLITE_LIBRARIES} - ${CMAKE_DL_LIBS} ${DBUS_LIBRARY} rt ) -ELSE(WITH_DBUS_WRAPPER) +ELSEIF(WITH_CAPI_WRAPPER) TARGET_LINK_LIBRARIES(AudioManager - ${SQLITE_LIBRARIES} - ${CMAKE_DL_LIBS} + ${COMMON_API_LIBRARIES} + ${COMMON_API_DBUS_LIBRARIES} rt ) -ENDIF(WITH_DBUS_WRAPPER) +ENDIF() IF(WITH_DLT) TARGET_LINK_LIBRARIES(AudioManager @@ -165,14 +198,18 @@ IF (SYSTEMD_FOUND) ) ENDIF (SYSTEMD_FOUND) -#IF(WITH_DOCUMENTATION) -# file(MAKE_DIRECTORY ${DOC_OUTPUT_PATH}) -# configure_file(${DOXY_FILE} ${DOC_OUTPUT_PATH}/Doxyfile @ONLY IMMEDIATE) -# add_custom_target (Docs ALL -# COMMAND ${DOXYGEN_EXECUTABLE} ${DOC_OUTPUT_PATH}/Doxyfile WORKING_DIRECTORY ${DOC_OUTPUT_PATH} -# SOURCES ${PROJECT_BINARY_DIR} ${DOC_OUTPUT_PATH}/Doxyfile -# ) -#ENDIF(WITH_DOCUMENTATION) +IF(WITH_CAPI_WRAPPER) + IF(WITH_NSM) + INSERT_DBUS_CONF_IF_NEEDED("@NSM_DBUS_CONF@" + "${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf" + NSM_DBUS_CONF) + ENDIF(WITH_NSM) +# Generates the dbus configuration file. Every component is responsible to append it dbus configuration part. +CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf) +CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/AudioManagerDaemon/fidls/AudioManager_dbus.conf.in ${CMAKE_BINARY_DIR}/AudioManager_dbus.conf) + +ENDIF(WITH_CAPI_WRAPPER) + INSTALL(TARGETS AudioManager RUNTIME @@ -191,11 +228,12 @@ IF(WITH_NSM) SET(NSM_INTROSPECTION_FILE ${EXECUTABLE_OUTPUT_PATH}/LifeCycleConsumer.xml) execute_process( COMMAND mkdir -p "${CMAKE_SOURCE_DIR}/bin" - COMMAND cp "${CMAKE_SOURCE_DIR}/cmake/LifecycleConsumer.xml" ${NSM_INTROSPECTION_FILE}) + COMMAND cp "${CMAKE_SOURCE_DIR}/cmake/LifecycleConsumer.xml" ${NSM_INTROSPECTION_FILE} + COMMAND cp "${CMAKE_BINARY_DIR}/AudioManager_dbus.conf" ${EXECUTABLE_OUTPUT_PATH}) ELSE(USE_BUILD_LIBS) - SET(NSM_INTROSPECTION_FILE ${CMAKE_INSTALL_PREFIX}/share/audiomanager/LifeCycleConsumer.xml) + SET(NSM_INTROSPECTION_FILE ${CMAKE_INSTALL_PREFIX}/share/audiomanager/LifecycleConsumer.xml) INSTALL( - FILES ${CMAKE_SOURCE_DIR}/cmake/LifecycleConsumer.xml + FILES ${CMAKE_SOURCE_DIR}/cmake/LifecycleConsumer.xml #${CMAKE_BINARY_DIR}/AudioManager_dbus.conf DESTINATION "${NSM_INTROSPECTION_FILE}" COMPONENT bin) ENDIF(USE_BUILD_LIBS) @@ -219,11 +257,13 @@ ENDIF(WITH_DLT) IF(WITH_DBUS_WRAPPER) SET(ADD_DEPEND_BIN_PROP ${ADD_DEPEND_BIN_PROP} "libdbus-1-3(>=1.2.16)") -ENDIF() +ENDIF(WITH_DBUS_WRAPPER) # Additional Dev packet dependency SET(ADD_DEPEND_DEV_PROP "audiomanager-bin" ${ADD_DEPEND_BIN_PROP}) +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -fno-common -fno-strict-aliasing -DNDEBUG") + MESSAGE(STATUS "bin packet dependency: ${ADD_DEPEND_BIN_PROP}") MESSAGE(STATUS "dev dependency: ${ADD_DEPEND_DEV_PROP}") diff --git a/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fdepl b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fdepl new file mode 100644 index 0000000..b92bb71 --- /dev/null +++ b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fdepl @@ -0,0 +1,6 @@ +import "platform:/plugin/org.genivi.commonapi.dbus/deployment/deployment.fdepl" +import "NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl" + +define org.genivi.commonapi.dbus.deployment.deployment for interface org.genivi.NodeStateManager.Consumer.Consumer { + PropertiesType=freedesktop +} diff --git a/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl new file mode 100755 index 0000000..6e6f224 --- /dev/null +++ b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.Consumer.fidl @@ -0,0 +1,127 @@ +package org.genivi.NodeStateManager.Consumer + +//interface org.genivi.NodeStateManager.Consumer { +interface Consumer { + + version { major 0 minor 1 } + + attribute Int32 RestartReason + + attribute Int32 ShutdownReason + + attribute Int32 WakeUpReason + + attribute Int32 BootMode + + method GetNodeState { + out { + Int32 NodeStateId + Int32 ErrorCode + } + } + method SetSessionState { + in { + String SessionName + String SessionOwner + Int32 SeatID + Int32 SessionState + } + out { + Int32 ErrorCode + } + } + method GetSessionState { + in { + String SessionName + Int32 SeatID + } + out { + Int32 SessionState + Int32 ErrorCode + } + } + method GetApplicationMode { + out { + Int32 ApplicationModeId + Int32 ErrorCode + } + } + method RegisterShutdownClient { + in { + String BusName + String ObjName + UInt32 ShutdownMode + UInt32 TimeoutMs + } + out { + Int32 ErrorCode + } + } + method UnRegisterShutdownClient { + in { + String BusName + String ObjName + UInt32 ShutdownMode + } + out { + Int32 ErrorCode + } + } + method RegisterSession { + in { + String SessionName + String SessionOwner + Int32 SeatID + Int32 SessionState + } + out { + Int32 ErrorCode + } + } + method UnRegisterSession { + in { + String SessionName + String SessionOwner + Int32 SeatID + } + out { + Int32 ErrorCode + } + } + method GetAppHealthCount { + out { + UInt32 Count + } + } + method GetInterfaceVersion { + out { + UInt32 Version + } + } + method LifecycleRequestComplete { + in { + UInt32 RequestId + Int32 Status + } + out { + Int32 ErrorCode + } + } + broadcast NodeState { + out { + Int32 NodeState + } + } + broadcast NodeApplicationMode { + out { + Int32 ApplicationModeId + } + } + broadcast SessionStateChanged { + out { + String SessionStateName + Int32 SeatID + Int32 SessionState + } + } +} \ No newline at end of file diff --git a/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.LifecycleConsumer.fidl b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.LifecycleConsumer.fidl new file mode 100755 index 0000000..e32c1c6 --- /dev/null +++ b/AudioManagerDaemon/fidls/NodeStateAccessStub_model_org.genivi.NodeStateManager.LifecycleConsumer.fidl @@ -0,0 +1,16 @@ +package org.genivi.NodeStateManager.LifeCycleConsumer + +//interface org.genivi.NodeStateManager.LifeCycleConsumer { +interface LifeCycleConsumer { + + version { major 0 minor 1 } + method LifecycleRequest { + in { + UInt32 Request + UInt32 RequestId + } + out { + Int32 ErrorCode + } + } +} \ No newline at end of file diff --git a/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf b/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf new file mode 100755 index 0000000..3f0b04e --- /dev/null +++ b/AudioManagerDaemon/fidls/NodeStateManager_dbus.conf @@ -0,0 +1,33 @@ +######################################### Node state manager configuration ####################################### +# NodeStateManager_dbus.conf # +# If you change something make sure you re-configure with 'ccmake..' which generates the *_dbus.conf file again. # +################################################################################################################## +# +# Copyright (C) 2012, BMW AG +# +# This file is part of GENIVI Project AudioManager. +# +# Contributions are licensed to the GENIVI Alliance under one or more +# Contribution License Agreements. +# +# \copyright +# This Source Code Form is subject to the terms of the +# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with +# this file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# +# \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 +# +# For further information see http://www.genivi.org/. +# + +[local:org.genivi.NodeStateManager.Consumer:org.genivi.NodeStateManager] +dbus_connection=org.genivi.NodeStateManager +dbus_object=/org/genivi/NodeStateManager +dbus_interface=org.genivi.NodeStateManager.Consumer +dbus_predefined=true +[local:org.genivi.NodeStateManager.LifeCycleConsumer:org.genivi.audiomanger] +dbus_connection=org.genivi.audiomanager +dbus_object=/org/genivi/audiomanager/LifeCycleConsumer +dbus_interface=org.genivi.NodeStateManager.LifeCycleConsumer +dbus_predefined=true \ No newline at end of file diff --git a/AudioManagerDaemon/fidls/amTypes.fidl b/AudioManagerDaemon/fidls/amTypes.fidl new file mode 100755 index 0000000..9798dd7 --- /dev/null +++ b/AudioManagerDaemon/fidls/amTypes.fidl @@ -0,0 +1,330 @@ +package org.genivi + +typeCollection am +{ + typedef am_sourceID_t is UInt16 + typedef am_sinkID_t is UInt16 + typedef am_gatewayID_t is UInt16 + typedef gongHandle is Int16 + typedef am_sourceClass_t is UInt16 + typedef am_sinkClass_t is UInt16 + typedef am_volume_t is Int16 + typedef am_mainVolume_t is Int16 + typedef am_handle_t is UInt16 + typedef am_time_t is UInt16 + typedef am_connectionID_t is UInt16 + + enumeration gp_indicatorDirection_e + { + INDICATOR_RIGHT ="0x00" + INDICATOR_LEFT="0x01" + INDICATOR_WARNING="0x02" + } + + enumeration am_RampType_e + { + RAMP_UNKNOWN = "0x00" + RAMP_GENIVI_DIRECT = "0x01" + RAMP_GENIVI_NO_PLOP = "0x02" + RAMP_GENIVI_EXP_INV = "0x03" + RAMP_GENIVI_LINEAR = "0x04" + RAMP_GENIVI_EXP = "0x05" + RAMP_MAX + } + + enumeration am_MuteState_e + { + MS_UNKNOWN = "0x00" + MS_MUTED = "0x01" + MS_UNMUTED = "0x02" + MS_MAX + } + + enumeration am_SourceState_e + { + SS_UNKNNOWN = "0x00" + SS_ON = "0x01" + SS_OFF = "0x02" + SS_PAUSED = "0x03" + SS_MAX + } + enumeration am_Error_e + { + E_OK = "0x00" + E_UNKNOWN = "0x01" + E_OUT_OF_RANGE = "0x02" + E_NOT_USED = "0x03" + E_DATABASE_ERROR = "0x04" + E_ALREADY_EXISTS = "0x05" + E_NO_CHANGE = "0x06" + E_NOT_POSSIBLE = "0x07" + E_NON_EXISTENT = "0x08" + E_ABORTED = "0x09" + E_WRONG_FORMAT = "0xA" + E_MAX + } + + enumeration am_DomainState_e + { + + DS_UNKNOWN = "0" + DS_CONTROLLED = "1" + DS_INDEPENDENT_STARTUP = "2" + DS_INDEPENDENT_RUNDOWN = "3" + DS_MAX + } + + enumeration gongType_e + { + AT_NUN = "0x01" + AT_POC = "0x02" + AT_QUE = "0x03" + AT_IWA = "0x04" + AT_WA = "0x05" + AT_ETC_F = "0x06" + AT_ETC_F2 = "0x07" + AT_ETC_ST = "0x08" + AT_ETC_S = "0x09" + AT_REV = "0x0A" + AT_ESU = "0x0B" + AT_ESD = "0x0C" + AT_DG = "0x0D" + AT_SG = "0x0E" + AT_IDG = "0x0F" + AT_ION = "0x10" + AT_IOFF = "0x11" + AT_FBS = "0x12" + AT_VFS = "0x13" + AT_GES = "0x14" + AT_UEE = "0x15" + } + + enumeration gp_indicatorStatus_e + { + IS_ON = "0x00" + IS_OFF = "0x01" + } + + enumeration gongStatus_e + { + NOT_PLAYING = "0x00" + PLAYING = "0x01" + INTERRUPTED = "0x02" + } + + enumeration gongError_e + { + SUCCESS = "0x00" + ERROR = "0x01" + LOW_PRIORITY = "0x02" + } + + enumeration gongClass_e + { + GONGCLASS_1 = "0x01" + GONGCLASS_2 = "0x02" + GONGCLASS_PDC = "0x03" + GONGCLASS_TURN = "0x04" + GONGCLASS_OBSTACLE = "0x05" + } + + enumeration sampleSet_e + { + setBMW = "0x00" + setMini = "0x01" + setRR = "0x02" + } + + enumeration am_Availability_e + { + A_UNKNOWN = "0x00" + A_AVAILABLE = "0x01" + A_UNAVAILABLE = "0x02" + A_MAX + } + enumeration am_AvailabilityReason_e + { + AR_UNKNOWN = "0x00" + AR_GENIVI_NEWMEDIA = "0x01" + AR_GENIVI_SAMEMEDIA = "0x02" + AR_GENIVI_NOMEDIA = "0x03" + AR_GENIVI_TEMPERATURE = "0x04" + AR_GENIVI_VOLTAGE = "0x05" + AR_GENIVI_ERRORMEDIA = "0x06" + AR_MAX + } + + enumeration am_InterruptState_e + { + IS_UNKNOWN = "0x00" + IS_OFF = "0x01" + IS_INTERRUPTED = "0x02" + IS_MAX + } + + enumeration am_SoundPropertyType_e + { + SP_UNKNOWN = "0x00" + SP_EXAMPLE_TREBLE = "0x01" + SP_EXAMPLE_MID = "0x02" + SP_EXAMPLE_BASS = "0x03" + SP_ENTER_SINKID = "0x04" + SP_INTERR_SUPERSEEDINGID = "0x05" + SP_INTERR_OVERLAYID = "0x06" + SP_PRIORITY = "0x07" + SP_MAX + } + + enumeration am_ConnectionFormat_e + { + CF_UNKNOWN = "0x00" + CF_GENIVI_MONO = "0x01" + CF_GENIVI_STEREO = "0x02" + CF_GENIVI_ANALOG = "0x03" + CF_GENIVI_AUTO = "0x04" + CF_MAX + } + array am_ConnectionFormat_L of am_ConnectionFormat_e + + enumeration am_MainSoundPropertyType_e + { + MSP_UNKNOWN = "0x00" + MSP_EXAMPLE_TREBLE = "0x01" + MSP_EXAMPLE_MID = "0x02" + MSP_EXAMPLE_BASS = "0x03" + MSP_SOURCE_TYPE = "0x04" + MSP_MAX + } + + enumeration am_NotificationType_e + { + NT_UNKNOWN = "0x00" + NT_LOUDNESS = "0x01" + NT_MAX + } + + enumeration am_NotificationStatus_e + { + NS_UNKNOWN = "0x00" + NS_OFF = "0x01" + NS_PERIODIC = "0x02" + NS_MINIMUM = "0x03" + NS_MAXIMUM = "0x04" + NS_CHANGE = "0x05" + NS_MAX + } + + struct distanceInformation_s + { + Int32 FrontLeft + Int32 FrontRight + Int32 RearLeft + Int32 RearRight + } + + struct sampleNames_s + { + sampleSet_e sample + String sampleName + } array listSampleNamesL of sampleNames_s + + typedef am_domainID_t is UInt16 + + struct am_Domain_s + { + am_domainID_t domainID + String name + String busname + String nodename + Boolean early + Boolean complete + am_DomainState_e ^state + } + + struct notificationPayload_s + { + Int16 type + Int16 payload + } + + struct am_Availability_s + { + am_Availability_e availability + am_AvailabilityReason_e availabilityReason + } + + struct am_SoundProperty_s + { + am_SoundPropertyType_e type + Int16 value + } + array am_SoundProperty_L of am_SoundProperty_s + + struct am_MainSoundProperty_s + { + am_MainSoundPropertyType_e type + Int16 value + } + array am_MainSoundProperty_L of am_MainSoundProperty_s + + struct am_NotificationConfiguration_s + { + am_NotificationType_e type + am_NotificationStatus_e status + Int16 parameter + } + array am_NotificationConfiguration_L of am_NotificationConfiguration_s + + + array bool_L of Boolean + + struct sourceData_s + { + am_sourceID_t sourceID + am_domainID_t domainID + String name + am_sourceClass_t sourceClassID + am_SourceState_e sourceState + am_volume_t volume + Boolean visible + am_Availability_s available + am_InterruptState_e interruptState + am_SoundProperty_L listSoundProperties + am_ConnectionFormat_L listConnectionFormats + am_MainSoundProperty_L listMainSoundProperties + am_NotificationConfiguration_L listMainNotificationConfigurations + am_NotificationConfiguration_L listNotificationConfigurations + } + + struct sinkData_s + { + am_sinkID_t sinkID + String name + am_domainID_t domainID + am_sinkClass_t sinkClassID + am_volume_t volume + Boolean visible + am_Availability_s available + am_MuteState_e muteState + am_mainVolume_t mainVolume + am_SoundProperty_L listSoundProperties + am_ConnectionFormat_L listConnectionFormats + am_MainSoundProperty_L listMainSoundProperties + am_NotificationConfiguration_L listMainNotificationConfigurations + am_NotificationConfiguration_L listNotificationConfigurations + } + + struct am_Gateway_s + { + am_gatewayID_t gatewayID + String name + am_sinkID_t sinkID + am_sourceID_t sourceID + am_domainID_t domainSinkID + am_domainID_t domainSourceID + am_domainID_t controlDomainID + am_ConnectionFormat_L listSourceFormats + am_ConnectionFormat_L listSinkFormats + bool_L convertionMatrix + } +} \ No newline at end of file diff --git a/AudioManagerDaemon/include/CAmNodeStateCommunicator.h b/AudioManagerDaemon/include/CAmNodeStateCommunicator.h index dfc6689..8cf0dce 100644 --- a/AudioManagerDaemon/include/CAmNodeStateCommunicator.h +++ b/AudioManagerDaemon/include/CAmNodeStateCommunicator.h @@ -13,16 +13,22 @@ * * * \author Christian Linke, christian.linke@bmw.de BMW 2012 + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 * * \file CAmNodeStateCommunicator.h * For further information see http://www.genivi.org/. * */ -#ifndef CAMNODESTATECOMMUNICATOR_H_ -#define CAMNODESTATECOMMUNICATOR_H_ -#include "shared/CAmDbusWrapper.h" +#ifndef CAMNODESTATECOMMUNICATORBASE_H_ +#define CAMNODESTATECOMMUNICATORBASE_H_ + +#include +#include "config.h" #include "NodeStateManager.h" +#include "audiomanagertypes.h" + + namespace am { @@ -30,43 +36,37 @@ namespace am class CAmControlSender; /** communicates with the NSM - * The CAmNodeStateCommunicator communicates with the NodeStateManager via Dbus. Only works, if CAmDBusWrapper is enabled. + * The CAmNodeStateCommunicator communicates with the NodeStateManager. * The CAmNodeStateCommunicator is triggered via CAmControlReceiver, so you can communicate from the ControllerPlugin with it. - * Most if the interfaces are passive, so you get the information you need via retrieving it. If you need to register the AudioManager + * Most of the interfaces are passive, so you get the information you need via retrieving it. If you need to register the AudioManager * as LifeCycleConsumer, you need to call CAmNodeStateCommunicator::nsmRegisterShutdownClient which can be undone with CAmNodeStateCommunicator::nsmUnRegisterShutdownClient. * After you have registered, you will get hookSystemLifecycleRequest on the ControlSendInterface of the controller. * You should answer this within your set timeout with CAmNodeStateCommunicator::nsmSendLifecycleRequestComplete. */ + class CAmNodeStateCommunicator { -public: - CAmNodeStateCommunicator(CAmDbusWrapper* iDbusWrapper); - virtual ~CAmNodeStateCommunicator(); - am_Error_e nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason) ; - am_Error_e nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) ; - am_Error_e nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) ; - NsmErrorStatus_e nsmGetNodeState(NsmNodeState_e& nsmNodeState) ; - NsmErrorStatus_e nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) ; - NsmErrorStatus_e nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) ; - NsmErrorStatus_e nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) ; - NsmErrorStatus_e nsmUnRegisterShutdownClient(const uint32_t shutdownMode) ; - am_Error_e nsmGetInterfaceVersion(uint32_t& version) ; - NsmErrorStatus_e nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) ; - - void registerControlSender(CAmControlSender* iControlSender); - static DBusHandlerResult receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data); - static DBusHandlerResult signalCallback(DBusConnection *conn, DBusMessage *msg, void *user_data); - - -private: - void sendIntrospection(DBusConnection* conn, DBusMessage* msg); - void sendMessage(DBusMessage* message, DBusMessage* origMessage); - DBusHandlerResult receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg); - am_Error_e readIntegerProperty(const std::string property, int32_t &value); - CAmDbusWrapper* mpDbusWrapper; +protected: CAmControlSender* mpControlSender; - DBusConnection* mpDBusConnection; +public: + CAmNodeStateCommunicator():mpControlSender(NULL) {} + virtual ~CAmNodeStateCommunicator() {} + virtual am_Error_e nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason) = 0; + virtual am_Error_e nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) = 0; + virtual am_Error_e nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) = 0; + virtual NsmErrorStatus_e nsmGetNodeState(NsmNodeState_e& nsmNodeState) = 0; + virtual NsmErrorStatus_e nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) = 0; + virtual NsmErrorStatus_e nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) = 0; + virtual NsmErrorStatus_e nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) = 0; + virtual NsmErrorStatus_e nsmUnRegisterShutdownClient(const uint32_t shutdownMode) = 0; + virtual am_Error_e nsmGetInterfaceVersion(uint32_t& version) = 0; + virtual NsmErrorStatus_e nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) = 0; + virtual void registerControlSender(CAmControlSender* iControlSender) { + assert(NULL!=iControlSender); + mpControlSender = iControlSender; + } }; -} /* namespace am */ -#endif /* CAMNODESTATECOMMUNICATOR_H_ */ +} + +#endif /* CAMNODESTATECOMMUNICATORBASE_H_ */ diff --git a/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h b/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h new file mode 100644 index 0000000..6c063e5 --- /dev/null +++ b/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h @@ -0,0 +1,101 @@ +/** + * Copyright (C) 2012, BMW AG + * + * This file is part of GENIVI Project AudioManager. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * \file CAmNodeStateCommunicatorCAPI.h + * For further information see http://www.genivi.org/. + * + */ +#ifndef CAMNODESTATECOMMUNICATORCAPI_H_ +#define CAMNODESTATECOMMUNICATORCAPI_H_ + +#include +#include "CAmNodeStateCommunicator.h" +#include "LifeCycleConsumerStubDefault.h" + +namespace am +{ +using namespace CommonAPI; +using namespace org::genivi::NodeStateManager::Consumer; +using namespace org::genivi::NodeStateManager::LifeCycleConsumer; + + +class CAmCommonAPIWrapper; +/** communicates with the NSM + * The CAmNodeStateCommunicator communicates with the NodeStateManager via Dbus Common-API's wrapping mechanism. Only works, if CAmCommonAPIWrapper is enabled. + */ +class CAmNodeStateCommunicatorCAPI : public CAmNodeStateCommunicator +{ + /* A concrete implementation of the life cycle stub. + * An object from this class is instantiated from the common-api factory. + * It forwards the invocations to its delegate CAmNodeStateCommunicatorCAPI. + */ + class CAmNodeStateCommunicatorServiceImpl : public LifeCycleConsumerStubDefault + { + CAmNodeStateCommunicatorCAPI *mpDelegate; + public: + CAmNodeStateCommunicatorServiceImpl ():mpDelegate(NULL) {} + CAmNodeStateCommunicatorServiceImpl (CAmNodeStateCommunicatorCAPI *aNSCommunicator):mpDelegate(aNSCommunicator) {} + ~CAmNodeStateCommunicatorServiceImpl() { mpDelegate = NULL; } + + CAmNodeStateCommunicatorCAPI *getDelegate() { return mpDelegate; }; + void setDelegate(CAmNodeStateCommunicatorCAPI *aDelegate) { mpDelegate = aDelegate; }; + + void LifecycleRequest(uint32_t Request, uint32_t RequestId, int32_t& ErrorCode) { + if(mpDelegate) + mpDelegate->cbReceivedLifecycleRequest(Request, RequestId, ErrorCode); + } + }; + + CAmCommonAPIWrapper *mpCAPIWrapper; + std::shared_ptr > mNSMProxy; + std::shared_ptr mNSMStub; +public: + CAmNodeStateCommunicatorCAPI(CAmCommonAPIWrapper* iCAPIWrapper); + virtual ~CAmNodeStateCommunicatorCAPI(); + + am_Error_e nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason) ; + am_Error_e nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) ; + am_Error_e nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) ; + NsmErrorStatus_e nsmGetNodeState(NsmNodeState_e& nsmNodeState) ; + NsmErrorStatus_e nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) ; + NsmErrorStatus_e nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) ; + NsmErrorStatus_e nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) ; + NsmErrorStatus_e nsmUnRegisterShutdownClient(const uint32_t shutdownMode) ; + am_Error_e nsmGetInterfaceVersion(uint32_t& version) ; + NsmErrorStatus_e nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) ; + + bool isServiceAvailable(); + + static const char * CLIENT_STRING; + static const char * SERVER_STRING; + static const char * OBJECT_NAME; + static const char * BUS_NAME; + +private: + /* Client events */ + void onNodeStateEvent(const int32_t nodeState); + void onNodeApplicationModeEvent(const int32_t nodeApplicationMode); + void onSessionStateChangedEvent(const std::string & sessionName, const int32_t seatID, const int32_t sessionState); + void onServiceStatusEvent(const CommonAPI::AvailabilityStatus& serviceStatus); + /* Service callbacks */ + void cbReceivedLifecycleRequest(uint32_t Request, uint32_t RequestId, int32_t& ErrorCode); +protected: + bool mIsServiceAvailable; +}; + +} +/* namespace am */ +#endif /* CAMNODESTATECOMMUNICATORCAPI_H_ */ diff --git a/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h b/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h new file mode 100644 index 0000000..cb78f0f --- /dev/null +++ b/AudioManagerDaemon/include/CAmNodeStateCommunicatorDBus.h @@ -0,0 +1,63 @@ +/** + * Copyright (C) 2012, BMW AG + * + * This file is part of GENIVI Project AudioManager. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Christian Linke, christian.linke@bmw.de BMW 2012 + * + * \file CAmNodeStateCommunicatorDBus.h + * For further information see http://www.genivi.org/. + * + */ +#ifndef CAMNODESTATECOMMUNICATORDBUS_H_ +#define CAMNODESTATECOMMUNICATORDBUS_H_ + +#include "shared/CAmDbusWrapper.h" +#include "CAmNodeStateCommunicator.h" + +namespace am +{ +/** communicates with the NSM + * The CAmNodeStateCommunicator communicates with the NodeStateManager via Dbus. Only works, if CAmDbusWrapper is enabled. + */ + +class CAmNodeStateCommunicatorDBus : public CAmNodeStateCommunicator +{ +public: + CAmNodeStateCommunicatorDBus(CAmDbusWrapper* iDbusWrapper); + virtual ~CAmNodeStateCommunicatorDBus(); + am_Error_e nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason) ; + am_Error_e nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) ; + am_Error_e nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) ; + NsmErrorStatus_e nsmGetNodeState(NsmNodeState_e& nsmNodeState) ; + NsmErrorStatus_e nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) ; + NsmErrorStatus_e nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) ; + NsmErrorStatus_e nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) ; + NsmErrorStatus_e nsmUnRegisterShutdownClient(const uint32_t shutdownMode) ; + am_Error_e nsmGetInterfaceVersion(uint32_t& version) ; + NsmErrorStatus_e nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) ; + + static DBusHandlerResult receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data); + static DBusHandlerResult signalCallback(DBusConnection *conn, DBusMessage *msg, void *user_data); + + +private: + void sendIntrospection(DBusConnection* conn, DBusMessage* msg); + void sendMessage(DBusMessage* message, DBusMessage* origMessage); + DBusHandlerResult receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg); + am_Error_e readIntegerProperty(const std::string property, int32_t &value); + CAmDbusWrapper* mpDbusWrapper; + DBusConnection* mpDBusConnection; +}; + +} /* namespace am */ +#endif /* CAMNODESTATECOMMUNICATORDBUS_H_ */ diff --git a/AudioManagerDaemon/include/TAmPluginTemplate.h b/AudioManagerDaemon/include/TAmPluginTemplate.h index 2959b04..a421cd1 100644 --- a/AudioManagerDaemon/include/TAmPluginTemplate.h +++ b/AudioManagerDaemon/include/TAmPluginTemplate.h @@ -46,10 +46,9 @@ template T* getCreateFunction(const std::string& libname, void*& librar // cut off "lib" in front and cut off .so end" std::string createFunctionName = libFileName.substr(3, libFileName.length() - 6) + "Factory"; - // open library dlerror(); // Clear any existing error - libraryHandle = dlopen(libname.c_str(), RTLD_LAZY); + libraryHandle = dlopen(libname.c_str(), RTLD_LAZY ); const char* dlopen_error = dlerror(); if (!libraryHandle || dlopen_error) { diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h new file mode 100644 index 0000000..345bd3b --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h @@ -0,0 +1,70 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2012, BMW AG + * + * This file is part of GENIVI Project AudioManager. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_H_ +#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_H_ + + + +#define COMMONAPI_INTERNAL_COMPILATION + +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +class Consumer { + public: + virtual ~Consumer() { } + + static inline const char* getInterfaceId(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* Consumer::getInterfaceId() { + return "org.genivi.NodeStateManager.Consumer.Consumer"; +} + +CommonAPI::Version Consumer::getInterfaceVersion() { + return CommonAPI::Version(0, 1); +} + + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +namespace CommonAPI { + +} + + +namespace std { + //hashes for types + + //hashes for error types +} + +#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_H_ diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp new file mode 100644 index 0000000..e920d51 --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp @@ -0,0 +1,292 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2012, BMW AG + * + * This file is part of GENIVI Project AudioManager. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * For further information see http://www.genivi.org/. +*/ +#include "ConsumerDBusProxy.h" + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +std::shared_ptr createConsumerDBusProxy( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyConnection) { + return std::make_shared(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection); +} + +__attribute__((constructor)) void registerConsumerDBusProxy(void) { + CommonAPI::DBus::DBusFactory::registerProxyFactoryMethod(Consumer::getInterfaceId(), + &createConsumerDBusProxy); +} + +ConsumerDBusProxy::ConsumerDBusProxy( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyconnection): + CommonAPI::DBus::DBusProxy(commonApiAddress, interfaceName, busName, objectPath, dbusProxyconnection) +, restartReason_(*this, interfaceName.c_str(), "RestartReason"), + shutdownReason_(*this, interfaceName.c_str(), "ShutdownReason"), + wakeUpReason_(*this, interfaceName.c_str(), "WakeUpReason"), + bootMode_(*this, interfaceName.c_str(), "BootMode") +, nodeState_(*this, "NodeState", "i"), + nodeApplicationMode_(*this, "NodeApplicationMode", "i"), + sessionStateChanged_(*this, "SessionStateChanged", "sii") + { +} + +ConsumerDBusProxy::RestartReasonAttribute& ConsumerDBusProxy::getRestartReasonAttribute() { + return restartReason_; +} +ConsumerDBusProxy::ShutdownReasonAttribute& ConsumerDBusProxy::getShutdownReasonAttribute() { + return shutdownReason_; +} +ConsumerDBusProxy::WakeUpReasonAttribute& ConsumerDBusProxy::getWakeUpReasonAttribute() { + return wakeUpReason_; +} +ConsumerDBusProxy::BootModeAttribute& ConsumerDBusProxy::getBootModeAttribute() { + return bootMode_; +} + +ConsumerDBusProxy::NodeStateEvent& ConsumerDBusProxy::getNodeStateEvent() { + return nodeState_; +} +ConsumerDBusProxy::NodeApplicationModeEvent& ConsumerDBusProxy::getNodeApplicationModeEvent() { + return nodeApplicationMode_; +} +ConsumerDBusProxy::SessionStateChangedEvent& ConsumerDBusProxy::getSessionStateChangedEvent() { + return sessionStateChanged_; +} + +void ConsumerDBusProxy::GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetNodeState", + "", + callStatus + , NodeStateId, ErrorCode); +} +std::future ConsumerDBusProxy::GetNodeStateAsync(GetNodeStateAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetNodeState", + "", + std::move(callback)); +} +void ConsumerDBusProxy::SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "SetSessionState", + "ssii", + SessionName, SessionOwner, SeatID, SessionState, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "SetSessionState", + "ssii", + SessionName, SessionOwner, SeatID, SessionState, + std::move(callback)); +} +void ConsumerDBusProxy::GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetSessionState", + "si", + SessionName, SeatID, + callStatus + , SessionState, ErrorCode); +} +std::future ConsumerDBusProxy::GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetSessionState", + "si", + SessionName, SeatID, + std::move(callback)); +} +void ConsumerDBusProxy::GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetApplicationMode", + "", + callStatus + , ApplicationModeId, ErrorCode); +} +std::future ConsumerDBusProxy::GetApplicationModeAsync(GetApplicationModeAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetApplicationMode", + "", + std::move(callback)); +} +void ConsumerDBusProxy::RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "RegisterShutdownClient", + "ssuu", + BusName, ObjName, ShutdownMode, TimeoutMs, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "RegisterShutdownClient", + "ssuu", + BusName, ObjName, ShutdownMode, TimeoutMs, + std::move(callback)); +} +void ConsumerDBusProxy::UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "UnRegisterShutdownClient", + "ssu", + BusName, ObjName, ShutdownMode, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "UnRegisterShutdownClient", + "ssu", + BusName, ObjName, ShutdownMode, + std::move(callback)); +} +void ConsumerDBusProxy::RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "RegisterSession", + "ssii", + SessionName, SessionOwner, SeatID, SessionState, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "RegisterSession", + "ssii", + SessionName, SessionOwner, SeatID, SessionState, + std::move(callback)); +} +void ConsumerDBusProxy::UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "UnRegisterSession", + "ssi", + SessionName, SessionOwner, SeatID, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "UnRegisterSession", + "ssi", + SessionName, SessionOwner, SeatID, + std::move(callback)); +} +void ConsumerDBusProxy::GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetAppHealthCount", + "", + callStatus + , Count); +} +std::future ConsumerDBusProxy::GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetAppHealthCount", + "", + std::move(callback)); +} +void ConsumerDBusProxy::GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetInterfaceVersion", + "", + callStatus + , Version); +} +std::future ConsumerDBusProxy::GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetInterfaceVersion", + "", + std::move(callback)); +} +void ConsumerDBusProxy::LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "LifecycleRequestComplete", + "ui", + RequestId, Status, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "LifecycleRequestComplete", + "ui", + RequestId, Status, + std::move(callback)); +} + +void ConsumerDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 0; + ownVersionMinor = 1; +} + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h new file mode 100644 index 0000000..c3db1df --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h @@ -0,0 +1,114 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2012, BMW AG + * + * This file is part of GENIVI Project AudioManager. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_PROXY_H_ +#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_PROXY_H_ + +#include + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +class ConsumerDBusProxy: virtual public ConsumerProxyBase, virtual public CommonAPI::DBus::DBusProxy { + public: + ConsumerDBusProxy( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyconnection); + + virtual ~ConsumerDBusProxy() { } + + virtual RestartReasonAttribute& getRestartReasonAttribute(); + virtual ShutdownReasonAttribute& getShutdownReasonAttribute(); + virtual WakeUpReasonAttribute& getWakeUpReasonAttribute(); + virtual BootModeAttribute& getBootModeAttribute(); + + virtual NodeStateEvent& getNodeStateEvent(); + virtual NodeApplicationModeEvent& getNodeApplicationModeEvent(); + virtual SessionStateChangedEvent& getSessionStateChangedEvent(); + + + virtual void GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode); + virtual std::future GetNodeStateAsync(GetNodeStateAsyncCallback callback); + + virtual void SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback); + + virtual void GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode); + virtual std::future GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback); + + virtual void GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode); + virtual std::future GetApplicationModeAsync(GetApplicationModeAsyncCallback callback); + + virtual void RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback); + + virtual void UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback); + + virtual void RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback); + + virtual void UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback); + + virtual void GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count); + virtual std::future GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback); + + virtual void GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version); + virtual std::future GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback); + + virtual void LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback); + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + + private: + CommonAPI::DBus::DBusFreedesktopObservableAttribute> restartReason_; + CommonAPI::DBus::DBusFreedesktopObservableAttribute> shutdownReason_; + CommonAPI::DBus::DBusFreedesktopObservableAttribute> wakeUpReason_; + CommonAPI::DBus::DBusFreedesktopObservableAttribute> bootMode_; + + CommonAPI::DBus::DBusEvent nodeState_; + CommonAPI::DBus::DBusEvent nodeApplicationMode_; + CommonAPI::DBus::DBusEvent sessionStateChanged_; +}; + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_PROXY_H_ diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp new file mode 100644 index 0000000..a72ba16 --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp @@ -0,0 +1,374 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2012, BMW AG + * + * This file is part of GENIVI Project AudioManager. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * For further information see http://www.genivi.org/. +*/ +#include "ConsumerDBusStubAdapter.h" +#include + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +std::shared_ptr createConsumerDBusStubAdapter( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyConnection, + const std::shared_ptr& stubBase) { + return std::make_shared(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase); +} + +__attribute__((constructor)) void registerConsumerDBusStubAdapter(void) { + CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(Consumer::getInterfaceId(), + &createConsumerDBusStubAdapter); +} + +ConsumerDBusStubAdapter::ConsumerDBusStubAdapter( + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr& dbusConnection, + const std::shared_ptr& stub): + ConsumerDBusStubAdapterHelper(commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath, dbusConnection, std::dynamic_pointer_cast(stub)) { +} + +const char* ConsumerDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const { + return + "\n" + "" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + ; +} + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConsumerStub, + int32_t + > getRestartReasonAttributeStubDispatcher(&ConsumerStub::getRestartReasonAttribute, "i"); +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConsumerStub, + int32_t + > setRestartReasonAttributeStubDispatcher( + &ConsumerStub::getRestartReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteSetRestartReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteRestartReasonAttributeChanged, + &ConsumerStubAdapter::fireRestartReasonAttributeChanged, + "i"); + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConsumerStub, + int32_t + > getShutdownReasonAttributeStubDispatcher(&ConsumerStub::getShutdownReasonAttribute, "i"); +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConsumerStub, + int32_t + > setShutdownReasonAttributeStubDispatcher( + &ConsumerStub::getShutdownReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteSetShutdownReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteShutdownReasonAttributeChanged, + &ConsumerStubAdapter::fireShutdownReasonAttributeChanged, + "i"); + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConsumerStub, + int32_t + > getWakeUpReasonAttributeStubDispatcher(&ConsumerStub::getWakeUpReasonAttribute, "i"); +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConsumerStub, + int32_t + > setWakeUpReasonAttributeStubDispatcher( + &ConsumerStub::getWakeUpReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteSetWakeUpReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteWakeUpReasonAttributeChanged, + &ConsumerStubAdapter::fireWakeUpReasonAttributeChanged, + "i"); + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConsumerStub, + int32_t + > getBootModeAttributeStubDispatcher(&ConsumerStub::getBootModeAttribute, "i"); +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConsumerStub, + int32_t + > setBootModeAttributeStubDispatcher( + &ConsumerStub::getBootModeAttribute, + &ConsumerStubRemoteEvent::onRemoteSetBootModeAttribute, + &ConsumerStubRemoteEvent::onRemoteBootModeAttributeChanged, + &ConsumerStubAdapter::fireBootModeAttributeChanged, + "i"); + + +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple<>, + std::tuple + > getNodeStateStubDispatcher(&ConsumerStub::GetNodeState, "ii"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > setSessionStateStubDispatcher(&ConsumerStub::SetSessionState, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > getSessionStateStubDispatcher(&ConsumerStub::GetSessionState, "ii"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple<>, + std::tuple + > getApplicationModeStubDispatcher(&ConsumerStub::GetApplicationMode, "ii"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > registerShutdownClientStubDispatcher(&ConsumerStub::RegisterShutdownClient, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > unRegisterShutdownClientStubDispatcher(&ConsumerStub::UnRegisterShutdownClient, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > registerSessionStubDispatcher(&ConsumerStub::RegisterSession, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > unRegisterSessionStubDispatcher(&ConsumerStub::UnRegisterSession, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple<>, + std::tuple + > getAppHealthCountStubDispatcher(&ConsumerStub::GetAppHealthCount, "u"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple<>, + std::tuple + > getInterfaceVersionStubDispatcher(&ConsumerStub::GetInterfaceVersion, "u"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > lifecycleRequestCompleteStubDispatcher(&ConsumerStub::LifecycleRequestComplete, "i"); + +void ConsumerDBusStubAdapter::fireRestartReasonAttributeChanged(const int32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "onRestartReasonAttributeChanged", + "i", + value + ); +} +void ConsumerDBusStubAdapter::fireShutdownReasonAttributeChanged(const int32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "onShutdownReasonAttributeChanged", + "i", + value + ); +} +void ConsumerDBusStubAdapter::fireWakeUpReasonAttributeChanged(const int32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "onWakeUpReasonAttributeChanged", + "i", + value + ); +} +void ConsumerDBusStubAdapter::fireBootModeAttributeChanged(const int32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "onBootModeAttributeChanged", + "i", + value + ); +} + +void ConsumerDBusStubAdapter::fireNodeStateEvent(const int32_t& NodeState) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "NodeState", + "i", + NodeState + ); +} +void ConsumerDBusStubAdapter::fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "NodeApplicationMode", + "i", + ApplicationModeId + ); +} +void ConsumerDBusStubAdapter::fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SessionStateChanged", + "sii", + SessionStateName, SeatID, SessionState + ); +} + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +template<> +const org::genivi::NodeStateManager::Consumer::ConsumerDBusStubAdapterHelper::StubDispatcherTable org::genivi::NodeStateManager::Consumer::ConsumerDBusStubAdapterHelper::stubDispatcherTable_ = { + { { "getRestartReasonAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getRestartReasonAttributeStubDispatcher } + , { { "setRestartReasonAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setRestartReasonAttributeStubDispatcher }, + { { "getShutdownReasonAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getShutdownReasonAttributeStubDispatcher } + , { { "setShutdownReasonAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setShutdownReasonAttributeStubDispatcher }, + { { "getWakeUpReasonAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getWakeUpReasonAttributeStubDispatcher } + , { { "setWakeUpReasonAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setWakeUpReasonAttributeStubDispatcher }, + { { "getBootModeAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getBootModeAttributeStubDispatcher } + , { { "setBootModeAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setBootModeAttributeStubDispatcher } + , + { { "GetNodeState", "" }, &org::genivi::NodeStateManager::Consumer::getNodeStateStubDispatcher }, + { { "SetSessionState", "ssii" }, &org::genivi::NodeStateManager::Consumer::setSessionStateStubDispatcher }, + { { "GetSessionState", "si" }, &org::genivi::NodeStateManager::Consumer::getSessionStateStubDispatcher }, + { { "GetApplicationMode", "" }, &org::genivi::NodeStateManager::Consumer::getApplicationModeStubDispatcher }, + { { "RegisterShutdownClient", "ssuu" }, &org::genivi::NodeStateManager::Consumer::registerShutdownClientStubDispatcher }, + { { "UnRegisterShutdownClient", "ssu" }, &org::genivi::NodeStateManager::Consumer::unRegisterShutdownClientStubDispatcher }, + { { "RegisterSession", "ssii" }, &org::genivi::NodeStateManager::Consumer::registerSessionStubDispatcher }, + { { "UnRegisterSession", "ssi" }, &org::genivi::NodeStateManager::Consumer::unRegisterSessionStubDispatcher }, + { { "GetAppHealthCount", "" }, &org::genivi::NodeStateManager::Consumer::getAppHealthCountStubDispatcher }, + { { "GetInterfaceVersion", "" }, &org::genivi::NodeStateManager::Consumer::getInterfaceVersionStubDispatcher }, + { { "LifecycleRequestComplete", "ui" }, &org::genivi::NodeStateManager::Consumer::lifecycleRequestCompleteStubDispatcher } +}; diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h new file mode 100644 index 0000000..8b43c21 --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h @@ -0,0 +1,68 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2012, BMW AG + * + * This file is part of GENIVI Project AudioManager. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_STUB_ADAPTER_H_ +#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_STUB_ADAPTER_H_ + +#include + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +typedef CommonAPI::DBus::DBusStubAdapterHelper ConsumerDBusStubAdapterHelper; + +class ConsumerDBusStubAdapter: public ConsumerStubAdapter, public ConsumerDBusStubAdapterHelper { + public: + ConsumerDBusStubAdapter( + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr& dbusConnection, + const std::shared_ptr& stub); + + void fireRestartReasonAttributeChanged(const int32_t& value); + void fireShutdownReasonAttributeChanged(const int32_t& value); + void fireWakeUpReasonAttributeChanged(const int32_t& value); + void fireBootModeAttributeChanged(const int32_t& value); + + void fireNodeStateEvent(const int32_t& NodeState); + void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId); + void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState); + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; +}; + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_STUB_ADAPTER_H_ diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h new file mode 100644 index 0000000..273fa8b --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h @@ -0,0 +1,619 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2012, BMW AG + * + * This file is part of GENIVI Project AudioManager. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * For further information see http://www.genivi.org/. +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_H_ +#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_H_ + +#include "ConsumerProxyBase.h" + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +template +class ConsumerProxy: virtual public Consumer, virtual public ConsumerProxyBase, public _AttributeExtensions... { + public: + ConsumerProxy(std::shared_ptr delegate); + ~ConsumerProxy(); + + /// Returns the wrapper class that provides access to the attribute RestartReason. + virtual RestartReasonAttribute& getRestartReasonAttribute() { + return delegate_->getRestartReasonAttribute(); + } + + /// Returns the wrapper class that provides access to the attribute ShutdownReason. + virtual ShutdownReasonAttribute& getShutdownReasonAttribute() { + return delegate_->getShutdownReasonAttribute(); + } + + /// Returns the wrapper class that provides access to the attribute WakeUpReason. + virtual WakeUpReasonAttribute& getWakeUpReasonAttribute() { + return delegate_->getWakeUpReasonAttribute(); + } + + /// Returns the wrapper class that provides access to the attribute BootMode. + virtual BootModeAttribute& getBootModeAttribute() { + return delegate_->getBootModeAttribute(); + } + + + /// Returns the wrapper class that provides access to the broadcast NodeState. + virtual NodeStateEvent& getNodeStateEvent() { + return delegate_->getNodeStateEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast NodeApplicationMode. + virtual NodeApplicationModeEvent& getNodeApplicationModeEvent() { + return delegate_->getNodeApplicationModeEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SessionStateChanged. + virtual SessionStateChangedEvent& getSessionStateChangedEvent() { + return delegate_->getSessionStateChangedEvent(); + } + + + + /** + * Calls GetNodeState with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode); + /** + * Calls GetNodeState with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetNodeStateAsync(GetNodeStateAsyncCallback callback); + + /** + * Calls SetSessionState with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls SetSessionState with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback); + + /** + * Calls GetSessionState with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode); + /** + * Calls GetSessionState with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback); + + /** + * Calls GetApplicationMode with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode); + /** + * Calls GetApplicationMode with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetApplicationModeAsync(GetApplicationModeAsyncCallback callback); + + /** + * Calls RegisterShutdownClient with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls RegisterShutdownClient with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback); + + /** + * Calls UnRegisterShutdownClient with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls UnRegisterShutdownClient with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback); + + /** + * Calls RegisterSession with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls RegisterSession with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback); + + /** + * Calls UnRegisterSession with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls UnRegisterSession with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback); + + /** + * Calls GetAppHealthCount with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count); + /** + * Calls GetAppHealthCount with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback); + + /** + * Calls GetInterfaceVersion with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version); + /** + * Calls GetInterfaceVersion with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback); + + /** + * Calls LifecycleRequestComplete with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls LifecycleRequestComplete with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback); + + /// Returns the CommonAPI address of the remote partner this proxy communicates with. + virtual std::string getAddress() const; + + /// Returns the domain of the remote partner this proxy communicates with. + virtual const std::string& getDomain() const; + + /// Returns the service ID of the remote partner this proxy communicates with. + virtual const std::string& getServiceId() const; + + /// Returns the instance ID of the remote partner this proxy communicates with. + virtual const std::string& getInstanceId() const; + + /// Returns true if the remote partner for this proxy is available. + virtual bool isAvailable() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr delegate_; +}; + +namespace ConsumerExtensions { + template