Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing the validity of a Com Port
Message
De
20/08/2008 13:11:55
 
 
À
20/08/2008 12:46:28
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01340243
Message ID:
01340418
Vues:
10
>>Hi,
>>>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().
>>
>>Don't think that would help. As mentioned the SerialPort.Open() should succeed whether or not the device in question is connected.
>>You'd probably need to use the .NET serial port to do a bit more probing to determine if the device was available but, not knowing the device, I've no suggestions as to what might be appropriate. What's the device in question?
>
>In this case it is an Rfid reader. We have been using these and other serial devices (gps, rfid, scales, cameras) but with this reader and this API I am getting this result. Part of the problem is I don't know exactly what is going on in the API where I am calling the connect into. It would be nice if it would return a fail on its own.

Is the API specific to the hardware?
Do you have any information on accessing the device other than via the API?
Maybe the API provides some other method/property which would help determine the device status?

>Is there a way to put some kind of timeout on execution of a command?

Don't think so - except perhaps using a seperate thread (which you seem to be considering). The problem there might be that a Thread.Abort wouldn't actually abort the thread if the wait is occurring in unmanaged code in the API :-{
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform