OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

Profile
Personal Photo
Options
Options
Personal Statement
zmarcoz doesn't have a personal statement currently.
Personal Info
zmarcoz
Age Unknown
Gender Not Set
Location Unknown
Birthday Unknown
Interests
No Information
Statistics
Joined: 11-February 08
Profile Views: 406*
Last Seen: 13th February 2008 - 01:27 PM
Local Time: Oct 23 2014, 12:40 AM
1 posts (0 per day)
Contact Information
AIM No Information
Yahoo No Information
ICQ No Information
MSN No Information
Contact Private
* Profile views updated each hour

zmarcoz

Members


Topics
Posts
Comments
Friends
My Content
11 Feb 2008
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
server_sock.bind(("",port))
server_sock.listen(1)

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

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

client_sock.close()
server_sock.close()
==========

import bluetooth

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

port = 1

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

sock.send("hello!!")

sock.close()

===========
Last Visitors
zmarcoz has no visitors to display.

Comments
Other users have left no comments for zmarcoz.

Friends
There are no friends to display.
RSS Lo-Fi Version Time is now: 23rd October 2014 - 12:40 AM