static void Main() { SafeFileHandle radioHandle; using (SafeBluetoothRadioFindHandle radioFindHandle = BluetoothFindFirstRadio(new BluetoothFindRadioParams(), out radioHandle)) { if (!radioFindHandle.IsInvalid) { BluetoothRadioInfo radioInfo = new BluetoothRadioInfo(); radioInfo.dwSize = 520; UInt32 result = BluetoothGetRadioInfo(radioHandle, ref radioInfo); if (result == ERROR_SUCCESS) { // Let's send the contents of the radio info to the // console. Console.WriteLine("address = {0:X}", radioInfo.address); Console.WriteLine("szName = {0}", radioInfo.szName); Console.WriteLine("ulClassOfDevice = {0}", radioInfo.ulClassOfDevice); Console.WriteLine("lmpSubversion = {0}", radioInfo.lmpSubversion); Console.WriteLine("manufacturer = {0}", radioInfo.manufacturer); } radioHandle.Dispose(); } } }
public static BluetoothRadioInfo GetRadioInfo(IntPtr radioHandle) { BluetoothRadioInfo radioInfo = default(BluetoothRadioInfo); int result = BluetoothGetRadioInfo(radioHandle, ref radioInfo); HandleResult(result); //if (result != 0) // throw new InvalidOperationException(); return(radioInfo); }
public static extern int BluetoothGetRadioInfo(IntPtr hRadio, ref BluetoothRadioInfo radioInfo);
public static extern int BluetoothGetRadioInfo(IntPtr hRadio, ref BluetoothRadioInfo pbtdi);
BluetoothGetRadioInfo(SafeFileHandle hRadio, ref BluetoothRadioInfo pRadioInfo);