Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

BluetoothGetRadioInfo (irprops)
 
.
Summary
Gets information on the radio (i.e. the local device attached to the user's computer)

C# Signature:

[DllImport("irprops.cpl", SetLastError=true)]
private static extern UInt32 BluetoothGetRadioInfo(IntPtr hRadio, ref Bluetooth_Radio_Info pRadioInfo);
private static extern UInt32 BluetoothGetRadioInfo(IntPtr hRadio, ref [Bluetooth_Radio_Info] pRadioInfo);

User-Defined Types:

Bluetooth_Radio_Info

VB Signature:

    <DllImport("irprops.cpl", setlasterror:=True, CharSet:=CharSet.Auto)> _
    Private Shared Function BluetoothGetRadioInfo( _
    ByVal hRadio As IntPtr, _
    ByRef pRadioInfo As BluetoothRadioInfo) As UInteger
    End Function

User-Defined Types:

    Private Const BLUETOOTH_MAX_NAME_SIZE = 248

    <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
    Friend Structure BluetoothRadioInfo

    Public Size As Integer
    Public Address As Int64
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=BLUETOOTH_MAX_NAME_SIZE)> _
    Public Name As String
    Public ClassofDevice As UInteger
    Public Subversion As UShort
    Public Manufacturer As UShort

    Public Sub Initialize()
        Me.Size = Marshal.SizeOf(Me)
    End Sub

    Public Function GetAddress() As String
        Dim fmt As String = "({0}:{1}:{2}:{3}:{4}:{5})"
        Return String.Format(fmt, _
                 ((Address >> 40) And &HFF).ToString("x2"), _
                 ((Address >> 32) And &HFF).ToString("x2"), _
                 ((Address >> 24) And &HFF).ToString("x2"), _
                 ((Address >> 16) And &HFF).ToString("x2"), _
                 ((Address >> 8) And &HFF).ToString("x2"), _
                 (Address And &HFF).ToString("x2"))
    End Function

    End Structure

Alternative Managed API:

http://32feet.net/

Notes:

XP SP1 required.

See the BluetoothAPIs.h file in the platform SDK.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation
Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions