|
|
@ -92,6 +92,7 @@ public class MpMasterService extends Service {
|
|
|
|
|
|
|
|
|
|
|
|
private int mPrevDateForLogs = 0;
|
|
|
|
private int mPrevDateForLogs = 0;
|
|
|
|
private int mMasterTimers = 0;
|
|
|
|
private int mMasterTimers = 0;
|
|
|
|
|
|
|
|
private SingletonThread batterySingleThread;
|
|
|
|
|
|
|
|
|
|
|
|
public static class STATE_SERVICE {
|
|
|
|
public static class STATE_SERVICE {
|
|
|
|
public static final int CONNECTED = 10;
|
|
|
|
public static final int CONNECTED = 10;
|
|
|
@ -330,7 +331,9 @@ public class MpMasterService extends Service {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (batterySingleThread != null) {
|
|
|
|
|
|
|
|
batterySingleThread.shutdown();
|
|
|
|
|
|
|
|
}
|
|
|
|
super.onDestroy();
|
|
|
|
super.onDestroy();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1087,23 +1090,29 @@ public class MpMasterService extends Service {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void buildChargingBatteryVoltage(long ts) {
|
|
|
|
private void buildChargingBatteryVoltage(long ts) {
|
|
|
|
logger.info("电压测试开始");
|
|
|
|
batterySingleThread = SingletonThread.getInstance();
|
|
|
|
int val = 0;
|
|
|
|
batterySingleThread.execute(new Runnable() {
|
|
|
|
for (int idx = 0; idx < 3; idx++) {
|
|
|
|
@Override
|
|
|
|
logger.info("电压测试第" + idx + "次开始读取");
|
|
|
|
public void run() {
|
|
|
|
val = MpMasterService.getInt(112);
|
|
|
|
logger.info("电压线程开始");
|
|
|
|
logger.info("电压测试第" + idx + "次读取结束 " + val);
|
|
|
|
int val = 0;
|
|
|
|
if (val > 0) {
|
|
|
|
for (int idx = 0; idx < 3; idx++) {
|
|
|
|
break;
|
|
|
|
logger.info("电压测试第" + idx + "次开始读取");
|
|
|
|
|
|
|
|
val = MpMasterService.getInt(112);
|
|
|
|
|
|
|
|
logger.info("电压测试第" + idx + "次读取结束 " + val);
|
|
|
|
|
|
|
|
if (val > 0) {
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (val > 0) {
|
|
|
|
|
|
|
|
if (val > mMaxBCV) {
|
|
|
|
|
|
|
|
mMaxBCV = val;
|
|
|
|
|
|
|
|
mMaxBCVTime = ts;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (val > 0) {
|
|
|
|
|
|
|
|
if (val > mMaxBCV) {
|
|
|
|
|
|
|
|
mMaxBCV = val;
|
|
|
|
|
|
|
|
mMaxBCVTime = ts;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getAndResetMaxBCV() {
|
|
|
|
public String getAndResetMaxBCV() {
|
|
|
|