leesiongchan / react-native-esc-pos

A React Native ESC/POS module to help you connect to your ESC/POS printer easily.
MIT License
80 stars 84 forks source link

Get/use bluetooth device from OS #23

Open KannarFr opened 4 years ago

KannarFr commented 4 years ago

Hi,

There is a way to get the deviceInfo from already connected bluetooth device when launching EscPos and then EscPos.connect easily without listeners on device connection?

Alex.

KannarFr commented 4 years ago

@leesiongchan ^

KannarFr commented 4 years ago

Using another lib?

KannarFr commented 4 years ago

Or simply using the bluetoothDeviceFound listener, but it doesn't work, only the bluetoothStateChanged works on connection from Android bluetooth settings.

KannarFr commented 4 years ago

Another question: (I'm trying to debug) how to print react-native-esc-pos logs to JS server which is running an application using this library? Probably just a loglevel or a mode to set?

leesiongchan commented 4 years ago

There is a way to get the deviceInfo from already connected bluetooth device when launching EscPos and then EscPos.connect easily without listeners on device connection?

Probably we could expose a new API connectedDevices. I will need to refer to one of the famous lib (https://polidea.github.io/react-native-ble-plx/#blemanagerdevices).

Another question: (I'm trying to debug) how to print react-native-esc-pos logs to JS server which is running an application using this library? Probably just a loglevel or a mode to set?

Agree with your suggestion, a debug: boolean option could probably be beneficial to the developer.

I am in the midst of rewriting the codebase, but I have very little time on this project as of now, if that is something bothering you probably will need your help on contributing to the project 💯