summaryrefslogtreecommitdiffstats
path: root/nsframework/framework_unified/client/include/native_service/frameworkunified_framework_types.h
blob: aa4119df369516062452afe5ababdc8025d81396 (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

///////////////////////////////////////////////////////////////////////////////
/// \ingroup
/// \brief    Application framework's core structures and data types.
///
///
///
///////////////////////////////////////////////////////////////////////////////
//@{
/**
 * @file frameworkunified_framework_types.h
 * @brief \~english Application framework's core structures and data types.
 *
 */
/** @addtogroup BaseSystem
 */
/** @addtogroup native_service
 *  @ingroup BaseSystem
 *  @{
 */
/** @addtogroup framework_unified
 *  @ingroup native_service
 *  @{
 */
/** @addtogroup framework
 *  @ingroup native_service
 *  @{
 */
#ifndef __NATIVESERVICES_FRAMEWORK_FRAMEWORKUNIFIED_FRAMEWORK_TYPES_H__  // NOLINT  (build/header_guard)
#define __NATIVESERVICES_FRAMEWORK_FRAMEWORKUNIFIED_FRAMEWORK_TYPES_H__

#include <native_service/frameworkunified_types.h>
#include <boost/function.hpp>

#define MAX_LEN      MAX_QUEUE_NAME_SIZE
#define MAX_MSGQ_BUFFER  MAX_QUEUE_MSG_SIZE
#define MAX_SESSION_ID_VAL 0xFFFF
#define MAX_FD_MULTIWAITING 8

#define FRAMEWORKUNIFIED_ANY_SOURCE   "NS_ANY_SRC"
#define FRAMEWORKUNIFIED_ANY_COMMAND  0xFFFFFFFF
#define FRAMEWORKUNIFIED_NS_NPSERVICE "NS_NPPService"
#define FRAMEWORKUNIFIED_NS_VERSIONUTIL "nsverutil"
#define FRAMEWORKUNIFIED_NS_MSGPROFILERUTIL "NSDisMsgProfile"
#define FRAMEWORKUNIFIED_NS_REMOTECONTROLSERVICE "NS_RemoteControlService"

// call back function definition
typedef boost::function< EFrameworkunifiedStatus(HANDLE) > TCbFunction;
typedef TCbFunction CallbackFunctionPtr;
typedef TCbFunction CbFuncPtr;
typedef EFrameworkunifiedStatus(*CbArgumentParser)(SI_32 argument, PCHAR argumentValue);

typedef enum _EFrameworkunifiedServiceAvailableStatus {
  eFrameworkunifiedServiceAvailable = 0,
  eFrameworkunifiedServiceNotAvailable,
} EFrameworkunifiedServiceAvailableStatus;

// Share Memory Retrieve Types
typedef enum _ESMRetrieveTypes {
  eSMRRelease = 0,  ///< data will be released on a read
  eSMRRetain = 1,  ///< data will be retained in the shared memory
} ESMRetrieveTypes;

/**
 * \~english Callbacks structure of Application Life cycle
 */
typedef struct _FrameworkunifiedDefaultCallbackHandler {
  CbFuncPtr onInitilization;  //!< \~english Callback of initialization
  CbFuncPtr onDestroy;  //!< \~english Callback of destroy
  CbFuncPtr onStart;  //!< \~english Callback of startup
  CbFuncPtr onStop;  //!< \~english Callback of stop
  CbFuncPtr onPreStart;  //!< \~english Callback of pre start
  CbFuncPtr onPreStop;  //!< \~english Callback of pre stop
  CbFuncPtr onBackgroundStart;  //!< \~english Callback of Background start
  CbFuncPtr onBackgroundStop;  //!< \~english Callback of Background stop
  CbFuncPtr onDebugDump;  //!< \~english Callback of debug dump
  CbFuncPtr createStateMachine;  //!< \~english Callback of created state machine
  CbFuncPtr ssFrameworkInterface;  //!< \~english Callback to Establish a session with the system_manager
} FrameworkunifiedDefaultCallbackHandler;

// LCOV_EXCL_BR_START 11:Occurred in the above test
typedef struct _FrameworkunifiedProtocolCallbackHandler {
  UI_32 iCmd;
  CbFuncPtr callBack;
} FrameworkunifiedProtocolCallbackHandler;
// LCOV_EXCL_BR_STOP

typedef struct _FrameworkunifiedFdProtocolCallbackHandler {
  int fd;
  CbFuncPtr callBack;
} FrameworkunifiedFdProtocolCallbackHandler;

// LCOV_EXCL_BR_START 11:Occurred in the above test
typedef struct _FrameworkunifiedNotificationCallbackHandler {
  CHAR cNotification[MAX_STRING_SIZE_NOTIFICATION];
  CbFuncPtr callBack;
} FrameworkunifiedNotificationCallbackHandler;
// LCOV_EXCL_BR_STOP

typedef struct _FrameworkunifiedNotificationsList {
  CHAR cNotification[MAX_STRING_SIZE_NOTIFICATION];
  UI_32 uiLengthData;
  EFrameworkunifiedNotificationType  persType;
} FrameworkunifiedNotificationsList;

typedef struct _FrameworkunifiedProtocolEvent {
  UI_32 iCmd;
  UI_32 iEventId;
} FrameworkunifiedProtocolEvent;

typedef struct _FrameworkunifiedNotificationEvent {
  CHAR cNotification[MAX_STRING_SIZE_NOTIFICATION];
  UI_32 iEventId;
} FrameworkunifiedNotificationEvent;

typedef struct _ServiceAvailability {
  CHAR cServiceName[MAX_NAME_SIZE_APP];
  EFrameworkunifiedServiceAvailableStatus eServiceAvailability;
} ServiceAvailability;

typedef enum _EFrameworkunifiedShutdowntatus {
  eFrameworkunifiedShutdownOk = 0,
  eFrameworkunifiedShutdownTimeout,
  eFrameworkunifiedShutdownFail,
} EFrameworkunifiedShutdownStatus;

typedef struct _ShutdownComplete {
  CHAR cServiceName[MAX_NAME_SIZE_APP];
  EFrameworkunifiedShutdownStatus eShutdownCompleteStatus;
} ShutdownComplete;

typedef struct _CustomCommandLineOptions {
  PCSTR cShortOptions;
  PCHAR cLongOptions;  // reserved for long options.
  CbArgumentParser callback;
} CustomCommandLineOptions;

/// Scheduling Policy
typedef enum _EFrameworkunifiedSchedPolicy {
  eFrameworkunifiedSchedPolicyInherit = 0,
  eFrameworkunifiedSchedPolicyTSS,
  eFrameworkunifiedSchedPolicyFIFO,
  eFrameworkunifiedSchedPolicyRR,
  eFrameworkunifiedSchedPolicyMAX
} EFrameworkunifiedSchedPolicy;

/// Child Thread Attribute
typedef struct _FrameworkunifiedChildThreadAttr {
  EFrameworkunifiedSchedPolicy schedPolicy;
  SI_32 schedPriority;
} FrameworkunifiedChildThreadAttr;

#endif /* __NATIVESERVICES_FRAMEWORK_FRAMEWORKUNIFIED_FRAMEWORK_TYPES_H__ */  // NOLINT  (build/header_guard)
/** @}*/
/** @}*/
/** @}*/
/** @}*/
//@}