I.MX6 show battery states in commandLine
2016-01-29 16:07
513 查看
#/bin/sh # I.MX6 show battery states in commandLine # 声明: # 在命令行下自动显示电池状态的信息。 # # 2016-1-29 # set battery root path batteryPath=/sys/class/power_supply/bq274xx-0 beginTime=`date +%H-%M-%S` while true do busybox clear # get battery data batteryCapacity=`cat $batteryPath/capacity` batteryCapacity_level=`cat $batteryPath/capacity_level` batteryCharge_full=`cat $batteryPath/charge_full` batteryCharge_full_design=`cat $batteryPath/charge_full_design` batteryCharge_now=`cat $batteryPath/charge_now` batteryCurrent_now=`cat $batteryPath/current_now` batteryPresent=`cat $batteryPath/present` batteryStatus=`cat $batteryPath/status` batteryTechnology=`cat $batteryPath/technology` batteryTemp=`cat $batteryPath/temp` batteryType=`cat $batteryPath/type` batteryVoltage_now=`cat $batteryPath/voltage_now` # show battery data in a format echo ------------------------------------- echo " capacity: $batteryCapacity" echo " capacity_level: $batteryCapacity_level" echo " charge_full: $batteryCharge_full" echo "charge_full_design: $batteryCharge_full_design" echo " charge_now: $batteryCharge_now" echo " current_now: $batteryCurrent_now" echo " present: $batteryPresent" echo " status: $batteryStatus" echo " technology: $batteryTechnology" echo " temp: $batteryTemp" echo " type: $batteryType" echo " voltage_now: $batteryVoltage_now" echo echo " beginTime: $beginTime" echo " currentTime: `date +%H-%M-%S`" sleep 1 done # data output # ------------------------------------- # capacity: 77 # capacity_level: Normal # charge_full: 1180000 # charge_full_design: 1340000 # charge_now: 57000 # current_now: 0 # present: 1 # status: Charging # technology: Li-ion # temp: 290 # type: Battery # voltage_now: 3979000 # # beginTime: 00-00-00 # current: 02-20-53
相关文章推荐
- Java批量插入、更新数据
- Socket 模拟Http协议发送图片文件 c#篇
- IOS开发之——蓝牙通信浅谈
- .class
- Core Animation 之 CALayer
- 为Bootstrap模态对话框添加拖拽移动功能
- CocoaPods的使用(一) 安装
- 单实例MySQL安装
- MyBatis+MySQL 传入参数
- 教你如何用百度Echarts做静态报表
- Spring 实现容器销毁该bean的时候获得一次回调
- 进程、作业和进程组
- UITableView的常见属性
- CMake/CPack变量之CPACK_PACKAGING_INSTALL_PREFIX
- 【mongodb】 log4j输出信息到mongodb
- SqlServer 递归查询树形数据
- SQL key vs index
- Unity 自动导出 AndroidStudio 项目
- 快速排序
- volatile 保证变量内存中值的同步