|
|
@@ -19,11 +19,11 @@ var (
|
|
|
isOnline atomic.Bool // 标记是否联网
|
|
|
offlineStartTs atomic.Int64 // 离线开始时间
|
|
|
isSyncNTPTimeOK atomic.Bool // 标记本地时间是否已同步成功
|
|
|
+ curNetType NetType // 当前的网络类型: 有线、蜂窝
|
|
|
mu1 sync.Mutex
|
|
|
isRunning1 bool
|
|
|
exitCh1 chan struct{}
|
|
|
wg1 sync.WaitGroup
|
|
|
- curNetType NetType
|
|
|
)
|
|
|
|
|
|
type NetType int
|
|
|
@@ -305,6 +305,11 @@ func monitorEth0PlugCycle(plugCycle chan bool, done chan struct{}) error {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 得到当前联网类型: 有线、蜂窝
|
|
|
+func GetCurrentNetType() NetType {
|
|
|
+ return curNetType
|
|
|
+}
|
|
|
+
|
|
|
//export RTU_IsInetAvailable
|
|
|
func RTU_IsInetAvailable() C.int {
|
|
|
if IsInetAvailable() {
|