University of Notre Dame NetScale Laboratory
The following attached code files are Python scripts written to use the python bluetooth module PyBluez from MIT: http://code.google.com/p/pybluez/

Keywords: threaded, python, bluetooth, pybluez, linux, client, server

The master starts the server application which begins listening for connections. The clients are started up searching for the appropriate service that the master advertises. Once the service is found, a connection is attempted, if successful the client can begin sending messages to the server. All received messages at the server are taken and broadcast out to all connected clients. Messages are not sent back to the requesting client. Each client is capable of sending and receiving messages to the server.

Notes:

  • The example code presented here was an exercise in using Python, Bluetooth, and synchronized threading by modifying the pre-existing RFCOMM server/client scripts from: http://org.csail.mit.edu/pybluez/
  • The original RFCOMM server was a single threaded server capable of a single client connection, the modified code now accepts multiple client connections via threading, additionally the server broadcasts messages to other clients connected to the server.
  • The original RFCOMM client was single threaded and transmitted messages to the RFCOMM server, now it can send and receive messages from the server.

Updates: * The newest client/server python scripts attached have been made thread safe, and will now transmit time stamps back and forth with each other automatically, not requiring user intervention.

-- AndrewBlaich - 22 May 2008

  Attachment Action Size Date Who Comment
txt rfcomm-client-mt.py.txt props, move 2.5 K 22 May 2008 - 20:44 AndrewBlaich Modified RFCOMM client, threaded client/server script
txt rfcomm-server-mt.py.txt props, move 1.9 K 22 May 2008 - 20:45 AndrewBlaich Modified RFCOMM server, threaded client/server script
r1 - 22 May 2008 - 20:52:42 - AndrewBlaich
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Syndicate this site RSSATOM