File: inquiry.py

package info (click to toggle)
pybluez 0.9.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 360 kB
  • ctags: 475
  • sloc: ansic: 3,608; python: 1,513; makefile: 49; sh: 12
file content (17 lines) | stat: -rw-r--r-- 466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# file: inquiry.py
# auth: Albert Huang <albert@csail.mit.edu>
# desc: performs a simple device inquiry followed by a remote name request of
#       each discovered device
# $Id: inquiry.py,v 1.7 2006/05/05 19:07:48 albert Exp $
#

import bluetooth

print "performing inquiry..."

nearby_devices = bluetooth.discover_devices(lookup_names = True)

print "found %d devices" % len(nearby_devices)

for name, addr in nearby_devices:
    print "  %s - %s" % (addr, name)