Closed rpilotte closed 1 year ago
Thanks for pointing this out. I'm able to reproduce the issue, but have no idea how to fix it :(
I just pushed a fix for this problem - please give it a try.
It's building now. Thanks. But, I have the same problem as with the Arduino library: only the top part of the picture is printing on the MX06 cat printer. Feed is working fine.
It may be the BLE write method. I tried speeding things up by writing without response, but packets can get lost. Try changing it to writing with response. It will be slower, but more reliable.
I did some investigation and turns our the issue is flow control, but asking to write with response doesn't work because the printer's characteristic does not support it:
(lldb) p (BOOL)self.myChar.properties & CBCharacteristicPropertyWrite
(unsigned long) $1 = 0
(lldb) p self.myChar.properties
(CBCharacteristicProperties) $4 = CBCharacteristicPropertyWriteWithoutResponse
So the quick solution here was to sleep for 0.1 second instead of writing waiting for a response. I just opened a pull request with the fix.
Hope it also fixes this issue on other printers!
Debug fails with
2022-11-17 22:08:09.379362+0100 Print2BLE[76575:1578471] ** Assertion failure in _NSTrackingAreaViewHelper trackingAreaHelper(NSView *)(), winTrackingAreas.m:168 2022-11-17 22:08:09.379625+0100 Print2BLE[76575:1578471] Failed to set (contentViewController) user defined inspected property on (NSWindow): _trackingAreaHelper not allocated yet!
I am discovering XCode and ObjectiveC and can only report.