infoxicator / react-native-star-prnt

React-Native bridge to communicate with Star Micronics Bluetooth/LAN Printers
MIT License
67 stars 65 forks source link

Port discovery is returning empty array #22

Closed msert29 closed 5 years ago

msert29 commented 5 years ago

I have a TSP100USB connected up to my iPad, however portDiscovery() returns an empty array. When I specify a connection using the parameters for TSP100U, I get back an empty array. Any idea what could be the issue?

Using EXPOKit and React Native 0.57.1

async connect() {
    try {
      var connect = await StarPRNT.connect(
        'USB:TSP100',
        'StarGraphic',
        false
      )
      console.log('Connected')
      console.log(connect) // Printer Connected!
    } catch (e) {
      console.log('error')
      console.error(e)
    }
  }

  async portDiscovery() {
    try {
      let printers = await StarPRNT.portDiscovery('All')
      console.log(printers)
    } catch (e) {
      console.error(e)
    }
  }
infoxicator commented 5 years ago

Hi @msert29 Unfortunately I didn't have a USB printer to test when I developed the plugin, so I am not sure what could be wrong. Have a look at the official Star SDK documentation for more information about the USB interface. Also download their official sample app to check if you are able to see and connect to the printer so we know it is an issue with this plugin and not the connection.