Results 1 to 7 of 7

Thread: [VB6] BTEnum - Enumerate Bluetooth devices

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    [VB6] BTEnum - Enumerate Bluetooth devices

    This uses the Microsoft Bluetooth APIs to get a list of remembered and in-range visible Bluetooth devices.

    Requires Windows XP SP 2 or later, and a Bluetooth adapter/radio supporting the Microsoft Bluetooth stack.


    A search can take a while, so you can specify the timeout. Shorter timeouts might miss some devices.

    Demo using the BTEnum class is attached. Sample run:

    Name:  sshot.png
Views: 3515
Size:  6.2 KB


    Only tested on Windows 10 1709.

    There were some tricky aspects to getting this working. There might still be flaws and it might not work right on older OSs due to changes in structs over time.
    Attached Files Attached Files

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [VB6] BTEnum - Enumerate Bluetooth devices

    I tested this using a Kensington USB Bluetooth dongle, but I'll try it on some other hardware too.

  3. #3
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    508

    Re: [VB6] BTEnum - Enumerate Bluetooth devices

    very good example dilettante.
    There would be some way to know the battery level of the device.
    I have a Bluetooth headset and the battery is short and I have to charge them always in the middle of a movie.
    a greeting

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [VB6] BTEnum - Enumerate Bluetooth devices

    Interesting idea and it sounds useful. As far as I can tell though this API doesn't support that.

    I will take a look at other possibilities for querying batter/power level info.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [VB6] BTEnum - Enumerate Bluetooth devices

    I am now pretty sure that I am reporting the device addresses backwards above. As a String they should be high byte to low byte.

    Also, in Windows 8 a later you can call those entrypoints in BluetoothAPIs.dll instead of in bthprops.cpl as required in obsolete OSs (dying Windows 7 and dead Windows Vista and XP SP2+).

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [VB6] BTEnum - Enumerate Bluetooth devices

    Getting battery levels looks a bit more complicated, and there may not even be any standards for it until Bluetooth Low Energy. Even for BTLE it may take some effort to work out the native API calls required.

    Maybe see How to Read the Battery Level of Bluetooth LE Devices as a starting point?

  7. #7
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    España
    Posts
    508

    Re: [VB6] BTEnum - Enumerate Bluetooth devices

    If that is the only thing I have found there is very little information.
    I do not know if to install the update "Windows 10 Creators Update" I'm fine now without much ****.
    Greetings and thank you

Posting Permissions

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



Click Here to Expand Forum to Full Width