Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
    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;
    }