|
|
@@ -70,6 +70,8 @@ class MainActivity : ComponentActivity() {
|
|
|
Button({ ctrlKeySlotCharge(0, true) }) { Text("0-开充电") }
|
|
|
Spacer(modifier = Modifier.width(10.dp))
|
|
|
Button({ ctrlKeySlotCharge(0, false) }) { Text("0-关充电") }
|
|
|
+ Spacer(modifier = Modifier.width(10.dp))
|
|
|
+ Button({ ctrlKeyAllSlot(-1, false, false) }) { Text("全开关充电") }
|
|
|
}
|
|
|
Row {
|
|
|
Button({ ctrlKeySlotLock(1, false) }) { Text("1-开锁") }
|
|
|
@@ -79,6 +81,8 @@ class MainActivity : ComponentActivity() {
|
|
|
Button({ ctrlKeySlotCharge(1, true) }) { Text("1-开充电") }
|
|
|
Spacer(modifier = Modifier.width(10.dp))
|
|
|
Button({ ctrlKeySlotCharge(1, false) }) { Text("1-关充电") }
|
|
|
+ Spacer(modifier = Modifier.width(10.dp))
|
|
|
+ Button({ ctrlKeyAllSlot(-1, true, true) }) { Text("全关开充电") }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -110,6 +114,13 @@ class MainActivity : ComponentActivity() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ fun ctrlKeyAllSlot(ch: Int, isLock: Boolean, isCharge: Boolean) {
|
|
|
+ val device = list.find { it.frame.cmd == 0x0601 }
|
|
|
+ if (device is DeviceKeySlot) {
|
|
|
+ CommManager.write(device.ctrlSlotLockAndCharge(ch, isLock, isCharge))
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 初始化ISCS SDK 操作
|
|
|
*/
|