Wireless Communication Library Support Forum
Frameworks => Serial Framework => Topic started by: craigTheBrit on September 14, 2009, 08:22:46 AM
-
Our code uses the USB connection to exchange data between a phone and a PC. At the moment we're having trouble in the scenario that goes like this:
1. Program runs
2. Phone connected to PC
3. Program connects to the right port
4. Phone disconnected from PC
...
5. Program quits
When the program quits it seems to hang. Further, it seems that the wclClient isn't receiving an OnDisconnect event when the cable is taken out. Can you think of why that would be?
-
Hi
Serial ports do not generate Disconnect event because there is no way to know is device connected or not. You should terminate connection by timeout or use TwclSerialDiscovery monitoring feature (added in 6.6.2.0) to detect moment when used port disappears.
-
I'm having a little trouble detecting those DeviceLost events. It seems that they aren't triggered when a device is unplugged if it is connected via the serial client component. Can you confirm?
So the program contains both a wclSerialDiscovery and a wclClient. When the wclClient is connected (via USB), the wclSerialDiscovery is blinded to connections and disconnections, it seems. The result is that I never get to disconnect properly, and when my program quits it just hangs...
Really appreciate the speed of your replies Mike, I'm very impressed!
-
Hi,
I will take a look on it and try to fix.
-
Hi,
Tested and fixed (and now OnDisconnect fires for serial ports as well).
If you have the sources I can give you a changes, otherwise you have to wait when I publish next release.
-
Wow, that was fast! It's a little urgent, would it be possible to send a .dcu file for the corrected unit? I'm using Delphi 2006.
Craig
-
Unfortunatly there was some other changes so only dcu will not help/work. The new updates is planned to this weekend so it is just few days to wait.
P.S. That is why better to have the library sources - you can apply updates without waitng :)
-
Players? What players?