Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Discover bluetooth devices around you (See related posts)

Pys60 has good bluetooth support from the beginning.
However, to discover another device, it require you to
interact with the app, choosing a device from the list.
PDIS has a library that help you list all devices silently.
# need to install these 2 modules from PDIS first
import aosocketnativenew
from aosocket.symbian.bt_device_discoverer import *

def callback(error, devices, cb_param=None):
    for address, name in devices:      
        print "Found: ", name, address
# You can get more data by importing socket and try 
# bt_discover(address) or bt_obex_discover(address)
# see details in official pys60 doc on socket module

lister = BtDeviceLister()
lister.discover_all(callback, None)

I summarize the code above from thejamo's example here.
His code is more complete with error checking.

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts