Bluetooth

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tor Erik Sønvisen

    #1

    Bluetooth

    Hi

    I'm making a server-side solution in Python and need to be able to
    communicate through bluetooth. Is there any bluetooth-packages out there for
    python?

    regards tores


  • Paul Boddie

    #2
    Re: Bluetooth

    Tor Erik Sønvisen wrote:[color=blue]
    > I'm making a server-side solution in Python and need to be able to
    > communicate through bluetooth. Is there any bluetooth-packages out there for
    > python?[/color]

    At the lowest level, you should be able to create sockets for Bluetooth
    communications (see the socket module's documentation and the source
    code in Modules/socketmodule.c) ; for example:

    from socket import *
    s = socket(AF_BLUET OOTH, SOCK_STREAM, BTPROTO_RFCOMM)

    On Linux, upon binding a device file to the Bluetooth device, you can
    use things like pySerial to manage the communications; this works with
    software like t616hack:




    Various other tools exist which understand Bluetooth communications,
    notably the OpenOBEX tools:



    I prefer to work with tools at the higher levels (obexftp to access
    files, pySerial/t616hack to access messages), but provided your Python
    distribution is set up correctly, you should be able to work at the
    lowest levels too.

    Paul

    Comment

    • Tor Erik Sønvisen

      #3
      Re: Bluetooth

      Okei....

      I've been doing some research since my first post and now I'm really
      confused. I'm programming in xp, and found some c++ code out of this world
      that supposidly should list all available services to a given bluetooth
      device. This code however where only working with certain bluetooth-devices
      supported by the Microsoft Bluetooth Stack. If someone out there has any
      advice/ experience on bluetooth-programming on laptops (preferably in
      windows) I would appreciate it. Maybe there is some easy-to-grasp tutorials
      out there using the windows API for bluetooth-programing???

      regards tores

      "Paul Boddie" <paul@boddie.or g.uk> wrote in message
      news:1127512737 .067466.299070@ g49g2000cwa.goo glegroups.com.. .
      Tor Erik Sønvisen wrote:[color=blue]
      > I'm making a server-side solution in Python and need to be able to
      > communicate through bluetooth. Is there any bluetooth-packages out there
      > for
      > python?[/color]

      At the lowest level, you should be able to create sockets for Bluetooth
      communications (see the socket module's documentation and the source
      code in Modules/socketmodule.c) ; for example:

      from socket import *
      s = socket(AF_BLUET OOTH, SOCK_STREAM, BTPROTO_RFCOMM)

      On Linux, upon binding a device file to the Bluetooth device, you can
      use things like pySerial to manage the communications; this works with
      software like t616hack:




      Various other tools exist which understand Bluetooth communications,
      notably the OpenOBEX tools:



      I prefer to work with tools at the higher levels (obexftp to access
      files, pySerial/t616hack to access messages), but provided your Python
      distribution is set up correctly, you should be able to work at the
      lowest levels too.

      Paul


      Comment

      • Paul Boddie

        #4
        Re: Bluetooth

        Tor Erik Sønvisen wrote:[color=blue]
        >
        > I've been doing some research since my first post and now I'm really
        > confused. I'm programming in xp, and found some c++ code out of this world
        > that supposidly should list all available services to a given bluetooth
        > device. This code however where only working with certain bluetooth-devices
        > supported by the Microsoft Bluetooth Stack.[/color]

        I was going to mention pybluez (http://www.python.org/pypi/pybluez) but
        it only supports GNU/Linux. However, it is related to the software
        (bluez) which manages connected devices and their services. There might
        be something similar available for Windows, even if it means going
        through a COM-based API.

        Paul

        Comment

        Working...