简体   繁体   English

MIT App Inventor蓝牙与未配对的设备连接

[英]MIT App Inventor Bluetooth connect with unpaired device

I am using MIT App Inventor 2 to do some bluetooth connection. 我正在使用MIT App Inventor 2做一些蓝牙连接。 I am trying to connect to my Arduino Bluetooth hc05. 我正在尝试连接到我的Arduino蓝牙hc05。 I noticed that if I didn't pair my device, the app I wrote can't connect to the device. 我注意到,如果不对设备进行配对,那么我编写的应用程序将无法连接到该设备。

Below is the code that I used to connect to my Bluetooth device. 以下是我用来连接蓝牙设备的代码。

蓝牙连接代码

Is there any way to use the code to connect with the Bluetooth device without having to pair it first? 有什么方法可以使用代码与蓝牙设备连接而不必先将其配对? Or is there any way to use the code to input the pairing password using MIT App Inventor 2? 还是有什么方法可以使用代码通过MIT App Inventor 2输入配对密码?

The devices must be paired before being able to connect. 必须先配对设备,然后才能进行连接。

There is no Pairing method available in the App Inventor Bluetooth components. App Inventor蓝牙组件中没有可用的配对方法。 But you could write your own extension, which does the pairing. 但是您可以编写自己的扩展名,以进行配对。

More information about how to create an extension see here . 有关如何创建扩展的更多信息,请参见此处 However that will be more advanced and will require some Java skills... 但是,这将更加高级,并且需要一些Java技能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM