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: The printer model of the discovered Bluetooth-connected printer is Unknown. #30

Closed yhirano closed 2 years ago

yhirano commented 2 years ago

The printer model of the discovered Bluetooth-connected printer is Unknown on Android. I can get the correct printer model on iOS.

Android iOS
android ios

Reference code

const starDeviceDiscoveryManager =
    await StarDeviceDiscoveryManagerFactory.create([
    InterfaceType.Lan,
    InterfaceType.Usb,
    ...(!isEmulator ? [InterfaceType.Bluetooth] : []),
    ...(!isEmulator && Platform.OS === 'ios'
        ? [InterfaceType.BluetoothLE]
        : []),
    ]);
starDeviceDiscoveryManager.onPrinterFound = (printer: StarPrinter) => {
    // printer.information.model is Uknown on Android.
};
await starDeviceDiscoveryManager.startDiscovery();

Reference my app

https://github.com/yhirano/ReactNativeUseStarPrinterSampleApp

bandit-ibayashi commented 2 years ago

@yhirano Due to the device specification, the information that can be retrieved during a search varies depending on the interface and OS. Therefore, the model name cannot be known at the stage of searching for paired devices on Android.

In iOS, because of the different specifications regarding Bluetooth, the mPOP and mC-Print series and also the TSP100IIIBI can get the model name at this stage.

We are sorry to not meet your expectations, but we appreciate your understanding.

yhirano commented 2 years ago

I've got it. Thank you for your answer.

bandit-ibayashi commented 2 years ago

@yhirano Thank you for your patience and understanding.