RDK Documentation (Open Sourced RDK Components)
test_main.c
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 /* Test front-end for iarmStatus */
21 
22 
23 
24 /**
25 * @defgroup iarmmgrs
26 * @{
27 * @defgroup vrexmgr
28 * @{
29 **/
30 
31 
32 #include <stdio.h>
33 //#include "iarmStatus.h"
34 
35 #include "vrexMgrInternal.h"
36 #ifdef RDK_LOGGER_ENABLED
37 
38 int b_rdk_logger_enabled = 0;
39 
40 void logCallback(const char *buff)
41 {
42  LOG("%s",buff);
43 }
44 #endif
45 
46 int main(int argc, char *argv[])
47 {
48  const char* debugConfigFile = NULL;
49  int itr = 0;
50 
51  while (itr < argc) {
52  if (strcmp(argv[itr], "--debugconfig") == 0) {
53  itr++;
54  if (itr < argc) {
55  debugConfigFile = argv[itr];
56  } else {
57  break;
58  }
59  }
60  itr++;
61  }
62 
63 #ifdef RDK_LOGGER_ENABLED
64 
65  if(rdk_logger_init(debugConfigFile) == 0) b_rdk_logger_enabled = 1;
66  IARM_Bus_RegisterForLog(logCallback);
67 
68 #endif
69 
70  IARMSTATUS_Start();
71 
72  while (1)
73  {
74  ;
75  }
76 
77  return 0;
78 }
79 
80 
81 
82 /** @} */
83 /** @} */
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