OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio


Welcome Guest ( Log In | Register )

> New User Question
post Feb 11 2008, 08:26 AM
Post #1

Group: Members
Posts: 1
Joined: 11-February 08
Member No.: 21,361

Dear all,

I am learning how to python and pybluez. I follow the step form a book and copy and paste the program to the python. However, I have no clue why there is error coming up.
There are a few questions that I want to ask. 1. Does Python just give us a simulation of bluetooth device only? (I will not able to use Python with pybluez to control my computer bluetooth system to talk to other bluetooth device). 2. If yes, why it is useful?

Traceback (most recent call last):
File "C:\Python25\rfcomm-client", line 8, in <module>
sock.connect((bd_addr, port))
File "C:\Python25\Lib\site-packages\bluetooth\widcomm.py", line 432, in rfcomm_connect
self.rfcomm_read_msg ()
File "C:\Python25\Lib\site-packages\bluetooth\widcomm.py", line 325, in rfcomm_read_msg
raise BluetoothError ("Connection failed")
BluetoothError: Connection failed

import bluetooth

server_sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )

port = 1

client_sock,address = server_sock.accept()
print "Accepted connection from ",address

data = client_sock.recv(1024)
print "received [%s]" % data


import bluetooth

bd_addr = "01:23:45:67:89:AB"

port = 1

sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
sock.connect((bd_addr, port))



Go to the top of the page
+Quote Post

Posts in this topic
zmarcoz   New User Question   Feb 11 2008, 08:26 AM

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 19th June 2018 - 10:30 AM