Closed arturdev closed 3 years ago
@arturdev what connection type does your printer have?
it is a bluetooth printer
@gare-bear The log from this demo app
PrinterSetting { portName: BT:TSP100 portSettings: macAddress: 00:11:62:18:35:61 modelName: TSP143IIIBI GY emulation: 3 cashDrawerOpenActiveHigh: true allReceiptsSettings: 7 selectedPaperSize: threeInch selectedModelIndex: tsp100 }
@arturdev there are two key/value pairs you should add to your plist to ensure you have the proper permission to discover Bluetooth printers.
This is mentioned in section 2 of our documentation
Check if these are missing from your plist
The second one is added, but the first one is missing. Let me add it and try again
@arturdev any luck?
The person who owns the printer is in a different timezone, I'm waiting for him. Will report back as soon as he tests it.
Thanks for your interest, appreciate that ❤️
After adding the missing entry to the info.plist, now it is able to find the printer. The printing returns success status code but nothing is printed in reality. Trying to figure out what is the issue. Thanks
It seems correct. I'm using the same function for printing as in the demo app. https://github.com/star-micronics/StarPRNT-SDK-iOS-Swift/blob/master/SDK/Swift%20SDK/Communications/Communication.swift#L28
And the completionHandler
is being called with SMStarIOResultCodeSuccess
but nothing is printed.
@arturdev You're probably trying to print text which the TSP143III doesn't support. This particular printer is Raster only, so you must send your data in graphical form using a UIImage. Then use the ISCBBuilder and the appendBitmap method to print the image. Here you can find the supported methods for each printer model.
Yes, I was trying to print a text. So I need to programmatically check what type the currently connected printer supports (text/image/etc..) and build the print-data accordingly, right?
Exactly! You can use the ModelCapability class to determine what emulation the printer supports. Just FYI the correct emulation is starGraphic.
@gare-bear Hi again. I'm having some issue when I'm printing second time in a row. First time it prints successfully. But second time it doesnt.
My flow is the following:
When user prints, I'm creating StarIoExtManager
instance with the selected printer port settings.
Then, sending commands (I'm using the same Communications class which is in this demo project).
The second time I'm getting errorOpenPort
.
Is there anything wrong I'm doing?
@gare-bear Can you help, please?
@arturdev please post this as a new issue and i'll be happy to help you. please post your code as well.
This returns an empty array, though the sample app works. What can be the issue?