Write() public method

Writes P-DATA-TF to PDU buffer
public Write ( ) : RawPDU
return RawPDU
Beispiel #1
0
 private void WritePDU(bool last)
 {
     if (_pdu.PDVs.Count == 0 || ((CurrentPduSize() + 6) < _max && GetBufferLength() > 0))
     {
         CreatePDV();
     }
     if (_pdu.PDVs.Count > 0)
     {
         if (last)
         {
             _pdu.PDVs[_pdu.PDVs.Count - 1].IsLastFragment = true;
         }
         RawPDU raw = _pdu.Write();
         raw.WritePDU(_network);
         if (OnPduSent != null)
         {
             OnPduSent();
         }
         _pdu = new PDataTF();
     }
 }