12.4.2 How to Connect to a Card using a Hostname or Explicit Address |
This procedure for making contact with a particular SP-ICE-3 Card from your application assumes that you already know the card's IP Address.
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 address, 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 CardIP, // which contains the IP address of our card. // Open a communications channel to the card: client.Connect( CardIP ); if ( client.Connected ) { // Send a command to the card: string serialNumber = client.System.GetCardSerialNumber(); Console.WriteLine( "Connected to SN {0} at {1}", serialNumber, CardIP ); // Close the communications channel to the card: client.Disconnect(); } }