rusel1989 / react-native-bluetooth-serial

Port of https://github.com/don/BluetoothSerial for react native
476 stars 291 forks source link

Get Connected Device Name and ID / Mac Address. #62

Open joshuapinter opened 7 years ago

joshuapinter commented 7 years ago

Hi there. Great library.

Curious if there's a way to get the currently connected device name and id from the library or do I have to store it myself after successfully connecting.

Right now connected() just returns true or false but I'm thinking it would be great if it returned the device object if it's connected or return false if it's not. This way you could still do a conditional like if (RNBS.connected()) { ... } but it would also allow you to display the currently connected Bluetooth device, etc.

Let me know what you think.

Thanks!