Closed hoanhtdd closed 1 year ago
How do you mean "reconnect"?
If you want to print to a Star printer and have the identifier and connection method, you can do the following:
let identifier = "" // fill in identifier
let interfaceType: StarIO10.InterfaceType = .lan | .usb | .bluetooth | .bluetoothLE
let starConnectionSettings = StarConnectionSettings(interfaceType: interfaceType, identifier: identifier)
let starPrinter = StarPrinter(starConnectionSettings)
and print with
try await starPrinter.print(command: command)
I use this to create a Printer object and save that in UserDefaults and it works perfectly.
@hoanhtdd The printer must be connected prior to use, by whichever means of communication you plan to use.
USB: connect the cable BT: Pair the printer to the device (Settings --> Bluetooth) LAN: connect the pritner to the network, get an IP, tablet must be on the same network to discover
The only exception is BLE, the app will discover it and there is no formal "pairing process"
is there a way to reconnect the printer using identifier, mac,...? i see sdk is scanning only connected devices , So how are the devices that are not connected to be scanned?