2 * Copyright (C) 2012, BMW AG
4 * This file is part of GENIVI Project AudioManager.
6 * Contributions are licensed to the GENIVI Alliance under one or more
7 * Contribution License Agreements.
10 * This Source Code Form is subject to the terms of the
11 * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
12 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 * \author Christian Linke, christian.linke@bmw.de BMW 2012
17 * \file CAmNodeStateCommunicatorDBus.h
18 * For further information see http://www.genivi.org/.
21 #ifndef CAMNODESTATECOMMUNICATORDBUS_H_
22 #define CAMNODESTATECOMMUNICATORDBUS_H_
24 #include "shared/CAmDbusWrapper.h"
25 #include "CAmNodeStateCommunicator.h"
29 /** communicates with the NSM
30 * The CAmNodeStateCommunicator communicates with the NodeStateManager via Dbus. Only works, if CAmDbusWrapper is enabled.
33 class CAmNodeStateCommunicatorDBus : public CAmNodeStateCommunicator
36 CAmNodeStateCommunicatorDBus(CAmDbusWrapper* iDbusWrapper);
37 virtual ~CAmNodeStateCommunicatorDBus();
38 am_Error_e nsmGetRestartReasonProperty(NsmRestartReason_e& restartReason) ;
39 am_Error_e nsmGetShutdownReasonProperty(NsmShutdownReason_e& ShutdownReason) ;
40 am_Error_e nsmGetRunningReasonProperty(NsmRunningReason_e& nsmRunningReason) ;
41 NsmErrorStatus_e nsmGetNodeState(NsmNodeState_e& nsmNodeState) ;
42 NsmErrorStatus_e nsmGetSessionState(const std::string& sessionName, const NsmSeat_e& seatID, NsmSessionState_e& sessionState) ;
43 NsmErrorStatus_e nsmGetApplicationMode(NsmApplicationMode_e& applicationMode) ;
44 NsmErrorStatus_e nsmRegisterShutdownClient(const uint32_t shutdownMode, const uint32_t timeoutMs) ;
45 NsmErrorStatus_e nsmUnRegisterShutdownClient(const uint32_t shutdownMode) ;
46 am_Error_e nsmGetInterfaceVersion(uint32_t& version) ;
47 NsmErrorStatus_e nsmSendLifecycleRequestComplete(const uint32_t RequestId, const NsmErrorStatus_e status) ;
49 static DBusHandlerResult receiveCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
50 static DBusHandlerResult signalCallback(DBusConnection *conn, DBusMessage *msg, void *user_data);
54 void sendIntrospection(DBusConnection* conn, DBusMessage* msg);
55 void sendMessage(DBusMessage* message, DBusMessage* origMessage);
56 DBusHandlerResult receiveCallbackDelegate(DBusConnection *conn, DBusMessage *msg);
57 am_Error_e readIntegerProperty(const std::string property, int32_t &value);
58 CAmDbusWrapper* mpDbusWrapper;
59 DBusConnection* mpDBusConnection;
63 #endif /* CAMNODESTATECOMMUNICATORDBUS_H_ */