* AmMapHanlderTest - added tests for the callbacks in CAmDatabaseObserver.
[profile/ivi/genivi/genivi-audio-manager.git] / nodeStateManagerIncludes / NodeStateManager.h
1 #ifndef NODESTATEMANAGER_H
2 #define NODESTATEMANAGER_H
3
4 /**********************************************************************************************************************
5 *
6 * Copyright (C) 2012 Continental Automotive Systems, Inc.
7 *
8 * Author: Jean-Pierre.Bogler@continental-corporation.com
9 *
10 * Interface between NodeStateManager and other components in the same process
11 *
12 * The file defines the interfaces and data types, which components in the same process or on the D-Bus
13 * can use to communicate to the NodeStateManager (NSM). Please note that there are further interfaces
14 * defined in XML to access the NSM via D-Bus.
15 *
16 * This Source Code Form is subject to the terms of the Mozilla Public
17 * License, v. 2.0. If a copy of the MPL was not distributed with this
18 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
19 *
20 * Date       Author             Reason
21 * 2012.06.01 uidu5846  1.0.0.0  CSP_WZ#388:  Initial version of the NodeStateManager interface
22 * 2012.09.27 uidu5846  1.1.0.0  CSP_WZ#1194: Changed file header structure and license to be released
23 *                                            as open source package. Introduced 'NodeStateTypes.h' to
24 *                                            avoid circle includes and encapsulate type definitions.
25 * 2012.10.24 uidu5846  1.2.0.0  CSP_WZ#1322: Changed types of interface parameters to native types.
26 *                                            Since the same native types are used, no interface change.
27 *
28 **********************************************************************************************************************/
29
30 /** \ingroup SSW_LCS */
31 /** \defgroup SSW_NSM_TEMPLATE Node State Manager
32  *  \{
33  */
34 /** \defgroup SSW_NSM_INTERFACE API document
35  *  \{
36  */
37
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42
43 /**********************************************************************************************************************
44 *
45 *  HEADER FILE INCLUDES
46 *
47 **********************************************************************************************************************/
48
49 #include "NodeStateTypes.h"
50
51 /**********************************************************************************************************************
52 *
53 *  CONSTANTS
54 *
55 **********************************************************************************************************************/
56
57 /**
58  *  Module version, use SswVersion to interpret the value.
59  *  The lower significant byte is equal 0 for released version only
60  */
61
62 #define NSM_INTERFACE_VERSION    0x01020000U
63
64 /**********************************************************************************************************************
65 *
66 *  TYPE
67 *
68 **********************************************************************************************************************/
69
70 /* There are no types defined here */
71
72 /**********************************************************************************************************************
73 *
74 *  GLOBAL VARIABLES
75 *
76 **********************************************************************************************************************/
77
78 /* There are no exported global variables */
79
80
81 /**********************************************************************************************************************
82 *
83 *  FUNCTION PROTOTYPE
84 *
85 **********************************************************************************************************************/
86
87 /** \brief Set data (property) of the NodeStateManager.
88 \param[in] enData     Type of the data to set (see ::NsmDataType_e).
89 \param[in] pData      Pointer to the memory location containing the data.
90 \param[in] u32DataLen Length of the data that should be set (in byte).
91 \retval see ::NsmErrorStatus_e
92
93 This is a generic interface that can be used by the NSMc to write a specific data item that from the NSM. */
94 NsmErrorStatus_e NsmSetData(NsmDataType_e enData, unsigned char *pData, unsigned int u32DataLen);
95
96
97 /** \brief Get data (property) of the NodeStateManager.
98 \param[in]  enData     Type of the data to get (see ::NsmDataType_e).
99 \param[out] pData      Pointer to the memory location where the data should be stored.
100 \param[in]  u32DataLen Length of the data that should be stored (in byte).
101 \retval     A positive value indicates the number of bytes that have been written to the out buffer pData.
102             A negative value indicates an error.
103
104 This is a generic interface that can be used by the NSMc to read a specific data item that from the NSM. */
105 int NsmGetData(NsmDataType_e enData, unsigned char *pData, unsigned int u32DataLen);
106
107
108 /** \brief Get version of the interface
109 \retval Version of the interface as defined in ::SswVersion_t
110
111 This function asks the lifecycle to perform a restart of the main controller. */
112 unsigned int NsmGetInterfaceVersion(void);
113
114
115 /**********************************************************************************************************************
116 *
117 *  MACROS
118 *
119 **********************************************************************************************************************/
120
121 /* There are no macros defined */
122
123
124 #ifdef __cplusplus
125 }
126 #endif
127 /** \} */ /* End of SSW_NSM_INTERFACE */
128 /** \} */ /* End of SSW_NSM_TEMPLATE  */
129 #endif /* NSM_NODESTATEMANAGER_H */