Using BLE between devices with React Native

2019-08-26 19:31发布

问题:

I am trying to make an app that uses Bluetooth Low Energy between two smartphones in proximity using React Native.

I am looking at react-native-ble-manager but i don't understand how to create the "server" (or in this case peripheral) part.

I understood the methods to discover and connect to a peripheral but I don't understand how to make a smartphone (with enabled bluetooth) listening incoming connections.

How can I listen incoming connections with BLE?

Thank you in advance for your answers

回答1:

For any BLE connection there has two part, i.e central and peripheral.

react-native-ble-manager is a central library. You can not create peripheral using this. Also, every smartphone does not have peripheral mode enabled. So in the situation, you can not use your application properly.