Пример #1
0
    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();
            }
        }
    }
Пример #2
0
        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);
        }
Пример #3
0
 public static extern int BluetoothGetRadioInfo(IntPtr hRadio, ref BluetoothRadioInfo radioInfo);
Пример #4
0
 public static extern int BluetoothGetRadioInfo(IntPtr hRadio, ref BluetoothRadioInfo pbtdi);
Пример #5
0
 BluetoothGetRadioInfo(SafeFileHandle hRadio,
                       ref BluetoothRadioInfo pRadioInfo);