Prechádzať zdrojové kódy

修复钥匙左右判断

Frankensteinly 10 mesiacov pred
rodič
commit
d2824d482f

+ 4 - 4
app/src/main/java/com/grkj/iscs/modbus/DockBean.kt

@@ -32,10 +32,10 @@ class DockBean(
             when (it) {
                 DOCK_TYPE_KEY -> {
                     // TODO 未验证
-                    val leftHasKey = (byteArray[4].toInt() shr 0) and 0x1 == 1
-                    val isLeftCharging = (byteArray[4].toInt() shr 1) and 0x1 == 1
-                    val rightHasKey = (byteArray[3].toInt() shr 0) and 0x1 == 1
-                    val isRightCharging = (byteArray[3].toInt() shr 1) and 0x1 == 1
+                    val rightHasKey = (byteArray[4].toInt() shr 0) and 0x1 == 1
+                    val isRightCharging = (byteArray[4].toInt() shr 1) and 0x1 == 1
+                    val leftHasKey = (byteArray[3].toInt() shr 0) and 0x1 == 1
+                    val isLeftCharging = (byteArray[3].toInt() shr 1) and 0x1 == 1
                     LogUtil.i("钥匙刷新状态 : $leftHasKey - $isLeftCharging - $rightHasKey - $isRightCharging")
                     if (getKeyList().isEmpty()) {
                         deviceList.add(KeyBean(0, leftHasKey, true, isLeftCharging, null, null))