Add Linux WI-FI state support

Support monitoring WIFI state on Linux through:
- NetworkManager (D-Bus)
- IWD (D-Bus)
- wpa_supplicant (control socket)
- ConnMan (D-Bus)
This commit is contained in:
世界
2026-01-17 05:47:04 +08:00
parent cd56eaaba2
commit 8d8ca282a1
19 changed files with 913 additions and 31 deletions
+4
View File
@@ -107,6 +107,10 @@ func (s *platformInterfaceStub) IncludeAllNetworks() bool {
func (s *platformInterfaceStub) ClearDNSCache() {
}
func (s *platformInterfaceStub) UsePlatformWIFIMonitor() bool {
return false
}
func (s *platformInterfaceStub) ReadWIFIState() adapter.WIFIState {
return adapter.WIFIState{}
}
@@ -18,6 +18,7 @@ type Interface interface {
UnderNetworkExtension() bool
IncludeAllNetworks() bool
ClearDNSCache()
UsePlatformWIFIMonitor() bool
ReadWIFIState() adapter.WIFIState
SystemCertificates() []string
process.Searcher
+5 -1
View File
@@ -111,7 +111,7 @@ func (s *BoxService) Close() error {
}
func (s *BoxService) NeedWIFIState() bool {
return s.instance.Router().NeedWIFIState()
return s.instance.Network().NeedWIFIState()
}
var (
@@ -224,6 +224,10 @@ func (w *platformInterfaceWrapper) ClearDNSCache() {
w.iif.ClearDNSCache()
}
func (w *platformInterfaceWrapper) UsePlatformWIFIMonitor() bool {
return true
}
func (w *platformInterfaceWrapper) ReadWIFIState() adapter.WIFIState {
wifiState := w.iif.ReadWIFIState()
if wifiState == nil {