|
|
@ -19,6 +19,8 @@ import com.blankj.utilcode.util.NetworkUtils; |
|
|
|
import com.blankj.utilcode.util.SizeUtils; |
|
|
|
import com.ouxuan.oxface.R; |
|
|
|
import com.ouxuan.oxface.device.MqttManager; |
|
|
|
import com.ouxuan.oxface.device.Ox485; |
|
|
|
import com.ouxuan.oxface.device.OxUDP; |
|
|
|
import com.ouxuan.oxface.utils.LogManager; |
|
|
|
|
|
|
|
import java.util.concurrent.Executors; |
|
|
@ -520,6 +522,38 @@ public class NetworkStatusIndicator { |
|
|
|
} catch (Exception e) { |
|
|
|
info.append("MQTT状态:").append("获取失败").append("\n"); |
|
|
|
} |
|
|
|
|
|
|
|
// // UDP连接状态 |
|
|
|
// try { |
|
|
|
// OxUDP udpManager = OxUDP.getInstance(); |
|
|
|
// String udpStatus = udpManager.isInitialized() ? |
|
|
|
// (udpManager.isPolling() ? "已连接(轮询中)" : "已连接(未轮询)") : |
|
|
|
// "未连接"; |
|
|
|
// info.append("UDP状态:").append(udpStatus).append("\n"); |
|
|
|
// } catch (Exception e) { |
|
|
|
// info.append("UDP状态:").append("获取失败").append("\n"); |
|
|
|
// } |
|
|
|
|
|
|
|
// // 485连接状态 |
|
|
|
// try { |
|
|
|
// Ox485 ox485Manager = Ox485.getInstance(); |
|
|
|
// // 使用get485Status方法获取详细状态信息 |
|
|
|
// String ox485Status = ox485Manager.get485Status(); |
|
|
|
// // 从详细状态信息中提取连接状态 |
|
|
|
// if (ox485Status.contains("已连接")) { |
|
|
|
// info.append("485状态:").append("已连接").append("\n"); |
|
|
|
// } else if (ox485Status.contains("连接中")) { |
|
|
|
// info.append("485状态:").append("连接中").append("\n"); |
|
|
|
// } else if (ox485Status.contains("未连接")) { |
|
|
|
// info.append("485状态:").append("未连接").append("\n"); |
|
|
|
// } else if (ox485Status.contains("未启用")) { |
|
|
|
// info.append("485状态:").append("未启用").append("\n"); |
|
|
|
// } else { |
|
|
|
// info.append("485状态:").append("未知").append("\n"); |
|
|
|
// } |
|
|
|
// } catch (Exception e) { |
|
|
|
// info.append("485状态:").append("获取失败").append("\n"); |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
info.append("检测时间:").append(new java.text.SimpleDateFormat("HH:mm:ss", java.util.Locale.getDefault()).format(new java.util.Date())); |
|
|
|