RDK Documentation (Open Sourced RDK Components)
sysMgrInternal.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21 * @file sysMgrInternal.h
22 *
23 * @brief IARM-Bus Sys Manager Internal API.
24 *
25 * This API defines the operations for Sys manager
26 *
27 * @par Document
28 * Document reference.
29 *
30 * @par Open Issues (in no particular order)
31 * -# None
32 *
33 * @par Assumptions
34 * -# None
35 *
36 * @par Abbreviations
37 * - BE: ig-Endian.
38 * - cb: allback function (suffix).
39 * - DS: Device Settings.
40 * - FPD: Front-Panel Display.
41 * - HAL: Hardware Abstraction Layer.
42 * - LE: Little-Endian.
43 * - LS: Least Significant.
44 * - MBZ: Must be zero.
45 * - MS: Most Significant.
46 * - RDK: Reference Design Kit.
47 * - _t: Type (suffix).
48 *
49 * @par Implementation Notes
50 * -# None
51 *
52 */
53 
54 /** @defgroup IARM_BUS IARM-Sys Manager API
55 * @ingroup IARM_RDK
56 *
57 * IARM-Bus is a platform agnostic Inter-process communication (IPC) interface. It allows
58 * applications to communicate with each other by sending Events or invoking Remote
59 * Procedure Calls. The common programming APIs offered by the RDK IARM-Bus interface is
60 * independent of the operating system or the underlying IPC mechanism.
61 *
62 * Two applications connected to the same instance of IARM-Bus are able to exchange events
63 * or RPC calls. On a typical system, only one instance of IARM-Bus instance is needed. If
64 * desired, it is possible to have multiple IARM-Bus instances. However, applications
65 * connected to different buses will not be able to communicate with each other.
66 */
67 
68 /** @addtogroup IARM_BUS_SYSMGR_INTERNAL_API IARM-Sys Manager internal API.
69 * @ingroup IARM_BUS
70 *
71 * Described herein are the Sys Manager types and functions.
72 *
73 * @{
74 */
75 
76 /**
77  * @brief Starts the Sys manager.
78  *
79  * This function registers and connects Sys Manager to the iarm bus.
80  * Register Events that this module publishes and register APIs that
81  * can be RPCs by other entities on the bus.
82  *
83  * @return Error code if start fails.
84  */
85 
86 
87 
88 /**
89 * @defgroup iarmmgrs
90 * @{
91 * @defgroup sysmgr
92 * @{
93 **/
94 
95 
96 #ifndef _IARM_SYSMGR_INTERNAL_
97 #define _IARM_SYSMGR_INTERNAL_
98 #include "libIARM.h"
99 
100 #include <string.h>
101 
102 
103 #ifdef RDK_LOGGER_ENABLED
104 #include "rdk_debug.h"
105 #include "iarmUtil.h"
106 
107 extern int b_rdk_logger_enabled;
108 
109 #define LOG(...) INT_LOG(__VA_ARGS__, "")
110 #define INT_LOG(FORMAT, ...) if(b_rdk_logger_enabled) {\
111 RDK_LOG(RDK_LOG_DEBUG, "LOG.RDK.SYSMGR", FORMAT , __VA_ARGS__);\
112 }\
113 else\
114 {\
115 printf(FORMAT, __VA_ARGS__);\
116 }
117 
118 #else
119 
120 #define LOG(...) printf(__VA_ARGS__)
121 
122 #endif
123 
124 
125 
126 IARM_Result_t SYSMgr_Start(void);
127 
128 /**
129  * @brief Listens for component specific events from drivers.
130  *
131  * @return Error code if fails.
132  */
133 IARM_Result_t SYSMgr_Loop(void);
134 
135 /**
136  * @brief Terminates the Sys manager.
137  *
138  * This function disconnects Sys Manager from the iarm bus and terminates it.
139  *
140  * @return Error code if stop fails.
141  */
142 IARM_Result_t SYSMgr_Stop(void);
143 
144 
145 #endif
146 
147 
148 /** @} */
149 /** @} */
rdk_debug.h
SYSMgr_Stop
IARM_Result_t SYSMgr_Stop(void)
Terminates the Sys manager.
Definition: sysMgr.c:187
SYSMgr_Loop
IARM_Result_t SYSMgr_Loop()
Listens for component specific events from drivers.
Definition: sysMgr.c:174