first attempts with pybluez on Linux fail as well

Gelonida gelonida at gmail.com
Wed Nov 17 18:50:06 EST 2010


Hi,


Wanted to write a first simple example with pybluez and offer
a serial connection service with a given name.

What I tried (being inspired by
http://people.csail.mit.edu/albert/bluez-intro/x290.html
) is:

server_sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
port = bluetooth.PORT_ANY # original example used get_available_port()
                          # buy this seems obsolete
server_sock.bind(("",port))
server_sock.listen(1)
print "listening on port %d" % port

loc_host, loc_port = server_sock.getsockname()
print "HOST", loc_host, "PORT??", loc_port

uuid = "1e0ca4ea-299d-4335-93eb-27fcfe7fa848"
bluetooth.advertise_service( server_sock, "FooBar Service", uuid )


Unde Linux the file does not produce an error message, but When I use
another PC to look for services I do NOT see the service "FooBar Service"


What might I be doing wrong?
Are there any special requirements on the buetooth dongle / bluetooth
stack to make abov example work?


Thanks a lot for your help.





More information about the Python-list mailing list