#cut here =======================
#!/bin/bash
Z=$( C='';until [ "$C" == "connected" ];do C=`rfcomm show 1|cut -d ' ' -f 5`;\
done;echo "at+cbc">/dev/rfcomm1 )&
ZZ=$((while read line
do
echo $line
if [ "$line" == "OK" ]; then
break
fi
done < /dev/rfcomm1 )|grep CBC|cut -d ',' -f 2 )
echo "Battery Level = $ZZ %"
#=================================
will put this in cron with some level checks around it to turn the charger off and on.
No comments:
Post a Comment