0

I tried to connect bluetooth device directly by passing peripheral id to connect method.But after few seconds it automatically disconnect and catch block execute and show Connection error.

connect(){
    BleManager.connect('58:85:e9:5f:5f:82')
  .then(() => {
    // Success code
    console.log('Connected');
  })
  .catch((error) => {
    // Failure code
    console.log(error);
  });
}

I referred this link: https://github.com/innoveit/react-native-ble-manager

1 Answers1

-3

BleManager does'nt contain function connect() it contains connectToDevice(); check it out https://polidea.github.io/react-native-ble-plx/#blemanager