0

i used bluetooth low energy in my mobile app with react-native . and i want to just find other mobile devices, so i can't find any other mobile phone and theirs supported bluetooth low-energy , but i find my Smartwatch , well my question is bluetooth low energy can find other mobile phone or is just for Accessory?

and what are you advicing me to find other mobile phone .

my code

export const App = () => {
    const manager = new BleManager();

    manager.startDeviceScan(null, { scanMode: 2, }, (error, device) => {
        if (error) {
            console.log('error', error)
            return
        }

        if (device !== null) {
              console.log(device)
        }
    }
}

i had edit my android/app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>

i used

  "react": "16.13.1",
  "react-native": "0.63.3", 
 "react-native-ble-plx": "^2.0.1",
Mohamd Almhde
  • 11
  • 2
  • 3
  • 11

1 Answers1

3

Bluetooth Low Energy (BLE) works different than the "old" Bluetooth (Bluetooth Classic). As soon as you turn on Bluetooth your device is visible for Bluetooth Classic scans, but not for BLE scans.

To find a BLE device it's necessary that the device advertises its present. That's one of the differences between BLE and Bluetooth Classic and allows small accessories to save power. You need to run a GATT Server on your other phone and advertise a service. One very generic tool that would work is nRF Connect.

Please read more about how BLE works.

Michael Kotzjan
  • 2,093
  • 2
  • 14
  • 23
  • 1
    i wan't to thank's you before every thing because i have search for 3 day's and not find any solution and i very sad jus't i wan't some one help me Thx from my heart and i will begin research – Mohamd Almhde Oct 26 '20 at 07:50
  • 1
    Finally your notice is very important i used bluetooth classic and solved my problem THX THX THX THX – Mohamd Almhde Oct 26 '20 at 08:31