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

About this user

Korakot Chaovavanich http://korakot.stumbleupon.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

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.
PDIS has a library that help you list all devices silently.
   1  
   2  # need to install these 2 modules from PDIS first
   3  import aosocketnativenew
   4  from aosocket.symbian.bt_device_discoverer import *
   5  
   6  def callback(error, devices, cb_param=None):
   7      for address, name in devices:      
   8          print "Found: ", name, address
   9  # You can get more data by importing socket and try 
  10  # bt_discover(address) or bt_obex_discover(address)
  11  # see details in official pys60 doc on socket module
  12  
  13  lister = BtDeviceLister()
  14  lister.discover_all(callback, None)

I summarize the code above from thejamo's example here.
His code is more complete with error checking.
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS