fix:增加首次发蓝牙端口后直接重发
This commit is contained in:
parent
93ce93bdd4
commit
aec0bc2b18
@ -167,11 +167,9 @@ class LockVoiceSettingLogic extends BaseGetXController {
|
|||||||
BluetoothConnectionState.disconnected) {
|
BluetoothConnectionState.disconnected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
// 延迟1秒后重试(避免频繁请求)
|
|
||||||
Future.delayed(const Duration(seconds: 2), () {
|
// 断开后重发一下
|
||||||
// 递归调用自身,重试次数+1
|
sendFileToDevice(data, token);
|
||||||
sendFileToDevice(data, token);
|
|
||||||
});
|
|
||||||
|
|
||||||
// showBlueConnetctToast();
|
// showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
@ -294,31 +292,6 @@ class LockVoiceSettingLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发送获取型号蓝牙命令
|
|
||||||
sendGetDeviceModelBleMessage() {
|
|
||||||
showEasyLoading();
|
|
||||||
showBlueConnetctToastTimer(action: () {
|
|
||||||
dismissEasyLoading();
|
|
||||||
});
|
|
||||||
BlueManage().blueSendData(
|
|
||||||
BlueManage().connectDeviceName,
|
|
||||||
(BluetoothConnectionState deviceConnectionState) async {
|
|
||||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
|
||||||
BlueManage().writeCharacteristicWithResponse(
|
|
||||||
GetDeviceModelCommand(
|
|
||||||
lockID: BlueManage().connectDeviceName,
|
|
||||||
).packageData(),
|
|
||||||
);
|
|
||||||
} else if (deviceConnectionState ==
|
|
||||||
BluetoothConnectionState.disconnected) {
|
|
||||||
dismissEasyLoading();
|
|
||||||
cancelBlueConnetctToastTimer();
|
|
||||||
showBlueConnetctToast();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _startSendLanguageFile() {
|
void _startSendLanguageFile() {
|
||||||
if (state.data == null) return;
|
if (state.data == null) return;
|
||||||
state.voiceSubcontractingIndex = 0;
|
state.voiceSubcontractingIndex = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user