Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing the validity of a Com Port
Message
De
20/08/2008 11:03:58
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
20/08/2008 09:36:01
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01340243
Message ID:
01340383
Vues:
10
Hi Viv,

Maybe in this is my answer. My connection is via a third party product and not using the .NET SerialPort object. I suppose I could pre test the port by trying a SerialPort.Open(). Currently what is happening is a hang when trying to connect. If I unplug the device, unplug the usb cable (it is emulated) and then reconnect and make sure the device is on first, etc. etc. and then verify before I start the application I have a valid device then the connection is successful. I am looking for a way to programatically make sure so I don't get a hang.

Tim


>Hi,
>
>What do you mean by 'tries to connect'? The port is valid it should open OK whether or not a device is connected. AFAIK SerialPort.Open() throws an exception if the specified port is not valid.
>Regards,
>Viv
>
>>I have a windows app that connects to devices via a com port. (Actually I use a serial emulator but it shows up as com 5). If I don't have the device plugged in or turned on when the application starts and tries to connect the application just appears to hang. Is there a way to test if the com port is a valid port before attempting to connect?
>>Thanks
>>Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform