Results 1 to 5 of 5

Thread: List of Bluetooth devices using C#

  1. #1

    Thread Starter
    ex-Administrator brad jones's Avatar
    Join Date
    Nov 2002
    Location
    Indianapolis
    Posts
    6,614

    List of Bluetooth devices using C#

    I need a very simple C# program that lists the names or IDs of bluetooth devices in range. I'm finding that there isn't a good example of this that I could find. I'm looking to create a simple Windows Phone 8.0/8.1 app that needs this functionality.

    Anyone seen such code (or know how to write it)!

    THanks,

    Brad!

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: List of Bluetooth devices using C#

    Hi Brad,

    Our Network Admin guy uses this 32feet.NET. There's a documentation section from that site.

    I don't have a clue on how it works/coding part.

    - kgc
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  3. #3
    Addicted Member
    Join Date
    May 2004
    Posts
    141

    Re: List of Bluetooth devices using C#

    Code:
            {
                System.Management.ManagementObjectCollection ManObjReturn;
                System.Management.ManagementObjectSearcher ManObjSearch;
                ManObjSearch = new System.Management.ManagementObjectSearcher("Select * from Win32_PnPEntity");
                ManObjReturn = ManObjSearch.Get();
    
                foreach (System.Management.ManagementObject ManObj in ManObjReturn)
                {
                    if ( ("" + ManObj["ClassGUID"]).ToUpper() == "{e0cbf06c-cd8b-4647-bb8a-263b43f0f974}")
                    {
                         // Do something with ManObj["Name"] such as Add to a <List>
                         SomeList.Add(ManObj["Name"])
    
                       
                    }
                }
                return SomeList;
    
            }

    See

    https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

    for a list of GUIDs for other device types.
    Last edited by Axcontrols; Jul 13th, 2016 at 08:14 AM. Reason: Additonal info

  4. #4

    Thread Starter
    ex-Administrator brad jones's Avatar
    Join Date
    Nov 2002
    Location
    Indianapolis
    Posts
    6,614

    Re: List of Bluetooth devices using C#

    Quote Originally Posted by Axcontrols View Post
    Code:
            {
                ...
    Does this show bluetooth devices on my current machine, or does it show devices in range of my machine? I'll need to take a closer look at this.

    Thanks!

  5. #5

    Thread Starter
    ex-Administrator brad jones's Avatar
    Join Date
    Nov 2002
    Location
    Indianapolis
    Posts
    6,614

    Re: List of Bluetooth devices using C#

    Quote Originally Posted by KGComputers View Post
    Our Network Admin guy uses this 32feet.NET. There's a documentation section from that site.
    Others have pointed to 32feet as well, so it looks like I need to look at it.

    Thanks!

Tags for this Thread

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