This is the second version of small program which continuously reads battery level from the phone and executes a script when it changes.
I first wrote this program to draw a graph of battery discharge over time, but since the FBUS protocol has only 5 levels (0, 1, 2 ,3 and 4 which this program converts to 0, 25, 50, 75 and 100) it turned out pretty dull; the AT driver supports 101 levels (0 to 100) so it could produce a more interesting graph, if phone firmware supports more than 5 levels, that is. This program outputs -1 when battery level can't be read.
Edit 2007/07/07: next version of gnocky will be available from http://www.gnokii.org/
The following patches written by Daniele Forsi allow to:
To compile the CVS version of gnocky you need to create an empty NEWS file in the top directory and fix the Makefile in the po directory (which is not including Makevars and so top_builddir is empty instead of ..).
Home page for gnokii: http://www.gnokii.org/
Home page for gnocky: http://sourceforge.net/projects/gnocky/
A quick list of DSLinux applications that need the XWindows sistem.
Easy program to print signal strength (RF level) returned by phone. It prints a number that you can assign to a variable o check in a conditional, e.g.:
[ $(rf_level) -lt 1 ] && echo "no signal"
Some phones have a range of -1..4 (with -1 meaning "no signal"), others have a range of 0..100 (with 0 meaning "no signal")
If you can send AT commands to your phone you can get this value using AT+CSQ but not all phones support this command and some take so long to answer to this command that communication times out if used with gnokii (LG U8120 is one that times out, you might succed if you first send this command using minicom).
This is the same value reported by gnokii --monitor while xgnokii translates this value graphically showing 0 to 4 segments.
C source code: