public override int ReceiveAlert(CecAlert alert, CecParameter data) { WriteLog("Received libcec Alert: " + alert.ToString()); if (alert == CecAlert.ConnectionLost) { WriteLog("Cecremote: RECONNECT"); short retries = 1; bool reconn = false; DeInit(); while (retries < 4 && !reconn) { OnStart(); reconn = _connected; WriteLog("Reconnection attempt " + retries.ToString() + " ... connected: " + reconn.ToString()); retries++; } } return(1); }
/// <summary> /// /// </summary> /// <param name="alert"></param> /// <param name="data"></param> /// <returns></returns> public override int ReceiveAlert(CecAlert alert, CecParameter data) { string log = "CEC alert: " + alert.ToString(); if (data != null && data.Type == CecParameterType.ParameterTypeString) { log += " " + data.Data; } Trace.WriteLine(log); Close(); //Try reconnect Open(1000); return(1); }
public override int ReceiveAlert(CecAlert alert, CecParameter data) { WriteLog("Received libcec Alert: " + alert.ToString()); if (alert == CecAlert.ConnectionLost) { WriteLog("Cecremote: RECONNECT"); short retries = 1; bool reconn = false; DeInit(); while (retries < 4 && !reconn) { OnStart(); reconn = _connected; WriteLog("Reconnection attempt " + retries.ToString() + " ... connected: " + reconn.ToString()); retries++; } } return 1; }