修复自动开启传感器蓝牙日志
This commit is contained in:
@@ -10,6 +10,7 @@ import 'package:vbvs_app/common/util/DailyLogUtils.dart';
|
||||
// wifi列表指令
|
||||
getWifiList(THapp tHapp) async {
|
||||
try {
|
||||
await openDlog(tHapp);
|
||||
print("wscan scan");
|
||||
edm.EasyDartModule.logger.info("发送请求网络列表指令");
|
||||
DailyLogUtils.writeLog("发送请求网络列表指令");
|
||||
@@ -53,6 +54,7 @@ getWifiList(THapp tHapp) async {
|
||||
}
|
||||
|
||||
getWifiStatus(THapp tHapp) async {
|
||||
await openDlog(tHapp);
|
||||
edm.EasyDartModule.logger.info("发送请求设备网络状态指令");
|
||||
DailyLogUtils.writeLog("发送请求设备网络状态指令");
|
||||
var result = await tHapp.send(
|
||||
@@ -83,6 +85,7 @@ getWifiStatus(THapp tHapp) async {
|
||||
|
||||
Future<bool> sendWifiSetting(wifiItem, String password, THapp tHapp) async {
|
||||
try {
|
||||
await openDlog(tHapp);
|
||||
edm.EasyDartModule.logger.info("发送wifi配置指令");
|
||||
DailyLogUtils.writeLog("发送wifi配置指令->");
|
||||
// String cmd = "vtouch save update -a -i .wifi.sta.auth=${wifiItem['auth']} "
|
||||
@@ -119,6 +122,7 @@ getDeviceWifiStatus(
|
||||
int times, {
|
||||
bool link = false,
|
||||
}) async {
|
||||
await openDlog(tHapp);
|
||||
DailyLogUtils.writeLog("发送请求设备已配置网络状态指令");
|
||||
bool success = false;
|
||||
final now = DateTime.now();
|
||||
@@ -203,6 +207,7 @@ getDeviceWifiStatus(
|
||||
|
||||
//只有4g并且没有wifi
|
||||
Future<String> getDeviceNetVersion(THapp tHapp, int times) async {
|
||||
await openDlog(tHapp);
|
||||
edm.EasyDartModule.logger.info("发送请求设备的网络信息");
|
||||
DailyLogUtils.writeLog("发送请求设备的网络信息");
|
||||
print("ls /root/mnt");
|
||||
@@ -240,6 +245,7 @@ Future<String> getDeviceNetVersion(THapp tHapp, int times) async {
|
||||
|
||||
/// 发送关闭blog日志与开启业务日志的指令
|
||||
Future<bool> sendBlogAndDlogCommands(THapp tHapp) async {
|
||||
await openDlog(tHapp);
|
||||
edm.EasyDartModule.logger.info("发送 blog disable 与 dlog on business 指令");
|
||||
DailyLogUtils.writeLog("发送 blog disable 与 dlog on business 指令");
|
||||
try {
|
||||
@@ -293,6 +299,7 @@ Future<bool> sendBlogAndDlogCommands(THapp tHapp) async {
|
||||
|
||||
/// 执行 wscan close -> 延迟 1s -> wscan open
|
||||
Future<bool> sendCloseAndOpenWscanCommand(THapp tHapp) async {
|
||||
await openDlog(tHapp);
|
||||
edm.EasyDartModule.logger.info("执行 wscan close -> wscan open 指令");
|
||||
DailyLogUtils.writeLog("执行 wscan close -> wscan open 指令开始");
|
||||
|
||||
@@ -336,7 +343,6 @@ Future<bool> sendCloseAndOpenWscanCommand(THapp tHapp) async {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// 查询设备内存状态(指令: free all)
|
||||
///
|
||||
/// 示例返回:
|
||||
@@ -346,6 +352,7 @@ Future<bool> sendCloseAndOpenWscanCommand(THapp tHapp) async {
|
||||
/// 若匹配到“关键内存剩余:xxxx 字节”,其中 xxxx < 20000 返回 false,
|
||||
/// 否则返回 true。
|
||||
Future<bool> queryMemory(THapp tHapp, {int times = 1}) async {
|
||||
await openDlog(tHapp);
|
||||
edm.EasyDartModule.logger.info("发送查询内存状态指令 (free all)");
|
||||
DailyLogUtils.writeLog("发送查询内存状态指令 (free all)");
|
||||
|
||||
@@ -358,8 +365,7 @@ Future<bool> queryMemory(THapp tHapp, {int times = 1}) async {
|
||||
final match = RegExp(r'关键内存剩余:(\d+)\s*字节').firstMatch(log);
|
||||
if (match != null) {
|
||||
final freeValue = int.tryParse(match.group(1) ?? "0") ?? 0;
|
||||
edm.EasyDartModule.logger
|
||||
.info("提取到关键内存剩余: $freeValue 字节");
|
||||
edm.EasyDartModule.logger.info("提取到关键内存剩余: $freeValue 字节");
|
||||
DailyLogUtils.writeLog("提取到关键内存剩余: $freeValue 字节");
|
||||
|
||||
// 判断内存是否充足
|
||||
@@ -375,8 +381,7 @@ Future<bool> queryMemory(THapp tHapp, {int times = 1}) async {
|
||||
|
||||
// result 就是 send 内部设置的 ss.result
|
||||
if (result is bool) {
|
||||
edm.EasyDartModule.logger
|
||||
.info("内存检测结果 -> ${result ? "充足" : "不足"}");
|
||||
edm.EasyDartModule.logger.info("内存检测结果 -> ${result ? "充足" : "不足"}");
|
||||
DailyLogUtils.writeLog("内存检测结果 -> ${result ? "充足" : "不足"}");
|
||||
return result;
|
||||
}
|
||||
@@ -391,12 +396,12 @@ Future<bool> queryMemory(THapp tHapp, {int times = 1}) async {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// 重启设备指令
|
||||
///
|
||||
/// 发送 "reboot" 命令,若响应中包含 reboot / restart / ok / success 等关键字
|
||||
/// 视为执行成功,返回 true;否则返回 false。
|
||||
Future<bool> rebootDevice(THapp tHapp) async {
|
||||
await openDlog(tHapp);
|
||||
edm.EasyDartModule.logger.info("发送设备重启指令 (reboot)");
|
||||
DailyLogUtils.writeLog("发送设备重启指令 (reboot)");
|
||||
|
||||
@@ -440,4 +445,6 @@ Future<bool> rebootDevice(THapp tHapp) async {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
openDlog(THapp tHapp) async {
|
||||
await tHapp.send("dlog on hal");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user