diff options
author | Aleksandar Donchev <Aleksander.Donchev@partner.bmw.de> | 2015-06-02 10:57:57 +0200 |
---|---|---|
committer | Aleksandar Donchev <Aleksander.Donchev@partner.bmw.de> | 2015-06-02 10:57:57 +0200 |
commit | 02987671e5335cb767e0a0c64391dd44dec9e737 (patch) | |
tree | 3387e6ffe038b683e5c05c921688f6cb70390296 /AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h | |
parent | ea0a30e1fa93d2ac79749c669a36d59e1bac2ab5 (diff) | |
download | audiomanager-02987671e5335cb767e0a0c64391dd44dec9e737.tar.gz |
* Common-API 3 integration and fix for the asserts order in the router tests.
Signed-off-by: Christian Linke <christian.linke@bmw.de>
Diffstat (limited to 'AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h')
-rw-r--r-- | AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h | 59 |
1 files changed, 35 insertions, 24 deletions
diff --git a/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h b/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h index 44c8149..ab89526 100644 --- a/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h +++ b/AudioManagerDaemon/include/CAmNodeStateCommunicatorCAPI.h @@ -23,27 +23,37 @@ #ifndef CAMNODESTATECOMMUNICATORCAPI_H_ #define CAMNODESTATECOMMUNICATORCAPI_H_ -#include <org/genivi/NodeStateManager/ConsumerProxy.h> #include "CAmNodeStateCommunicator.h" -#include <org/genivi/NodeStateManager/LifeCycleConsumerStubDefault.h> +#include "CAmCommonAPIWrapper.h" +#include <v1_0/org/genivi/NodeStateManager/ConsumerProxy.hpp> +#include <v1_0/org/genivi/NodeStateManager/LifeCycleConsumerStubDefault.hpp> + namespace am { -using namespace CommonAPI; -using namespace org::genivi::NodeStateManager; + +#define am_nodestatemanager v1_0::org::genivi::NodeStateManager 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. + * The CAmNodeStateCommunicator communicates with the NodeStateManager via Common-API wrapping mechanism. It works only, if CAmCommonAPIWrapper is enabled. */ class CAmNodeStateCommunicatorCAPI : public CAmNodeStateCommunicator { + static const char * DEFAULT_DOMAIN_STRING; + static const char * CLIENT_INSTANCE_STRING; + static const char * CLIENT_INTERFACE_STRING; + static const char * LIFECYCLE_SERVICE_INSTANCE_STRING; + static const char * LIFECYCLE_SERVICE_INTERFACE_STRING; + static const char * OBJECT_NAME; + static const char * BUS_NAME; + /* 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 + class CAmNodeStateCommunicatorServiceImpl : public am_nodestatemanager::LifeCycleConsumerStubDefault { CAmNodeStateCommunicatorCAPI *mpDelegate; public: @@ -58,11 +68,29 @@ class CAmNodeStateCommunicatorCAPI : public CAmNodeStateCommunicator if(mpDelegate) mpDelegate->cbReceivedLifecycleRequest(Request, RequestId, ErrorCode); } + + void LifecycleRequest(const std::shared_ptr<CommonAPI::ClientId> client, uint32_t Request, uint32_t RequestId, LifecycleRequestReply_t reply){ + int32_t ErrorCode; + LifecycleRequest(Request, RequestId, ErrorCode); + reply(ErrorCode); + } }; CAmCommonAPIWrapper *mpCAPIWrapper; - std::shared_ptr<ConsumerProxy<> > mNSMProxy; + std::shared_ptr<am_nodestatemanager::ConsumerProxy<> > mNSMProxy; std::shared_ptr<CAmNodeStateCommunicatorCAPI::CAmNodeStateCommunicatorServiceImpl> mNSMStub; + + /* 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; + public: CAmNodeStateCommunicatorCAPI(CAmCommonAPIWrapper* iCAPIWrapper); virtual ~CAmNodeStateCommunicatorCAPI(); @@ -77,24 +105,7 @@ public: 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; }; } |