12.4.3 How to Connect to a Card using its Serial Number |
This procedure for making contact with a particular SP-ICE-3 Card from your application assumes that you already know the card's Serial Number.
Important |
---|
|
Please refer to 5.5.2.3 How to obtain Card IP-Addresses the Hard Way.
Assuming we have armed ourselves with the card's Serial Number, we can attempt to make contact with it like this:
Note |
---|
|
using ( ClientAPI client = new ClientAPI() ) { // NB: we assume the existence of a variable called SerialNumber, // which contains the serial number of the card we wish to contact. string CardIP = ClientAPI.PredictIPAddressFromSerialNumber( SerialNumber ); // Open a communications channel to the card: client.Connect( CardIP ); if ( client.Connected ) { // Make sure that we are indeed in contact with the correct card! string cardSerialNumber = client.System.GetCardSerialNumber(); Console.WriteLine( "Using SN {0}, connected to SN {1} at {2}", SerialNumber, cardSerialNumber, CardIP ); // Close the communications channel to the card: client.Disconnect(); } }