RDK Documentation (Open Sourced RDK Components)
diskMgr.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 diskMgr.h
22 *
23 * @brief IARM-Bus Disk Manager Public API.
24 *
25 * This API defines the public interfaces for Disk 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-Disk 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 /** @todo complete the implementation with adding required RPCs.
69 */
70 
71 /** @addtogroup IARM_BUS_DISKMGR_API IARM-Disk Manager API.
72 * @ingroup IARM_BUS
73 *
74 * Described herein are the Disk Manager events and functions.
75 *
76 * @{
77 */
78 
79 
80 
81 
82 /**
83 * @defgroup iarmmgrs
84 * @{
85 * @defgroup disk
86 * @{
87 **/
88 
89 
90 #ifndef _IARM_BUS_DISKMGR_H
91 #define _IARM_BUS_DISKMGR_H
92 
93 #include "libIARM.h"
94 
95 #ifdef __cplusplus
96 extern "C"
97 {
98 #endif
99 
100 #define IARM_BUS_DISKMGR_NAME "DISKMgr" /*!< IARM bus name for Disk manager */
101 #define IARM_BUS_DISKMGR_MAX_LEN 200 /*!< Maximum length for strings in the module */
102 
103  /*! Published Events from disk manager */
104  typedef enum _DISKMgr_EventId_t {
105  IARM_BUS_DISKMGR_EVENT_HWDISK, /*!< Harddisk event */
106  IARM_BUS_DISKMGR_EVENT_EXTHDD, /*!< External disk event */
107  IARM_BUS_DISKMGR_EVENT_MAX /*!< Max event id */
109 
110  /*! Type of event related to disks */
111  typedef enum _DISKMgr_HDDEvents_t {
112  DISKMGR_EVENT_EXTHDD_ON, /*!< Disk is on */
113  DISKMGR_EVENT_EXTHDD_OFF, /*!< Disk is off */
114  DISKMGR_EVENT_EXTHDD_PAIR /*!< Disk is paired */
116 
117  /*! Data associated with disk events */
119  IARM_Bus_DISKMgr_EventId_t id; /*!< Harddisk or external disk event*/
120  char eventType; /*!< DiskMgr_HDDEvents_t event types*/
121  char status; /*!< Disk added/paired/removed */
122  char model[IARM_BUS_DISKMGR_MAX_LEN]; /*!< Disk model*/
123  char modelNumber[IARM_BUS_DISKMGR_MAX_LEN]; /*!< Model number of the disk*/
124  char serialNum[IARM_BUS_DISKMGR_MAX_LEN]; /*!< Serial number of the disk*/
125  char devicePath[IARM_BUS_DISKMGR_MAX_LEN]; /*!< Device node path*/
126  char mountPath[IARM_BUS_DISKMGR_MAX_LEN]; /*!< Path to which disk is mounted*/
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 
133 #endif
134 
135 /* End of IARM_BUS_DISKMGR_API doxygen group */
136 /**
137  * @}
138  */
139 
140 
141 
142 /** @} */
143 /** @} */
IARM_Bus_DISKMgr_EventId_t
enum _DISKMgr_EventId_t IARM_Bus_DISKMgr_EventId_t
DISKMGR_EVENT_EXTHDD_PAIR
@ DISKMGR_EVENT_EXTHDD_PAIR
Definition: diskMgr.h:114
IARM_BUS_DISKMGR_EVENT_MAX
@ IARM_BUS_DISKMGR_EVENT_MAX
Definition: diskMgr.h:107
_IARM_BUS_DISKMgr_EventData_t::devicePath
char devicePath[200]
Definition: diskMgr.h:125
_IARM_BUS_DISKMgr_EventData_t::modelNumber
char modelNumber[200]
Definition: diskMgr.h:123
DISKMgr_HDDEvents_t
enum _DISKMgr_HDDEvents_t DISKMgr_HDDEvents_t
_IARM_BUS_DISKMgr_EventData_t::eventType
char eventType
Definition: diskMgr.h:120
IARM_BUS_DISKMGR_MAX_LEN
#define IARM_BUS_DISKMGR_MAX_LEN
Definition: diskMgr.h:101
_DISKMgr_EventId_t
_DISKMgr_EventId_t
Definition: diskMgr.h:104
DISKMGR_EVENT_EXTHDD_ON
@ DISKMGR_EVENT_EXTHDD_ON
Definition: diskMgr.h:112
_IARM_BUS_DISKMgr_EventData_t::mountPath
char mountPath[200]
Definition: diskMgr.h:126
_IARM_BUS_DISKMgr_EventData_t::serialNum
char serialNum[200]
Definition: diskMgr.h:124
_IARM_BUS_DISKMgr_EventData_t::model
char model[200]
Definition: diskMgr.h:122
IARM_BUS_DISKMgr_EventData_t
struct _IARM_BUS_DISKMgr_EventData_t IARM_BUS_DISKMgr_EventData_t
IARM_BUS_DISKMGR_EVENT_HWDISK
@ IARM_BUS_DISKMGR_EVENT_HWDISK
Definition: diskMgr.h:105
_IARM_BUS_DISKMgr_EventData_t::status
char status
Definition: diskMgr.h:121
_IARM_BUS_DISKMgr_EventData_t::id
IARM_Bus_DISKMgr_EventId_t id
Definition: diskMgr.h:119
IARM_BUS_DISKMGR_EVENT_EXTHDD
@ IARM_BUS_DISKMGR_EVENT_EXTHDD
Definition: diskMgr.h:106
_DISKMgr_HDDEvents_t
_DISKMgr_HDDEvents_t
Definition: diskMgr.h:111
_IARM_BUS_DISKMgr_EventData_t
Definition: diskMgr.h:118
DISKMGR_EVENT_EXTHDD_OFF
@ DISKMGR_EVENT_EXTHDD_OFF
Definition: diskMgr.h:113