Frameworks > Serial Framework
USB Serial Pull out problem
gomsun2:
hi. i'm testing wcl component.
6.10.2.0 / vcl / windows 7 64bit. / trial version / device chipset - silabs CP210x
The scenario that goes like this:
1. Run VCL\demo\Delphi\SerialConnection\SerialClientDemoXE2.exe
2. Enum Click
3. Seldect Device
4. Connect Click -> Connect success
5. Unplugging usb device
6. BluetoothClientDemoXE2.exe application is lock & no response
i try like this. But dose't work. what should I do?
procedure TfmMain.FormCreate(Sender: TObject);
begin
wclAPI.Load;
wclSerialDiscovery.StartMonitoring;
end;
procedure TfmMain.wclSerialDiscoveryDeviceLost(Sender: TObject;
Device: TwclSerialDevice);
begin
if Device.Port = MY_PORT then
wclClient.Disconnect;
end;
Mike Petrichenko:
Hi,
WCL uses timeout to detects when serial device disconnects. So you do not need to monitor serial ports to detect disconnection. However, with some USB->COM adatpters we faced such issue and are working on this matter. Hopefully we will have solution soon. The problem is that some USB->COM (or its drivers) don't notify high level apps about device disconnection (when it is used).
Any way, try to not use monitoring and wait for OnDisconnect event from wclClient.
gomsun2:
thank you for reply.
i setting "wclClinet.TimeOut := 100;" but OnDisconnect event does not execute
Is there another way to solve the problem?
Mike Petrichenko:
We will check it out and back to you with solution.
gomsun2:
Thank you.
Looking forward to your solution. :)
Navigation
[0] Message Index
[#] Next page
Go to full version