star-micronics / react-native-star-io10

react-native-star-io10 is a library for supporting application development for Star Micronics devices.
Other
83 stars 54 forks source link

[iOS] StarIO10/PrinterPortFactory.swift:37: Fatal error #36

Open yongmin86k opened 2 years ago

yongmin86k commented 2 years ago

While testing with a SM-L300 printer on iOS, the following error was found after a printing request

StarPrinter class

image

StarDeviceDiscoveryManager.onPrinterFound() only retrieves the identifier and interface type of the printer. I am not sure why the value of emulation and model is Unknown. That might be relevant to the error?

Device information

Replication Steps

Info.plist

...
  <key>NSBluetoothAlwaysUsageDescription</key>
    <string>For connecting to print and barcode scanning</string>
  <key>NSBluetoothPeripheralUsageDescription</key>
    <string>For connecting to printers and barcode scanners</string>
  <key>NSLocalNetworkUsageDescription</key>
    <string>For connecting to print local network</string>
  <key>UISupportedExternalAccessoryProtocols</key>
    <array>
        <string>jp.star-m.starpro</string>
    </array>
...

Logs

2021-12-10 00:54:07.349979-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: capabilities 0x8020
2021-12-10 00:54:07.350084-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: __eaClientRegisterediapd 0 -> 1
2021-12-10 00:54:07.350118-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: __eaClientRegisterediap2d 0 -> 1
2021-12-10 00:54:07.350330-0800 TestStarReceipt[599:107012] IAPDHasLaunched: kIAPAvailableNotification iapdAvailableState 100 -> 0
2021-12-10 00:54:07.350392-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: __eaiapdHasClientID 0, IAPDHasLaunched 0
2021-12-10 00:54:07.350752-0800 TestStarReceipt[599:107012] IAP2DHasLaunched: kIAP2AvailableNotification iap2dAvailableState 100 -> 0
2021-12-10 00:54:07.350820-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: __eaiap2dHasClientID 0, IAP2DHasLaunched 0
2021-12-10 00:54:07.351011-0800 TestStarReceipt[599:107012] IAPAppRegisterClient: registerWasSuccessful 0
2021-12-10 00:54:07.351469-0800 TestStarReceipt[599:107012] -[EAAccessoryManager _initFromSingletonCreationMethod] isRunningOnMac
2021-12-10 00:54:07.353445-0800 TestStarReceipt[599:107012] IAPAppConnectedAccessories: __eaClientHasCheckedForConnectedAccessories 0 -> 1
2021-12-10 00:54:07.353701-0800 TestStarReceipt[599:107012] IAPAppConnectedAccessories: IAPDHasLaunched 0, IAP2DHasLaunched 0
StarIO10/PrinterPortFactory.swift:37: Fatal error
2021-12-10 00:54:22.301739-0800 TestStarReceipt[599:107092] StarIO10/PrinterPortFactory.swift:37: Fatal error
(lldb) 
gare-bear commented 2 years ago

@yongmin86k Can you post a self-test here? In the StarPrinterInformation object, i'm seeing the modelName reported as SN-L300 but it should be SM-L300. Note the N vs M.

If that info is coming is coming from the Bluetooth Device Name, it could explain why it can't populate the emulation and model; because it doesn't know what an SN-L300 is.