RDK Documentation (Open Sourced RDK Components)
sysMgr.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 sysMgr.h
22 *
23 * @brief IARM-Bus Sys Manager Public API.
24 */
25 
26 /**
27  * @defgroup IARMBUS_SYS_MGR Sys Manager
28  * @ingroup IARM_MGR
29  *
30  * Sys Manager is a IARM Manager application which maintains the state of different
31  * subsystem/components of RDK such as HDMI, Network, RF, Date & Time, Tuner, CA, Mfr information etc.
32  * It collects the State change and error codes through a common event handler.
33  * It publishes RPC methods for getting the system state data.
34  *
35  * @par Following event handler is registered for receiving events from different components.
36  * - @b IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE
37  * @par The Event Data contains
38  * @code
39  * IARM_Bus_SYSMgr_EventData_t *sysEventData; // The event data contains stateId, state and error.
40  * @endcode
41  *
42  * @par Sys Manager: Events
43  *
44  * - @b IARM_BUS_SYSMGR_EVENT_HDCP_PROFILE_UPDATE
45  * Event to notify HDCP Profile change:
46  *
47  * @par Sys Manager: RPC Methods
48  * Following RPC Methods are published:
49  *
50  *
51  * - @b IARM_BUS_SYSMGR_API_GetSystemStates
52  * @n This returns the System State data structure.
53  * @n Example:
54  * @code
55  * IARM_Bus_RegisterCall(IARM_BUS_SYSMGR_API_GetSystemStates, _GetSystemStates);
56  * @endcode
57  *
58  * - @b IARM_BUS_SYSMGR_API_SetHDCPProfile
59  * @n This Method is called to set the new HDCP Profile.
60  * @n Example:
61  * @code
62  * IARM_Bus_RegisterCall(IARM_BUS_SYSMGR_API_SetHDCPProfile,_SetHDCPProfile);
63  * @endcode
64  *
65  * - @b IARM_BUS_SYSMGR_API_GetHDCPProfile
66  * @n This Method is called to get the current HDCP Profile.
67  * @n Example:
68  * @code
69  * IARM_Bus_RegisterCall(IARM_BUS_SYSMGR_API_GetHDCPProfile,_GetHDCPProfile);
70  * @endcode
71  *
72  * - @b IARM_BUS_SYSMGR_API_RunScript
73  * @n This Method is called to run a script through Sys Manager.
74  * @n Example:
75  * @code
76  * IARM_Bus_RegisterCall(IARM_BUS_SYSMGR_API_RunScript, _RunScript);
77  * @endcode
78 
79  */
80 
81 
82 /**
83 * @defgroup iarmmgrs
84 * @{
85 * @defgroup sysmgr
86 * @{
87 **/
88 
89 
90 
91 
92 /**
93 * @defgroup iarmmgrs
94 * @{
95 * @defgroup sysmgr
96 * @{
97 **/
98 
99 
100 #ifndef _IARM_BUS_SYSMGR_H
101 #define _IARM_BUS_SYSMGR_H
102 
103 #include "libIARM.h"
104 
105 #ifdef __cplusplus
106 extern "C"
107 {
108 #endif
109 
110 #define IARM_BUS_SYSMGR_NAME "SYSMgr" /*!< IARM BUS name for Sys manager */
111 
112 
114  char *pBuffer; /*!< Shared memory location having expected data*/
115  int bufLength; /*!< Length of buffer */
117 
118 
120  int HdcpProfile; /*!< HDCP Profile Data */
122 
124  int logStatus; /*!< HDCP Profile Data */
126 
127 /*! Published Events from sys manager */
128 typedef enum _SYSMgr_EventId_t {
129  IARM_BUS_SYSMGR_EVENT_SYSTEMSTATE,
130  IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_REQUEST, /*!< Xupnp data request frm Receiver to UPNP*/
131  IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_UPDATE, /*!< Xupnp data frm UPNP to Receiver*/
132  IARM_BUS_SYSMGR_EVENT_IMAGE_DNLD, /*Image download status to Receiver */
133  IARM_BUS_SYSMGR_EVENT_CARD_FWDNLD, /*!< CARD FW download event to Receiver - Valid on Cisco CA*/
134  IARM_BUS_SYSMGR_EVENT_HDCP_PROFILE_UPDATE, /*!< HDCP Profile Update */
135  IARM_BUS_SYSMGR_EVENT_INTRUSION, /*!< Intrusion Detection */
136  IARM_BUS_SYSMGR_EVENT_EISS_FILTER_STATUS, /*!< EISS Filter status event */
137  IARM_BUS_SYSMGR_EVENT_EISS_APP_ID_UPDATE, /*!< EISS App ID update */
138  IARM_BUS_SYSMGR_EVENT_KEYCODE_LOGGING_CHANGED, /*!< Key Code logging status update */
139  IARM_BUS_SYSMGR_EVENT_USB_MOUNT_CHANGED, /*!< Fires when USB mounts change */
140  IARM_BUS_SYSMGR_EVENT_APP_RELEASE_FOCUS, /*!< Application fires event to release focus*/
141  IARM_BUS_SYSMGR_EVENT_MAX /*!< Max Event Id */
143 
144 typedef enum _SYSMgr_SystemState_t {
145  IARM_BUS_SYSMGR_SYSSTATE_CHANNELMAP, //0
146  IARM_BUS_SYSMGR_SYSSTATE_DISCONNECTMGR,//1
147  IARM_BUS_SYSMGR_SYSSTATE_TUNEREADY, //2
148  IARM_BUS_SYSMGR_SYSSTATE_EXIT_OK,//3
149  IARM_BUS_SYSMGR_SYSSTATE_CMAC,//4
150  IARM_BUS_SYSMGR_SYSSTATE_MOTO_ENTITLEMENT,//5
151  IARM_BUS_SYSMGR_SYSSTATE_MOTO_HRV_RX,//6
152  IARM_BUS_SYSMGR_SYSSTATE_CARD_CISCO_STATUS,//7
153  IARM_BUS_SYSMGR_SYSSTATE_VIDEO_PRESENTING,//8
154  IARM_BUS_SYSMGR_SYSSTATE_HDMI_OUT,//9
155  IARM_BUS_SYSMGR_SYSSTATE_HDCP_ENABLED,//10
156  IARM_BUS_SYSMGR_SYSSTATE_HDMI_EDID_READ,//11
157  IARM_BUS_SYSMGR_SYSSTATE_FIRMWARE_DWNLD,//12
158  IARM_BUS_SYSMGR_SYSSTATE_TIME_SOURCE,//13
159  IARM_BUS_SYSMGR_SYSSTATE_TIME_ZONE,//14
160  IARM_BUS_SYSMGR_SYSSTATE_CA_SYSTEM,//15
161  IARM_BUS_SYSMGR_SYSSTATE_ESTB_IP,//16
162  IARM_BUS_SYSMGR_SYSSTATE_ECM_IP,//17
163  IARM_BUS_SYSMGR_SYSSTATE_LAN_IP,//18
164  IARM_BUS_SYSMGR_SYSSTATE_MOCA,//19
165  IARM_BUS_SYSMGR_SYSSTATE_DOCSIS,//20
166  IARM_BUS_SYSMGR_SYSSTATE_DSG_BROADCAST_CHANNEL,//21
167  IARM_BUS_SYSMGR_SYSSTATE_DSG_CA_TUNNEL,//22
168  IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD,//23
169  IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD_DWNLD,//24
170  IARM_BUS_SYSMGR_SYSSTATE_CVR_SUBSYSTEM,//25
171  IARM_BUS_SYSMGR_SYSSTATE_DOWNLOAD,//26
172  IARM_BUS_SYSMGR_SYSSTATE_VOD_AD,//27
173  IARM_BUS_SYSMGR_SYSSTATE_DAC_INIT_TIMESTAMP,//28
174  IARM_BUS_SYSMGR_SYSSTATE_CABLE_CARD_SERIAL_NO,//29
175  IARM_BUS_SYSMGR_SYSSTATE_ECM_MAC,//30
176  IARM_BUS_SYSMGR_SYSSTATE_DAC_ID,//31
177  IARM_BUS_SYSMGR_SYSSTATE_PLANT_ID,//32
178  IARM_BUS_SYSMGR_SYSSTATE_STB_SERIAL_NO, //33
179  IARM_BUS_SYSMGR_SYSSTATE_BOOTUP, //34
180  IARM_BUS_SYSMGR_SYSSTATE_GATEWAY_CONNECTION, //35
181  IARM_BUS_SYSMGR_SYSSTATE_DST_OFFSET, //36
182  IARM_BUS_SYSMGR_SYSSTATE_RF_CONNECTED, //37
183  IARM_BUS_SYSMGR_SYSSTATE_PARTNERID_CHANGE, //38
184  IARM_BUS_SYSMGR_SYSSTATE_IP_MODE, //39
185  IARM_BUS_SYSMGR_SYSSTATE_LP_CONNECTION_RESET, //40
186  IARM_BUS_SYSMGR_SYSSTATE_RWS_CONNECTION_RESET, //41
187  IARM_BUS_SYSMGR_SYSSTATE_QAM_READY, //42
188  IARM_BUS_SYSMGR_SYSSTATE_FIRMWARE_UPDATE_STATE, //43, Added as part of RDK-19978, As the IARM
189  // requirement for RDK-19978 and IARM_BUS_SYSMGR_SYSSTATE_FIRMWARE_DWNLD
190  // are having some mismatches, introduced the new event
191  IARM_BUS_SYSMGR_SYSSTATE_USB_DETECTED //44
192 }IARM_Bus_SYSMgr_SystemState_t;
193 
194 
195 /*! Possible Firmware Download state */
197 {
198  IARM_BUS_SYSMGR_CARD_FWDNLD_START,
199  IARM_BUS_SYSMGR_CARD_FWDNLD_COMPLETE,
201 
202 /*! Possible Image Download state */
204 {
205  IARM_BUS_SYSMGR_IMAGE_FWDNLD_UNINITIALIZED,
206  IARM_BUS_SYSMGR_IMAGE_FWDNLD_DOWNLOAD_INPROGRESS,
207  IARM_BUS_SYSMGR_IMAGE_FWDNLD_DOWNLOAD_COMPLETE,
208  IARM_BUS_SYSMGR_IMAGE_FWDNLD_DOWNLOAD_FAILED,
209  IARM_BUS_SYSMGR_IMAGE_FWDNLD_FLASH_INPROGRESS,
210  IARM_BUS_SYSMGR_IMAGE_FWDNLD_FLASH_COMPLETE,
211  IARM_BUS_SYSMGR_IMAGE_FWDNLD_FLASH_FAILED
213 
214 /*! Possible Firmware Update States (as per RDK-14100, RDK-19928)*/
216 {
217  IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_UNINITIALIZED = 0,
218  IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_REQUESTING = 1,
219  IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_DOWNLOADING = 2,
220  IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_FAILED = 3,
221  IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_DOWNLOAD_COMPLETE = 4,
222  IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_VALIDATION_COMPLETE = 5,
223  IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_PREPARING_TO_REBOOT = 6,
224  IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_ONHOLD_FOR_OPTOUT = 7, /* On Hold for opt-out */
225  IARM_BUS_SYSMGR_FIRMWARE_UPDATE_STATE_CRITICAL_REBOOT = 8
227 
228 /*! Event Data associated with Sys Managers */
230  union {
231  struct _CARD_FWDNLD_DATA {
232  char eventType;
233  char status;
234  } cardFWDNLD;
235  struct _IMAGE_FWDNLD_DATA {
236  char status;
237  } imageFWDNLD;
238  struct _XUPNP_DATA {
239  unsigned long deviceInfoLength;
240  } xupnpData;
241  struct _HDCP_PROFILE {
242  unsigned int hdcpProfile;
243  } hdcpProfileData;
244  struct _SystemStates {
245  IARM_Bus_SYSMgr_SystemState_t stateId;
246  int state;
247  int error;
248  char payload[128];
249  } systemStates;
250  struct _EISS_STATUS {
251  int filterStatus;
252  } eissEventData;
253  struct _EISS_APP_ID {
254  unsigned char idList[4][6];
255  int count;
256  } eissAppIDList;
257  struct _KEY_CODE_LOG {
258  int logStatus;
259  } keyCodeLogData;
260  struct _USB_MOUNT {
261  int mounted;
262  char device[128];
263  char dir[256];
264  } usbMountData;
265  struct _USB_DETECT {
266  int inserted;
267  char vendor[128];
268  char productid[256];
269  char devicename[256];
270  } usbData;
271 
272  } data;
274 
275 typedef struct _propertyValue
276 {
277  int state;
278  int error;
279  char payload[128];
281 /*
282  * Declare RPC API names and their arguments
283  */
284 #define IARM_BUS_SYSMGR_API_GetSystemStates "GetSystemStates" /*!< Gets the states of the system*/
285 
286 /*
287  * Declare RPC API names for HDCP Profile
288  */
289 #define IARM_BUS_SYSMGR_API_SetHDCPProfile "SetHDCPProfile"
290 #define IARM_BUS_SYSMGR_API_GetHDCPProfile "GetHDCPProfile"
291 
292 /*
293  * Declare RPC API names for Key Code Logging Status
294  */
295 #define IARM_BUS_SYSMGR_API_GetKeyCodeLoggingPref "GetKeyCodeLoggingPref"
296 #define IARM_BUS_SYSMGR_API_SetKeyCodeLoggingPref "SetKeyCodeLoggingPref"
297 
298 /*! Parameter for Setpowerstate call*/
300  state_property channel_map; /*!< [in] New powerstate to be set */
301  state_property disconnect_mgr_state;
302  state_property TuneReadyStatus;
303  state_property exit_ok_key_sequence;
304  state_property cmac;
305  state_property card_moto_entitlements;
306  state_property card_moto_hrv_rx;
307  state_property dac_init_timestamp;
308  state_property card_cisco_status;
309  state_property video_presenting;
310  state_property hdmi_out;
311  state_property hdcp_enabled;
312  state_property hdmi_edid_read;
313  state_property firmware_download;
314  state_property time_source;
315  state_property time_zone_available;
316  state_property ca_system;
317  state_property estb_ip;
318  state_property ecm_ip;
319  state_property lan_ip;
320  state_property moca;
321  state_property docsis;
322  state_property dsg_broadcast_tunnel;
323  state_property dsg_ca_tunnel;
324  state_property cable_card;
325  state_property cable_card_download;
326  state_property cvr_subsystem;
327  state_property download;
328  state_property vod_ad;
329  state_property card_serial_no;
330  state_property ecm_mac;
331  state_property dac_id;
332  state_property plant_id;
333  state_property stb_serial_no;
334  state_property bootup;
335  state_property dst_offset;
336  state_property rf_connected;
337  state_property ip_mode;
338  state_property qam_ready_status;
339  state_property firmware_update_state;
341 
342 #define IARM_BUS_SYSMGR_Intrusion_MaxLen 1024
343 
344 /*! Parameter for intrusion detect call*/
346  char intrusionData[ IARM_BUS_SYSMGR_Intrusion_MaxLen+1 ]; //[in] intrusion detection data
348 
349 
350 #ifdef __cplusplus
351 }
352 #endif
353 
354 #endif
355 
356 /* End of IARM_BUS_SYSMGR_API doxygen group */
357 /**
358  * @}
359  */
360 
361 
362 
363 /** @} */
364 /** @} */
_IARM_BUS_SYSMGR_HDCPProfileInfo_Param_t
Definition: sysMgr.h:119
_IARM_BUS_SYSMGR_KEYCodeLoggingInfo_Param_t
Definition: sysMgr.h:123
_SYSMgr_IMAGE_FWDNLDState_t
_SYSMgr_IMAGE_FWDNLDState_t
Definition: sysMgr.h:203
IARM_Bus_SYSMGR_FWDNLDState_t
enum _SYSMgr_CARD_FWDNLDState_t IARM_Bus_SYSMGR_FWDNLDState_t
_IARM_Bus_SYSMgr_IntrusionData_t
Definition: sysMgr.h:345
_IARM_Bus_SYSMgr_GetSystemStates_Param_t::channel_map
state_property channel_map
Definition: sysMgr.h:300
IARM_BUS_SYSMGR_EVENT_CARD_FWDNLD
@ IARM_BUS_SYSMGR_EVENT_CARD_FWDNLD
Definition: sysMgr.h:133
IARM_BUS_SYSMGR_EVENT_APP_RELEASE_FOCUS
@ IARM_BUS_SYSMGR_EVENT_APP_RELEASE_FOCUS
Definition: sysMgr.h:140
IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_UPDATE
@ IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_UPDATE
Definition: sysMgr.h:131
_IARM_BUS_SYSMGR_GetXUPNPDeviceInfo_Param_t::bufLength
int bufLength
Definition: sysMgr.h:115
_IARM_Bus_SYSMgr_GetSystemStates_Param_t
Definition: sysMgr.h:299
_SYSMgr_CARD_FWDNLDState_t
_SYSMgr_CARD_FWDNLDState_t
Definition: sysMgr.h:196
IARM_Bus_SYSMGR_IMG_FWDNLDState_t
enum _SYSMgr_IMAGE_FWDNLDState_t IARM_Bus_SYSMGR_IMG_FWDNLDState_t
_IARM_BUS_SYSMgr_EventData_t
Definition: sysMgr.h:229
_propertyValue
Definition: sysMgr.h:275
IARM_Bus_SYSMGR_FirmwareUpdateState_t
enum _SYSMgr_FirmwareUpdateState_t IARM_Bus_SYSMGR_FirmwareUpdateState_t
_IARM_BUS_SYSMGR_GetXUPNPDeviceInfo_Param_t
Definition: sysMgr.h:113
IARM_BUS_SYSMGR_EVENT_MAX
@ IARM_BUS_SYSMGR_EVENT_MAX
Definition: sysMgr.h:141
_SYSMgr_FirmwareUpdateState_t
_SYSMgr_FirmwareUpdateState_t
Definition: sysMgr.h:215
IARM_BUS_SYSMGR_EVENT_EISS_APP_ID_UPDATE
@ IARM_BUS_SYSMGR_EVENT_EISS_APP_ID_UPDATE
Definition: sysMgr.h:137
IARM_BUS_SYSMGR_EVENT_INTRUSION
@ IARM_BUS_SYSMGR_EVENT_INTRUSION
Definition: sysMgr.h:135
_SYSMgr_EventId_t
_SYSMgr_EventId_t
Definition: sysMgr.h:128
IARM_BUS_SYSMGR_EVENT_USB_MOUNT_CHANGED
@ IARM_BUS_SYSMGR_EVENT_USB_MOUNT_CHANGED
Definition: sysMgr.h:139
IARM_BUS_SYSMGR_EVENT_EISS_FILTER_STATUS
@ IARM_BUS_SYSMGR_EVENT_EISS_FILTER_STATUS
Definition: sysMgr.h:136
IARM_Bus_SYSMgr_EventData_t
struct _IARM_BUS_SYSMgr_EventData_t IARM_Bus_SYSMgr_EventData_t
IARM_Bus_SYSMgr_EventId_t
enum _SYSMgr_EventId_t IARM_Bus_SYSMgr_EventId_t
_IARM_BUS_SYSMGR_KEYCodeLoggingInfo_Param_t::logStatus
int logStatus
Definition: sysMgr.h:124
IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_REQUEST
@ IARM_BUS_SYSMGR_EVENT_XUPNP_DATA_REQUEST
Definition: sysMgr.h:130
_IARM_BUS_SYSMGR_HDCPProfileInfo_Param_t::HdcpProfile
int HdcpProfile
Definition: sysMgr.h:120
IARM_Bus_SYSMgr_GetSystemStates_Param_t
struct _IARM_Bus_SYSMgr_GetSystemStates_Param_t IARM_Bus_SYSMgr_GetSystemStates_Param_t
IARM_BUS_SYSMGR_EVENT_KEYCODE_LOGGING_CHANGED
@ IARM_BUS_SYSMGR_EVENT_KEYCODE_LOGGING_CHANGED
Definition: sysMgr.h:138
_IARM_BUS_SYSMGR_GetXUPNPDeviceInfo_Param_t::pBuffer
char * pBuffer
Definition: sysMgr.h:114
IARM_Bus_SYSMgr_IntrusionData_t
struct _IARM_Bus_SYSMgr_IntrusionData_t IARM_Bus_SYSMgr_IntrusionData_t
IARM_BUS_SYSMGR_EVENT_HDCP_PROFILE_UPDATE
@ IARM_BUS_SYSMGR_EVENT_HDCP_PROFILE_UPDATE
Definition: sysMgr.h:134