static bool checkConnection(void)
{
  bool connected = checkSerialPort(readConfig(serialPort), true);

  if (connected)
  {
    return true;
  }
  else
  {
    fprintf(stdout, "Lost connection to NCP. Attempting to reconnect...\r\n");
    // Attempt to restore the connection. This will reset the EM260.
    if(usbReconnect()==EZSP_SUCCESS)
    {
      fprintf(stdout, "Success!\r\n");
      return true;
    }
  }
  return false;
}
Exemple #2
0
void MainWindow::processSerialPort()
{
    foundSerialPort = checkSerialPort();
    if(foundSerialPort){openSerialPort();}
}