RDK Documentation (Open Sourced RDK Components)
btrMgr_SysDiag.c
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  * @file btrMgr_SysDiag.c
21  *
22  * @description This file implements bluetooth manager's
23  *
24  */
25 
26 #ifdef HAVE_CONFIG_H
27 #include <config.h>
28 #endif
29 
30 /* System Headers */
31 #include <stdlib.h>
32 #include <stdbool.h>
33 #include <string.h>
34 #include <stdio.h>
35 
36 /* Ext lib Headers */
37 #ifdef BTRTEST_SYS_DIAG_ENABLE
38 #include "libIBus.h"
39 #include "libIARM.h"
40 #include "wifiSrvMgrIarmIf.h"
41 #include "sysMgr.h"
42 #include "pwrMgr.h"
43 #endif
44 
45 /* Interface lib Headers */
46 #include "btrMgr_logger.h"
47 
48 /* Local Headers */
49 #include "btrMgr_Types.h"
50 #include "btrMgr_SysDiag.h"
51 
52 
53 typedef struct _stBTRMgrSDHdl {
54 #ifdef BTRTEST_SYS_DIAG_ENABLE
55  IARM_Bus_PWRMgr_PowerState_t _powerState;
56 #endif
57  stBTRMgrSysDiagStatus lstBtrMgrSysDiagStat;
58  fPtr_BTRMgr_SD_StatusCb fpcBSdStatus;
59  void* pvcBUserData;
61 
62 stBTRMgrSDHdl* gpstSDHandle = NULL;
63 
64 /* Static Function Prototypes */
65 static int btrMgr_SysDiag_getDeviceMAC(char* aFileName, unsigned char* aData);
66 static int btrMgr_SysDiag_getDiagInfoFromFile(char* aFileName, char* aData);
67 static int btrMgr_SysDiag_getDiagInfoFromPipe(char* aCmd, char* aData);
68 
69 /* Incoming Callbacks Prototypes */
70 #ifdef BTRTEST_SYS_DIAG_ENABLE
71 static void btrMgr_SysDiag_powerModeChangeCb (const char *owner, IARM_EventId_t eventId, void *data, size_t len);
72 #endif
73 
74 /* Static Function Definitions */
75 static int
76 btrMgr_SysDiag_getDeviceMAC (
77  char* aFileName,
78  unsigned char* aData
79 ) {
80  FILE *fPtr;
81  unsigned char lElement;
82  int index = 0;
83  char temp[6];
84  unsigned int lDeviceMac[16];
85  int count = 0;
86  int lDataLen = 0;
87  int ch = 0;
88  int leBtrMgrAcRet = 0;
89 
90  fPtr = fopen(aFileName, "r");
91  if (NULL == fPtr) {
92  printf("File cannot be opened\n");
93  }
94  else {
95  while ((lElement = fgetc(fPtr)) != '\n') {
96  if (lElement != ':') {
97  snprintf(temp, sizeof(temp), "%c", lElement);
98  sscanf(temp, "%x", &ch);
99  lDeviceMac[index] = ch;
100  index++;
101  }
102  }
103 
104  lDataLen = index;
105  index = 0;
106  while (index < lDataLen) {
107  aData[count] = lDeviceMac[index] << 4;
108  index++;
109  aData[count] |= lDeviceMac[index++];
110  count++;
111  }
112 
113  fclose(fPtr);
114  }
115  printf("device mac addr is %s\n", aData);
116  return leBtrMgrAcRet;
117 }
118 
119 static int
120 btrMgr_SysDiag_getDiagInfoFromFile (
121  char* aFileName,
122  char* aData
123 ) {
124  FILE* fPtr = NULL;
125  int leBtrMgrAcRet = 0;
126 
127  fPtr = fopen(aFileName, "r");
128  if (NULL == fPtr) {
129  leBtrMgrAcRet = -1;
130  printf("File cannot be opened\n");
131  }
132  else {
133  if (NULL == fgets(aData, BTRMGR_STR_LEN_MAX, fPtr)) {
134  BTRMGRLOG_DEBUG("Could not parse output of <%s>\n", aFileName);
135  }
136  else {
137  if ('\n' == aData[strlen(aData) - 1]) {
138  aData[strlen(aData) - 1] = '\0';
139  }
140  }
141  fclose(fPtr); //CID:115333 - Alloc free mismatch
142  }
143 
144  return leBtrMgrAcRet;
145 }
146 
147 static int
148 btrMgr_SysDiag_getDiagInfoFromPipe (
149  char* aCmd,
150  char* aData
151 ) {
152  FILE *fPipe;
153  int leBtrMgrAcRet = 0;
154 
155  fPipe = popen(aCmd, "r");
156  if (NULL == fPipe) { /* check for errors */
157  leBtrMgrAcRet = -1;
158  BTRMGRLOG_DEBUG("Pipe failed to open\n");
159  }
160  else {
161  if (NULL == fgets(aData, BTRMGR_STR_LEN_MAX, fPipe)) {
162  BTRMGRLOG_DEBUG("Could not parse output of <%s>\n", aCmd);
163  }
164  else {
165  if ('\n' == aData[strlen(aData) - 1]) {
166  aData[strlen(aData) - 1] = '\0';
167  }
168  }
169 
170  pclose(fPipe);
171  }
172 
173  return leBtrMgrAcRet;
174 }
175 
176 
177 /* Interfaces - Public Functions */
179 BTRMgr_SD_Init (
180  tBTRMgrSDHdl* hBTRMgrSdHdl,
181  fPtr_BTRMgr_SD_StatusCb afpcBSdStatus,
182  void* apvUserData
183 ) {
184  stBTRMgrSDHdl* sDHandle = NULL;
185 
186  if ((sDHandle = (stBTRMgrSDHdl*)malloc (sizeof(stBTRMgrSDHdl))) == NULL) {
187  BTRMGRLOG_ERROR ("BTRMgr_SD_Init FAILED\n");
188  return eBTRMgrFailure;
189  }
190 
191  memset(sDHandle, 0, sizeof(stBTRMgrSDHdl));
192  sDHandle->lstBtrMgrSysDiagStat.enSysDiagChar = BTRMGR_SYS_DIAG_UNKNOWN;
193 #ifdef BTRTEST_SYS_DIAG_ENABLE
194  sDHandle->_powerState = IARM_BUS_PWRMGR_POWERSTATE_OFF;
195 #endif
196  sDHandle->fpcBSdStatus= afpcBSdStatus;
197  sDHandle->pvcBUserData= apvUserData;
198 
199  gpstSDHandle = sDHandle;
200  *hBTRMgrSdHdl = (tBTRMgrSDHdl)sDHandle;
201  return eBTRMgrSuccess;
202 }
203 
204 
206 BTRMgr_SD_DeInit (
207  tBTRMgrSDHdl hBTRMgrSdHdl
208 ) {
209  stBTRMgrSDHdl* pstBtrMgrSdHdl = (stBTRMgrSDHdl*)hBTRMgrSdHdl;
210 
211  if (NULL != pstBtrMgrSdHdl) {
212  gpstSDHandle = NULL;
213  free((void*)pstBtrMgrSdHdl);
214  pstBtrMgrSdHdl = NULL;
215  BTRMGRLOG_INFO ("BTRMgr_SD_DeInit SUCCESS\n");
216  return eBTRMgrSuccess;
217  }
218  else {
219  BTRMGRLOG_WARN ("BTRMgr SD handle is not Inited(NULL)\n");
220  return eBTRMgrFailure;
221  }
222 }
223 
224 
226 BTRMGR_SysDiag_GetData (
227  tBTRMgrSDHdl hBTRMgrSdHdl,
228  BTRMGR_SysDiagChar_t aenSysDiagChar,
229  char* aData
230 ) {
231  stBTRMgrSDHdl* pstBtrMgrSdHdl = (stBTRMgrSDHdl*)hBTRMgrSdHdl;
232  eBTRMgrRet rc = eBTRMgrSuccess;
233 #ifdef BTRTEST_SYS_DIAG_ENABLE
234  IARM_Result_t lIARMStatus = IARM_RESULT_SUCCESS;
235 #endif
236 
237  if (NULL == pstBtrMgrSdHdl)
238  return eBTRMgrFailure;
239 
240  switch (aenSysDiagChar) {
241  case BTRMGR_SYS_DIAG_DEVICEMAC: {
242  unsigned char lData[BTRMGR_STR_LEN_MAX] = "\0";
243 
244  btrMgr_SysDiag_getDeviceMAC("/tmp/.estb_mac", lData);
245  int ret = snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", lData);
246  if (ret > (BTRMGR_STR_LEN_MAX - 1)) {
247  BTRMGRLOG_DEBUG("BTRMGR_SYS_DIAG_DEVICEMAC truncated\n");
248  }
249  }
250  break;
251  case BTRMGR_SYS_DIAG_BTRADDRESS: {
252  btrMgr_SysDiag_getDiagInfoFromPipe("hcitool dev |grep hci |cut -d$'\t' -f3", aData);
253  }
254  break;
255  case BTRMGR_SYS_DIAG_SYSTEMID:
256  case BTRMGR_SYS_DIAG_HWREVISION:
257  case BTRMGR_SYS_DIAG_MODELNUMBER: {
258  btrMgr_SysDiag_getDiagInfoFromFile("/tmp/.model_number", aData);
259  }
260  break;
261  case BTRMGR_SYS_DIAG_SERIALNUMBER: {
262  btrMgr_SysDiag_getDiagInfoFromPipe("grep Serial /proc/cpuinfo | cut -d ' ' -f2 | tr '[:lower:]' '[:upper:]'", aData);
263  }
264  break;
265  case BTRMGR_SYS_DIAG_FWREVISION:
266  case BTRMGR_SYS_DIAG_SWREVISION: {
267  btrMgr_SysDiag_getDiagInfoFromFile("/tmp/.imageVersion", aData);
268  }
269  break;
270  case BTRMGR_SYS_DIAG_MFGRNAME: {
271  btrMgr_SysDiag_getDiagInfoFromPipe("grep MFG_NAME /etc/device.properties | cut -d'=' -f2", aData);
272  }
273  break;
274  case BTRMGR_SYS_DIAG_DEVICESTATUS: {
275  }
276  break;
277  case BTRMGR_SYS_DIAG_FWDOWNLOADSTATUS: {
278  char lValue[BTRMGR_STR_LEN_MAX] = "";
279 #ifdef BTRTEST_SYS_DIAG_ENABLE
281  memset(&param, 0, sizeof(param));
282 #endif
283 
284  btrMgr_SysDiag_getDiagInfoFromPipe("grep BOX_TYPE /etc/device.properties | cut -d'=' -f2", lValue);
285  if (!strcmp(lValue, "pi")) {
286  BTRMGRLOG_DEBUG("Box is PI \n");
287  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "COMPLETED");
288  }
289  else {
290 #ifdef BTRTEST_SYS_DIAG_ENABLE
291  lIARMStatus = IARM_Bus_Call(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_API_GetSystemStates, (void *)&param, sizeof(param));
292  if (IARM_RESULT_SUCCESS != lIARMStatus) {
293  BTRMGRLOG_DEBUG("Failure : Return code is %d\n", lIARMStatus);
294  rc = eBTRMgrFailure;
295  }
296  else {
297  BTRMGRLOG_DEBUG("Iarm call fw state :%d\n", param.firmware_download.state);
298 
299  if (IARM_BUS_SYSMGR_IMAGE_FWDNLD_DOWNLOAD_INPROGRESS == param.firmware_download.state) {
300  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "IN PROGRESS");
301  }
302  else {
303  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "COMPLETED");
304  }
305  }
306 #endif
307  }
308  }
309  break;
310  case BTRMGR_SYS_DIAG_WEBPASTATUS: {
311  char lValue[BTRMGR_STR_LEN_MAX] = "";
312  char* lCmd = "tr181Set -g Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.TR069support.Enable 2>&1 1>/dev/null";
313 
314  btrMgr_SysDiag_getDiagInfoFromPipe(lCmd, lValue);
315  if (0 == strcmp(lValue, "true")) {
316  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "UP");
317  }
318  else {
319  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "DOWN");
320  }
321  BTRMGRLOG_DEBUG("Webpa status:%s\n", aData);
322  }
323  break;
324  case BTRMGR_SYS_DIAG_WIFIRADIO1STATUS:
325  case BTRMGR_SYS_DIAG_WIFIRADIO2STATUS: {
326 #ifdef BTRTEST_SYS_DIAG_ENABLE
327  IARM_BUS_WiFi_DiagsPropParam_t param = { 0 };
328  memset(&param, 0, sizeof(param));
329 
330  lIARMStatus = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getRadioProps, (void *)&param, sizeof(param));
331 
332  BTRMGRLOG_DEBUG("Wifi status is %s\n", param.data.radio.params.status);
333  if (IARM_RESULT_SUCCESS != lIARMStatus) {
334  BTRMGRLOG_DEBUG("Failure : Return code is %d\n", lIARMStatus);
335  rc = eBTRMgrFailure;
336  }
337  else {
338  if (!strcmp("UP", param.data.radio.params.status)) {
339  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "UP");
340  }
341  else {
342  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "DOWN");
343  }
344  }
345 #else
346  BTRMGRLOG_DEBUG("Wifi diagnostics is not available\n");
347  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "DOWN");
348 #endif /* #ifdef BTRTEST_SYS_DIAG_ENABLE */
349  }
350  break;
351  case BTRMGR_SYS_DIAG_RFSTATUS: {
352  char lValue[BTRMGR_STR_LEN_MAX] = "";
353 #ifdef BTRTEST_SYS_DIAG_ENABLE
355  memset(&param, 0, sizeof(param));
356 #endif
357 
358  btrMgr_SysDiag_getDiagInfoFromPipe("grep GATEWAY_DEVICE /etc/device.properties | cut -d'=' -f2", lValue);
359  BTRMGRLOG_DEBUG("Is Gateway device:%s\n", lValue);
360 
361  if (!strcmp(lValue, "false")) {
362  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "NOT CONNECTED");
363  }
364  else {
365 #ifdef BTRTEST_SYS_DIAG_ENABLE
366  lIARMStatus = IARM_Bus_Call(IARM_BUS_SYSMGR_NAME, IARM_BUS_SYSMGR_API_GetSystemStates, (void *)&param, sizeof(param));
367  if (IARM_RESULT_SUCCESS != lIARMStatus) {
368  BTRMGRLOG_DEBUG("Failure : Return code is %d\n", lIARMStatus);
369  rc = eBTRMgrFailure;
370  }
371  else {
372  BTRMGRLOG_DEBUG(" Iarm call fw state :%d\n", param.rf_connected.state);
373 
374  if (0 == param.rf_connected.state) {
375  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "NOT CONNECTED");
376  }
377  else {
378  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", "CONNECTED");
379  }
380  }
381 #endif
382  }
383  }
384  break;
385  case BTRMGR_SYS_DIAG_POWERSTATE: {
386 #ifdef BTRTEST_SYS_DIAG_ENABLE
389  (void *)&param, sizeof(param));
390 
391  snprintf(aData, (BTRMGR_STR_LEN_MAX - 1), "%s", BTRMGR_SYS_DIAG_PWRST_UNKNOWN);
392  if (res == IARM_RESULT_SUCCESS) {
393 
394  if (param.curState == IARM_BUS_PWRMGR_POWERSTATE_ON)
395  snprintf(aData, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_ON);
396  else if (param.curState == IARM_BUS_PWRMGR_POWERSTATE_STANDBY)
397  snprintf(aData, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_STANDBY);
398  else if (param.curState == IARM_BUS_PWRMGR_POWERSTATE_STANDBY_LIGHT_SLEEP)
399  snprintf(aData, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_STDBY_LIGHT_SLEEP);
400  else if (param.curState == IARM_BUS_PWRMGR_POWERSTATE_STANDBY_DEEP_SLEEP)
401  snprintf(aData, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_STDBY_DEEP_SLEEP);
402  else if (param.curState == IARM_BUS_PWRMGR_POWERSTATE_OFF)
403  snprintf(aData, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_OFF);
404 
405 
406  pstBtrMgrSdHdl->lstBtrMgrSysDiagStat.enSysDiagChar = BTRMGR_SYS_DIAG_POWERSTATE;
407  strncpy(pstBtrMgrSdHdl->lstBtrMgrSysDiagStat.pcSysDiagRes, aData, BTRMGR_STR_LEN_MAX - 1);
408  pstBtrMgrSdHdl->_powerState = param.curState;
409 
410  if (param.curState != IARM_BUS_PWRMGR_POWERSTATE_ON) {
411  BTRMGRLOG_WARN("BTRMGR_SYS_DIAG_POWERSTATE PWRMGR :%d - %s\n", param.curState, aData);
413  }
414  }
415  else {
416  BTRMGRLOG_DEBUG("BTRMGR_SYS_DIAG_POWERSTATE Failure : Return code is %d\n", res);
417  /* In case of Failure to call GetPowerState registet the event handler anyway */
419  rc = eBTRMgrFailure;
420  }
421 #else
422  rc = eBTRMgrFailure;
423 #endif
424  }
425  break;
426  default: {
427  rc = eBTRMgrFailure;
428  }
429  break;
430  }
431 
432  return rc;
433 }
434 
436 BTRMGR_SysDiag_ConnectToWifi (
437  tBTRMgrSDHdl hBTRMgrSdHdl,
438  char* aSSID,
439  char* aPassword,
440  int aSecurityMode
441 ) {
442  stBTRMgrSDHdl* pstBtrMgrSdHdl = (stBTRMgrSDHdl*)hBTRMgrSdHdl;
443  eBTRMgrRet rc = eBTRMgrSuccess;
444 
445  if (NULL == pstBtrMgrSdHdl)
446  return eBTRMgrFailure;
447 
448 
449 #ifdef BTRTEST_SYS_DIAG_ENABLE
450  IARM_Result_t retVal = IARM_RESULT_SUCCESS;
452 
453  strcpy(param.data.connect.ssid, aSSID);
454  strcpy(param.data.connect.passphrase, aPassword);
455  param.data.connect.security_mode = (SsidSecurity)aSecurityMode;
456 
457  retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_connect, (void *)&param, sizeof(param));
458 
459  BTRMGRLOG_DEBUG("\n \"%s\", status: \"%s\"\n", IARM_BUS_WIFI_MGR_API_connect, ((retVal == IARM_RESULT_SUCCESS && param.status) ? "Success" : "Failure"));
460 #else
461  BTRMGRLOG_DEBUG("Wifi not available\n");
462 #endif /* #ifdef BTRTEST_SYS_DIAG_ENABLE */
463 
464  return rc;
465 }
466 
467 /* Incoming Callbacks */
468 #ifdef BTRTEST_SYS_DIAG_ENABLE
469 static void
470 btrMgr_SysDiag_powerModeChangeCb (
471  const char *owner,
472  IARM_EventId_t eventId,
473  void *data,
474  size_t len
475 ) {
476  if (strcmp(owner, IARM_BUS_PWRMGR_NAME) == 0) {
477  switch (eventId) {
480  BTRMGRLOG_WARN("BTRMGR_SYS_DIAG_POWERSTATE Event IARM_BUS_PWRMGR_EVENT_MODECHANGED: new State: %d\n", param->data.state.newState);
481 
482  if (gpstSDHandle != NULL) {
483 
484  if (param->data.state.newState == IARM_BUS_PWRMGR_POWERSTATE_ON)
485  snprintf(gpstSDHandle->lstBtrMgrSysDiagStat.pcSysDiagRes, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_ON);
486  else if (param->data.state.newState == IARM_BUS_PWRMGR_POWERSTATE_STANDBY)
487  snprintf(gpstSDHandle->lstBtrMgrSysDiagStat.pcSysDiagRes, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_STANDBY);
488  else if (param->data.state.newState == IARM_BUS_PWRMGR_POWERSTATE_STANDBY_LIGHT_SLEEP)
489  snprintf(gpstSDHandle->lstBtrMgrSysDiagStat.pcSysDiagRes, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_STDBY_LIGHT_SLEEP);
490  else if (param->data.state.newState == IARM_BUS_PWRMGR_POWERSTATE_STANDBY_DEEP_SLEEP)
491  snprintf(gpstSDHandle->lstBtrMgrSysDiagStat.pcSysDiagRes, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_STDBY_DEEP_SLEEP);
492  else if (param->data.state.newState == IARM_BUS_PWRMGR_POWERSTATE_OFF)
493  snprintf(gpstSDHandle->lstBtrMgrSysDiagStat.pcSysDiagRes, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_OFF);
494  else
495  snprintf(gpstSDHandle->lstBtrMgrSysDiagStat.pcSysDiagRes, BTRMGR_STR_LEN_MAX - 1, "%s", BTRMGR_SYS_DIAG_PWRST_UNKNOWN);
496 
497  gpstSDHandle->lstBtrMgrSysDiagStat.enSysDiagChar = BTRMGR_SYS_DIAG_POWERSTATE;
498 
499 
500  if (gpstSDHandle->_powerState != param->data.state.newState && (param->data.state.newState != IARM_BUS_PWRMGR_POWERSTATE_ON && param->data.state.newState != IARM_BUS_PWRMGR_POWERSTATE_STANDBY_LIGHT_SLEEP)) {
501  BTRMGRLOG_WARN("BTRMGR_SYS_DIAG_POWERSTATE - Device is being suspended\n");
502  }
503 
504  if (gpstSDHandle->_powerState != param->data.state.newState && param->data.state.newState == IARM_BUS_PWRMGR_POWERSTATE_ON) {
505  BTRMGRLOG_WARN("BTRMGR_SYS_DIAG_POWERSTATE - Device just woke up\n");
506  if (gpstSDHandle->fpcBSdStatus) {
507  stBTRMgrSysDiagStatus lstBtrMgrSysDiagStat;
508  eBTRMgrRet leBtrMgrSdRet = eBTRMgrSuccess;
509 
510  memcpy(&lstBtrMgrSysDiagStat, &gpstSDHandle->lstBtrMgrSysDiagStat, sizeof(stBTRMgrSysDiagStatus));
511  if ((leBtrMgrSdRet = gpstSDHandle->fpcBSdStatus(&lstBtrMgrSysDiagStat, gpstSDHandle->pvcBUserData)) != eBTRMgrSuccess) {
512  BTRMGRLOG_ERROR("BTRMGR_SYS_DIAG_POWERSTATE - Device woke up - NOT PROCESSED\n");
513  }
514  }
515  }
516 
517  gpstSDHandle->_powerState = param->data.state.newState;
518  }
519  }
520  break;
521  default:
522  break;
523  }
524  }
525 }
526 #endif /* #ifdef BTRTEST_SYS_DIAG_ENABLE */
IARM_BUS_PWRMGR_NAME
#define IARM_BUS_PWRMGR_NAME
Definition: pwrMgr.h:54
btrMgr_Types.h
sysMgr.h
IARM-Bus Sys Manager Public API.
IARM_BUS_SYSMGR_NAME
#define IARM_BUS_SYSMGR_NAME
Definition: sysMgr.h:110
_IARM_Bus_PWRMgr_GetPowerState_Param_t
Structure which holds the current power state of the CPE.
Definition: pwrMgr.h:173
IARM_Bus_Call
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
Definition: iarm_bus.c:57
_PWRMgr_EventData_t
Structure which holds the event data.
Definition: pwrMgr.h:117
IARM_BUS_PWRMGR_API_GetPowerState
#define IARM_BUS_PWRMGR_API_GetPowerState
Definition: pwrMgr.h:168
IARM_Bus_RegisterEventHandler
IARM_Result_t IARM_Bus_RegisterEventHandler(const char *ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler)
This API register to listen to event and provide the callback function for event notification....
Definition: iarmMgrMocks.cpp:43
btrMgr_SysDiag.h
_IARM_Bus_SYSMgr_GetSystemStates_Param_t
Definition: sysMgr.h:299
IARM_BUS_WIFI_MGR_API_connect
#define IARM_BUS_WIFI_MGR_API_connect
Definition: wifiSrvMgrIarmIf.h:65
_stBTRMgrSysDiagStatus
Definition: btrMgr_SysDiag.h:66
_IARM_BUS_WiFi_DiagsPropParam_t
Definition: wifiSrvMgrIarmIf.h:396
_stBTRMgrSDHdl
Definition: btrMgr_SysDiag.c:53
SsidSecurity
enum _SsidSecurity SsidSecurity
libIBus.h
RDK IARM-Bus API Declarations.
IARM_BUS_PWRMGR_EVENT_MODECHANGED
@ IARM_BUS_PWRMGR_EVENT_MODECHANGED
Definition: pwrMgr.h:60
eBTRMgrRet
enum _eBTRMgrRet eBTRMgrRet
Represents the bluetooth manager return values.
pwrMgr.h
IARM-Bus Power Manager Public API.
IARM_BUS_WIFI_MGR_API_getRadioProps
#define IARM_BUS_WIFI_MGR_API_getRadioProps
Definition: wifiSrvMgrIarmIf.h:82
_IARM_Bus_WiFiSrvMgr_Param_t
Definition: wifiSrvMgrIarmIf.h:258
IARM_BUS_SYSMGR_API_GetSystemStates
#define IARM_BUS_SYSMGR_API_GetSystemStates
Definition: sysMgr.h:284