Show / Hide Table of Contents

How to retrieve a slot's status

When you construct an OtpSession object, you can retrieve the general status of both OTP application slots. Slot status will tell you if the slot:

  • is configured
  • requires touch

To output slot status to the console, do the following:

using (OtpSession otp = new OtpSession(yKey))
{
  Output(Slot.ShortPress, otp.IsShortPressConfigured, otp.ShortPressRequiresTouch);
  Output(Slot.LongPress, otp.IsLongPressConfigured, otp.LongPressRequiresTouch);
}
void Output(Slot slot, bool configured, bool touchRequired)
{
  Console.WriteLine($"Slot {slot} Configured: {configured}");
  if (configured)
  {
    Console.WriteLine($"Slot {slot} Requires Touch: {touchRequired}");
  }
}
  • Improve this Doc
In this article
Back to top Generated by DocFX