Archived:Find bluetooth devices silently

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Code ExampleTested with
Devices(s): N95 8GB
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Keywords: Bluetooth, discover
Created: diegodobelo (27 Jan 2009)
Last edited: hamishwillee (19 Jun 2012)


Here is a package containing a source code and a sis file of an implementation of silent bluetooth devices search. It is a simple module which provides a single method, called discover.


This method can be called asynchronously (by passing a callable object as parameter) or synchronously (without parameter). It returns a list containing all found bluetooth devices MAC addresses.

Code Snippets

Here is an example of how to use the bluetooth search method synchronously.

import silent_bt
print silent_bt.discover()

Here is an example of how to use the bluetooth search method asynchronously.

def cb_func(devices):
print devices

With this method we can choose a device to be searched like in the example below:

import silent_bt
def watch_device(device):
found_devices = []
if type(device) == str:
if device in silent_bt.discover():
return found_devices
elif type(device) == list:
for dev in device:
if dev in silent_bt.discover():
return found_devices
return None
def find(device):
device_found = watch_device(device)
if device_found is not None:
print "device found: %s"% device_found[0]


device found: 00:1f:5b:df:21:6c

or verify if a device has entered or has exited the range area of the searching device:

import silent_bt
old_list = []
new_list = []
def observer():
global old_list
global new_list
new_list = silent_bt.discover()
for dev in old_list:
if dev not in new_list:
print "%s has exited" % dev
for dev in new_list:
if dev not in old_list:
print "%s has entered" % dev
old_list = new_list


00:1f:5b:df:21:6c has entered 
2c:1d:aa:cb:22:2c has entered
00:1f:5b:df:21:6c has exited
This page was last modified on 19 June 2012, at 05:09.
44 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.