YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.pairing.PairingWindow Class Reference

The pairing window of a client (spec, "Pairing Window"): a state in which the client has decided to accept code-based pairing attempts. More...

Collaboration diagram for de.yaacc.sendspin.pairing.PairingWindow:
Collaboration graph

Public Member Functions

 PairingWindow (LongSupplier nowMillis)
 
synchronized void open ()
 The opening gesture (also a new one while it is open: the lifetime starts again and the failures are forgotten).
 
synchronized void close ()
 The closing gesture.
 
synchronized boolean isOpen ()
 
synchronized boolean isExhausted ()
 
synchronized boolean admitsAttempt ()
 Whether a new attempt may start now: the window is open and not exhausted.
 
synchronized void staticAttemptFailed ()
 The client's verification of server_kc failed in a static attempt.
 
synchronized void roundLimitReached ()
 A dynamic attempt reached the round limit.
 
synchronized void completed ()
 A pairing completed: the window closes.
 
synchronized long remainingMillis ()
 How long the window stays open, in milliseconds; 0 if it is closed.
 

Static Public Attributes

static final long LIFETIME_MILLIS = 5L * 60L * 1000L
 Recommended by the specification.
 
static final int STATIC_FAILURES = 5
 Failed static attempts that exhaust the window.
 

Detailed Description

The pairing window of a client (spec, "Pairing Window"): a state in which the client has decided to accept code-based pairing attempts.

An operator gesture on the client opens it (the app's button in the sheet of the phone's own card: an action no server can drive); it lasts five minutes without pausing during attempts; it closes on a completed pairing, on a closing gesture or when it expires; it is exhausted after its fifth failed static attempt or at the round limit of a dynamic attempt: it then stays open but admits no further attempt until a new opening gesture. Thread safe.


The documentation for this class was generated from the following file: