/// <summary> /// Start using the device. /// </summary> public override void Start() { try { DebugOpen("MicrosoftMceTransceiver_DriverReplacement.log"); DebugWriteLine("Start()"); DebugWriteLine("Device Guid: {0}", _deviceGuid); DebugWriteLine("Device Path: {0}", _devicePath); DebugWriteLine("Device Type: {0}", Enum.GetName(typeof(DeviceType), _deviceType)); _notifyWindow = new NotifyWindow(); _notifyWindow.Create(); _notifyWindow.Class = _deviceGuid; _notifyWindow.RegisterDeviceArrival(); OpenDevice(); StartReadThread(); InitializeDevice(); _notifyWindow.DeviceArrival += OnDeviceArrival; _notifyWindow.DeviceRemoval += OnDeviceRemoval; } catch { DebugClose(); throw; } }
/// <summary> /// Starts listening for messages from the device. /// </summary> void StartDevice() { lock (_startStopLock) { _notifyWindow = new NotifyWindow(); _notifyWindow.Create(); _notifyWindow.Class = _deviceGuid; _notifyWindow.RegisterDeviceArrival(); OpenDevice(); InitializeDevice(); StartReadThread(ReadThreadMode.Receiving); _notifyWindow.DeviceArrival += OnDeviceArrival; _notifyWindow.DeviceRemoval += OnDeviceRemoval; } }
/// <summary> /// Start using the device. /// </summary> public override void Start() { try { DebugOpen("MicrosoftMceTransceiver_DriverReplacement.log"); DebugWriteLine("Start()"); DebugWriteLine("Device Guid: {0}", _deviceGuid); DebugWriteLine("Device Path: {0}", _devicePath); DebugWriteLine("Device Type: {0}", Enum.GetName(typeof (DeviceType), _deviceType)); _notifyWindow = new NotifyWindow(); _notifyWindow.Create(); _notifyWindow.Class = _deviceGuid; _notifyWindow.RegisterDeviceArrival(); OpenDevice(); StartReadThread(); InitializeDevice(); _notifyWindow.DeviceArrival += OnDeviceArrival; _notifyWindow.DeviceRemoval += OnDeviceRemoval; } catch { DebugClose(); throw; } }