huangcm
2025-09-01 53d8e046ac1bf2ebe94f671983e3d3be059df91a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
 
##############################################################################
# \version     1.0.0
# \date        2014年08月28日
# \author      hesimin <hesimin@allwinnertech.com>
# \Descriptions:
#            create the inital version
##############################################################################
 
source send_cmd_pipe.sh
source script_parser.sh
 
#batterypath="/sys/class/power_supply/battery/"
#if cat $batterypath"/present" | grep 1; then
while true ; do
   batterypath="/sys/class/power_supply/battery/present"
   if cat $batterypath | grep 0; then
       SEND_CMD_PIPE_OK_EX $3 "NOT PMU"
   else
       pmu_status=`cat /sys/class/power_supply/battery/status`
       SEND_CMD_PIPE_OK_EX $3 "${pmu_status}"
   fi
   sleep 1
done
#else
#    SEND_CMD_PIPE_FAIL $3
#fi