/* UI handle function when user select a network to connect. */
EFI_STATUS WifiMgrUserSelectProfileToConnect(IN WIFI_MGR_PRIVATE_DATA *Private, IN UINT32 ProfileIndex)
/* UI handle function when user select a network to connect. */
EFI_STATUS WifiMgrUserSelectProfileToConnect(IN WIFI_MGR_PRIVATE_DATA *Private, IN UINT32 ProfileIndex)
{
  WIFI_MGR_NETWORK_PROFILE  *Profile;
  WIFI_MGR_DEVICE_DATA      *Nic;
  Nic = Private->CurrentNic;
  if (Nic == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  WifiMgrCleanUserInput (Private);
  Profile = WifiMgrGetProfileByProfileIndex (ProfileIndex, &Nic->ProfileList);
  if (Profile == NULL) {
    return EFI_NOT_FOUND;
  }
  Private->CurrentNic->UserSelectedProfile = Profile;
  return EFI_SUCCESS;
}