views:

730

answers:

2

From the website http://www.mobilepythonbook.org/ I found the following example of bluetooth sockets: BT chat example

Here in function chat_server() the bind method accepts a tuple with two elements. The first one has been used as a null string. What does it signify?

Which node will act as master in the Bluetooth, the one that starts chat_client or the one that starts chat_server? I feel it should be the node running chat_client. Andhence Bluetooth slave will be the other nodes.

+1  A: 

For IPv4 addresses, two special forms are accepted instead of a host address: the empty string represents INADDR_ANY, and the string '' represents INADDR_BROADCAST -- http://docs.python.org/library/socket.html

There you'll find more than enough information. Basically what INADDR_ANY means that it will bind to any address that the host has.

The server is would be the Bluetooth master and the clients the slave, this is because the master has to exist before the the client can be spawned. As a discoverable device the server is the one that determines how the channel gets configured.

I hope this clarifies things up.

mpeterson
A: 

I found the answer the device that starts listening for incoming connections is slave and the one that discovers and requests for connection is the master.

Sorry michelpeterson your answer is totally wrong.

Xolve