更新太和e护配置wifi失败问题

This commit is contained in:
wyf
2025-11-13 09:56:02 +08:00
parent a9992f40ee
commit 776275aa3d
34 changed files with 5470 additions and 552 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:vbvs_app/common/util/FirmwareVersionService.dart';
class BlueToothDataModel {
String name; // 设备型号
@@ -13,6 +14,12 @@ class BlueToothDataModel {
DateTime lastSeen; // 最后可见时间
String? deviceID; // 设备ID
int? version; // ✅ 新增版本号,可为空
int? rssi; //信号强度
bool? selected; //是否选中
int? process = 0; //升级进度
int? newVersion; //升级版本
FirmwareVersionInfo? upgradeInfo;//升级固件信息
int? upgradeStatus;//升级状态
BlueToothDataModel({
this.name = '',
@@ -25,6 +32,12 @@ class BlueToothDataModel {
required this.lastSeen,
this.deviceID,
this.version, // ✅ 构造函数参数
this.rssi, // ✅ 构造函数参数
this.selected, // ✅ 构造函数参数
this.process, // ✅ 构造函数参数
this.newVersion, // ✅ 构造函数参数
this.upgradeInfo, // ✅ 构造函数参数
this.upgradeStatus, // ✅ 构造函数参数
});
factory BlueToothDataModel.fromScanResult(
@@ -35,6 +48,12 @@ class BlueToothDataModel {
String mac = '',
String? deviceID,
int? version, // ✅ 工厂方法参数
int? rssi, // ✅ 工厂方法参数
bool? selected, // ✅ 工厂方法参数
int? process, // ✅ 工厂方法参数
int? newVersion, // ✅ 工厂方法参数
FirmwareVersionInfo? upgradeInfo, // ✅ 工厂方法参数
int? upgradeStatus, // ✅ 工厂方法参数
}) {
String finalName =
name.isNotEmpty ? name : (result.advertisementData.localName ?? '');
@@ -50,6 +69,12 @@ class BlueToothDataModel {
lastSeen: DateTime.now(),
deviceID: deviceID,
version: version, // ✅ 赋值
rssi: rssi,
selected: selected,
process: process,
newVersion: newVersion,
upgradeInfo: upgradeInfo,
upgradeStatus: upgradeStatus,
);
}
}