[DllImport("irprops.cpl", SetLastError=true)]
static extern TODO BluetoothGetRadioInfo(TODO);
<DllImport("irprops.cpl", setlasterror:=True, CharSet:=CharSet.Auto)> _
Private Shared Function BluetoothGetRadioInfo( _
ByVal hRadio As IntPtr, _
ByRef pRadioInfo As BluetoothRadioInfo) As UInteger
End Function
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
XP SP1 required.
See the BluetoothAPIs.h file in the platform SDK.
Please add some!
Please add some!