31 #include "resetModes.h"
32 #include "pwrlogger.h"
34 #ifdef ENABLE_PERSONALITY_SWITCH
36 typedef enum svcs_transPersonalityResult {
37 TRANS_PERS_SUCCESS = 0,
38 TRANS_PERS_MOCA_ERROR = 1,
39 TRANS_PERS_ACS_CONNECT_ERROR = 2,
40 TRANS_PERS_TR069_ERROR = 3
41 } svcs_transPersonalityResult;
42 svcs_transPersonalityResult svcs_transSetPersonalityFlag(
char * newTransPersonalityFlag);
43 unsigned int svcs_transGetPersonalityFlag(
char ** personalityFlag );
47 int processPersonalityReset()
50 char *personalityFlag = NULL;
51 LOG(
"\n Reset: Processing personality reset\n");
53 #ifdef ENABLE_PERSONALITY_SWITCH
54 svcs_transGetPersonalityFlag(&personalityFlag);
55 LOG(
"Current personality is %s\n", personalityFlag);
56 free(personalityFlag);
57 result = svcs_transSetPersonalityFlag(
"DTA");
58 LOG(
"Personality reset returned %d\n", result);
59 svcs_transGetPersonalityFlag(&personalityFlag);
60 LOG(
"Current personality is %s\n", personalityFlag);
61 free(personalityFlag);
65 system(
"sh /lib/rdk/deviceReset.sh personality");
67 system(
"echo 0 > /opt/.rebootFlag");
68 system(
" echo `/bin/timestamp` ------------- Rebooting due to personality reset process --------------- >> /opt/logs/receiver.log");
69 system(
"sleep 5; /rebootNow.sh -s PowerMgr_PersonalityReset -o 'Rebooting the box due to personality reset process ...'");
72 LOG(
"\n Reset: personality reset is not supported on this device.\n");
74 #endif //ENABLE_PERSONALITY_SWITCH