private void SendSFormatPdu() { var requestAPdu = new APdu(0, receiveSequenceNumber, APdu.ApciType.S_FORMAT, null); requestAPdu.Encode(buffer, settings); writer.Write(buffer, 0, 6); writer.Flush(); acknowledgedReceiveSequenceNumber = receiveSequenceNumber; ResetMaxIdleTimeTimer(); }
public void Send(ASdu aSdu) { acknowledgedReceiveSequenceNumber = receiveSequenceNumber; var requestAPdu = new APdu(sendSequenceNumber, receiveSequenceNumber, APdu.ApciType.FORMAT, aSdu); sendSequenceNumber = (sendSequenceNumber + 1)%32768; if (maxTimeNoAckSentFuture != null) { maxTimeNoAckSentFuture.Cancel(); maxTimeNoAckSentFuture = null; } if (maxTimeNoAckReceivedFuture == null) { ScheduleMaxTimeNoAckReceivedFuture(); } var length = requestAPdu.Encode(buffer, settings); writer.Write(buffer, 0, length); writer.Flush(); ResetMaxIdleTimeTimer(); }