简体   繁体   中英

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).

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. You should be able to discover the BlueSMiRF and pair from the "Bluetooth Settings" on android. You might have to put the BlueSMiRF module in discoverable mode (and you can set the a pin code for it).

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. For an example you can have a look at this post .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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