|
@@ -708,7 +708,7 @@ object BusinessManager {
|
|
|
if (res == 0x01.toByte() && job == 0x01.toByte()) {
|
|
if (res == 0x01.toByte() && job == 0x01.toByte()) {
|
|
|
loadingCallBack?.invoke(false, ctx.getString(R.string.simple_switch_work_mode_success), null)
|
|
loadingCallBack?.invoke(false, ctx.getString(R.string.simple_switch_work_mode_success), null)
|
|
|
// TODO 切成工作模式断开,待机模式不断开
|
|
// TODO 切成工作模式断开,待机模式不断开
|
|
|
- BleManager.getInstance().disconnectAllDevice()
|
|
|
|
|
|
|
+// BleManager.getInstance().disconnectAllDevice()
|
|
|
} else if (res == 0x02.toByte() && job == 0x01.toByte()) {
|
|
} else if (res == 0x02.toByte() && job == 0x01.toByte()) {
|
|
|
loadingCallBack?.invoke(false, ctx.getString(R.string.simple_switch_standby_mode_success), null)
|
|
loadingCallBack?.invoke(false, ctx.getString(R.string.simple_switch_standby_mode_success), null)
|
|
|
}
|
|
}
|
|
@@ -745,7 +745,10 @@ object BusinessManager {
|
|
|
loadingCallBack?.invoke(true, ctx.getString(R.string.simple_switch_work_mode), null)
|
|
loadingCallBack?.invoke(true, ctx.getString(R.string.simple_switch_work_mode), null)
|
|
|
BleCmdManager.switchMode(STATUS_WORK, bleBean.bleDevice, object : CustomBleWriteCallback() {
|
|
BleCmdManager.switchMode(STATUS_WORK, bleBean.bleDevice, object : CustomBleWriteCallback() {
|
|
|
override fun onWriteSuccess(current: Int, total: Int, justWrite: ByteArray?) {
|
|
override fun onWriteSuccess(current: Int, total: Int, justWrite: ByteArray?) {
|
|
|
- println("switch mode 1 success")}
|
|
|
|
|
|
|
+ println("switch mode 1 success")
|
|
|
|
|
+ // TODO 只能在这里断开,不能全部断开
|
|
|
|
|
+ BleManager.getInstance().disconnect(bleBean.bleDevice)
|
|
|
|
|
+ }
|
|
|
override fun onWriteFailure(exception: BleException?) {
|
|
override fun onWriteFailure(exception: BleException?) {
|
|
|
println("switch mode 1 fail")}
|
|
println("switch mode 1 fail")}
|
|
|
})
|
|
})
|