Bluetooth

T

Tor Erik Sønvisen

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
 
P

Paul Boddie

Tor said:
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?

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_BLUETOOTH, 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:

http://www.nelson.monkey.org/~nelson/weblog/tech/phone/
http://pyserial.sourceforge.net/

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

http://triq.net/obex/

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
 
T

Tor Erik Sønvisen

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

Tor said:
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?

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_BLUETOOTH, 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:

http://www.nelson.monkey.org/~nelson/weblog/tech/phone/
http://pyserial.sourceforge.net/

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

http://triq.net/obex/

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
 
P

Paul Boddie

Tor said:
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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,323
Members
48,006
Latest member
TerranceCo

Latest Threads

Top