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

Can't write and disconnect. #100

Open
manelsanz opened this issue Feb 14, 2019 · 2 comments
Open

Can't write and disconnect. #100

manelsanz opened this issue Feb 14, 2019 · 2 comments

Comments

@manelsanz
Copy link

manelsanz commented Feb 14, 2019

Hi, I can connect perfectly to my bluetooth serial port, but when I call BluetoothSerial.write("Hi"), it shows the following error: RTCBluetoothSerial.writeToDevice got 4 arguments, expected 3.

The same with the "disconnect" method: RTCBluetoothSerial.disconnect got 3 arguments, expected 2.

I need some help, please...

@chamaloriz
Copy link

I found how to :p spent 2 Days

let encoder = new EscPosEncoder();

let result = encoder
  .initialize()
  .text("HelloWorld")
  .newline()
  .qrcode('HelloWorld')
  .encode();

const { Buffer } = require('buffer');

BluetoothSerial.write(Buffer.from(result.buffer))

@tienw
Copy link

tienw commented Nov 6, 2019

I had the same issue and your solution works! However, I recieved the following error after printed

Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference

Anyone have same issue? it looks like a Java issue

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

3 participants