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 tag_StateMachine
23 ///////////////////////////////////////////////////////////////////////////////
26 * @file frameworkunified_sm_framework_dispatch.h
27 * @brief \~english This file contains basic api to operate state machine
30 /** @addtogroup BaseSystem
33 /** @addtogroup native_service
37 /** @addtogroup framework_unified
38 * @ingroup native_service
41 /** @addtogroup framework
42 * @ingroup framework_unified
45 /** @addtogroup statemachine
49 #ifndef __FRAMEWORKUNIFIED_NATIVESERVICES_NATIVESERVICES_INC_FRAMEWORK_STATEMACHINE_FRAMEWORKUNIFIED_SM_FRAMEWORK_DISPATCH_H__ // NOLINT (build/header_guard)
50 #define __FRAMEWORKUNIFIED_NATIVESERVICES_NATIVESERVICES_INC_FRAMEWORK_STATEMACHINE_FRAMEWORKUNIFIED_SM_FRAMEWORK_DISPATCH_H__
52 #include <native_service/frameworkunified_types.h>
53 #include <native_service/frameworkunified_framework_types.h>
54 #include <native_service/frameworkunified_sm_framework_types.h>
55 #include <native_service/frameworkunified_sm_hsmframework.h>
57 ////////////////////////////////////////////////////////////////////////////////////////////
58 /// \ingroup FrameworkunifiedSetStateMachine
59 /// \~english @par Brief
60 /// Get pointer to the statemachine object.
61 /// \~english @param [in] hApp
62 /// HANDLE - Handle to the framework application
63 /// \~english @retval CFrameworkunifiedHSMParentFramework* pointer to the statemachine object
64 /// \~english @retval NULL Failed to get pointer to the statemachine object
65 /// \~english @par Prerequisite
66 /// - Generation/Initialization of Dispatcher for the Application by FrameworkunifiedHSMDispatcherWithArguments has been done.
67 /// \~english @par Change of internal state
68 /// - Change of internal state according to the API does not occur.
69 /// \~english @par Conditions of processing failure
70 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) . [NULL]
71 /// - Pointer to statemachine object is NULL. [NULL]
72 /// \~english @par Detail
73 /// Get pointer to the statemachine object associated with application framework handle.\n
74 /// Do not release the statemachine object in application, because it is a part of the Dispathcer.
75 /// \~english @par Classification
77 /// \~english @par type
79 /// \~english @see FrameworkunifiedHSMDispatcherWithArguments,FrameworkunifiedGetStateMachine
80 ////////////////////////////////////////////////////////////////////////////////////////////
81 /// FrameworkunifiedSetStateMachine
82 /// sets the statemachine object
85 /// HANDLE - Handle to the application session
87 /// \param [in] f_pFrameworkunifiedHSM
88 /// CFrameworkunifiedHSM - Pointer to statemachine object
90 /// \return pointer to the StateMachine object
91 /// CFrameworkunifiedHSMParentFramework* - pointer to the StateMachine object
95 ////////////////////////////////////////////////////////////////////////////////////////////
96 EFrameworkunifiedStatus FrameworkunifiedSetStateMachine(HANDLE hApp,
97 CFrameworkunifiedHSM *f_pFrameworkunifiedHSM);
99 /////////////////////////////////////////////////////////////////////////////////////
100 /// \ingroup FrameworkunifiedAttachHSMEventToDispatcher
101 /// \~english @par Brief
102 /// Register an event in dispatcher
103 /// \~english @param [in] hApp
104 /// HANDLE hApp - Application framework handle
105 /// \~english @param [in] pServiceName
106 /// PCSTR pServiceName - Service Name
107 /// \~english @param [in] iCmd
108 /// UI_32 iCmd - service protocol command/request/acknowledgment ID
109 /// \~english @param [in] iEvent
110 /// UI_32 iEvent - event to be posted to active state on receiving iCmd from pServiceName.
111 /// \~english @param [in] hSession
112 /// HANDLE hSession - Session Handle.
113 /// \~english @retval eFrameworkunifiedStatusOK success
114 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
115 /// \~english @par Prerequisite
116 /// - Generation/Initialization of Dispatcher for the Application by FrameworkunifiedHSMDispatcherWithArguments has been done.
117 /// \~english @par Change of internal state
119 /// \~english @par Conditions of processing failure
120 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
121 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
122 /// - Pointer to service name specified in the argument (pServiceName) is NULL [eFrameworkunifiedStatusInvldHandle]
123 /// \~english @par Detail
124 /// Register an event information (iCmd,iEvent) for service specified in the argument in dispatcher.\n
125 /// After that, when receiving an iCmd from service, post the event to active state.
127 /// Please note the following points when using this API for application.
128 /// - Operation is not guaranteed if a different handle is set for an application handle.
129 /// - Operation is not guaranteed if an invalid handle is set for a session handle.
130 /// - This API registers one event for one command and one callback for one event.\n
131 /// When registration is performed for the same command, the previously registered event is activated.
132 /// - The callback information is registered to the heap.
133 /// \~english @par Classification
135 /// \~english @par Type
137 /// \~english @see FrameworkunifiedAttachHSMEventsToDispatcher
139 /////////////////////////////////////////////////////////////////////////////////////
140 ////////////////////////////////////////////////////////////////////////////////////////////
141 /// FrameworkunifiedAttachHSMEventToDispatcher
142 /// Registers a single event with the dispatcher for a given service.
146 /// HANDLE - Application framework handle
147 /// \param [in] pServiceName
148 /// PCSTR - Service Name
150 /// UI_32 - service protocol command/request/acknowledgment ID
151 /// \param [in] iEvent
152 /// UI_32 - event to be posted to active state on receiving iCmd from pServiceName.
153 /// \param [in] hSession
154 /// HANDLE - Session Handle.
157 /// EFrameworkunifiedStatus - success or error
161 ////////////////////////////////////////////////////////////////////////////////////////////
162 EFrameworkunifiedStatus FrameworkunifiedAttachHSMEventToDispatcher(HANDLE hApp, PCSTR pServiceName, UI_32 iCmd, UI_32 iEvent,
163 HANDLE hSession = NULL);
165 /////////////////////////////////////////////////////////////////////////////////////
166 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
167 /// \~english @par Brief
168 /// Register events in dispatcher.
169 /// \~english @param [in] hApp
170 /// HANDLE hApp - Application framework handle
171 /// \~english @param [in] pServiceName
172 /// PCSTR pServiceName - Service Name
173 /// \~english @param [in] pEventIds
174 /// const FrameworkunifiedProtocolEvent *pEventIds - structure mapping event ids with the messages
175 /// \~english @param [in] uiEventCount
176 /// UI_32 uiEventCount - no of events
177 /// \~english @param [in] hSession
178 /// HANDLE hSession - Session Handle.
179 /// \~english @retval eFrameworkunifiedStatusOK success
180 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
181 /// \~english @par Prerequisite
182 /// - Generation/Initialization of Dispatcher for the Application by FrameworkunifiedHSMDispatcherWithArguments has been done.
183 /// \~english @par Change of internal state
185 /// \~english @par Conditions of processing failure
186 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
187 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
188 /// - Pointer to service name specified in the argument (pServiceName) is NULL [eFrameworkunifiedStatusInvldHandle]
189 /// - Pointer to FrameworkunifiedProtocolEvent structure specified in the argument is NULL [eFrameworkunifiedStatusInvldHandle]
190 /// \~english @par Detail
191 /// Register events information (iCmd,iEvent) for service specified in the argument in dispatcher.\n
192 /// After that, when receiving an iCmd from service, post the event to active state.\n
193 /// If register failed, only the events that register before it are valid.\n
194 /// When multiple registration, if an error occurs in the second and subsequent, becomes effective only \n
195 /// information that has been registered so far. \n
196 /// For number of upper limit of the registration possible event, depending on \n
197 /// the securable size as the area of the FrameworkunifiedProtocolEvent structure. Therefore, note to ensure \n
198 /// the size of the area of the FrameworkunifiedProtocolEvent structure at the call side of API, and define \n
199 /// the number of event.
201 /// Please note the following points when using this API for application.
202 /// - Operation is not guaranteed if a different handle is set to Handle for the application.
203 /// - Operation is not guaranteed if an invalid handle is set for a session handle.
204 /// - If an error occurs when multiple events are registered, it is impossible to determine which event was valid.
205 /// Therefore, either register multiple event information again or delete multiple event information at the same time when registration fails.
206 /// \~english @par Classification
208 /// \~english @par Type
210 /// \~english @see FrameworkunifiedAttachHSMEventToDispatcher
212 /////////////////////////////////////////////////////////////////////////////////////
213 ////////////////////////////////////////////////////////////////////////////////////////////
214 /// FrameworkunifiedAttachHSMEventsToDispatcher
215 /// Registers a multiple event with the dispatcher for a given service.
219 /// HANDLE - Application framework handle
220 /// \param [in] pServiceName
221 /// PCSTR - Service Name
222 /// \param [in] pEventIds
223 /// const FrameworkunifiedProtocolEvent* - structure mapping event ids with the messages
224 /// \param [in] uiEventCount
225 /// UI_32 - no of events
226 /// \param [in] hSession
227 /// HANDLE - Session Handle.
230 /// EFrameworkunifiedStatus - success or error
234 ////////////////////////////////////////////////////////////////////////////////////////////
235 EFrameworkunifiedStatus FrameworkunifiedAttachHSMEventsToDispatcher(HANDLE hApp, PCSTR pServiceName,
236 const FrameworkunifiedProtocolEvent *pEventIds,
238 HANDLE hSession = NULL);
240 /////////////////////////////////////////////////////////////////////////////////////
241 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
242 /// \~english @par Brief
243 /// register a notification in service
244 /// \~english @param [in] hApp
245 /// HANDLE hApp - Handle to the Framework
246 /// \~english @param [in] pNotification
247 /// PCSTR pNotification - Name of Notification
248 /// \~english @param [in] max_length
249 /// const UI_32 max_length - Max size of the notification message
250 /// \~english @param [in] persType
251 /// const EFrameworkunifiedNotificationType persType - Type of persistent
252 /// \~english @retval eFrameworkunifiedStatusOK success
253 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
254 /// \~english @par Prerequisite
256 /// \~english @par Change of internal state
258 /// \~english @par Conditions of processing failure
259 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
260 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
261 /// - Pointer(pNotification) to service name is NULL [eFrameworkunifiedStatusInvldHandle]
262 /// \~english @par Detail
263 /// send message to Notification Service to register a notification
264 /// \~english @par Classification
266 /// \~english @par Type
270 /////////////////////////////////////////////////////////////////////////////////////
271 ////////////////////////////////////////////////////////////////////////////////////////////
272 /// FrameworkunifiedNPHSMRegisterNotificatsionEvent
273 /// API to send message to Notification Service to register a notification
276 /// HANDLE - Handle to the Framework
277 /// \param [in] pNotification
278 /// PCSTR - Name of Notification
279 /// \param [in] max_length
280 /// const UI_32 - Max size of the notification message
281 /// \param [in] persType
282 /// const EFrameworkunifiedNotificationType - Type of persistent
285 /// EFrameworkunifiedStatus - success or error
286 ////////////////////////////////////////////////////////////////////////////////////////////
287 EFrameworkunifiedStatus FrameworkunifiedNPHSMRegisterNotificatsionEvent(HANDLE hApp, PCSTR pNotification, const UI_32 max_length,
288 const EFrameworkunifiedNotificationType persType);
291 /////////////////////////////////////////////////////////////////////////////////////
292 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
293 /// \~english @par Brief
294 /// register many notifications in service
295 /// \~english @param [in] hApp
296 /// HANDLE hApp - Handle to the Framework
297 /// \~english @param [in] pList
298 /// const FrameworkunifiedNotificationsList *pList - List of the notifications that need to be registered
299 /// \~english @param [in] uiListLength
300 /// UI_32 uiListLength - Length of the list
301 /// \~english @retval eFrameworkunifiedStatusOK success
302 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
303 /// \~english @par Prerequisite
305 /// \~english @par Change of internal state
307 /// \~english @par Conditions of processing failure
308 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
309 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
310 /// - Pointer(pList) to service name is NULL [eFrameworkunifiedStatusInvldHandle]
311 /// \~english @par Detail
312 /// send message to Notification Service to register many notifications
313 /// \~english @par Classification
315 /// \~english @par Type
319 /////////////////////////////////////////////////////////////////////////////////////
320 ////////////////////////////////////////////////////////////////////////////////////////////
321 /// FrameworkunifiedNPHSMRegisterNotificationsEvents
322 /// API to send message to Notification Service to register a notification
325 /// HANDLE - Handle to the Framework
326 /// \param [in] pList
327 /// FrameworkunifiedNotificationsList - List of the notifications that need to be registered
328 /// \param [in] uiListLength
329 /// const UI_32 - Length of the list
332 /// EFrameworkunifiedStatus - success or error
333 ////////////////////////////////////////////////////////////////////////////////////////////
334 EFrameworkunifiedStatus FrameworkunifiedNPHSMRegisterNotificationsEvents(HANDLE hApp, const FrameworkunifiedNotificationsList *pList,
338 /////////////////////////////////////////////////////////////////////////////////////
339 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
340 /// \~english @par Brief
341 /// remove a notification in service
342 /// \~english @param [in] hApp
343 /// HANDLE hApp - Handle to the Framework
344 /// \~english @param [in] pNotification
345 /// cPCSTR pNotification - Name of Notification
346 /// \~english @retval eFrameworkunifiedStatusOK success
347 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
348 /// \~english @par Prerequisite
350 /// \~english @par Change of internal state
352 /// \~english @par Conditions of processing failure
353 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
354 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
355 /// - Pointer(pNotification) to service name is NULL [eFrameworkunifiedStatusInvldHandle]
356 /// \~english @par Detail
357 /// send message to Notification Service to remove a notification
358 /// \~english @par Classification
360 /// \~english @par Type
364 /////////////////////////////////////////////////////////////////////////////////////
365 ////////////////////////////////////////////////////////////////////////////////////////////
366 /// FrameworkunifiedNPHSMUnRegisterNotificationEvent
367 /// API to send message to Notification Service to remove a notification
370 /// HANDLE - Handle to the Framework
371 /// \param [in] pNotification
372 /// PCSTR - Name of Notification
375 /// EFrameworkunifiedStatus - success or error
376 ////////////////////////////////////////////////////////////////////////////////////////////
377 EFrameworkunifiedStatus FrameworkunifiedNPHSMUnRegisterNotificationEvent(HANDLE hApp, PCSTR pNotification);
379 /////////////////////////////////////////////////////////////////////////////////////
380 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
381 /// \~english @par Brief
382 /// attach an event to the dispatcher on receiving a specific notification.
383 /// \~english @param [in] hApp
384 /// HANDLE hApp - Handle to the Framework
385 /// \~english @param [in] pNotification
386 /// cPCSTR pNotification - Name of Notification
387 /// \~english @param [in] iEventId
388 /// UI_32 iEventId - event ID
389 /// \~english @retval eFrameworkunifiedStatusOK success
390 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
391 /// \~english @par Prerequisite
393 /// \~english @par Change of internal state
395 /// \~english @par Conditions of processing failure
396 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
397 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
398 /// - Pointer(pNotification) to service name is NULL [eFrameworkunifiedStatusInvldHandle]
399 /// \~english @par Detail
400 /// attach an event to the dispatcher on receiving a specific notification.
401 /// \~english @par Classification
403 /// \~english @par Type
407 /////////////////////////////////////////////////////////////////////////////////////
408 ////////////////////////////////////////////////////////////////////////////////////////////
409 /// FrameworkunifiedAttachNotificationEventToDispatcher
410 /// API to attach a event to the dispatcher on receiving a specific notification.
413 /// HANDLE - Application framework handle
414 /// \param [in] pNotification
415 /// PCSTR - Notification String.
416 /// \param [in] iEventId
417 /// UI_32 - event to be posted to active state on receiving iCmd from pServiceName.
420 /// EFrameworkunifiedStatus - success or error
424 ////////////////////////////////////////////////////////////////////////////////////////////
425 EFrameworkunifiedStatus FrameworkunifiedSubscribeNotificationWithHSMEvent(HANDLE hApp, PCSTR pNotification,
428 /////////////////////////////////////////////////////////////////////////////////////
429 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
430 /// \~english @par Brief
431 /// attach many events to eath dispatcher on receiving a specific notification.
432 /// \~english @param [in] hApp
433 /// HANDLE hApp - Handle to the Framework
434 /// \~english @param [in] pNtfyEvent
435 /// const FrameworkunifiedNotificationEvent *pNtfyEvent - Notification event structure.
436 /// \~english @param [in] uiEventCount
437 /// UI_32 uiEventCount - Number of Notification event
438 /// \~english @retval eFrameworkunifiedStatusOK success
439 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
440 /// \~english @par Prerequisite
442 /// \~english @par Change of internal state
444 /// \~english @par Conditions of processing failure
445 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
446 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
447 /// - Pointer to FrameworkunifiedProtocolEvent structure specified in the argument is NULL [eFrameworkunifiedStatusInvldHandle]
448 /// \~english @par Detail
449 /// attach many events to eath dispatcher on receiving a specific notification.
450 /// \~english @par Classification
452 /// \~english @par Type
456 /////////////////////////////////////////////////////////////////////////////////////
457 ////////////////////////////////////////////////////////////////////////////////////////////
458 /// FrameworkunifiedAttachNotificationEventsToDispatcher
459 /// API to attach a event to the dispatcher on receiving a specific notification.
462 /// HANDLE - Application framework handle
463 /// \param [in] pNtfyEvent
464 /// const FrameworkunifiedNotificationEvent* - Notification event structure.
465 /// \param [in] uiEventCount
466 /// UI_32 - Number of Notification event
469 /// EFrameworkunifiedStatus - success or error
473 ////////////////////////////////////////////////////////////////////////////////////////////
474 EFrameworkunifiedStatus FrameworkunifiedSubscribeNotificationsWithHSMEvent(HANDLE hApp, const FrameworkunifiedNotificationEvent *pNtfyEvent,
477 /////////////////////////////////////////////////////////////////////////////////////
478 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
479 /// \~english @par Brief
480 /// detach events from the dispatcher.
481 /// \~english @param [in] hApp
482 /// HANDLE hApp - Handle to the Framework
483 /// \~english @param [in] pNtfyHandler
484 /// const FrameworkunifiedNotificationEvent *pNtfyHandler - Notification handler structure.
485 /// \~english @param [in] uiHandlerCount
486 /// UI_32 uiHandlerCount - Notification handler structure.
487 /// \~english @retval eFrameworkunifiedStatusOK success
488 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
489 /// \~english @par Prerequisite
491 /// \~english @par Change of internal state
493 /// \~english @par Conditions of processing failure
494 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
495 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
496 /// - Pointer to FrameworkunifiedProtocolEvent structure specified in the argument is NULL [eFrameworkunifiedStatusInvldHandle]
497 /// \~english @par Detail
498 /// detach events from the dispatcher.
499 /// \~english @par Classification
501 /// \~english @par Type
505 /////////////////////////////////////////////////////////////////////////////////////
506 ////////////////////////////////////////////////////////////////////////////////////////////
507 /// FrameworkunifiedUnsubscribeNotificationsWithHSMEvent
508 /// API to detach a notification event from the dispatcher.
511 /// HANDLE - Application framework handle
512 /// \param [in] pNtfyHandler
513 /// const FrameworkunifiedNotificationEvent* - Notification handler structure.
514 /// \param [in] uiHandlerCount
515 /// UI_32 - Number of notification handlers
518 /// EFrameworkunifiedStatus - success or error
522 ////////////////////////////////////////////////////////////////////////////////////////////
523 EFrameworkunifiedStatus FrameworkunifiedUnsubscribeNotificationsWithHSMEvent(HANDLE hApp, const FrameworkunifiedNotificationEvent *pNtfyHandler,
524 UI_32 uiHandlerCount);
526 /////////////////////////////////////////////////////////////////////////////////////
527 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
528 /// \~english @par Brief
529 /// detach a notification event from the dispatcher.
530 /// \~english @param [in] hApp
531 /// HANDLE hApp - Handle to the Framework
532 /// \~english @param [in] pNotification
533 /// PCSTR pNotification - Notification String.
534 /// \~english @retval eFrameworkunifiedStatusOK success
535 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
536 /// \~english @par Prerequisite
538 /// \~english @par Change of internal state
540 /// \~english @par Conditions of processing failure
541 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
542 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
543 /// - Pointer(pNotification) to service name is NULL [eFrameworkunifiedStatusInvldHandle]
544 /// \~english @par Detail
545 /// detach a notification event from the dispatcher.
546 /// \~english @par Classification
548 /// \~english @par Type
552 /////////////////////////////////////////////////////////////////////////////////////
553 ////////////////////////////////////////////////////////////////////////////////////////////
554 /// FrameworkunifiedDetachNotificationEventsFromDispatcher
555 /// API to detach a notification event from the dispatcher.
558 /// HANDLE - Application framework handle
559 /// \param [in] pNotification
560 /// PCSTR - Notification String.
563 /// EFrameworkunifiedStatus - success or error
567 ////////////////////////////////////////////////////////////////////////////////////////////
568 EFrameworkunifiedStatus FrameworkunifiedUnsubscribeNotificationWithHSMEvent(HANDLE hApp, PCSTR pNotification);
570 /////////////////////////////////////////////////////////////////////////////////////
571 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
572 /// \~english @par Brief
573 /// Registers a multiple HSM event with the dispatcher for a given service.
574 /// \~english @param [in] hApp
575 /// HANDLE hApp - Child Thread handle
576 /// \~english @param [in] pEventIds
577 /// const FrameworkunifiedProtocolEvent *pEventIds - structure mapping event ids with the messages
578 /// \~english @param [in] uiEventCount
579 /// UI_32 uiEventCount - no of events
580 /// \~english @retval eFrameworkunifiedStatusOK success
581 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
582 /// \~english @par Prerequisite
584 /// \~english @par Change of internal state
586 /// \~english @par Conditions of processing failure
587 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
588 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
589 /// - Pointer to FrameworkunifiedProtocolEvent structure specified in the argument is NULL [eFrameworkunifiedStatusInvldHandle]
590 /// \~english @par Detail
591 /// Registers a multiple HSM event with the dispatcher for a given service.
592 /// \~english @par Classification
594 /// \~english @par Type
598 /////////////////////////////////////////////////////////////////////////////////////
599 ////////////////////////////////////////////////////////////////////////////////////////////
600 /// FrameworkunifiedAttachParentHSMEventsToDispatcher
601 /// Registers a multiple HSM event with the dispatcher for a given service.
604 /// \param [in] hChildApp
605 /// HANDLE - Application framework handle
606 /// \param [in] pEventIds
607 /// const FrameworkunifiedProtocolEvent* - structure mapping event ids with the messages
608 /// \param [in] uiEventCount
609 /// UI_32 - no of events
612 /// EFrameworkunifiedStatus - success or error
616 ////////////////////////////////////////////////////////////////////////////////////////////
617 EFrameworkunifiedStatus FrameworkunifiedAttachParentHSMEventsToDispatcher(HANDLE hChildApp, const FrameworkunifiedProtocolEvent *pEventIds,
620 /////////////////////////////////////////////////////////////////////////////////////
621 /// \ingroup FrameworkunifiedAttachHSMEventsToDispatcher
622 /// \~english @par Brief
623 /// detach notification HSM events from the dispatcher.
624 /// \~english @param [in] hApp
625 /// HANDLE hApp - Child Thread handle
626 /// \~english @param [in] puiEventArray
627 /// const PUI_32 puiEventArray - Array of events
628 /// \~english @param [in] uiEventCount
629 /// UI_32 uiEventCount - Number of events
630 /// \~english @retval eFrameworkunifiedStatusOK success
631 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
632 /// \~english @par Prerequisite
634 /// \~english @par Change of internal state
636 /// \~english @par Conditions of processing failure
637 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
638 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
639 /// \~english @par Detail
640 /// detach notification HSM events from the dispatcher.
641 /// \~english @par Classification
643 /// \~english @par Type
647 /////////////////////////////////////////////////////////////////////////////////////
648 ////////////////////////////////////////////////////////////////////////////////////////////
649 /// FrameworkunifiedDetachParentHSMEventsFromDispatcher
650 /// API to detach a notification HSM event from the dispatcher.
653 /// \param [in] hChildApp
654 /// HANDLE - Child Thread handle
655 /// \param [in] puiEventArray
656 /// const PUI_32 puiEventArray - Array of events
657 /// \param [in] uiEventCount
658 /// UI_32 - Number of events
661 /// EFrameworkunifiedStatus - success or error
665 ////////////////////////////////////////////////////////////////////////////////////////////
666 EFrameworkunifiedStatus FrameworkunifiedDetachParentHSMEventsFromDispatcher(HANDLE hChildApp, const PUI_32 puiEventArray, UI_32 uiEventCount);
668 /////////////////////////////////////////////////////////////////////////////////////
669 /// \ingroup FrameworkunifiedDetachHSMEventsFromDispatcher
670 /// \~english @par Brief
671 /// detach multiple events from the dispatcher
672 /// \~english @param [in] hApp
673 /// HANDLE hApp - Application framework handle
674 /// \~english @param [in] pServiceName
675 /// PCSTR pServiceName - Service Name
676 /// \~english @param [in] puiCmdArray
677 /// const PUI_32 puiCmdArray - Array of commands
678 /// \~english @param [in] uiCmdCount
679 /// UI_32 uiCmdCount - Number of Commands
680 /// \~english @param [in] hSession
681 /// HANDLE hSession - Session Handle.
682 /// \~english @retval eFrameworkunifiedStatusOK success
683 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
684 /// \~english @retval eFrameworkunifiedStatusFail process failed
685 /// \~english @retval eFrameworkunifiedStatusInvldParam invalid parameter
686 /// \~english @par Prerequisite
687 /// - Generation/Initialization of Dispatcher for the Application by FrameworkunifiedHSMDispatcherWithArguments has been done.
688 /// \~english @par Change of internal state
690 /// \~english @par Conditions of processing failure
691 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
692 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
693 /// - Pointer to service name specified in the argument (pServiceName) is NULL [eFrameworkunifiedStatusInvldHandle]
694 /// - Pointer(pServiceName) to service name doesn't exist [eFrameworkunifiedStatusFail]
695 /// - Pointer to event array specified in the argument which will be deleted is NULL [eFrameworkunifiedStatusInvldParam]
696 /// \~english @par Detail
697 /// Detach multiple events(puiCmdArray) information for service specified in the argument from dispatcher.\n
698 /// After that, when receiving command from service, post the event to unactive state.\n
699 /// If the information has been deleted, return eFrameworkunifiedStatusOK.\n
700 /// If the specific event has not been registered, return eFrameworkunifiedStatusOK.\n
701 /// If number of puiCmdArray to be deleted is 0, return eFrameworkunifiedStatusOK.\n
702 /// When deleting multiple events, if an error occurs, stop deleting. \n
704 /// Please note the following points when using this API for application.
705 /// - Operation is not guaranteed if a different handle is set for an application handle.
706 /// - Operation is not guaranteed if an invalid handle is set for a session handle.
707 /// - Operatuib is not guaranteed if a puiCmdArray that differs from the events to be deleted is set.
708 /// \~english @par Classification
710 /// \~english @par Type
712 /// \~english @see FrameworkunifiedDetachHSMEventFromDispatcher
714 ////////////////////////////////////////////////////////////////////////////////////////////
715 ////////////////////////////////////////////////////////////////////////////////////////////
716 /// FrameworkunifiedDetachHSMEventsFromDispatcher
717 /// API to detach a notification HSM event from the dispatcher.
721 /// HANDLE - Application framework handle
722 /// \param [in] pServiceName
723 /// PCSTR - Service Name
724 /// \param [in] puiCmdArray
725 /// const PUI_32 - Array of commands
726 /// \param [in] uiCmdCount
727 /// UI_32 - Number of Commands
728 /// \param [in] hSession
729 /// HANDLE - Session Handle.
732 /// EFrameworkunifiedStatus - success or error
736 EFrameworkunifiedStatus FrameworkunifiedDetachHSMEventsFromDispatcher(HANDLE hApp, PCSTR pServiceName, const PUI_32 puiCmdArray,
737 UI_32 uiCmdCount, HANDLE hSession = NULL);
739 /////////////////////////////////////////////////////////////////////////////////////
740 /// \ingroup FrameworkunifiedDetachHSMEventFromDispatcher
741 /// \~english @par Brief
742 /// detach an event from the dispatcher
743 /// \~english @param [in] hApp
744 /// HANDLE hApp - Application framework handle
745 /// \~english @param [in] pServiceName
746 /// PCSTR pServiceName - Service Name
747 /// \~english @param [in] iCmd
748 /// UI_32 iCmd - service protocol command/request/acknowledgment ID
749 /// \~english @param [in] hSession
750 /// HANDLE hSession - Session Handle.
751 /// \~english @retval eFrameworkunifiedStatusOK success
752 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
753 /// \~english @retval eFrameworkunifiedStatusFail process failed
754 /// \~english @par Prerequisite
755 /// - Generation/Initialization of Dispatcher for the Application by FrameworkunifiedHSMDispatcherWithArguments has been done.
756 /// \~english @par Change of internal state
758 /// \~english @par Conditions of processing failure
759 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
760 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
761 /// - Pointer to service name specified in the argument (pServiceName) is NULL [eFrameworkunifiedStatusInvldHandle]
762 /// - Pointer(pServiceName) to service name doesn't exist [eFrameworkunifiedStatusFail]
763 /// \~english @par Detail
764 /// Detach an event information for service specified in the argument from dispatcher.\n
765 /// After that, when receiving command from service, post the event to unactive state.\n
766 /// If the information has been deleted or the specific iCmd has not been registered, return eFrameworkunifiedStatusOK.\n
768 /// Please note the following points when using this API for application.
769 /// - Operation is not guaranteed if a different handle is set for an application handle.
770 /// - Operation is not guaranteed if an invalid handle is set for a session handle.
771 /// \~english @par Classification
773 /// \~english @par Type
775 /// \~english @see FrameworkunifiedDetachHSMEventsFromDispatcher
777 ////////////////////////////////////////////////////////////////////////////////////////////
778 ////////////////////////////////////////////////////////////////////////////////////////////
779 ////////////////////////////////////////////////////////////////////////////////////////////
780 /// FrameworkunifiedDetachHSMEventFromDispatcher
781 /// API to detach a notification HSM event from the dispatcher.
785 /// HANDLE - Application framework handle
786 /// \param [in] pServiceName
787 /// PCSTR - Service Name
789 /// UI_32 - service protocol command/request/acknowledgment ID
790 /// \param [in] hSession
791 /// HANDLE - Session Handle.
794 /// EFrameworkunifiedStatus - success or error
798 EFrameworkunifiedStatus FrameworkunifiedDetachHSMEventFromDispatcher(HANDLE hApp, PCSTR pServiceName, UI_32 iCmd, HANDLE hSession = NULL);
800 ////////////////////////////////////////////////////////////////////////////////////////////
801 /// \ingroup FrameworkunifiedGetStateMachine
802 /// \~english @par Brief
803 /// Get pointer to the statemachine object.
804 /// \~english @param [in] hApp
805 /// HANDLE - Handle to the framework application
806 /// \~english @retval CFrameworkunifiedHSMParentFramework* pointer to the statemachine object
807 /// \~english @retval NULL Failed to get pointer to the statemachine object
808 /// \~english @par Prerequisite
809 /// - Generation/Initialization of Dispatcher for the Application by FrameworkunifiedHSMDispatcherWithArguments has been done.
810 /// \~english @par Change of internal state
811 /// - Change of internal state according to the API does not occur.
812 /// \~english @par Conditions of processing failure
813 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) . [NULL]
814 /// - HANDLE specified in the argument (hApp) is not generated by FrameworkunifiedHSMDispatcherWithArguments. [NULL]
815 /// \~english @par Detail
816 /// Get pointer to the statemachine object associated with application framework handle.\n
817 /// Do not release the statemachine object in application, because it is a part of the Dispathcer.
818 /// \~english @par Classification
820 /// \~english @par Type
822 /// \~english @see FrameworkunifiedHSMDispatcherWithArguments,FrameworkunifiedSetStateMachine
823 ////////////////////////////////////////////////////////////////////////////////////////////
824 /// FrameworkunifiedGetStateMachine
825 /// returns the pointer to the statemachine object
828 /// HANDLE - Handle to the application session
830 /// \return pointer to the StateMachine object
831 /// CFrameworkunifiedHSMParentFramework* - pointer to the StateMachine object
835 CFrameworkunifiedHSMFramework *FrameworkunifiedGetStateMachine(HANDLE hApp);
837 /////////////////////////////////////////////////////////////////////////////////////
838 /// \ingroup FrameworkunifiedDetachHSMEventFromDispatcher
839 /// \~english @par Brief
840 /// subscribing to single event of a service. attaches the session event with HSM events.
841 /// \~english @param [in] hApp
842 /// HANDLE hApp - Application handle
843 /// \~english @param [in] uiEventId
844 /// UI_32 uiEventId - Session Event id
845 /// \~english @param [in] uiHSMEventId
846 /// UI_32 uiHSMEventId- Statemachine Event id
847 /// \~english @param [in] hSession
848 /// HANDLE hSession - Session Handle.
849 /// \~english @retval eFrameworkunifiedStatusOK success
850 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
851 /// \~english @retval eFrameworkunifiedStatusFail process failed
852 /// \~english @par Prerequisite
854 /// \~english @par Change of internal state
856 /// \~english @par Conditions of processing failure
857 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
858 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
859 /// \~english @par Detail
860 /// This API is used for subscribing to single event of a service.
861 /// This API also attaches the session event with HSM events.
862 /// \~english @par Classification
864 /// \~english @par Type
868 ////////////////////////////////////////////////////////////////////////////////////////////
869 ////////////////////////////////////////////////////////////////////////////////////////////
870 /// FrameworkunifiedSubscribeToSessionEventWithHSMEvent
871 /// This API is used for subscribing to single event of a service.
872 /// This API also attaches the session event with HSM events.
875 /// HANDLE - Application handle
876 /// \param [in] uiEventId
877 /// UI_32 - Session Event id
878 /// \param [in] uiHSMEventId
879 /// UI_32 - Statemachine Event id
880 /// \param [in] hSession
881 /// HANDLE - Session handle
884 /// EFrameworkunifiedStatus - success or error
886 /// \see FrameworkunifiedSubscribeToSessionEventsWithHSMEvents
888 ////////////////////////////////////////////////////////////////////////////////////////////
889 EFrameworkunifiedStatus FrameworkunifiedSubscribeToSessionEventWithHSMEvent(HANDLE hApp, UI_32 uiEventId, UI_32 uiHSMEventId, HANDLE hSession);
891 /////////////////////////////////////////////////////////////////////////////////////
892 /// \ingroup FrameworkunifiedDetachHSMEventFromDispatcher
893 /// \~english @par Brief
894 /// subscribing to multiple events of a service. attaches the session events with HSM events.
895 /// \~english @param [in] hApp
896 /// HANDLE hApp - Application handle
897 /// \~english @param [in] pEventIds
898 /// const FrameworkunifiedProtocolEvent *pEventIds - structure mapping session event id's with the hsm event id's
899 /// \~english @param [in] uiEventCount
900 /// UI_32 uiEventCount - count of events
901 /// \~english @param [in] hSession
902 /// HANDLE hSession - Session Handle.
903 /// \~english @retval eFrameworkunifiedStatusOK success
904 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
905 /// \~english @retval eFrameworkunifiedStatusFail process failed
906 /// \~english @par Prerequisite
908 /// \~english @par Change of internal state
910 /// \~english @par Conditions of processing failure
911 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
912 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
913 /// - Pointer to FrameworkunifiedProtocolEvent structure specified in the argument is NULL [eFrameworkunifiedStatusInvldHandle]
914 /// \~english @par Detail
915 /// This API is used for subscribing to multiple events of a service.
916 /// his API also attaches the session events with hsm events.
917 /// \~english @par Classification
919 /// \~english @par Type
923 ////////////////////////////////////////////////////////////////////////////////////////////
924 ////////////////////////////////////////////////////////////////////////////////////////////
925 /// FrameworkunifiedSubscribeToSessionEventsWithHSMEvents
926 /// This API is used for subscribing to multiple events of a service.
927 /// This API also attaches the session events with hsm events.
930 /// HANDLE - Application handle
931 /// \param [in] pEventIds
932 /// FrameworkunifiedProtocolEvent - structure mapping session event id's with the hsm event id's
933 /// \param [in] uiEventCount
934 /// UI_32 - count of events
935 /// \param [in] hSession
936 /// HANDLE - Session handle
939 /// EFrameworkunifiedStatus - success or error
941 /// \see FrameworkunifiedSubscribeToSessionEventWithHSMEvent
943 ////////////////////////////////////////////////////////////////////////////////////////////
944 EFrameworkunifiedStatus FrameworkunifiedSubscribeToSessionEventsWithHSMEvents(HANDLE hApp, const FrameworkunifiedProtocolEvent *pEventIds, UI_32 uiEventCount,
947 /////////////////////////////////////////////////////////////////////////////////////
948 /// \ingroup FrameworkunifiedDetachHSMEventFromDispatcher
949 /// \~english @par Brief
950 /// unsubscribe from event of a service. detaches HSM event from session event.
951 /// \~english @param [in] hApp
952 /// HANDLE hApp - Application handle
953 /// \~english @param [in] uiEventId
954 /// UI_32 uiEventId - Event id
955 /// \~english @param [in] hSession
956 /// HANDLE hSession - Session Handle.
957 /// \~english @retval eFrameworkunifiedStatusOK success
958 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
959 /// \~english @retval eFrameworkunifiedStatusFail process failed
960 /// \~english @par Prerequisite
962 /// \~english @par Change of internal state
964 /// \~english @par Conditions of processing failure
965 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
966 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
967 /// \~english @par Detail
968 /// API to unsubscribe from event of a service. Also detaches HSM event from session event.
969 /// \~english @par Classification
971 /// \~english @par Type
975 ////////////////////////////////////////////////////////////////////////////////////////////
976 ////////////////////////////////////////////////////////////////////////////////////////////
977 /// FrameworkunifiedUnSubscribeSessionEventWithHSMEvent
978 /// API to unsubscribe from event of a service. Also detaches HSM event from session event.
981 /// HANDLE - Application Handle
982 /// \param [in] uiEventId
984 /// \param [in] hSession
985 /// HANDLE - Session Handle
988 /// EFrameworkunifiedStatus - success or error
990 /// \see FrameworkunifiedUnSubscribeSessionEventsWithHSMEvents
992 ////////////////////////////////////////////////////////////////////////////////////////////
993 EFrameworkunifiedStatus FrameworkunifiedUnSubscribeSessionEventWithHSMEvent(HANDLE hApp, UI_32 uiEventId, HANDLE hSession);
995 /////////////////////////////////////////////////////////////////////////////////////
996 /// \ingroup FrameworkunifiedDetachHSMEventFromDispatcher
997 /// \~english @par Brief
998 /// unsubscribe from multiple events of a service. detaches HSM events from session events.
999 /// \~english @param [in] hApp
1000 /// HANDLE hApp - Application handle
1001 /// \~english @param [in] pEventsArray
1002 /// PUI_32 pEventsArray - Array of events id's.
1003 /// \~english @param [in] uiListSize
1004 /// UI_32 uiListSize - count of elements in array.
1005 /// \~english @param [in] hSession
1006 /// HANDLE hSession - Session Handle.
1007 /// \~english @retval eFrameworkunifiedStatusOK success
1008 /// \~english @retval eFrameworkunifiedStatusInvldHandle invalid state handle
1009 /// \~english @retval eFrameworkunifiedStatusFail process failed
1010 /// \~english @par Prerequisite
1012 /// \~english @par Change of internal state
1014 /// \~english @par Conditions of processing failure
1015 /// - HANDLE specified in the argument (hApp) is NULL [eFrameworkunifiedStatusInvldHandle]
1016 /// - HANDLE specified in the argument (hApp) is not appropriate (which is invalid) [eFrameworkunifiedStatusInvldHandle]
1017 /// \~english @par Detail
1018 /// API to unsubscribe from multiple events of a service. Also detaches HSM events from session events.
1019 /// \~english @par Classification
1021 /// \~english @par Type
1025 ////////////////////////////////////////////////////////////////////////////////////////////
1026 ////////////////////////////////////////////////////////////////////////////////////////////
1027 /// FrameworkunifiedUnSubscribeSessionEventsWithHSMEvents
1028 /// API to unsubscribe from multiple events of a service. Also detaches HSM events from session events.
1030 /// \param [in] hApp
1031 /// HANDLE - Application Handle
1032 /// \param [in] pEventsArray
1033 /// PUI_32 - Array of events id's.
1034 /// \param [in] uiListSize
1035 /// UI_32 - count of elements in array.
1036 /// \param [in] hSession
1037 /// HANDLE - Session Handle
1040 /// EFrameworkunifiedStatus - success or error
1042 /// \see FrameworkunifiedUnSubscribeSessionEventWithHSMEvent
1044 ////////////////////////////////////////////////////////////////////////////////////////////
1045 EFrameworkunifiedStatus FrameworkunifiedUnSubscribeSessionEventsWithHSMEvents(HANDLE hApp, PUI_32 pEventsArray, UI_32 uiListSize,
1048 #endif /* __FRAMEWORKUNIFIED_NATIVESERVICES_NATIVESERVICES_INC_FRAMEWORK_STATEMACHINE_FRAMEWORKUNIFIED_SM_FRAMEWORK_DISPATCH_H__ */ // NOLINT (build/header_guard)