|
|
|
@ -1,8 +1,9 @@
|
|
|
|
|
package com.yinuo.safetywatcher.watcher.port
|
|
|
|
|
|
|
|
|
|
import android.os.Process
|
|
|
|
|
import com.common.commonlib.db.DBUtils
|
|
|
|
|
import com.common.serialport.ComMultiPortUtils
|
|
|
|
|
import com.yinuo.safetywatcher.watcher.port.cmd.CMD
|
|
|
|
|
import android.os.Process
|
|
|
|
|
import com.yinuo.safetywatcher.watcher.port.cmd.CalibrationCmd
|
|
|
|
|
|
|
|
|
|
object GasPortUtils {
|
|
|
|
@ -37,6 +38,9 @@ object GasPortUtils {
|
|
|
|
|
readGasMsgThread = Thread {
|
|
|
|
|
try {
|
|
|
|
|
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
|
|
|
|
|
// 删除老的传感器列表数据
|
|
|
|
|
val gasTypeDao = DBUtils.gasTypeDao()
|
|
|
|
|
gasTypeDao.deleteAll()
|
|
|
|
|
while (true) {
|
|
|
|
|
// 延时一段时间后,发送指令读取气体数据
|
|
|
|
|
Thread.sleep(READ_MSG_INTERVAL)
|
|
|
|
|