Exemplo n.º 1
0
static bool
ParseStatus(WifiStatus &status, char *src)
{
  status.Clear();

  while (true) {
    char *eol = strchr(src, '\n');
    if (eol != nullptr)
      *eol = 0;

    if (!ParseStatusLine(status, src))
      break;

    if (eol == nullptr)
      break;

    src = eol + 1;
  }

  return true;
}
Exemplo n.º 2
0
void
WifiListWidget::UpdateList()
{
  status.Clear();

  if (EnsureConnected()) {
    wpa_supplicant.Status(status);

    for (auto &i : networks)
      i.old_visible = i.old_configured = true;

    UpdateScanResults();
    UpdateConfigured();

    /* remove items that are still marked as "old" */
    SweepList();
  } else
    networks.clear();

  GetList().SetLength(networks.size());

  UpdateButtons();
}