本文介绍了使用React Native在设备之间使用BLE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发一个使用React Native在两个智能手机之间使用低功耗蓝牙的应用程序.

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

我正在查看反应- native-ble-manager ,但我不了解如何创建服务器"(或本例中的外围设备)部分.

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.

如何收听BLE的传入连接?

How can I listen incoming connections with BLE?

预先感谢您的回答

推荐答案

对于任何BLE连接,都有两个部分,即中央部分和外围部分.

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

react-native-ble-manager 是一个中央图书馆.您不能使用此创建外围设备.此外,每个智能手机均未启用外围设备模式.因此,在这种情况下,您将无法正确使用应用程序.

react-native-ble-manageris 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.

这篇关于使用React Native在设备之间使用BLE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 06:40