HC-06 Bluetooth module, what bluetooth mode I have to use

androidbluetooth

I am trying to connect an HC-06 Bluetooth module to my Android device to send data from my smartphone to my microcontroller conected to the HC-06.

I am writing the Android application and I have a question, according to: Bluetooth | Android Developers: Managing a Connection. I have to Bluetooth modes client and server, which one should I use?

I have seen an example in NeoTeo: Módulo Bluetooth HC-06 (Android), but it uses AppInventor so I can't see the source code.

Best Answer

"Server" devices are usually characterized by having data that is needed by some other device. A temperature sensor for example has information that others may wish to know. "Server" devices may also be capable of taking actions upon request or storing information for later use.

"Client" devices are the other half of the puzzle. A "client" may be a device that needs information from a server. It may also be the device that commands the heating and cooling system into the requested mode, or provides the set points to allow the system to operate automatically.

Source: Introduction to Bluetooth Application Development

Bluetooth networks (commonly referred to as piconets) use a master/slave model to control when and where devices can send data. In this model, a single master device can be connected to up to seven different slave devices. Any slave device in the piconet can only be connected to a single master.

The master coordinates communication throughout the piconet. It can send data to any of its slaves and request data from them as well. Slaves are only allowed to transmit to and receive from their master. They can’t talk to other slaves in the piconet.

Bluetooth Basics