Current connection state
Gets the binary payload for QR code generation
Uint8Array to encode as QR code (use Byte mode)
QWBPConnectionError if called in wrong state or connection not initialized
Get the Short Authentication String (SAS) for visual verification
Both peers should display this code and users should verify they match. This detects active MITM attacks where an attacker substitutes their own QR.
4-digit verification code, or null if not yet connected
Initialize the connection and gather ICE candidates
Creates a PC with derived ICE credentials (HKDF from fingerprint). The same PC is reused for the actual connection after role assignment.
Must be called before getQRPayload()
QWBPConnectionError if called in wrong state or ICE gathering fails
Process a scanned QR payload from the remote peer
Binary data from QR code scan
QWBPConnectionError if called in wrong state or packet is invalid
QWBPSelfConnectionError if the scanned QR is from this device
High-level connection manager for QWBP
Handles the complete flow from QR generation to DataChannel establishment
Example