Question

I want to control an embedded system with a simple mechanism: app sends command, embedded system sends data back via a bluetooth module rn-41.

I'm referring to this Android Developer: Tutorial and was wondering whether I need to connect via app as a server or client or whether it doesn't matter.

Was it helpful?

Solution

Bluetooth has a Master-Slave Architecture. A master can be simultaneously connected to as much as 7 active slaves. If your android app need to control more than one embedded system then you need to configure your android device as a master. If your app need to control only one device you can configure your app either as master or as Slave.

In android terms you can initiate connection to your embedded device as a client using "BluetoothSocket" and get the socket using the function "createRfcommSocketToServiceRecord"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top