-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ble.write() doesn't print or show any error (Android) #1017
Comments
You haven't got any code here showing how the scan or connect is working. |
@peitschie Hi. That's right I don't have any problem for scanning and connecting to Bluetooth printers and I can connect to printers successfully. Only problem |
There's nothing obviously wrong there in the BLE code @shayan-izadi But... it's fairly complex code, with a lot of I'd highly recommend coming up with the simplest case possible, and seeing if you have more luck there. const BT_device=57:4C:54:03:1D:0D;
const BT_service_id=18f0;
const BT_characteristic_id=2af1;
/* async/await is available in typescript, and makes life a lot easier */
async function onConnect() {
const payload1 = new TextEncoder().encode("some value");
await ble.withPromises.write(BT_device, BT_service, BT_characteristic, payload.buffer);
const payload2 = new TextEncoder().encode("some value");
await ble.withPromises.write(BT_device, BT_service, BT_characteristic, payload2.buffer);
....
}
ble.connect(BT_device, onConnect, console.error); |
Hello. I have an Apache Cordova app and I want to print receipts with this plugin. I use the code below but it does not print data and does not show any error or response. I am really confused and the task is very vital for me. I would appreciate any suggestion or help:)
Here is my test print code (the first 3 variables are correct and I get it automatically from the device.I added as a const here from my printer here to make it easier for you to check):
The text was updated successfully, but these errors were encountered: