Skip to content
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

Thermal printer not response #447

Open
Eizaz opened this issue Mar 9, 2022 · 1 comment
Open

Thermal printer not response #447

Eizaz opened this issue Mar 9, 2022 · 1 comment

Comments

@Eizaz
Copy link

Eizaz commented Mar 9, 2022

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

@sadalsuud
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants