4d38828a6f28ba4895e2303be17e1db7ec80dacc
[staging/basesystem.git] / nsframework / framework_unified / client / NS_FrameworkCore / include / frameworkunified_framework_internal.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_NSFramework
19 /// \brief   Internal functions of the application framework.
20 ///
21 ///
22 ///
23 ///////////////////////////////////////////////////////////////////////////////
24
25 #ifndef FRAMEWORK_UNIFIED_CLIENT_NS_FRAMEWORKCORE_INCLUDE_FRAMEWORKUNIFIED_FRAMEWORK_INTERNAL_H_
26 #define FRAMEWORK_UNIFIED_CLIENT_NS_FRAMEWORKCORE_INCLUDE_FRAMEWORKUNIFIED_FRAMEWORK_INTERNAL_H_
27
28 #include <native_service/ns_shared_mem_if.h>
29 #include <native_service/frameworkunified_types.h>
30 #include "frameworkunified_framework_core.h"
31 #define PASA_APPCONFIG_FILES "PASA_APPCONFIG_FILES"
32
33 #define FRAMEWORKUNIFIEDLOG_CUT(zone, funcname, print_fmt, args...)
34
35 //////////////////////////////////////////////////
36 // dispatcher internal functions
37 //////////////////////////////////////////////////
38
39 ////////////////////////////////////////////////////////////////////////////////////////////
40 /// FrameworkunifiedAttachSystemCallbacksDispatcher
41 /// All system defined callbacks will be attached to the dispatcher
42 ///
43 /// \param [in] hApp
44 ///         HANDLE - Handle to the application framework.
45 ///
46 /// \return eStatus
47 ///         EFrameworkunifiedStatus - success or error
48 ///
49 ///
50 ////////////////////////////////////////////////////////////////////////////////////////////
51 EFrameworkunifiedStatus FrameworkunifiedAttachSystemCallbacksDispatcher(HANDLE hApp);
52
53 ////////////////////////////////////////////////////////////////////////////////////////////
54 /// FrameworkunifiedSendSystemErrMessage
55 /// This API is used to send application's critical error message to system manager.
56 ///
57 /// \param [in] hApp
58 ///         HANDLE - Handle to the application framework.
59 /// \param [in] eSystemError
60 ///         EFrameworkunifiedSystemError - System error type
61 ///
62 /// \return EFrameworkunifiedStatus - success or error
63 ///
64 ///
65 ////////////////////////////////////////////////////////////////////////////////////////////
66 EFrameworkunifiedStatus FrameworkunifiedSendSystemErrMessage(HANDLE hApp, EFrameworkunifiedSystemError eSystemError);
67
68 ////////////////////////////////////////////////////////////////////////////////////////////
69 /// FrameworkunifiedCreateDispatcher
70 /// Creates and initializes an applications/threads dispatcher.
71 ///
72 /// \param [in] cAppname
73 ///         PCSTR - Application/ thread name
74 /// \param [out] hApp
75 ///         HANDLE& - Reference of application handle
76 /// \param [in] bIsChildThread
77 ///         BOOL - child thread
78 ///
79 /// \return status
80 ///         EFrameworkunifiedStatus - eFrameworkunifiedStatusOK if Success
81 ///            possible errors from call CreateDispatcher
82 ///
83 /// \see FrameworkunifiedDispatchBlock,
84 ///      FrameworkunifiedDispatchProcess, FrameworkunifiedCloseDispatcher,
85 ///
86 ////////////////////////////////////////////////////////////////////////////////////////////
87 EFrameworkunifiedStatus FrameworkunifiedCreateDispatcher(PCSTR cAppName, HANDLE &hApp, BOOL bIsChildThread);  // NOLINT  (readability/nolint)
88
89 ////////////////////////////////////////////////////////////////////////////////////////////
90 /// FrameworkunifiedCreateHSMDispatcher
91 /// Creates and initializes an applications/threads hsm dispatcher.
92 ///
93 /// \param [in] cAppname
94 ///         PCSTR - Application/ thread name
95 /// \param [out] hApp
96 ///         HANDLE& - Reference of application handle
97 /// \param [in] bIsThread
98 ///         BOOL - child thread
99 /// \param [in] f_pFrameworkunifiedHSM
100 ///         CFrameworkunifiedHSMFramework* - statemachine instances
101 ///
102 /// \return status
103 ///         EFrameworkunifiedStatus - eFrameworkunifiedStatusOK if Success
104 ///            possible errors from call CreateDispatcher
105 ///
106 ////////////////////////////////////////////////////////////////////////////////////////////
107 EFrameworkunifiedStatus FrameworkunifiedCreateHSMDispatcher(PCSTR cAppName,
108                                   HANDLE &hApp,  // NOLINT  (readability/nolint)
109                                   BOOL bIsThread,
110                                   CFrameworkunifiedHSMFramework *f_pFrameworkunifiedHSM = NULL);
111
112 ////////////////////////////////////////////////////////////////////////////////////////////
113 /// FrameworkunifiedDispatchBlock
114 /// Blocked until the dipatcher receives a notification of a service request or ack.
115 ///
116 /// \param [in] hApp
117 ///         HANDLE - Application framework handle
118 ///
119 /// \return status
120 ///         EFrameworkunifiedStatus -Success or error
121 ///
122 /// \see FrameworkunifiedCreateDispatcher,
123 ///      FrameworkunifiedDispatchProcess, FrameworkunifiedCloseDispatcher,
124 ///
125 ////////////////////////////////////////////////////////////////////////////////////////////
126 EFrameworkunifiedStatus FrameworkunifiedDispatchBlock(HANDLE hApp);
127
128 ////////////////////////////////////////////////////////////////////////////////////////////
129 /// frameworkunifiedFdHandler
130 /// FD POLLIN blocked & process.
131 ///
132 /// \param [in] hApp
133 ///         HANDLE - Application framework handle
134 /// \param [in] efd
135 ///         int - epoll FD
136 ///
137 /// \return status
138 ///         EFrameworkunifiedStatus -Success or error
139 ///
140 /// \see FrameworkunifiedCreateDispatcher, FrameworkunifiedDispatchProcess, FrameworkunifiedDispatchBlock,
141 ///
142 ////////////////////////////////////////////////////////////////////////////////////////////
143 EFrameworkunifiedStatus frameworkunifiedFdHandler(HANDLE hApp , int efd);
144
145 ////////////////////////////////////////////////////////////////////////////////////////////
146 /// FrameworkunifiedDispatchProcess
147 /// Processes the Service/system request or notification.
148 ///
149 /// \param [in] hApp
150 ///         HANDLE - Application framework handle
151 ///
152 /// \return status
153 ///         EFrameworkunifiedStatus -Success or error
154 ///
155 /// \see FrameworkunifiedCreateDispatcher, FrameworkunifiedDispatchBlock
156 ///      FrameworkunifiedCloseDispatcher,
157 ///
158 /// \details
159 /// \code
160 /// Pseudo code:
161 ///   IF message_source != Notification Service
162 ///     FIND source_name
163 ///       IF source_name available
164 ///         FIND protocol_cmd
165 ///           IF protocol_cmd available
166 ///             execute callback
167 ///           ELSE
168 ///             ignore
169 ///           END
170 ///       ELSE
171 ///         ignore
172 ///       END
173 ///   ELSE  // notification
174 ///     FIND notification_callback
175 ///       IF available
176 ///         execute callback
177 ///   END
178 /// \endcode
179 ////////////////////////////////////////////////////////////////////////////////////////////
180 EFrameworkunifiedStatus FrameworkunifiedDispatchProcess(HANDLE hApp);
181
182 ////////////////////////////////////////////////////////////////////////////////////////////
183 /// FrameworkunifiedCloseDispatcher
184 /// Closing the dispatcher
185 ///
186 /// \param [in] hApp
187 ///         HANDLE - Application framework handle
188 ///
189 /// \return status
190 ///         EFrameworkunifiedStatus -Success or error
191 ///
192 /// \see FrameworkunifiedCreateDispatcher, FrameworkunifiedDispatchBlock
193 ///      FrameworkunifiedDispatchProcess.
194 ///
195 ////////////////////////////////////////////////////////////////////////////////////////////
196 EFrameworkunifiedStatus FrameworkunifiedCloseDispatcher(HANDLE hApp);
197
198
199 ////////////////////////////////////////////////////////////////////////////////////////////
200 /// FrameworkunifiedPopedDeferedMessage
201 /// Checks the Defer'ed Message Queue should be pop'ed off
202 /// the front of the queue!
203 ///
204 /// \param [in] hApp
205 ///         HANDLE - Application framework handle
206 ///
207 /// \return status
208 ///         BOOL -  TRUE (a message has been pop'ed of the defer'ed msg queue)
209 ///         FALSE (no msg was pop'ed of the defer'ed msg queue)
210 ///
211 /// \see FrameworkunifiedCreateDispatcher, FrameworkunifiedDispatchBlock
212 ///      FrameworkunifiedDispatchProcess.
213 ///
214 ////////////////////////////////////////////////////////////////////////////////////////////
215 BOOL FrameworkunifiedPopedDeferedMessage(HANDLE hApp);
216
217
218
219 ////////////////////////////////////////////////////////////////////////////////////////////
220 /// FrameworkunifiedDispatcherMain
221 /// Main processing loop that is shared between FrameworkunifiedDispacther and FrameworkunifiedDispatcherWithCmdLnArguments.
222 ///
223 /// \param [in] hApp
224 ///         HANDLE - Application framework handle
225 ///
226 /// \return status
227 ///         BOOL -  TRUE (a message has been pop'ed of the defer'ed msg queue)
228 ///         FALSE (no msg was pop'ed of the defer'ed msg queue)
229 ///
230 /// \see FrameworkunifiedCreateDispatcher, FrameworkunifiedDispatchBlock
231 ///      FrameworkunifiedDispatchProcess.
232 ///
233 ////////////////////////////////////////////////////////////////////////////////////////////
234 EFrameworkunifiedStatus FrameworkunifiedDispatcherMain(HANDLE hApp);
235
236 EFrameworkunifiedStatus FrameworkunifiedHSMDispatcherMain(HANDLE hApp);
237
238
239 ////////////////////////////////////////////////////////////////////////////////////////////
240 /// FrameworkunifiedDispatcherMain
241 /// Main processing loop that is shared between FrameworkunifiedDispacther and FrameworkunifiedDispatcherWithCmdLnArguments.
242 ///
243 /// \param [in] hApp
244 ///         HANDLE - Application framework handle
245 ///
246 /// \return status
247 ///         BOOL -  TRUE (a message has been pop'ed of the defer'ed msg queue)
248 ///         FALSE (no msg was pop'ed of the defer'ed msg queue)
249 ///
250 /// \see FrameworkunifiedCreateDispatcher, FrameworkunifiedDispatchBlock
251 ///      FrameworkunifiedDispatchProcess.
252 ///
253 ////////////////////////////////////////////////////////////////////////////////////////////
254 EFrameworkunifiedStatus FrameworkunifiedArgumentParser(HANDLE hApp, int argc, char *argv[], CustomCommandLineOptions *cmdLineOptions);
255
256
257 EFrameworkunifiedStatus FrameworkunifiedOnInitializationInternal(HANDLE hApp);
258 EFrameworkunifiedStatus FrameworkunifiedOnDestroyInternal(HANDLE hApp);
259 EFrameworkunifiedStatus FrameworkunifiedOnStartInternal(HANDLE hApp);
260 EFrameworkunifiedStatus FrameworkunifiedOnStopInternal(HANDLE hApp);
261 EFrameworkunifiedStatus FrameworkunifiedOnPreStartInternal(HANDLE hApp);
262 EFrameworkunifiedStatus FrameworkunifiedOnPreStopInternal(HANDLE hApp);
263 EFrameworkunifiedStatus FrameworkunifiedOnBackgroundStartInternal(HANDLE hApp);
264 EFrameworkunifiedStatus FrameworkunifiedOnBackgroundStopInternal(HANDLE hApp);
265 EFrameworkunifiedStatus FrameworkunifiedOnDebugDumpInternal(HANDLE hApp);
266 EFrameworkunifiedStatus FrameworkunifiedCreateStateMachineInternal(HANDLE hApp);
267 EFrameworkunifiedStatus FrameworkunifiedSSFrameworkInterfaceInternal(HANDLE hApp);
268 EFrameworkunifiedStatus RegistDefaultCbHandler(const FrameworkunifiedDefaultCallbackHandler *CbHandler);
269
270
271 //////////////////////////////////////////////////
272 // message center internal functions
273 //////////////////////////////////////////////////
274
275
276
277 ////////////////////////////////////////////////////////////////////////////////////////////
278 /// frameworkunifiedGetIsTypeOfSync
279 /// Gets if message type is sync, return TRUE. or not return FALSE
280 ///
281 /// \param [in] hApp
282 ///         HANDLE - Handle to a Application Framework
283 ///
284 /// \return status
285 ///         BOOL - TRUE or FALSE
286 ///
287 /// \see FrameworkunifiedInvokeSync, frameworkunifiedSendSyncResponse
288 ///
289 ////////////////////////////////////////////////////////////////////////////////////////////
290 BOOL frameworkunifiedGetIsTypeOfSync(HANDLE hApp);
291
292 ////////////////////////////////////////////////////////////////////////////////////////////
293 /// FrameworkunifiedSendSyncResponse
294 /// Send Sync Response to the hApp.
295 ///
296 /// \param [in] hApp
297 ///         HANDLE - Handle to the dispatcher to receive message
298 /// \param [in] seq_id
299 ///         UI_32 - Sync sequence ID
300 /// \param [in] retValue
301 ///         EFrameworkunifiedStatus - Return Status
302 /// \param [in] length
303 ///         UI_32 - Length of the data to be receive response.
304 /// \param [in] data
305 ///         PVOID - Pointer to the response data.
306 ///
307 /// \return status
308 ///         EFrameworkunifiedStatus - success or error
309 ///
310 /// \see FrameworkunifiedInvokeSync
311 ///
312 ////////////////////////////////////////////////////////////////////////////////////////////
313 EFrameworkunifiedStatus frameworkunifiedSendSyncResponse(HANDLE hApp, UI_32 iCmd, UI_32 seq_id, EFrameworkunifiedStatus retValue, UI_32 length, PCVOID data);
314
315 //////////////////////////////////////////////////
316 // logger internal functions
317 //////////////////////////////////////////////////
318 EFrameworkunifiedStatus FrameworkunifiedAttachLoggerCallbacksDispatcher(HANDLE hApp);
319
320 #ifdef DISPATCHER_PROFILER
321 ////////////////////////////////////////////////////////////////////////////////////////////
322 /// FrameworkunifiedAttachMsgProfilerCallbacksDispatcher
323 /// This function attaches callback function for profiler protocol for main thread.
324 /// Protocol is attached considering the source as "nsprofilerutil"
325 ///
326 /// \param [in] hApp
327 ///         HANDLE - Handle to a Application Framework
328 ///
329 /// \return status
330 ///         EFrameworkunifiedStatus - success or error
331 ///
332 ////////////////////////////////////////////////////////////////////////////////////////////
333 EFrameworkunifiedStatus FrameworkunifiedAttachMsgProfilerCallbacksDispatcher(HANDLE hApp);
334
335 ////////////////////////////////////////////////////////////////////////////////////////////
336 /// FrameworkunifiedAttachMsgProfilerCallbacksDispatcher
337 /// This function attaches callback function for profiler protocol for child threads.
338 /// Protocol is attached considering the source as parent thread
339 ///
340 /// \param [in] hApp
341 ///         HANDLE - Handle to a Application Framework
342 ///
343 /// \return status
344 ///         EFrameworkunifiedStatus - success or error
345 ///
346 ////////////////////////////////////////////////////////////////////////////////////////////
347 EFrameworkunifiedStatus FrameworkunifiedAttachChildMsgProfilerCallbacksDispatcher(HANDLE hApp);
348 #endif
349
350 EFrameworkunifiedStatus FrameworkunifiedSetLogMask(HANDLE hApp);
351 EFrameworkunifiedStatus FrameworkunifiedGetLogMask(HANDLE hApp);
352 EFrameworkunifiedStatus FrameworkunifiedSetOutputLogOpts(HANDLE hApp);
353 EFrameworkunifiedStatus FrameworkunifiedGetOutputLogOpts(HANDLE hApp);
354 EFrameworkunifiedStatus FrameworkunifiedSetLogSeverity(HANDLE hApp);
355 EFrameworkunifiedStatus FrameworkunifiedGetLogSeverity(HANDLE hApp);
356 EFrameworkunifiedStatus FrameworkunifiedDebugDumpRequest(HANDLE hApp);
357
358 EFrameworkunifiedStatus NSRcsSetLogSettings(HANDLE hApp);
359 EFrameworkunifiedStatus NSRcsGetLogSettings(HANDLE hApp);
360 EFrameworkunifiedStatus NSRcsSetLogMask(HANDLE hApp);
361 EFrameworkunifiedStatus NSRcsSetOutputLogOpts(HANDLE hApp);
362 EFrameworkunifiedStatus NSRcsSetLogSeverity(HANDLE hApp);
363
364 ////////////////////////////////////////////////////////////////////////////////////////////
365 /// SetConfigHandle
366 /// This Function opens the configuration file from given path and sets the file handle in hApp
367 ///
368 /// \param [in] cAppname
369 ///         HANDLE - Application handle
370 /// \param [in] sFilePath
371 ///         PCHAR - File path of the config file
372 ///
373 /// \return status of the operation
374 ///
375 /// \see SetDefaultFilePath,
376 ///
377 ////////////////////////////////////////////////////////////////////////////////////////////
378 EFrameworkunifiedStatus SetConfigHandle(HANDLE hApp, PCHAR sFilePath);
379
380 ////////////////////////////////////////////////////////////////////////////////////////////
381 /// SetDefaultFilePath
382 /// This Function fetches the default config path, opens the configuration file and sets the file
383 /// handle in the application
384 ///
385 /// \param [in] cAppname
386 ///         HANDLE - Application handle
387 /// \param [in] sFilePath
388 ///         PCHAR - File path of the config file
389 ///
390 /// \return status of the operation
391 ///
392 ////////////////////////////////////////////////////////////////////////////////////////////
393 EFrameworkunifiedStatus SetDefaultConfigFile(HANDLE hApp);
394
395 EFrameworkunifiedStatus FrameworkunifiedProcessServiceProtocolHSMEvent(HANDLE hApp, PCSTR pRequester);
396
397 ////////////////////////////////////////////////////////////////////////////////////////////
398 /// ProcessProtocolEvents
399 /// This Function registers the events of server with the client.
400 /// If the event is published previously and is a state event then send the event data to the client.
401 ///
402 /// \param [in] hApp
403 ///         HANDLE - Application handle
404 ///
405 /// \return status of the operation
406 ///
407 ////////////////////////////////////////////////////////////////////////////////////////////
408 EFrameworkunifiedStatus ProcessProtocolEvents(HANDLE hApp);
409
410 ////////////////////////////////////////////////////////////////////////////////////////////
411 /// ProcessPrivateEvents
412 /// This Function registers the events of server with the client.
413 /// If the event is published previously and is a state event then send the event data to the client.
414 ///
415 /// \param [in] hApp
416 ///         HANDLE - Application handle
417 ///
418 /// \return status of the operation
419 ///
420 ////////////////////////////////////////////////////////////////////////////////////////////
421 EFrameworkunifiedStatus ProcessPrivateEvents(HANDLE hApp);
422
423 ////////////////////////////////////////////////////////////////////////////////////////////
424 /// CleanAllEventsOfSession
425 /// This Function closes the session handle and removes its entry from the table of
426 /// ServiceSessionHandleTable of application framework handle.
427 ///
428 /// \param [in] hApp
429 ///         HANDLE - Application handle
430 /// \param [in] serviceName
431 ///         PCSTR - Name of a service
432 /// \param [in] sessionId
433 ///         UI_32 - Session id
434 ///
435 /// \return status of the operation
436 ///
437 ////////////////////////////////////////////////////////////////////////////////////////////
438 EFrameworkunifiedStatus CleanAllEventsOfSession(HANDLE hApp, PCSTR serviceName, UI_32 sessionId);
439
440 ////////////////////////////////////////////////////////////////////////////////////////////
441 /// RemoveEntryFromSessionEventInfoTable
442 /// This Function removes the entry of event id from the session table based on the service
443 /// name and session id.
444 ///
445 /// \param [in] hApp
446 ///         HANDLE - Application handle
447 /// \param [in] serviceName
448 ///         PCSTR - Name of service
449 /// \param [in] sessionId
450 ///         UI_32 - Session id
451 /// \param [in] eventId
452 ///         UI_32 - Event id which needs to be removed from internal table
453 ///
454 /// \return eFrameworkunifiedStatusOK- Success, or eFrameworkunifiedStatusFail
455 ///
456 ////////////////////////////////////////////////////////////////////////////////////////////
457 EFrameworkunifiedStatus RemoveEntryFromSessionEventInfoTable(HANDLE hApp, PCSTR serviceName, UI_32 sessionId, UI_32 eventId);
458
459 ////////////////////////////////////////////////////////////////////////////////////////////
460 /// HandleSessionEventOnCloseSession
461 /// This Function does the handling of session events on close session request
462 ///
463 /// \param [in] hApp
464 ///         HANDLE - Application handle
465 ///
466 /// \return status of the operation
467 ///
468 ////////////////////////////////////////////////////////////////////////////////////////////
469 EFrameworkunifiedStatus HandleSessionEventOnCloseSession(HANDLE hApp);
470
471 ////////////////////////////////////////////////////////////////////////////////////////////
472 /// UnregisterPrivateEvents
473 /// This Function unregisters the private event.
474 ///
475 /// \param [in] hApp
476 ///         HANDLE - Application handle
477 ///
478 /// \return status of the operation
479 ///
480 ////////////////////////////////////////////////////////////////////////////////////////////
481 EFrameworkunifiedStatus UnregisterPrivateEvents(HANDLE hApp);
482
483 ////////////////////////////////////////////////////////////////////////////////////////////
484 /// GetMsgQueueHandle
485 /// Gets the message queue handle from servicesessionhandletable map.
486 ///
487 /// \param [in] hApp
488 ///         HANDLE - Application handle
489 /// \param [in] serviceName
490 ///         PCSTR - Service name of receiver
491 /// \param [in] uiSessionId
492 ///         UI_32 - session id
493 ///
494 /// \return Message queue handle
495 ///
496 ////////////////////////////////////////////////////////////////////////////////////////////
497 HANDLE GetMsgQueueHandle(HANDLE hApp, PCSTR serviceName, const UI_32 uiSessionId);
498
499 ////////////////////////////////////////////////////////////////////////////////////////////
500 /// GetNewMsgQueueHandle
501 /// This function creates and returns the message queue handle.
502 ///
503 /// \param [in] hApp
504 ///         HANDLE - Application handle
505 /// \param [in] serviceName
506 ///         PCSTR - Service name of receiver
507 /// \param [in] uiSessionId
508 ///         UI_32 - session id
509 /// \param [in] uiEventId
510 ///         const UI_32 - event id
511 ///
512 /// \return Message queue handle
513 ///
514 ////////////////////////////////////////////////////////////////////////////////////////////
515 HANDLE GetNewHandleAndUpdateEventInfoTable(HANDLE hApp, PCSTR serviceName, const UI_32 uiSessionId,
516                                            const UI_32 uiEventId);
517
518 ////////////////////////////////////////////////////////////////////////////////////////////
519 /// IsEventAlreadyRegistered
520 /// Searches for the session id in the vector
521 ///
522 /// \param [in] vSessionIdList
523 ///         SessionIdList - list of sessions id's
524 /// \param [in] uiSessionId
525 ///         UI_32 - session id
526 ///
527 /// \return true or false
528 ///
529 ////////////////////////////////////////////////////////////////////////////////////////////
530 BOOL IsEventAlreadyRegistered(const SessionIdList &vSessionIdList, const UI_32 uiSessionId);
531
532 ////////////////////////////////////////////////////////////////////////////////////////////
533 /// RemoveEventEntryFromEventTable
534 /// This Function removes the entry of event for received service on the active session id
535 /// from Event Table.
536 ///
537 /// \param [in] hApp
538 ///         HANDLE - Application handle
539 /// \param [in] uiEventId
540 ///         UI_32 - event id
541 /// \param [in] serviceName
542 ///         PCSTR - Service name of receiver
543 /// \param [in] uiSessionId
544 ///         UI_32 - session id
545 ///
546 /// \return success or failure
547 ///
548 ////////////////////////////////////////////////////////////////////////////////////////////
549 EFrameworkunifiedStatus RemoveEventEntryFromEventTable(HANDLE hApp, UI_32 uiEventId, PCSTR cServiceName, const UI_32 uiSessionId);
550
551 ////////////////////////////////////////////////////////////////////////////////////////////
552 /// SendEventMessage
553 /// This function sends the private event message to all the sessions of service registered
554 /// for event.
555 ///
556 /// \param [in] hApp
557 ///         HANDLE - Application handle
558 /// \param [in] vSessionIdList
559 ///         SessionIdList - session id list
560 /// \param [in] uiEventId
561 ///         UI_32 - event id
562 /// \param [in] cServiceName
563 ///         PCSTR - Service name of receiver
564 /// \param [in] pData
565 ///         PCVOID - data to send
566 /// \param [in] uiLength
567 ///         UI_32 - length of data
568 ///
569 /// \return success or failure
570 ///
571 ////////////////////////////////////////////////////////////////////////////////////////////
572 EFrameworkunifiedStatus SendEventMessage(HANDLE hApp, const SessionIdList &vSessionIdList, UI_32 uiEventId, PCSTR cServiceName,
573                             PCVOID pData, UI_32 uiLength);
574
575 ////////////////////////////////////////////////////////////////////////////////////////////
576 /// UpdatePublicStateEventData
577 /// This API updates the event data of public state event for all the session of
578 /// all subscribed clients.
579 ///
580 /// \param [in] hApp
581 ///         HANDLE - Application handle
582 /// \param [in] uiEventId
583 ///         UI_32 - event id
584 /// \param [in] pData
585 ///         PCVOID - data to send
586 /// \param [in] uiLength
587 ///         UI_32 - length of data
588 ///
589 /// \return success or failure
590 ///
591 ////////////////////////////////////////////////////////////////////////////////////////////
592 EFrameworkunifiedStatus UpdatePublicStateEventData(HANDLE hApp, UI_32 uiEventId, PCVOID pData, UI_32 uiLength);
593
594 ////////////////////////////////////////////////////////////////////////////////////////////
595 /// UpdatePrivateStateEventData
596 /// This API updates the event data of private state event for session with
597 /// session id uiSessionId of client pClientName.
598 ///
599 /// \param [in] hApp
600 ///         HANDLE - Application handle
601 /// \param [in] uiEventId
602 ///         UI_32 - event id
603 /// \param [in] pClientName
604 ///         PCSTR - Event Subscriber name
605 /// \param [in] uiSessionId
606 ///         UI_32 - session id
607 /// \param [in] pData
608 ///         PCVOID - data to send
609 /// \param [in] uiLength
610 ///         UI_32 - length of data
611 ///
612 /// \return success or failure
613 ///
614 ////////////////////////////////////////////////////////////////////////////////////////////
615 EFrameworkunifiedStatus UpdatePrivateStateEventData(HANDLE hApp, UI_32 uiEventId, PCSTR pClientName, UI_32 uiSessionId, PCVOID pData,
616                                        UI_32 uiLength);
617
618 ////////////////////////////////////////////////////////////////////////////////////////////
619 /// DeleteSessionEventData
620 /// This function is called while destroying the session with client.
621 /// This method removes the private event data associated with the session.
622 ///
623 /// \param [in] hApp
624 ///         HANDLE - Application handle
625 /// \param [in] pClientName
626 ///         PCSTR - Event Subscriber name
627 /// \param [in] uiSessionId
628 ///         UI_32 - session id
629 ///
630 /// \return success or failure
631 ///
632 ////////////////////////////////////////////////////////////////////////////////////////////
633 EFrameworkunifiedStatus DeleteSessionEventData(HANDLE hApp, PCSTR pClientName, UI_32 uiSessionId);
634
635 ////////////////////////////////////////////////////////////////////////////////////////////
636 /// FrameworkunifiedGetDataUSID
637 /// Gets the shared memory ID
638 ///
639 /// \param [in] hApp
640 ///         HANDLE - Application framework handle
641 ///
642 /// \return status
643 ///         UI_32 - success or error
644 ///
645 /// \see FrameworkunifiedMcOpenSender, FrameworkunifiedMcClose, FrameworkunifiedSendMsg, FrameworkunifiedGetMsgLength, FrameworkunifiedGetMsgSrc, FrameworkunifiedGetMsgDataOfSize,
646 ///      FrameworkunifiedClearMsgData, FrameworkunifiedForwardMessage, FrameworkunifiedGetSystemInfo
647 ///
648 ////////////////////////////////////////////////////////////////////////////////////////////
649 TMemID FrameworkunifiedGetDataUSID(HANDLE hApp);
650
651 ////////////////////////////////////////////////////////////////////////////////////////////
652 /// FrameworkunifiedIsAutoPublishServiceAvailableEnabled
653 /// This function is used to check whether auto publishing of service availability is
654 /// enabled or not.
655 ///
656 /// \param None
657 ///
658 /// \return BOOL
659 ///         BOOL - true if auto publish is enabled for service else false
660 ///
661 ////////////////////////////////////////////////////////////////////////////////////////////
662 BOOL FrameworkunifiedIsAutoPublishServiceAvailableEnabled();
663
664 ////////////////////////////////////////////////////////////////////////////////////////////
665 /// FrameworkunifiedIsWaitInStoppingStateEnabled
666 /// Check if wait in stopping state is enabled.
667 ///
668 /// \param [in] none
669 ///
670 /// \return BOOL - TRUE if enabled or FALSE
671 ///
672 ////////////////////////////////////////////////////////////////////////////////////////////
673 BOOL FrameworkunifiedIsWaitInStoppingStateEnabled();
674
675 #endif  // FRAMEWORK_UNIFIED_CLIENT_NS_FRAMEWORKCORE_INCLUDE_FRAMEWORKUNIFIED_FRAMEWORK_INTERNAL_H_