DZone 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
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. <a href=http://pdis.hiit.fi/pdis/download/pdis/>PDIS</a> 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 <a href=http://discussion.forum.nokia.com/forum/showthread.php?p=176190#post175725>here</a>. His code is more complete with error checking.