summaryrefslogtreecommitdiff
path: root/NodeStateMachineStub/NodeStateMachine.h
blob: c486d205d76f045fd6a3d61ad899c00e1c4687ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#ifndef NSM_NODESTATEMACHINE_H
#define NSM_NODESTATEMACHINE_H


/**********************************************************************************************************************
*
* Copyright (C) 2012 Continental Automotive Systems, Inc.
*
* Author: Jean-Pierre.Bogler@continental-corporation.com
*
* Header for the NodestateMachine stub.
*
* The header file defines the interfaces offred by the NodeStateMachine stub.
*
* 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/.
*
* Date             Author              Reason
* 27.09.2012       Jean-Pierre Bogler  CSP_WZ#1194: Initial creation.
* 24.10.2012       Jean-Pierre Bogler  CSP_WZ#1322: Changed parameter types of interface functions.
*                                                   No change of major interface version, because
*                                                   the same native types are used.
*
**********************************************************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif

/**********************************************************************************************************************
*
*  HEADER FILE INCLUDES
*
**********************************************************************************************************************/

#include "NodeStateTypes.h"

/**********************************************************************************************************************
*
*  CONSTANTS
*
**********************************************************************************************************************/

/**
 *  Module version, use SswVersion to interpret the value.
 *  The lower significant byte is equal 0 for released version only
 */

#define NSMC_INTERFACE_VERSION    0x01010000U


/**********************************************************************************************************************
*
*  TYPE
*
**********************************************************************************************************************/

/* There are no own types defined */


/**********************************************************************************************************************
*
*  GLOBAL VARIABLES
*
**********************************************************************************************************************/

/* There are no exported global variables */


/**********************************************************************************************************************
*
*  FUNCTION PROTOTYPE
*
**********************************************************************************************************************/

/** \brief Initialize the NodeStateMachine
\retval true:  The NodeStateMachine could be initialized and is running. false: An error occurred. NodeStateMachine not started.

This function will be used to initialize the Node State Machine, it will be called by the Node State Manager.
At the point where this function returns the machine is available to accept events via its interfaces from
the NSM. It is envisaged that in this call the NSMC will create and transfer control of the NSMC to its own
thread and will return in the original thread.*/
unsigned char NsmcInit(void);


/** \brief Check for Last User Context
\retval true:  Last User Context (LUC) is required. false: No LUC required.

This will be used by the NSM to check whether in the current Lifecycle the Last User Context (LUC) should
be started. This allows the product to define its own handling for specific Application modes. */
unsigned char NsmcLucRequired(void);


/** \brief Set data in the NodeStateMachine.
\param[in]  enData     Type of the data to set (see ::NsmDataType_e).
\param[in]  pData      Pointer to the memory location containing the data.
\param[in]  u32DataLen Length of the data that should be set (in byte).
\retval see ::NsmErrorStatus_e

This is a generic interface that can be used by the NSM to inform the NSMC about changes
to data items (i.e. events that have occurred in the system) */
NsmErrorStatus_e NsmcSetData(NsmDataType_e enData, unsigned char *pData, unsigned int u32DataLen);


/** \brief Request a NodeRestart.
\retval true:  The request for the restart could be processed. false: Error processing the restart request.

This will be used by the NSM to request a node restart when requested by one of its clients.*/
unsigned char NsmcRequestNodeRestart(void);


/** \brief Get version of the interface
\retval Version of the interface as defined in ::SswVersion_t

This function asks the lifecycle to perform a restart of the main controller. */
unsigned int NsmcGetInterfaceVersion(void);


/**********************************************************************************************************************
*
*  MACROS
*
**********************************************************************************************************************/

/* There are no macros defined */


#ifdef __cplusplus
}
#endif
/** \} */ /* End of SSW_NSMC_INTERFACE */
/** \} */ /* End of SSW_NSMC_TEMPLATE  */
#endif /* NSM_NODESTATEMACHINE_H */