Android Bluetooth Socket does not give expected confirmation

I send an array of bytes to the bluetooth socket, and I get a response from the bluetooth printer, but I do not get the correct confirmation of sending image data.

I write an array of bytes to outputstream as follows:

 byte[] queryData = new byte[]{ 0x1B, 0x2A, 0x43, 0x41, 0x00, 0x00, 0x00, 0x00, 0x01, 0x27, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00 }; outputStream.write(queryData); outputStream.flush(); 

Is there any other way to write binary data to outputstream ?

I got stuck and opened any offer.

+5
source share

Source: https://habr.com/ru/post/1233845/


All Articles