To interact with the ATECCGEN2 rack, you must create an IAteCoreSession object using the static function CreateAteCoreSessionAsync from AteCoreSession. This static function takes in the following arguments to connect to a rack from a host:

  • Hostname/IP address
  • Password
  • Optional rememberPassword parameter

When the session object is returned from CreateAteCoreSessionAsync, the network connection is successfully established and you can use the session to call the properties and functions of different classes and interfaces to perform the desired operation. Call Dispose to close the network connection.

Session Creation and Session Disposal

IAteCoreSession ateCoreSession = null;
try
{
    // To create an object of IAteCoreSession.
    ateCoreSession = await AteCoreSession.CreateAteCoreSessionAsync(hostname, password, true);

    // Call another function to perform an operation on the ATECCGEN2 rack.
}
catch(Exception ex)
{
    Console.WriteLine(ex.Message); //Print the exception message.
}
finally
{
    if (ateCoreSession != null)
    {
        // To close the session.
        ateCoreSession.Dispose();
    }
}