@@ -30,10 +30,10 @@ public class DeleteObjectResponse : IS7pResponse
3030 public uint IntegrityId { get ; set ; }
3131 public bool WithIntegrityId { get ; set ; }
3232
33- public DeleteObjectResponse ( byte protocolVersion )
33+ public DeleteObjectResponse ( byte protocolVersion , bool withIntegrityId )
3434 {
3535 ProtocolVersion = protocolVersion ;
36- WithIntegrityId = false ;
36+ WithIntegrityId = withIntegrityId ; // When deleting the Sesssion Object-Id, there's no Integrity-Id!
3737 }
3838
3939 public int Deserialize ( Stream buffer )
@@ -52,7 +52,11 @@ public int Deserialize(Stream buffer)
5252 PObject errorObject = new PObject ( ) ;
5353 ret += S7p . DecodeObject ( buffer , ref errorObject ) ;
5454 }
55-
55+ if ( WithIntegrityId )
56+ {
57+ ret += S7p . DecodeUInt32Vlq ( buffer , out uint iid ) ;
58+ IntegrityId = iid ;
59+ }
5660 return ret ;
5761 }
5862
@@ -71,7 +75,7 @@ public override string ToString()
7175 return s ;
7276 }
7377
74- public static DeleteObjectResponse DeserializeFromPdu ( Stream pdu )
78+ public static DeleteObjectResponse DeserializeFromPdu ( Stream pdu , bool withIntegrityId )
7579 {
7680 byte protocolVersion ;
7781 byte opcode ;
@@ -91,7 +95,7 @@ public static DeleteObjectResponse DeserializeFromPdu(Stream pdu)
9195 {
9296 return null ;
9397 }
94- DeleteObjectResponse resp = new DeleteObjectResponse ( protocolVersion ) ;
98+ DeleteObjectResponse resp = new DeleteObjectResponse ( protocolVersion , withIntegrityId ) ;
9599 resp . Deserialize ( pdu ) ;
96100
97101 return resp ;
0 commit comments