c# - How to Forcefully close SerialPort Connection? -


i have device connect pc via usb serial communication. performing following steps

  1. start device (power on)
  2. device detected in pc comx name
  3. start application
  4. on base of com pid/vid, connect device
  5. perform communication. (up not facing problem)
  6. when switch off device, device disconnected cannot able close connection.
  7. when again start(switch on) device, device detected application cannot able connect comx(device). throws ioexception "comx not exist"

so think have way close communication port forcefully.

any appreciated

thanks

if communicationg hardware on serial port , using serialeventlistener, think serial.data_break(dont remember exact name) event occurs. catch in serialevent method , close connection program port. hope helps forcibly close connection @ time of disconnection of hardware.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -