private AckResponse InternalSendRequest(EnqRequest request) { int getValueLength = 0; string getstring = null; var bytes = request.GetBytes(); socket.Receive(getbyte, 0 , getbyte.Length, SocketFlags.None); getValueLength = byteArrayDefrag(getbyte); getstring = Encoding.UTF7.GetString(getbyte, 0 , getValueLength + 1); //this._port.Write(bytes, 0, bytes.Length); //Thread.VolatileWrite(ref this._lastResponse, null); this._lastResponse = getbyte; //this._ar.WaitOne(SecondsToWait); if (this._lastResponse == null) { throw new Exception("Cannot connect to port!"); } return((AckResponse)this._lastResponse); }
public void ResetFaults() { var request = new EnqRequest(); request.Ident = Identifiers.ResetFaults; var response = this.InternalSendRequest(request); this.CheckAck(response); }
public void SendMessage(Message message) { var request = new EnqRequest(); request.Ident = Identifiers.TransmitNonLibraryMessage; request.Data = message.GetBytes(); var response = this.InternalSendRequest(request); this.CheckAck(response); }
public void ShortShutDown() { var request = new EnqRequest(); request.Ident = Identifiers.Power; request.Data = new byte[] { 0x01 }; var response = this.InternalSendRequest(request); this.CheckAck(response); }
public void SendPartialMessage(PartialMessage message) { var request = new EnqRequest(); request.Ident = Identifiers.TransmitPartialMessage; request.Data = message.GetBytes(); var response = this.InternalSendRequest(request); this.CheckAck(response); }
public PrinterFaults RequestPrinterFaults() { var request = new EnqRequest(); request.Ident = Identifiers.RequestPrinterFaults; var response = this.InternalSendRequest(request); this.CheckAck(response); return(new PrinterFaults(response.Data)); }
public InkInfo RequestInkInfo() { var request = new EnqRequest(); request.Ident = Identifiers.RequestInkCircuitSolenoidValve; var response = this.InternalSendRequest(request); this.CheckAck(response); return(new InkInfo(response.Data)); }
public void TransmitMessageToPrint(byte headNumber, byte messageNumber) { var request = new EnqRequest(); request.Ident = Identifiers.TransmitMessageNumber; request.Data = new byte[] { headNumber, 0x00, messageNumber }; var response = this.InternalSendRequest(request); this.CheckAck(response); }
private AckResponse InternalSendRequest(EnqRequest request) { var bytes = request.GetBytes(); this._port.Write(bytes, 0, bytes.Length); Thread.VolatileWrite(ref this._lastResponse, null); this._ar.WaitOne(SecondsToWait); if (this._lastResponse == null) { throw new Exception("Cannot connect to port!"); } return((AckResponse)this._lastResponse); }
private AckResponse InternalSendRequest(EnqRequest request) { var bytes = request.GetBytes(); this._port.Write(bytes, 0, bytes.Length); Thread.VolatileWrite(ref this._lastResponse, null); this._ar.WaitOne(SecondsToWait); if (this._lastResponse == null) { throw new Exception("Cannot connect to port!"); } return (AckResponse)this._lastResponse; }
public PrinterFaults RequestPrinterFaults() { var request = new EnqRequest(); request.Ident = Identifiers.RequestPrinterFaults; var response = this.InternalSendRequest(request); this.CheckAck(response); return new PrinterFaults(response.Data); }
public InkInfo RequestInkInfo() { var request = new EnqRequest(); request.Ident = Identifiers.RequestInkCircuitSolenoidValve; var response = this.InternalSendRequest(request); this.CheckAck(response); return new InkInfo(response.Data); }