Hi Gustavo,
Thanks for your reply. I would try to explain the task in my hand and the process that I am following. Finally I would explain the error.
I am developing an iOS app, which will print images on a thermal printer via Bluetooth. I am doing following steps to print the image:
- Connection
- Discovering nearby device (in my case a Bluetooth printer, which is BLE enable)
- Connecting to discovered device.
- Finding services of connected device.
- Finding writable characterinstic from found services.
- Printing
- Converting image into grayscale (as thermal printer prints inly black-n-white).
- Packing pixels into black and white formats
- Adding printer specific command (which is 8 byte - 0x1d, 0x76, 0x30, 0x00, (bytesPerLine%256), (bytesPerLine/256), (height%256), (height/256)) to buffer array.
- Adding image bytes at the end of buffer array.
- Converting it to NSData and sending it to connecting device by calling "writeValue: forCharacteristic: type:" method.
Image is being printed successfully, but the problem is: printing is very slow (compared to printing from Android app) and printed images have horizontal lines in it.
Note that same packet prints correctly on a wifi printer (printed by connecting to socet and writing data to outputstream).
Let me know, if I was able to explain the problem or you need more clarifycation.
Thanks,
Dipak