Closed zhanLaiDong closed 2 months ago
Hello, when I tried to connect to the printer using ble.connect, I tried the success callback function, but later when I used ble.isConnected to check the connection status with the printer, it showed that it was not connected. The device's status kept showing that it was connected. After disconnecting, I tried to connect again, but it still failed to print. These are all accidental occurrences. May I ask what the problem is? Please advise. Thank you
Please, brothers, wish you all a safe life
Hi @zhanLaiDong
Can you paste what your javascript code wiring all this together looks like? In the above console screenshot there, it says the state is connecting
still.
The device's status kept showing that it was connected
The phone may be connected but the app is not aware of this. Standard practice is to always call ble.connect
on app launch and after any kind of disconnect.
Hello, the current issue is that the customer did not continue printing for a short period of time after using Bluetooth to connect to the printer. For example, after about 20 minutes, this problem may occur again when printing. This is a random occurrence. The more printers and mobile phones there are around the customer, the higher the probability of errors. Thank you
幸运信息 @.***
------------------ 原始邮件 ------------------ 发件人: "Philip @.>; 发送时间: 2024年1月8日(星期一) 上午9:55 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [don/cordova-plugin-ble-central] The plugin ble.write in versions after iOS 17 reported an error (Issue #1000)
Hi @zhanLaiDong
Can you paste what your javascript code wiring all this together looks like? In the above console screenshot there, it says the state is connecting still.
The device's status kept showing that it was connected
The phone may be connected but the app is not aware of this. Standard practice is to always call ble.connect on app launch and after any kind of disconnect.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
Also, restarting the printer has no effect. Only after the app kills the process and reopens it can it print normally
幸运信息 @.***
------------------ 原始邮件 ------------------ 发件人: "don/cordova-plugin-ble-central" @.>; 发送时间: 2024年1月8日(星期一) 上午9:55 @.>; @.**@.>; 主题: Re: [don/cordova-plugin-ble-central] The plugin ble.write in versions after iOS 17 reported an error (Issue #1000)
Hi @zhanLaiDong
Can you paste what your javascript code wiring all this together looks like? In the above console screenshot there, it says the state is connecting still.
The device's status kept showing that it was connected
The phone may be connected but the app is not aware of this. Standard practice is to always call ble.connect on app launch and after any kind of disconnect.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
After each printing of the app, it needs to be disconnected because there are multiple phones sharing the same printer device, so it cannot be kept connected all the time, which means other phones cannot connect to the printer
@zhanLaiDong without examples of how the javascript connection loop there is working, it's fairly difficult to guess what's going on.
This is a normal printed code, but there may be occasional printing errors. Please check, thank you code.docx
So, a few things:
CBPeripheral
state is connecting
in your screenshots above.doPrint
method is allowing both a Write
and WriteWithoutResponse
method to be the writeService
, however, you only ever call ble.write
. This means that if you find WriteWithoutResponse
for some reason, the write call will fail because you should be using ble.writeWithoutResponse
As an aside, the whole approach there to finding the characteristic is very unusual. Usually, the service and characteristic UUIDs are a fixed part of the contract, and don't need to be extracted like you are doing here.
Closing this out due to inactivity. Feel free to re-open if there is still an unresolved issue here.
Hello author, first of all, thank you for your contribution. After the iOS version was updated to 17, an error occurred in ble.write when Bluetooth was connected to the printer for printing. May I ask how to solve this problem? I cannot know exactly what information the user has lost, and I cannot reproduce it. I am very anxious. Please, thank you very much
Could not find service with UUID FFF0 on peripheral with UUID AC9E3C01-1EC0-1172-6E27-36A516479242