don/BluetoothSerial

Thermal printer not response

Eizaz opened this issue · 1 comments

Eizaz commented
import { BluetoothSerial } from '@awesome-cordova-plugins/bluetooth-serial/ngx';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})

export class HomePage {



    MAC = 'DC:0D:30:12:11:15'; // this is bluetooth printer mac address

    constructor(private bluetoothSerial: BluetoothSerial) {}

  print() {

       var data = new Uint8Array([0x0A, 0x0A, 0x0A]);
               // send byte code into the printer
        this.bluetoothSerial.connect(this.MAC).subscribe(() => {
          this.bluetoothSerial.write(data)
            .then(() => {
              console.log('Print success');
              console.log(this.MAC);
              this.bluetoothSerial.disconnect();
              console.log(data)
            })
            .catch((err) => {
              console.error(err);
            });
        }); 
    
  }

the console output are success but my thermal printer print nothing
printer type : xprinter xp-460b

What happen with this? ... how did you fix this?