×

Discussion Board

Results 1 to 4 of 4

Thread: Bluetooth Name

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    16

    Bluetooth Name

    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?

  2. #2
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    151

    Re: Bluetooth Name

    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 13:07.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    16

    Re: Bluetooth Name

    Quote Originally Posted by jtullis View Post
    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()
    Works great. Thanks.

    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
    Let me know if there's another way to do that.

    Note: I wonder why such basic functions are not in the PyS60 native libraries.
    Last edited by bmichel; 2008-05-06 at 13:49.

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    151

    Re: Bluetooth Name

    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)

Similar Threads

  1. How To Make The S60 Emulator See My USB Bluetooth Dongle ?
    By Mo7ammed_01 in forum Bluetooth Technology
    Replies: 9
    Last Post: 2009-07-17, 02:33
  2. Replies: 35
    Last Post: 2009-04-11, 14:36
  3. How To Make The S60 Emulator See My USB Bluetooth Dongle ?
    By Mo7ammed_01 in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2006-07-25, 00:14
  4. How To Make The S60 Emulator See My USB Bluetooth Dongle ?
    By Mo7ammed_01 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-07-25, 00:12
  5. Nokia 7650 support Bluetooth audo?
    By ovjo12 in forum Bluetooth Technology
    Replies: 5
    Last Post: 2003-07-17, 18:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •