summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2012-05-23 12:15:23 +0200
committersmos <seth.mos@dds.nl>2012-05-23 12:15:23 +0200
commit99f95f7d3be4b85dcbd3c15455c6fbd704b6fa73 (patch)
tree72c4550a00de06966d2700a050da1eff4452a11e
parentfe7fef6418ff469a09c1dee1c1704240ae0e4633 (diff)
downloadpfsense-99f95f7d3be4b85dcbd3c15455c6fbd704b6fa73.zip
pfsense-99f95f7d3be4b85dcbd3c15455c6fbd704b6fa73.tar.gz
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.
-rw-r--r--etc/inc/pfsense-utils.inc5
-rwxr-xr-xusr/local/bin/3gstats.php9
-rwxr-xr-xusr/local/www/status_interfaces.php7
3 files changed, 16 insertions, 5 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 1cfea7a..ccd04ddd 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1267,8 +1267,9 @@ function get_interface_info($ifdescr) {
$cellstats = file($mondev);
$a_cellstats = explode(",", $cellstats[1]);
$ifinfo['cell_rssi'] = $a_cellstats[1];
- $ifinfo['cell_upstream'] = $a_cellstats[7];
- $ifinfo['cell_downstream'] = trim($a_cellstats[8]);
+ $ifinfo['cell_mode'] = $a_cellstats[2] .",". $a_cellstats[3];
+ $ifinfo['cell_upstream'] = $a_cellstats[8];
+ $ifinfo['cell_downstream'] = trim($a_cellstats[9]);
}
// Calculate cumulative uptime for PPP link. Useful for connections that have per minute/hour contracts so you don't go over!
if (isset($ppp['uptime']))
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);
diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php
index dec67bb..c23140e 100755
--- a/usr/local/www/status_interfaces.php
+++ b/usr/local/www/status_interfaces.php
@@ -198,6 +198,13 @@ include("head.inc");
<?=htmlspecialchars($ifinfo['cell_rssi']);?> (0-31)
</td>
</tr>
+ <?php endif; if ($ifinfo['cell_mode']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Cell Mode");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['cell_mode']);?>
+ </td>
+ </tr>
<?php endif; if ($ifinfo['cell_upstream']): ?>
<tr>
<td width="22%" class="vncellt"><?=gettext("Cell Upstream");?></td>
OpenPOWER on IntegriCloud