简体   繁体   English

如何通过Android蓝牙使用串行通信(端口)发送数据?

[英]How can I use serial communication (port) via Android Bluetooth to send data?

How can I use serial communication (port) via Bluetooth to send data? 如何通过蓝牙使用串行通信(端口)发送数据?

I need to send serial data through an Android device to a Bluetooth model (BlueSMiRF Silver) (that is connected to an Arduino board). 我需要通过Android设备将串行数据发送到蓝牙模型(BlueSMiRF Silver)(已连接到Arduino板)。

I was literally sitting for three day trying to understand how to do that... 我实际上坐了三天,试图了解如何做到这一点。

Would be nice to have more details about what you tried and where you are stuck. 将是不错的有关于你尝试过什么,你在哪里停留更多的细节。

On the Android side the first step is to pair with the BlueSMiRF module. 在Android方面,第一步是与BlueSMiRF模块配对。 You should be able to discover the BlueSMiRF and pair from the "Bluetooth Settings" on android. 您应该能够在Android的“蓝牙设置”中发现BlueSMiRF并进行配对。 You might have to put the BlueSMiRF module in discoverable mode (and you can set the a pin code for it). 您可能必须将BlueSMiRF模块置于可发现模式(并且可以为其设置密码)。

Once paired, to be able to send and receive data you need to connect using a Bluetooth socket. 配对后,为了能够发送和接收数据,您需要使用蓝牙插座进行连接。 To communicate with the BlueSMiRF module you need to use the Serial Port Profile (SPP) and create and RFCOMM socket. 要与BlueSMiRF模块通信,您需要使用串行端口配置文件(SPP)并创建一个RFCOMM套接字。 For an example you can have a look at this post . 例如,您可以看一下这篇文章

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

相关问题 我如何使用小程序通过ubuntu上的rxtxComm.jar将数据发送到串行端口 - How can i use applet send data to serial port via rxtxComm.jar On ubuntu 通过COM端口上的蓝牙进行串行通信 - Serial Communication via Bluetooth on COM port Android 语音识别并通过蓝牙将数据发送到 Arduino。 如何多次发送数据? - Android voice recognition and send data via bluetooth to Arduino. How can I send data several times? 如何通过蓝牙将串行数据发送到未指定的设备? - How to send serial data via Bluetooth to an unspecified device? 如何通过Android蓝牙串口RFCOMM将串行通信转储为文件 - How do I dump serial communication as file through Android bluetooth serial RFCOMM 在Android中通过蓝牙发送数据 - Send data via Bluetooth in Android 我正在尝试通过蓝牙发送数据,但是Serial.available()总是返回0 - I am trying to send data via bluetooth but Serial.available() always return 0 如何通过Android设备通过USB通信发送数据? - How to send data via USB communication from Android device? 在 Android 中通过蓝牙同时发送和接收数据 - Send and Receive data simultaneously via Bluetooth in Android Arduino - 处理双向通信无法通过串行接收数据 - Arduino - Processing bidirectional communication can't receive data via serial
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM