2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup system_manager
19 /// \file ss_system_manager_protocol.h
20 /// \brief This file supports the System Manager client interface.
21 ///////////////////////////////////////////////////////////////////////////////
23 #ifndef __SS_SYSTEM_MANAGER_PROTOCOL_H__ // NOLINT (build/header_guard)
24 #define __SS_SYSTEM_MANAGER_PROTOCOL_H__
26 #include <native_service/frameworkunified_types.h>
27 #include <native_service/frameworkunified_service_protocol.h>
29 /// \addtogroup system_manager
32 #define SS_SM_MAX_MODULE_NAME_LENGTH (256)
33 #define SS_SM_MAX_TEST_CASE_NAME_SIZE (128)
34 #define SS_SM_MAX_RESP_MSG_SIZE (2048)
36 // system manager protocol --> define all protocol messages in and out of system manager
37 // that are pertinent to the functionality offered by system manager.
39 * \~english System control protocol type.
41 typedef enum _SS_SystemManagerProtocol {
42 // System Manager - command Protocol
43 SS_SYSTEM_MANAGER_PROTOCOL_BEGINNING_INDEX = 0x800, //!< \~english
44 SS_SM_NOTIFY_SYSTEM_LAUNCH_COMPLETE = SS_SYSTEM_MANAGER_PROTOCOL_BEGINNING_INDEX //!< System Manager to Power manager
45 , SS_SM_PROTOCOL_INTERFACE_END //!< \~english
47 // SystemManager-command Protocol
48 , SS_SM_START //!< \~english Normal-boot start request.
49 , SS_SM_START_COMPL_RSPN //!< \~english Normal-boot start completion notification.
50 , SS_SM_STOP //!< \~english Shutdown request.
51 , SS_SM_STOP_COMPL_RSPN //!< \~english Shutdown completion notification.
52 // SystemManager-command Protocol
53 , SS_SM_WAKEUP_MODULES_CMPL_RSPN //!< \~english Response to request of power state transition to power_service.(message format to use: \ref _wakeinfo "wakeInfo")
54 , SS_SM_SHUTDOWN_MODULES_CMPL_RSPN //!< SM to power
56 , SS_SM_WAKEUP_MODULES //!< client to service
57 , SS_SM_POWER_OFF_MODULES //!< client to service
58 , SS_SM_SHUTDOWN_MODULES //!< client to service
60 , SS_SM_CRNT_STATE_QUERY //!< client to service
61 , SS_SM_CRNT_STATE_QUERY_RSPN //!< service to client
62 , SS_SM_SYSTEM_MODE_INFO_REQ //!< client to service
63 , SS_SM_SYSTEM_MODE_INFO_RSPN //!< service to client
64 , SS_SM_INITCOMP_REP //!< client to service
66 , SS_SM_PROTOCOL_OPEN_SESSION_REQ //!< \~english
67 , SS_SM_PROTOCOL_OPEN_SESSION_ACK //!< \~english
69 //*************************************************************************
70 // Get Extended Parameter Protocol *
72 // Protocol between applications and SM *
73 , SS_SM_GET_START_EXT_INFO //!< FrameworkunifiedOnStart Extended Parameter
74 , SS_SM_GET_STOP_EXT_INFO //!< FrameworkunifiedOnStop Extended Parameter
75 // End of Get Extended Parameter Protocol *
76 //*************************************************************************
78 //*************************************************************************
79 // Reset Mode Protocol: *
81 // Request by Privileged clients to set the data reset mode: *
82 // None, UserData Reset or *
85 // The Set Request message carries the requested reset Mode. *
86 // Set Result message is not defined, because the Set Request is send by *
87 // FrameworkunifiedInvokeSync() *
88 , SS_SM_DATA_RESET_MODE_SET_REQ //!< Client to Service (Sys Mgr)
90 // End of Reset Mode Protocol *
91 //*************************************************************************
93 //*************************************************************************
94 // Program Update Status Protocol: *
96 // Request by Privileged clients to set the program update status: *
97 // None or Program Updated *
99 // The Set Request message carries the requested program update status. *
100 // Set Result message is not defined, because the Set Request is send by *
101 // FrameworkunifiedInvokeSync() *
102 , SS_SM_PROG_UPDATE_STATE_SET_REQ //!< Client to Service (Sys Mgr)
104 // End of Reset Mode Protocol *
105 //*************************************************************************
107 //*************************************************************************
108 // 'CPU Reset' Protocol: *
110 // CPU Reset request from applications to SM and SM to PS *
111 // /// < Client to Service when *
112 // /// message originating from *
113 // /// Application to SS\SM. *
114 // /// < Service to Client when *
115 // /// message originating from *
116 // /// SS\SM to SS\PS. *
117 , SS_SM_CPU_RESET_REQ //!< \~english
119 // End of CPU Reset Protocol *
120 //*************************************************************************
122 //*************************************************************************
123 // 'Local Data Reset' Protocol: *
125 // Local Data Reset request from applications to SM. *
126 // /// < Client to Service when *
127 // /// message originating from *
128 // /// Application to SS\SM. *
129 , SS_SM_LOCAL_DATA_RESET_REQ //!< \~english
131 // End of Local Data Reset Protocol *
132 //*************************************************************************
134 //*************************************************************************
135 // 'Remote Data Reset' Protocol: *
137 // Remote Data Reset request from SM to PS *
138 // /// < Service to Client when *
139 // /// message originating from *
140 // /// SS\SM to SS\PS. *
141 , SS_SM_REMOTE_DATA_RESET_REQ //!< \~english
143 // End of Remote Data Reset Protocol *
144 //*************************************************************************
147 //*************************************************************************
148 // Startup Confirmation Protocol: *
150 // Request by the Power Shadow to the Power Service to forward to the *
151 // System Manager the Startup Confirmation message. *
153 // The Request message carries the Startup Confirmation message. *
154 // The Response message carries the EFrameworkunifiedStatus of the request. *
155 , SS_SM_FWD_STARTUP_CONFIRMATION_MSG_REQ //!< Pwr Svc to Sys Mgr
156 , SS_SM_FWD_START_CONFIRMATION_MSG_RESP //!< Sys Mgr to Pwr Svc
158 // End of Startup Confirmation Protocol *
159 //*************************************************************************
161 //*************************************************************************
162 // Power Request Protocol: *
164 // Power Request message from the Power Shadow to the System Manager with *
165 // _CWORD56_'s "Power_Request" IPC_Command data. *
167 // The Request message carries the _CWORD56_'s data. *
168 // The Response message carries the EFrameworkunifiedStatus of the request. *
169 , SS_SM_POWER_REQUEST_MSG //!< \~english Startup process start request from power_service.
170 , SS_SM_POWER_REQUEST_MSG_RESP //!< Sys Mgr to Pwr Svc
172 // End of Power Request Protocol *
173 //*************************************************************************
175 //*************************************************************************
176 // User Mode Protocol: *
178 // Request from the Power Service to the System Manager, originally from *
179 // the Power Shadow, to turn on or off the video & audio output of HMI *
180 // and Audio services. *
181 // User Mode 'On' => turn video & audio output on *
182 // User Mode 'Off' => turn video & audio output off *
184 // The Request message carries the requested User Mode state. *
185 // The Response message carries the actual User Mode state. *
186 , SS_SM_USER_MODE_SET_RESP //!< Service (Sys Mgr) to Client (Pwr Svc)
188 // Note: See the corresponding Power Shadow / Power Service *
189 // 'SS_PowerServiceProtocol' enums in *
190 // /SystemServices/inc/ss_power_service_protocol.h *
191 // End of User Mode Protocol *
192 //*************************************************************************
194 , SS_SM_NEXT_WAKEUP_TYPE_SET_REQ //!< \~english
196 //*************************************************************************
197 // Error Event Protocol *
199 , SS_SM_EVENT_ERROR //!< SM to HMI(_CWORD77_)
200 , SS_SM_EVENT_ERROR_TO_SSL //!< SM to SSL
201 , SS_SM_ERROR_EVENT_LOGGING_START_REQ //!< SSL to SM
202 , SS_SM_ERROR_EVENT_LOGGING_START_RSPN //!< SM to SSL
203 , SS_SM_ERROR_EVENT_ARTIFACT_REQ //!< SSL to SM
204 , SS_SM_ERROR_EVENT_ARTIFACT_RSPN //!< SM to SSL
205 , SS_SM_ERROR_EVENT_LOGGING_COMPLETE //!< SSL to SM
206 , SS_SM_ERROR_EVENT_LOGGING_COMPLETE_RSPN //!< SM to SSL
208 , SS_SM_ERROR_EVENT_TIMER_ID_LOGGER_START_REQ //!< \~english
209 , SS_SM_ERROR_EVENT_TIMER_ID_DEBUG_DUMP_RSPN //!< \~english
210 , SS_SM_ERROR_EVENT_TIMER_ID_BOOT_MICRO_LOG_RSPN //!< \~english
211 , SS_SM_ERROR_EVENT_TIMER_ID_CORE_FILE_POLL //!< \~english
213 , SS_SM_USER_INVOKED_LOG_REQ //!< Key Shadow to SM
215 , SS_SM_ERROR_EVENT_EEL_EXPORT_REQ //!< SSL to SM
216 , SS_SM_ERROR_EVENT_INTERFACEUNIFIED_EMMC_LOGS_REQ //!< SSL to SM
217 , SS_SM_ERROR_EVENT_INTERFACEUNIFIED_EMMC_LOGS_RSPN //!< SM to SVC
218 , SS_SM_ERROR_EVENT_CLR_LOGS_REQ //!< SVC to SM
219 , SS_SM_ERROR_EVENT_PROCESS_EXIT //!< SM\CD to SM
220 , SS_SM_ERROR_EVENT_DIAG_LOG_REQ //!< SSL to SM
221 , SS_SM_ERROR_EVENT_CAN_LOG_REQ //!< SSL to SM
222 , SS_SM_ERROR_EVENT_DTC_LOG_REQ //!< SSL to SM
224 // End of Error Event Protocol *
225 //*************************************************************************
227 , SS_SM_GROUP_LAUNCH_TRIGGER //!< \~english
229 //*************************************************************************
230 // Debug Dump Protocol *
232 // Protocol between applications and SM *
233 , SS_SM_DEBUG_DUMP //!< SM to client
234 , SS_SM_DEBUG_DUMP_RSPN //!< client to SM
236 // End of Debug Dump Protocol *
237 //*************************************************************************
239 //*************************************************************************
240 // IAT Propagate Error (Module Relaunch Request) *
242 // Protocol between applications and SM *
243 , SS_SM_MODULE_RELAUNCH_REQ //!< client to SM
245 // End of IAT Propagate Error (Module Relaunch Request) *
246 //*************************************************************************
248 //*************************************************************************
251 // Protocol between SS_CPU_Monitor and SM *
252 , SS_SM_CPU_HIGH_LOAD_DETECTED //!< client to SM
254 // End of CPU High Load *
255 //*************************************************************************
257 //*************************************************************************
258 // IAT Propagate Error (System Error) *
260 // Protocol between application and SM *
261 , SS_SM_PROPAGATE_SYSTEM_ERROR //!< client to SM
263 // End of IAT Propagate Error (System Error) *
264 //*************************************************************************
266 //*************************************************************************
267 // _CWORD56_ HeartBeat Request Protocol *
269 // Protocol between Power Services and SM *
270 , SS_SM__CWORD56__HEARTBEAT_REQ //!< PS to SM
271 , SS_SM__CWORD56__HEARTBEAT_RSPN //!< SM to PS
273 // End of _CWORD56_ HeartBeat Request Protocol *
274 //*************************************************************************
276 //*************************************************************************
277 // User Data Reset Event Protocol *
279 // Protocol between SM and Service *
280 , SS_SM_EVENT_USER_DATA_RESET //!< SM to MS
282 // End of User Data Reset Event Protocol *
283 //*************************************************************************
285 //*************************************************************************
286 // Boot Micro Logging Protocol *
288 // Protocol between SS_Logger and SM. *
289 , SS_SM_BOOT_MICRO_RESET_NTF //!< Logging Shadow to SM
290 , SS_SM_BOOT_MICRO_LOG_REQ //!< SM to Logging Shadow
291 , SS_SM_BOOT_MICRO_LOG_RSP //!< Logging Shadow to SM aka ENDING_INDEX
293 // End Boot Micro Logging Protocol *
294 //*************************************************************************
296 // SystemManager-command Protocol
297 , SS_SM_PRE_START //!< \~english Pre-boot(+BA) start request.
298 , SS_SM_PRE_START_COMPL_RSPN //!< \~english Pre-boot(+BA) start completion notification.
299 , SS_SM_PRE_STOP //!< \~english Pre-boot(+BA) stop request.
300 , SS_SM_PRE_STOP_COMPL_RSPN //!< \~english Pre-boot(+BA) stop completion notification.
301 , SS_SM_BACKGROUND_START //!< \~english Background-boot(+BA) start request.
302 , SS_SM_BACKGROUND_START_COMPL_RSPN //!< \~english Background-boot(+BA) start completion notification.
303 , SS_SM_BACKGROUND_STOP //!< \~english Background-boot(+BA) stop request.
304 , SS_SM_BACKGROUND_STOP_COMPL_RSPN //!< \~english Background-boot(+BA) stop completion notification.
306 // UPDATE IF ANOTHER 'LAST' ENUMERATION IS ADDED !
307 , SS_SYSTEM_MANAGER_PROTOCOL_ENDING_INDEX = SS_SM_BACKGROUND_STOP_COMPL_RSPN //!< \~english
308 } SS_SystemManagerProtocol;
310 typedef struct _SS_SMCurrentState {
311 CHAR testCaseIdString[SS_SM_MAX_TEST_CASE_NAME_SIZE];
312 CHAR respMsgString[SS_SM_MAX_RESP_MSG_SIZE];
315 typedef struct _SMCompleteAck {
317 CHAR szServiceName[MAX_QUEUE_NAME_SIZE];
320 typedef struct _SMGroupLaunchTrigger {
322 }SMGroupLaunchTrigger;
323 //*************************************************************************
328 #endif /* __SS_SYSTEM_MANAGER_PROTOCOL_H__ */ // NOLINT (build/header_guard)