Browse Source

Update WiFi (Sync Ver.200626)

hi80482 3 years ago
parent
commit
5dd287ab8d
1 changed files with 14 additions and 7 deletions
  1. 14 7
      Menu/GameShell/10_Settings/Wifi/wifi_list.py

+ 14 - 7
Menu/GameShell/10_Settings/Wifi/wifi_list.py

@@ -10,7 +10,7 @@ from wicd import misc
 from UI.constants import Width,Height
 from UI.page   import Page,PageSelector
 from UI.label  import Label
-from UI.util_funcs import midRect,SwapAndShow
+from UI.util_funcs import midRect,SwapAndShow,FileExists,ReadTheFileContent
 from UI.keys_def   import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
 from UI.scroller   import ListScroller
 from UI.confirm_page import ConfirmPage
@@ -82,7 +82,11 @@ class WifiInfoPage(Page):
                     self._AList["ip"]["value"] = ip
             
             self._AList["bssid"]["value"] = self._Wireless.GetWirelessProperty(self._NetworkId,"bssid")
-        
+            if FileExists("/sys/class/net/wlan0/address"):
+                self._AList["mac_addr"]["value"] = ReadTheFileContent("/sys/class/net/wlan0/address").strip().upper()
+            else:
+                self._AList["mac_addr"]["value"] = ""
+
         start_x  = 0
         start_y  = 0
         
@@ -130,10 +134,16 @@ class WifiInfoPage(Page):
         bssid["key"] = "bssid"
         bssid["label"] = "BSSID"
         bssid["value"] = ""
-        
+
+        mac_addr = {}
+        mac_addr["key"] = "mac_addr"
+        mac_addr["label"] = "MAC ADDR"
+        mac_addr["value"] = ""
+       
         self._AList["ip"] = ip
         self._AList["bssid"] = bssid
-        
+        self._AList["mac_addr"] = mac_addr
+
         self.GenList()
 
         self._DisconnectConfirmPage = WifiDisconnectConfirmPage()
@@ -453,7 +463,6 @@ class WifiList(Page):
          in DbusConnectResultsSent
         'dhcp_failed'
         dbus says start scan...
-
         """
         if result != None:
             print(result)
@@ -550,10 +559,8 @@ class WifiList(Page):
                 results.append({text:value})
         """
         [{'preshared_key': 'blah blah blah',},]
-
         or nothing 
         [{'identity': None,},{'password': None,},]
-
         """
         return results