RDK Documentation (Open Sourced RDK Components)
vrexMgrMain.cpp
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 //#include "iarmStatus.h"
21 
22 
23 
24 /**
25 * @defgroup iarmmgrs
26 * @{
27 * @defgroup vrexmgr
28 * @{
29 **/
30 
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 #include <stdio.h>
36 #ifdef __cplusplus
37 }
38 #endif
39 
40 #include "vrexMgrInternal.h"
41 #ifdef RDK_LOGGER_ENABLED
42 
43 extern "C" int b_rdk_logger_enabled = 0;
44 
45 void logCallback(const char *buff)
46 {
47  LOG("%s",buff);
48 }
49 #endif
50 int main(int argc, char *argv[])
51 {
52  const char* debugConfigFile = NULL;
53  int itr=0;
54 
55  while (itr < argc)
56  {
57  if(strcmp(argv[itr],"--debugconfig")==0)
58  {
59  itr++;
60  if (itr < argc)
61  {
62  debugConfigFile = argv[itr];
63  }
64  else
65  {
66  break;
67  }
68  }
69  itr++;
70  }
71 
72 #ifdef RDK_LOGGER_ENABLED
73 
74  if(rdk_logger_init(debugConfigFile) == 0) b_rdk_logger_enabled = 1;
75  IARM_Bus_RegisterForLog(logCallback);
76 
77 #endif
78 
79  VREXMgr_Start();
80  //IARMSTATUS_Start(); - SAL: Turning this code off for now because it is not detecting hang
81 
82  VREXMgr_Loop();
83 
84  //IARMSTATUS_Stop();
85  VREXMgr_Stop();
86  return 0;
87 }
88 
89 
90 
91 
92 /** @} */
93 /** @} */
VREXMgr_Loop
IARM_Result_t VREXMgr_Loop()
Listens for component specific events from drivers.
Definition: vrexMgr.cpp:266
VREXMgr_Stop
IARM_Result_t VREXMgr_Stop(void)
Terminates the Sys manager.
Definition: vrexMgr.cpp:285
rdk_logger_init
rdk_Error rdk_logger_init(const char *debugConfigFile)
Initialize the logger. Sets up the environment variable storage by parsing debug configuration file t...
Definition: rdk_logger_init.c:57