Namespaces
Variants
Actions

Archived:How to discover a Bluetooth device in PySymbian

Jump to: navigation, search
Archived.png
Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
Article Metadata

Article
Created: cyke64 (20 Mar 2007)
Last edited: hamishwillee (08 May 2013)

This article shows a number of 3rd party Python libraries that you can use to discover and list available Bluetooth devices.

Needs-update.png
This article needs to be updated: If you found this article useful, please fix the problems below then delete the {{ArticleNeedsUpdate}} template from the article to remove this warning.

Reasons: hamishwillee (07 Oct 2011)
PDIS download no longer available for bt_device_discoverer. The version linked in section below needs to be tested.

S60 2nd Edition

The bt_device_discoverer from PDIS silently lists all Bluetooth Devices (S60 2nd Edition only).

Note: The original PDIS download site is no longer available. The link below should access the same file, but is not tested. http://code.google.com/p/aircable/source/browse/esc-sj/robot/ao-socket/python-lib/aosocket/symbian/bt_device_discoverer.py?spec=svn663&r=663

# 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)

S60 2nd and 3rd Editions

There's additional solution for 2nd and 3rd Edition : LightBlue library.

from lightblue import *
 
device=finddevices()
This page was last modified on 8 May 2013, at 09:14.
172 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved