private void SendProjCmd(MonitorConfig mc, ProjectorCommand pc) { try { //send the command if (mc.m_displayconnectionenabled == false) { DebugLogger.Instance().LogWarning("Display connection not enabled"); return; } //Find the driver DeviceDriver driver = UVDLPApp.Instance().m_deviceinterface.FindProjDriverByComName(mc.m_displayconnection.comname); if (driver == null) { DebugLogger.Instance().LogError("Driver not found"); return; } if (driver.Connected == true) { //send the command. driver.Write(pc.GetBytes(), pc.GetBytes().Length); } else { DebugLogger.Instance().LogError("Driver not connected"); return; } } catch (Exception ex) { DebugLogger.Instance().LogError(ex); } }
public bool SendProjCommand(string displayname, string commandname) { try { // get the projector command for 'on' // ACER_ON ProjectorCommand pcmd = UVDLPApp.Instance().m_proj_cmd_lst.FindByName(commandname); if (pcmd != null) { DeviceDriver dd = DisplayManager.Instance().FindDisplaySerialPortDriverByName(displayname); if (dd != null) { if (dd.Connected) { byte[] data = pcmd.GetBytes(); dd.Write(data, data.Length); return(true); } else { DebugLogger.Instance().LogError("Projector Driver not connected"); } } else { DebugLogger.Instance().LogError("Projector Driver not found"); } } else { DebugLogger.Instance().LogError("Projector command not found"); } } catch (Exception ex) { DebugLogger.Instance().LogError(ex); } return(false); }