Python
  Home arrow Python arrow Page 2 - Bluetooth Programming using Python
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 
 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 using Python
By: A.P.Rajshekhar
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 8
    2007-09-10

    Table of Contents:
  • Bluetooth Programming using Python
  • Bluetooth and Python: the Whys and Wherefores
  • Bluetooth Programming, Step by Step
  • Bluetooth Programming 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Bluetooth Programming using Python - Bluetooth and Python: the Whys and Wherefores
    (Page 2 of 4 )

    According to its definition, Bluetooth is "a radio standard and communications protocol primarily designed for low power consumption, with a short range (power-class-dependent: 1 meter, 10 meters, 100 m) based on low-cost transceiver microchips in each device." In other words, Bluetooth is a standard and protocol that uses short-range frequencies to create a wireless connection between two compatible (Bluetooth enabled) devices. Since a radio communication system is used, there is no "line of sight" problem that is common with infrared-based devices. As long as the devices are in range, they can communicate with each other even if one device is in one room and the other device is in a separate room. Bluetooth-enabled devices are categorized into three classes, which are:

    1. Class 1
    2. Class 2
    3. Class 3

    The classification is based on the range in which the devices can communicate. The ordering is from the longest range to the shortest one.

    Class 1 devices have the longest range. The range is up to 100 meters, approximately. Devices of this class consume the highest amount of power of all three classes. They consume 100 mW of power.

    Class 2 devices can be considered medium range. The range in which they can communicate is up to 10 meters. With respect to power consumption, they require 2.5 mW.

    Class 3 devices cannot communicate beyond one meter. The power requirement also is the least for devices of this class. They require only 1 mW.

    If you observe closely the power requirement decreases with the decrease in communication range. That was a bird's eye view of Bluetooth. Next we will look at how a device provides services to other devices using Bluetooth. Each device provides certain services based on a specification known as the Wireless Interface Specification. A set of such services forms a profile. Sometimes the profile contains only one service, such as streaming of sound from an audio file, or it can contain a set of different services such as capturing a live video and streaming it. There are 27 standard profiles that are currently used by different devices. Some of the common profiles are:

    1. Basic Imaging Profile - for sending, receiving and resizing images.
    2. Basic Printing Profile - for using certain vCards, text, e-mail etc. to send to the printer from the device.
    3. File Transfer Profile - for accessing the file system of another device.
    4. Headset Profile - provides support for Bluetooth headsets to work with Bluetooth-enabled mobile phones for wireless audio; one of the most common profiles.
    5. Serial Port Profile - emulates serial cable connectivity and communication. It uses RFCOMM protocol.

    Writing a program for a Bluetooth device, in reality, means programming for the profiles or accessing the functionalities of the profile. For programming, the BlueZ library is commonly used. It provides access to the Bluetooth stack in an object-oriented and modular manner. The Python wrapper for the BlueZ is PyBlueZ.

    The wrapper targets the Microsoft Bluetooth stack on Windows and BlueZ stack on GNU/Linux. Using PyBlueZ, one can easily create a connection between traditional systems such as laptops, desktops and mobile devices and program the basic profiles such as File Transfer, network communication, and so forth. Now that the library that supports programming for Bluetooth has been introduced, we can look at the steps required to program Bluetooth devices using Python.

    More Python Articles
    More By A.P.Rajshekhar


       · In this discussion I have tried to introduce the basics of Bluetooth programming...
     

       

    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 2 hosted by Hostway