更新
This commit is contained in:
@@ -30,7 +30,9 @@ class ClickableContainer extends StatelessWidget {
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
onTap: onTap,
|
||||
splashColor: highlightColor.withOpacity(0.5),
|
||||
splashColor: highlightColor == Colors.transparent
|
||||
? Colors.transparent
|
||||
: highlightColor.withOpacity(0.5),
|
||||
child: Padding(
|
||||
padding: padding,
|
||||
child: child,
|
||||
|
||||
@@ -86,8 +86,8 @@ Future<bool> sendWifiSetting(wifiItem, String password, THapp tHapp) async {
|
||||
final success = await tHapp.send(cmd, true, (log) {
|
||||
if (log.log.contains("update parm is successful")) {
|
||||
print("[wifi456]:" + log.log);
|
||||
edm.EasyDartModule.logger.info("WiFi配置成功-》log:$log");
|
||||
DailyLogUtils.writeLog("WiFi配置成功->log:$log");
|
||||
edm.EasyDartModule.logger.info("WiFi配置参数成功-》log:$log");
|
||||
DailyLogUtils.writeLog("WiFi配置参数成功->log:$log");
|
||||
log.result = true;
|
||||
log.over = true;
|
||||
return true;
|
||||
@@ -107,24 +107,21 @@ Future<bool> sendWifiSetting(wifiItem, String password, THapp tHapp) async {
|
||||
}
|
||||
}
|
||||
|
||||
getDeviceWifiStatus(THapp tHapp) async {
|
||||
getDeviceWifiStatus(THapp tHapp, int times) async {
|
||||
edm.EasyDartModule.logger.info("发送请求设备已配置网络状态指令");
|
||||
DailyLogUtils.writeLog("发送请求设备已配置网络状态指令");
|
||||
|
||||
var result = await tHapp.send(
|
||||
"at+system info",
|
||||
true,
|
||||
(ss) {
|
||||
try {
|
||||
var result = await tHapp.send("at+system info", true, (ss) {
|
||||
var log = ss.log;
|
||||
|
||||
// 匹配设备状态
|
||||
final statusMatch = RegExp(r'status=([^\s]+)').firstMatch(log);
|
||||
final statusMatch = RegExp(r'Status=([^\s]+)').firstMatch(log);
|
||||
final status = statusMatch?.group(1);
|
||||
if (status != null) {
|
||||
print('提取到的 status: $status');
|
||||
|
||||
// 如果设备连接状态是 "connect",继续检测
|
||||
if (status == 'connect') {
|
||||
if (status.contains('connect')) {
|
||||
ss.result = true;
|
||||
ss.over = true;
|
||||
|
||||
@@ -159,8 +156,10 @@ getDeviceWifiStatus(THapp tHapp) async {
|
||||
|
||||
// 未找到状态或Wi-Fi信息时,返回 false
|
||||
return false;
|
||||
},
|
||||
);
|
||||
}, times);
|
||||
|
||||
return result;
|
||||
return result;
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user