star-micronics / react-native-star-io10

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

StarIO10ArgumentError - _errorCode:0 #14

Closed mengheangrat closed 3 years ago

mengheangrat commented 3 years ago

import { InterfaceType, StarDeviceDiscoveryManager, StarDeviceDiscoveryManagerFactory, } from 'react-native-star-io10'

// const manager = StarDeviceDiscoveryManager export const discover = async () => { try { // Specify your printer interface types. manager = await StarDeviceDiscoveryManagerFactory.create([ InterfaceType.Bluetooth, InterfaceType.BluetoothLE, ])

// Set discovery time. (option)
manager.discoveryTime = 10000

// Callback for printer found.
manager.onPrinterFound = (printer) => {
  console.tron.log('======> onPrinterFound', printer)
}

// Callback for discovery finished. (option)
manager.onDiscoveryFinished = () => {
  console.tron.log(`Discovery finished.`)
}

// Start discovery.
await manager.startDiscovery()

// Stop discovery.
// await manager.stopDiscovery()

} catch (error) { // Error. console.tron.log('discover on error ', error) } }

smsagithub commented 3 years ago

Could you please let me know more deatils as below...

mengheangrat commented 3 years ago

It's an error on discovery method.

smsagithub commented 3 years ago

Noted with Thank so much for your integrate with Star Printer . If you have any question please contact us any time.

vatsal-gadhiya-searce commented 2 years ago

@mengheangrat How did you resolve? I am getting the same error when using example app.

vatsal-gadhiya-searce commented 2 years ago

@smsagithub Can you please help me how we can resolved this? We are getting same error with the example app.