HdlcFrameGetNext(ByteBuffer, Int32) Method
Returns the next frame of type 3 from the start of rawData. The terminating flag could not be returned if
multiple frames are linked together. Procedure skips any starting bytes before starting flag (7E).
Namespace: OddPrg.Protocols.HdlcAssembly: OddPrg.Frames.Hdlc (in OddPrg.Frames.Hdlc.dll) Version: 1.0.0.2 (1.0.0.2)
public static ByteBuffer GetNext(
ByteBuffer rawData,
out int startIndex
)
- rawData ByteBuffer
- Data received from a server (meter).
- startIndex Int32
- Returns the starting index of the frame in rawData. The index is valid only if procedure retuns non-null value.
ByteBuffer
Returns a HDLC frame from the beginning of data. If data does not start with a valid HDLC frame, it returns null.
Valid HDLC frame means:
1) It starts with STARTING_FLAG
2) It has the minimal length of 3 bytes to check starting flag and frame format
3) It has the frame format of type 3
4) The length from frame format field matches the length of the frame
5) It ends with STARTING_FLAG