public void SetPairingStatus(DeviceTabsForm.PairingStatus state) { pairingStatus = state; PairBondUserInputControl(); }
public void TabPairBondInitValues() { devForm.StopTimer(DeviceForm.EventType.PairBond); pairingStatus = DeviceTabsForm.PairingStatus.Empty; UsePasskeySecurity(HCICmds.GAP_UiOutput.DISPLAY_PASSCODE); ShowProgress(false); SetAuthenticatedBond(false); PairBondUserInputControl(); }
public void PairBondUserInputControl() { if (devForm.GetConnectInfo().BDA == "00:00:00:00:00:00") { devForm.StopTimer(DeviceForm.EventType.PairBond); pairingStatus = DeviceTabsForm.PairingStatus.NotConnected; UsePasskeySecurity(HCICmds.GAP_UiOutput.DISPLAY_PASSCODE); ShowProgress(false); } switch (pairingStatus) { case DeviceTabsForm.PairingStatus.Empty: pairingStatus = DeviceTabsForm.PairingStatus.NotConnected; break; case DeviceTabsForm.PairingStatus.NotConnected: UsePasskeySecurity(HCICmds.GAP_UiOutput.DISPLAY_PASSCODE); if (devForm.GetConnectInfo().BDA != "00:00:00:00:00:00") { pairingStatus = DeviceTabsForm.PairingStatus.NotPaired; break; } else break; case DeviceTabsForm.PairingStatus.NotPaired: UsePasskeySecurity(HCICmds.GAP_UiOutput.DISPLAY_PASSCODE); break; case DeviceTabsForm.PairingStatus.DevicesPairedBonded: case DeviceTabsForm.PairingStatus.DevicesPaired: case DeviceTabsForm.PairingStatus.PasskeyIncorrect: case DeviceTabsForm.PairingStatus.ConnectionTimedOut: UsePasskeySecurity(HCICmds.GAP_UiOutput.DISPLAY_PASSCODE); break; } tbPairingStatus.Text = GetPairingStatusStr(pairingStatus); PairBondFieldControl(); }