public bool OpenRs232(string readerName) { BaseConnect = new ConnectedTypeSerial(); BaseConnect.ReceivedCombineMethod(new delegateMessageReceived(this.SortMessage)); if (BaseConnect.Connected(readerName)) { this.ReaderName = readerName; BaseConnect.isConnected = true; LinkStatus = true; return(true); } else { this.Close(); return(false); } }
public bool Close() { try { if (BaseConnect != null) { LinkStatus = false; BaseConnect.isConnected = false; BaseConnect.Closed(); BaseConnect.RececivedRemoveMethod(new delegateMessageReceived(this.SortMessage)); BaseConnect = null; return(true); } } catch { } return(false); }