RDK Documentation (Open Sourced RDK Components)
diskMgrMain.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 
21 
22 /**
23 * @defgroup iarmmgrs
24 * @{
25 * @defgroup disk
26 * @{
27 **/
28 
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 #include <stdio.h>
34 #ifdef __cplusplus
35 }
36 #endif
37 
38 #include "diskMgrInternal.h"
39 #ifdef RDK_LOGGER_ENABLED
40 
41 int b_rdk_logger_enabled = 0;
42 
43 void logCallback(const char *buff)
44 {
45  LOG("%s",buff);
46 }
47 #endif
48 int main(int argc, char *argv[])
49 {
50  const char* debugConfigFile = NULL;
51  int itr=0;
52 
53  while (itr < argc)
54  {
55  if(strcmp(argv[itr],"--debugconfig")==0)
56  {
57  itr++;
58  if (itr < argc)
59  {
60  debugConfigFile = argv[itr];
61  }
62  else
63  {
64  break;
65  }
66  }
67  itr++;
68  }
69 
70 #ifdef RDK_LOGGER_ENABLED
71 
72  if(rdk_logger_init(debugConfigFile) == 0) b_rdk_logger_enabled = 1;
73  IARM_Bus_RegisterForLog(logCallback);
74 
75 #endif
76 
77  DISKMgr_Start();
78  DISKMgr_Loop();
79  DISKMgr_Stop();
80  return 0;
81 }
82 
83 
84 
85 
86 /** @} */
87 /** @} */
DISKMgr_Stop
IARM_Result_t DISKMgr_Stop(void)
Terminates the Disk manager.
Definition: diskMgr.c:67
diskMgrInternal.h
IARM-Bus Disk Manager Internal API.
DISKMgr_Loop
IARM_Result_t DISKMgr_Loop()
Listens for component specific events from drivers.
Definition: diskMgr.c:54
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