My favorites
▼
|
Sign in
pybluez
PyBluez is an effort to create python wrappers around system Bluetooth resources to allow Python developers to easily and quickly create Bluetooth applications.
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
examples
/
simple
/
rfcomm-client.py
r55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# file: rfcomm-client.py
# auth: Albert Huang <albert@csail.mit.edu>
# desc: simple demonstration of a client application that uses RFCOMM sockets
# intended for use with rfcomm-server
#
# $Id: rfcomm-client.py 424 2006-08-24 03:35:54Z albert $
from bluetooth import *
import sys
addr = None
if len(sys.argv) < 2:
print "no device specified. Searching all nearby bluetooth devices for"
print "the SampleServer service"
else:
addr = sys.argv[1]
print "Searching for SampleServer on %s" % addr
# search for the SampleServer service
uuid = "94f39d29-7d6d-437d-973b-fba39e49d4ee"
service_matches = find_service( uuid = uuid, address = addr )
if len(service_matches) == 0:
print "couldn't find the SampleServer service =("
sys.exit(0)
first_match = service_matches[0]
port = first_match["port"]
name = first_match["name"]
host = first_match["host"]
print "connecting to \"%s\" on %s" % (name, host)
# Create the client socket
sock=BluetoothSocket( RFCOMM )
sock.connect((host, port))
print "connected. type stuff"
while True:
data = raw_input()
if len(data) == 0: break
sock.send(data)
sock.close()
Show details
Hide details
Change log
r1
by ashuang on Nov 12, 2007
Diff
import pybluez version 0.14 from MIT servers
Go to:
/branches
/trunk
/trunk/CHANGELOG
/trunk/COPYING
/trunk/README
/trunk/bluetooth
/trunk/bluetooth/__init__.py
/trunk/bluetooth/bluez.py
/trunk/bluetooth/btcommon.py
/trunk/bluetooth/msbt.py
/trunk/bluetooth/osx.py
/trunk/bluetooth/widcomm.py
/trunk/bluez
/trunk/bluez/btmodule.c
/trunk/bluez/btmodule.h
/trunk/bluez/btsdp.c
/trunk/bluez/btsdp.h
/trunk/doc
/trunk/doc/gendoc
/trunk/examples
/trunk/examples/advanced
...es/advanced/inquiry-with-rssi.py
/trunk/examples/advanced/l2-mtu.py
...advanced/l2-unreliable-client.py
...advanced/l2-unreliable-server.py
...es/advanced/read-local-bdaddr.py
...s/advanced/write-inquiry-scan.py
/trunk/examples/bluezchat
...amples/bluezchat/bluezchat.glade
...mples/bluezchat/bluezchat.gladep
.../examples/bluezchat/bluezchat.py
/trunk/examples/simple
...s/simple/asynchronous-inquiry.py
/trunk/examples/simple/inquiry.py
...k/examples/simple/l2capclient.py
...k/examples/simple/l2capserver.py
...examples/simple/rfcomm-client.py
...examples/simple/rfcomm-server.py
...nk/examples/simple/sdp-browse.py
/trunk/msbt
/trunk/msbt/_msbt.c
/trunk/osx
/trunk/osx/_osxbt.c
/trunk/setup.py
/trunk/widcomm
/trunk/widcomm/_widcomm.cpp
/trunk/widcomm/inquirer.cpp
/trunk/widcomm/inquirer.hpp
/trunk/widcomm/l2capconn.cpp
/trunk/widcomm/l2capconn.hpp
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 1148 bytes, 45 lines
View raw file
Powered by
Google Project Hosting