public void DetectarImpresora() { try { bool test1 = fiscal.CheckFPrinter(); if (fiscal.OpenFpCtrl(Puerto)) { if (!fiscal.ReadFpStatus()) { throw (new Exception(string.Format("Error de conexión, Estatus {0} verifique el puerto por favor...", fiscal.Status_Error))); } } else { var texto = fiscal.ComPort; bool test = fiscal.CheckFPrinter(); var x = fiscal.Estado; throw (new Exception(string.Format("Error al abrir el puerto {0}", Puerto))); } } catch (TfhkaNet.IF.PrinterException x) { throw new Exception(string.Format("Error de impresora: {0}, estatus {1}", x.Message, fiscal.Estado)); } }
/// <summary> /// Reinstalls the device. /// </summary> /// <returns></returns> public Boolean Reinstall() { WriteToTrace("#### Method :: Reinstall ####"); // Close com port Bixolon.CloseFpCtrl(); // Open com port if (Bixolon.OpenFpCtrl(comPort)) { WriteToTrace("Reinstall :: Com port " + comPort + " reopened"); return(true); } else { WriteToTrace("Reinstall :: Com port" + comPort + " not opened"); if (!Bixolon.CheckFPrinter()) { PStatus = Bixolon.GetPrinterStatus(); WriteToTrace("Install :: Error, printer status error code: " + PStatus.PrinterErrorCode); WriteToTrace("Install :: Error, printer status error description " + PStatus.PrinterErrorDescription); return(false); } return(false); } }