RDK Documentation (Open Sourced RDK Components)
wareHouseReset.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
* @defgroup iarmmgrs
23
* @{
24
* @defgroup power
25
* @{
26
**/
27
28
29
#include <stdio.h>
30
#include <stdlib.h>
31
#include "resetModes.h"
32
#include "pwrlogger.h"
33
34
35
int
processWareHouseReset()
36
{
37
38
/*Code copied from X1.. Needs modification*/
39
LOG(
"\n Reset: Processing Ware House Reset\n"
);
40
fflush(stdout);
41
LOG(
"Reset: ...Clearing data from your box before reseting \n"
);
42
fflush(stdout);
43
/*Execute the script for Ware House Reset*/
44
system(
"echo 0 > /opt/.rebootFlag"
);
45
system(
"touch /tmp/.warehouse-reset"
);
46
system(
"echo `/bin/timestamp` ------------- Rebooting due to Warehouse Reset process --------------- >> /opt/logs/receiver.log"
);
47
system(
"sh /lib/rdk/deviceReset.sh warehouse"
);
48
49
return
1;
50
}
51
52
int
processWHReset()
53
{
54
55
LOG(
"\n Reset: Processing Ware House Reset\n"
);
56
fflush(stdout);
57
58
/*Execute the script for Ware House Reset*/
59
system(
"echo 0 > /opt/.rebootFlag"
);
60
system(
"touch /tmp/.warehouse-reset"
);
61
system(
"echo `/bin/timestamp` ------------- Rebooting due to Warehouse Reset process--------------- >> /opt/logs/receiver.log"
);
62
63
return
system(
"sh /lib/rdk/deviceReset.sh warehouse"
);
64
}
65
66
int
processWHResetNoReboot()
67
{
68
69
LOG(
"\n Reset: Invoking Ware House Reset Request from APP\n"
);
70
fflush(stdout);
71
72
/*Execute the script for Ware House Reset*/
73
system(
"touch /tmp/.warehouse-reset"
);
74
return
system(
"sh /lib/rdk/deviceReset.sh warehouse --suppressReboot &"
);
75
}
76
77
78
79
/** @} */
80
/** @} */
components
generic
iarmmgrs
power
wareHouseReset.c
Generated on Thu Feb 9 2023 06:32:30 for RDK Documentation (Open Sourced RDK Components) by
1.8.17