c# - How to Forcefully close SerialPort Connection? -
i have device connect pc via usb serial communication. performing following steps
- start device (power on)
- device detected in pc comx name
- start application
- on base of com pid/vid, connect device
- perform communication. (up not facing problem)
- when switch off device, device disconnected cannot able close connection.
- 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
Post a Comment