From 99f95f7d3be4b85dcbd3c15455c6fbd704b6fa73 Mon Sep 17 00:00:00 2001 From: smos Date: Wed, 23 May 2012 12:15:23 +0200 Subject: Add the 3G mode display, really needs a function that translates these into sane display numbers for strength and mode. The mode is actually a combination of LED color 4 = blue(idle), 5 = cyan(connected), and submode 7 = HSDPA I need to find some proper documentation, really. --- usr/local/bin/3gstats.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr/local/bin') diff --git a/usr/local/bin/3gstats.php b/usr/local/bin/3gstats.php index c63a014..bea0461 100755 --- a/usr/local/bin/3gstats.php +++ b/usr/local/bin/3gstats.php @@ -9,7 +9,8 @@ if(empty($argv[1])) { /* Huawei example */ $device = "/dev/{$argv[1]}"; $statfile = "/tmp/3gstats.{$argv[2]}"; -$header = "#seconds,rssi,mode,upstream,downstream,sentbytes,receivedbyts,bwupstream,bwdownstream\n"; +/* mode is a comma seperated value, thus submode is born */ +$header = "#seconds,rssi,mode,submode,upstream,downstream,sentbytes,receivedbyts,bwupstream,bwdownstream\n"; $i = 0; @@ -19,15 +20,17 @@ if(! $handle) { echo "Can not open modem stats device\n"; exit(1); } -$record['mode'] = 0; -$record['rssi'] = 0; + $record['time'] = 0; +$record['rssi'] = 0; +$record['mode'] = "0,0"; $record['upstream'] = 0; $record['downstream'] = 0; $record['sent'] = 0; $record['received'] = 0; $record['bwupstream'] = 0; $record['bwdownstream'] = 0; + while(true) { $string = ""; $string = fgets($handle, 256); -- cgit v1.1