fix:增加首次发蓝牙端口后直接重发

This commit is contained in:
liyi 2025-08-04 15:24:20 +08:00
parent 93ce93bdd4
commit aec0bc2b18

View File

@ -167,11 +167,9 @@ class LockVoiceSettingLogic extends BaseGetXController {
BluetoothConnectionState.disconnected) {
dismissEasyLoading();
cancelBlueConnetctToastTimer();
// 1
Future.delayed(const Duration(seconds: 2), () {
// +1
sendFileToDevice(data, token);
});
//
sendFileToDevice(data, token);
// 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() {
if (state.data == null) return;
state.voiceSubcontractingIndex = 0;