Wednesday, 24 February 2010
Wednesday, 17 February 2010
Saturday, 6 February 2010
Tuesday, 19 January 2010
Thursday, 7 January 2010
Thursday, 24 December 2009
phone battery check over bluetooth
bash script to check the battery level via bluetooth (assumes you have bind-ed the devices in rfcomm.conf already)
will put this in cron with some level checks around it to turn the charger off and on.
#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.
Subscribe to:
Posts (Atom)
