Exemple #1
0
        protected override EventResult OnConnectBusy()
        {
//            handle_ = UsbPcapManager.OpenDevice(prop_.DeviceName.Value);
            handle_ = UsbPcapManager.OpenDevice(prop_.DeviceName.Value, false);

            return ((handle_ != WinAPI.INVALID_HANDLE_VALUE) ? (EventResult.Success) : (EventResult.Busy));
        }
Exemple #2
0
        protected override void OnDisconnected()
        {
#if ASYNC_RECV_MODE
            WinAPI.CloseHandle(exit_event_handle_);
            exit_event_handle_ = IntPtr.Zero;

            WinAPI.CloseHandle(recv_event_handle_);
            recv_event_handle_ = IntPtr.Zero;
#endif

            UsbPcapManager.CloseDevice(handle_);
            handle_ = WinAPI.INVALID_HANDLE_VALUE;
        }
        private void InitializeDeviceList()
        {
            var devices = UsbPcapManager.GetDeviceList();

            CBox_DeviceList.BeginUpdate();
            {
                CBox_DeviceList.Items.AddRange(devices.ToArray());
                if (CBox_DeviceList.Items.Count == 0)
                {
                    CBox_DeviceList.Enabled = false;
                }
            }
            CBox_DeviceList.EndUpdate();
        }