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

[Android] `StarPrinterInformation` object returns `emulation: unknown` to all BT printers #32

Closed yongmin86k closed 2 years ago

yongmin86k commented 2 years ago

Hi,

There is an issue of StarPrinterInformation object returns emulation: unknown to all BT printers on Android

Using StarDeviceDiscoveryManager.startDiscovery() and StarDeviceDiscoveryManager.onPrinterFound: (printer: StarPrinter) => void, StarPrinter.information is not working as expected

To enable, print() method, emulation property should be stored and returned, but it doesn't show up for all Star Bluetooth printers.

I've checked LAN/WiFi printers, they work fine.

Is there a workaround to get the emulation value?

image

gare-bear commented 2 years ago

@yongmin86k looks like this is the same as #30.

@bandit-ibayashi if we can't get a usable PrinterInformation object for BT printers, how do you propose we can work around this?

yongmin86k commented 2 years ago

@gare-bear

Hello 😁, (didn't expect to see you here again)

yup, I didn't know that there was a closed ticket already 🙏

My previous option was using the other StarPrinter package, react-native-star-prnt

It returns the name of a model image

gare-bear commented 2 years ago

@yongmin86k We're going to add better model detection in a future update. For Bluetooth printers that include the model in the Bluetooth Device Name (e.g. mC-Print3-J0164), we'll properly detect it as mC-Print3. In order for this solution to work, its important that you don't change the printers Bluetooth Device Name.

This will give us coverage to detect the model for most Bluetooth printers, but not all due to hardware limitations. Once we can detect the model name properly, then the printers emulation will be reported as well.

bandit-ibayashi commented 2 years ago

In version 1.2.0, We updated the specification that the printer model can be estimated and acquired for some printers with Bluetooth device name set to the initial value (TSP100IIIBI, mPOP, mC-Print2/3 and SM-L200/L300) when using StarDeviceDiscoveryManager class.

As @gare-bear said, there are some restrictions to using this feature.