BLE plugin write returning ok but not working

I am using BLE plugin to connect to printer (Model SEWOO LK-P400), I want just to send a “Hello World” test, the connect and disconnect part is ok, I wrote the WRITE function this way:

async print() {
    let text = new TextEncoder().encode("HELLO_WORLD");
    let value = text.buffer as ArrayBuffer;
    await this.bluetoothProvider.print(this.deviceId, this.serviceUUID, this.characteristicUUID, value)
    .then(response => {
      console.log(response);
    });
}

print(deviceId: string, serviceUUID: string, characteristicUUID: string, value: ArrayBuffer): any {
    return this.ble.write(deviceId, serviceUUID, characteristicUUID, value);
}

it’s returning OK in console but not printing nothing.

Can you add more context? Which exact BLE plugin are you using (there are multiple)? Are you using Cordova or Capacitor? What versions? What is this.bluetoothProvider and this.ble?

1 Like

Ok, let’s go

I’m using this plugin: Ionic Native - BLE

I’m using Cordova

Cordova version 11.0.0
BLE version 4.20.0 this.bluetoothProvider calls the function print that call the write function of the plugin

I’m using a Sewoo printer SEWOO LK-P400, the functions connect and disconnect it’s ok, but the write function returns ok but it’s printing, the display of the printer turns on but nothing happens