private bool IsWiiDevice(BluetoothDevice device)
 {
     if (device.Name == "Nintendo RVL-CNT-01")
         return true;
     else if (device.Name == "Nintendo RVL-WBC-01")
         return true;
     return false;
 }
 public BluetoothDeviceEventArgs(BluetoothDevice bluetoothDevice)
 {
     this.bluetoothDevice = bluetoothDevice;
 }
        public BluetoothDevice[] InquireDevices(TimeSpan timeOut)
        {
            ValidateThread();
            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state)
            {
                Thread.Sleep(timeOut);
                NativeMethods.BT_CancelInquiry();
            }));
            NativeMethods.BLUETOOTH_DEVICE_INFO[] deviceInfos;
            NativeMethods.BTSTATUS status = NativeMethods.BT_InquireDevices(NativeMethods.INQUIRY.INQUIRY_GENERAL_REFRESH, 0, out deviceInfos);
            ValidateStatus(status);

            BluetoothDevice[] devices = new BluetoothDevice[deviceInfos.Length];
            for (int i = 0; i < devices.Length; i++)
                devices[i] = CreateBluetoothDevice(deviceInfos[i]);
            return devices;
        }
 public BluetoothService[] BrowseServices(BluetoothDevice device)
 {
     ValidateThread();
     NativeMethods.GENERAL_SERVICE_INFO[] serviceInfos;
     NativeMethods.BTSTATUS status = NativeMethods.BT_BrowseServices(device.DeviceInfo, true, out serviceInfos);
     ValidateStatus(status);
     BluetoothService[] services = new BluetoothService[serviceInfos.Length];
     for (int i = 0; i < serviceInfos.Length; i++)
     {
         services[i] = new BluetoothService(this, device, serviceInfos[i]);
     }
     return services;
 }
Example #5
0
 public BluetoothDeviceEventArgs(BluetoothDevice bluetoothDevice)
 {
     this.bluetoothDevice = bluetoothDevice;
 }