private RedEye(OnRemoteCommand remoteCommandCallback) { try { using (Settings xmlreader = new MPSettings()) { recInternalCommands = xmlreader.GetValueAsString("RedEye", "internal", "false") == "true"; commport = xmlreader.GetValueAsString("RedEye", "commport", "COM1:"); baudrate = xmlreader.GetValueAsInt("RedEye", "baudrate", 9600); handshake = xmlreader.GetValueAsString("RedEye", "handshake", "none"); irbytes = xmlreader.GetValueAsInt("RedEye", "irbytes", 6); uirirmaninit = xmlreader.GetValueAsString("RedEye", "uirirmaninit", "true") == "true"; LearningTimeOut = 1000 * xmlreader.GetValueAsInt("RedEye", "timeout", 4); CommandDelay = xmlreader.GetValueAsInt("RedEye", "delay", 300); } this.remoteCommandCallback = remoteCommandCallback; if (InternalCommandsActive) { base.Open(); } } catch (Exception) { //most users dont have serial device on their system so will get a exception here } }
private SerialUIR(OnRemoteCommand remoteCommandCallback) : this() { try { using (Settings xmlreader = new MPSettings()) { recInternalCommands = xmlreader.GetValueAsString("SerialUIR", "internal", "false") == "true"; commport = xmlreader.GetValueAsString("SerialUIR", "commport", "COM1:"); baudrate = xmlreader.GetValueAsInt("SerialUIR", "baudrate", 9600); handshake = xmlreader.GetValueAsString("SerialUIR", "handshake", "None"); irbytes = xmlreader.GetValueAsInt("SerialUIR", "irbytes", 6); uirirmaninit = xmlreader.GetValueAsString("SerialUIR", "uirirmaninit", "true") == "true"; LearningTimeOut = 1000 * xmlreader.GetValueAsInt("SerialUIR", "timeout", 4); CommandDelay = xmlreader.GetValueAsInt("SerialUIR", "delay", 300); } this.remoteCommandCallback = remoteCommandCallback; commandsLearned = new Hashtable(); if (File.Exists(remotefile)) { LoadValues(); } if (InternalCommandsActive) { base.Open(); } } catch (Exception ex) { //most users dont have serial device on their system so will get a exception here Log.Error("SerialUIR:SerialUIR {0}", ex.Message); } }
public static RedEye Create(OnRemoteCommand remoteCommandCallback) { try { if (instance == null) { instance = new RedEye(remoteCommandCallback); } } catch (Exception) {} return(instance); }
public static SerialUIR Create(OnRemoteCommand remoteCommandCallback) { try { if (instance == null) { instance = new SerialUIR(remoteCommandCallback); } } catch (Exception) {} return(instance); }
public static SerialUIR Create(OnRemoteCommand remoteCommandCallback) { try { if (instance == null) { instance = new SerialUIR(remoteCommandCallback); } } catch (Exception ex) { Log.Error("SerialUIR:Create {0}", ex.Message); } return(instance); }
public static RedEye Create(OnRemoteCommand remoteCommandCallback) { try { if (instance == null) { instance = new RedEye(remoteCommandCallback); } } catch (Exception ex) { Log.Error("RedEye Create: {0}", ex.Message); } return(instance); }
/// <summary> /// /// </summary> /// <param name="remoteCommandCallback"></param> /// <returns></returns> public static USBUIRT Create(OnRemoteCommand remoteCommandCallback) { try { if (Instance == null) { Instance = new USBUIRT(remoteCommandCallback); } } catch (Exception) {} return Instance; }
/// <summary> /// /// </summary> /// <param name="callback"></param> private USBUIRT(OnRemoteCommand callback) { try { Log.Info("USBUIRT:Open"); _commandsLearned = new Hashtable(); _jumpToCommands = new Hashtable(); CreateJumpToCommands(); _usbUirtHandle = UUIRTOpen(); if (_usbUirtHandle != _empty) { IsUsbUirtLoaded = true; Log.Info("USBUIRT:Open success:{0}", GetVersions()); } else { Log.Info("USBUIRT:Unable to open USBUIRT driver"); } if (IsUsbUirtLoaded) { Initialize(); //setup callback to receive IR messages _urcb = UUIRTReceiveCallback; UUIRTSetReceiveCallback(_usbUirtHandle, _urcb, 0); RemoteCommandCallback = callback; } } catch (DllNotFoundException) { //most users don't have the dll on their system so will get a exception here Log.Info("USBUIRT:uuirtdrv.dll not found"); } catch (Exception) { //most users don't have the dll on their system so will get a exception here } }
private SerialUIR(OnRemoteCommand remoteCommandCallback) : this() { try { using (Settings xmlreader = new MPSettings()) { recInternalCommands = xmlreader.GetValueAsString("SerialUIR", "internal", "false") == "true"; commport = xmlreader.GetValueAsString("SerialUIR", "commport", "COM1:"); baudrate = xmlreader.GetValueAsInt("SerialUIR", "baudrate", 9600); handshake = xmlreader.GetValueAsString("SerialUIR", "handshake", "None"); irbytes = xmlreader.GetValueAsInt("SerialUIR", "irbytes", 6); uirirmaninit = xmlreader.GetValueAsString("SerialUIR", "uirirmaninit", "true") == "true"; LearningTimeOut = 1000 * xmlreader.GetValueAsInt("SerialUIR", "timeout", 4); CommandDelay = xmlreader.GetValueAsInt("SerialUIR", "delay", 300); } this.remoteCommandCallback = remoteCommandCallback; commandsLearned = new Hashtable(); if (File.Exists(remotefile)) { LoadValues(); } if (InternalCommandsActive) base.Open(); } catch (Exception) { //most users dont have serial device on their system so will get a exception here } }
public static SerialUIR Create(OnRemoteCommand remoteCommandCallback) { try { if (instance == null) { instance = new SerialUIR(remoteCommandCallback); } } catch (Exception) {} return instance; }
public static RedEye Create(OnRemoteCommand remoteCommandCallback) { try { if (instance == null) { instance = new RedEye(remoteCommandCallback); } } catch (Exception) {} return instance; }
private RedEye(OnRemoteCommand remoteCommandCallback) { try { using (Settings xmlreader = new MPSettings()) { recInternalCommands = xmlreader.GetValueAsString("RedEye", "internal", "false") == "true"; commport = xmlreader.GetValueAsString("RedEye", "commport", "COM1:"); baudrate = xmlreader.GetValueAsInt("RedEye", "baudrate", 9600); handshake = xmlreader.GetValueAsString("RedEye", "handshake", "none"); irbytes = xmlreader.GetValueAsInt("RedEye", "irbytes", 6); uirirmaninit = xmlreader.GetValueAsString("RedEye", "uirirmaninit", "true") == "true"; LearningTimeOut = 1000 * xmlreader.GetValueAsInt("RedEye", "timeout", 4); CommandDelay = xmlreader.GetValueAsInt("RedEye", "delay", 300); } this.remoteCommandCallback = remoteCommandCallback; base.Open(); } catch (Exception) { //most users dont have serial device on their system so will get a exception here } }