react-native-esc-pos icon indicating copy to clipboard operation
react-native-esc-pos copied to clipboard

Get/use bluetooth device from OS

Open KannarFr opened this issue 4 years ago • 5 comments

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 avatar Nov 13 '19 23:11 KannarFr

@leesiongchan ^

KannarFr avatar Nov 13 '19 23:11 KannarFr

Using another lib?

KannarFr avatar Nov 14 '19 00:11 KannarFr

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

KannarFr avatar Nov 14 '19 00:11 KannarFr

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?

KannarFr avatar Nov 14 '19 00:11 KannarFr

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 💯

leesiongchan avatar Nov 15 '19 01:11 leesiongchan