0

我尝试通过将外围设备 ID 传递给连接方法来直接连接蓝牙设备。几秒钟后它会自动断开连接并捕获块执行并显示连接错误

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

我提到了这个链接: https ://github.com/innoveit/react-native-ble-manager

4

1 回答 1

-2

BleManager 不包含函数 connect() 它包含 connectToDevice();看看 https://polidea.github.io/react-native-ble-plx/#blemanager

于 2020-10-31T12:34:52.430 回答