| Reply | « Previous Thread | Next Thread » |
|
This might seem quite obvious; but if it exists, the documentation doesn't clearly state it. Here goes:
How can I get in PyS60 the Bluetooth name and address of the mobile phone? |
|
Take a look at the Miso module. Documentation here
local_bt_address() Returns the local Bluetooth address. Only works with Bluetooth enabled. local_bt_name() Returns the local Bluetooth name. Only works with Bluetooth enabled. Code:
import miso print miso.local_bt_address() print miso.local_bt_name()
Last edited by jtullis : 2008-05-06 at 14:07.
|
|
Quote:
Here's one not-so-elegant solution to check if bt is connected: Code:
def bt_connected():
try:
miso.local_bt_name()
except:
return False
return True
Note: I wonder why such basic functions are not in the PyS60 native libraries.
Last edited by bmichel : 2008-05-06 at 14:49.
|
|
Yes, I was just about to suggest you use try/except. The Mobile Python book recommends it: "Especially when handling files, Bluetooth and network connections...exceptions are common" (p113)
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| How To Make The S60 Emulator See My USB Bluetooth Dongle ? | Mo7ammed_01 | Bluetooth Technology | 9 | 2009-07-17 03:33 |
| Q: How to use NCF 1.2 bluetooth with S60 3rd Edition for Symbian C++ MR | jimgilmour1 | Bluetooth Technology | 35 | 2009-04-11 15:36 |
| How To Make The S60 Emulator See My USB Bluetooth Dongle ? | Mo7ammed_01 | Symbian Tools & SDKs | 1 | 2006-07-25 01:14 |
| How To Make The S60 Emulator See My USB Bluetooth Dongle ? | Mo7ammed_01 | Symbian Networking & Messaging | 1 | 2006-07-25 01:12 |
| Nokia 7650 support Bluetooth audo? | ovjo12 | Bluetooth Technology | 5 | 2003-07-17 19:50 |