Python
  Home arrow Python arrow Bluetooth Programming in Python: Netwo...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

Bluetooth Programming in Python: Network Programming using RFCOMM
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2007-12-12

    Table of Contents:
  • Bluetooth Programming in Python: Network Programming using RFCOMM
  • Developing Applications for RFCOMM, Step by Step
  • Listening for requests
  • Developing the Client
  • RFCOMM in the Real World

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    Bluetooth Programming in Python: Network Programming using RFCOMM
    (Page 1 of 5 )

    In the last article I discussed various Bluetooth profiles. If one wants to create a client-server based application using Bluetooth, then one should program for the RFCOMM profile. RFCOMM offers a socket-based client-server paradigm for providing services.

    In this article, I will focus on creating networked based application using RFCOMM. The first section will be about the whys and wherefores of RFCOMM. In the second, third, and fourth sections, I will enumerate the steps necessary to create a client-server based application using RFCOMM. In the last section, a single-threaded server will be developed that uses RFCOMM to provide a file transfer service. That's the outline for this discussion.

    RFCOMM: The Whys and Wherefores

    The term or abbreviation RFCOMM comes from the term "radio frequency" or RF. RFCOMM involves emulation of serial port communication using radio frequency, hence the name RFCOMM. The serial port emulated by RFCOMM is RS-232 which has 9 circuits. RFCOMM uses the baseband of Bluetooth to provide reliable and in-sequence delivery of a data stream. The main attributes of RFCOMM are:

    1. It provides multiple concurrent connections. It does this by relying on L2CAP. L2CAP can handle multiplexing over a single connection.
    2. It supports flow control on separate and individual channels.
    3. It does not provide error control. The assumption that RFCOMM makes is L2CAP provides an error-free channel. 
    4. How devices should communicate using RFCOMM is decided by the Serial Port Profile (SPP), which is one of the Bluetooth profiles.

    RFCOMM divides devices into two major classes. They are Type I and Type II. The division is based on whether the port is physically present or emulated. I explain the details below.

    Type I devices have emulated serial ports. Emulated ports are entities used to map system-specific services and their API to the RFCOMM services. Therefore, whenever applications are built for RFCOMM, Type I devices are used. In other words, Type I devices enable programmers to use serial port even if there is no physical serial port.

    Type II devices have physical serial ports. They act as intermediate devices. In other words, they are proxies for relaying transmissions from RFCOMM to an external RS-232 interface that may be linked with other devices.

    As I have said before, RFCOMM provides a client-server based paradigm. In the case of PyBluez, the client-server is based on sockets. And the steps to create them are similar to the steps that one would follow in creating TCP/IP or UDP- based sockets. The next section explains those steps. Let's get started.

    More Python Articles
    More By A.P.Rajshekhar


       · In this article, I have discussed about using RFCOMM for network programming. Please...
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway