detect firmware version
authorChristian Weiske <cweiske@cweiske.de>
Fri, 17 Dec 2010 18:11:55 +0000 (19:11 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 17 Dec 2010 18:11:55 +0000 (19:11 +0100)
Wrt3g/HtmlParser.php
tests/status_noauth-aquiring.phpt
tests/status_noauth-connected-2.phpt
tests/status_noauth-connected.phpt

index f369bd1648366145847adaa8f52c60ded611985b..9574cd032ac6c2bd14448d199f626614ac4caabb 100644 (file)
@@ -208,6 +208,10 @@ class Wrt3g_HtmlParser
             }
         }
 
+        if (preg_match('/Capture\\(share.firmwarever\\):(.+?)</', $body, $arMatches)) {
+            $arRaw['router firmware'] = trim($arMatches[1]);
+        }
+
         return $arRaw;
     }
 }
\ No newline at end of file
index 8c6c5d491c00def948a3666017f986d0567998ea..627c9e633a17de9dc3c8fb5c8033bf144872e9a7 100644 (file)
@@ -11,7 +11,7 @@ var_dump(
     )
 );
 --EXPECT--
-array(10) {
+array(11) {
   ["connection"]=>
   string(10) "connecting"
   ["type"]=>
@@ -32,4 +32,6 @@ array(10) {
   string(42) "1.5.5  (Date: May 17 2005, Time: 14:55:44)"
   ["IMSI"]=>
   string(15) "262032010984707"
+  ["router firmware"]=>
+  string(11) "v2.01.03-EM"
 }
\ No newline at end of file
index d4f12f8d0111bc87b05b02f693760c1bbc066748..86b85d655ef5dd0f6babee1307631e5b9d93e484 100644 (file)
@@ -11,7 +11,7 @@ var_dump(
     )
 );
 --EXPECT--
-array(10) {
+array(11) {
   ["connection"]=>
   string(9) "connected"
   ["type"]=>
@@ -37,4 +37,6 @@ array(10) {
   string(42) "1.5.5  (Date: May 17 2005, Time: 14:55:44)"
   ["IMSI"]=>
   string(15) "262032010984707"
+  ["router firmware"]=>
+  string(11) "v2.01.03-EM"
 }
\ No newline at end of file
index efd673d18fe332043b4963870fe7b8e59f5ccbb5..ddc172406cb3973b8022a4639f77ab094836d8c5 100644 (file)
@@ -11,7 +11,7 @@ var_dump(
     )
 );
 --EXPECT--
-array(10) {
+array(11) {
   ["connection"]=>
   string(9) "connected"
   ["type"]=>
@@ -37,4 +37,6 @@ array(10) {
   string(42) "1.5.5  (Date: May 17 2005, Time: 14:55:44)"
   ["IMSI"]=>
   string(15) "262032010984707"
+  ["router firmware"]=>
+  string(11) "v2.01.03-EM"
 }
\ No newline at end of file