Friend, I guess you didn’t understand my question, maybe because of my english.
This is not a valid packet;
78 78 1f 12 11 02 0d 0a
This is a valid one;
78 78 1f 12 11 02 0d 0a 04 1e c9 01 c5 3d 4a 05 4d b6 8c 00 38 14 02 d4 06 0c 5a 00 7a 79 00 12 ff 0e 0d 0a
Explaining the packet;
7878 = beginning
1f 12 11 02 0d 0a 04 1e c9 01 c5 3d 4a 05 4d b6 8c 00 38 14 02 d4 06 0c 5a 00 7a 79 00 12 = data
ff 0e = crc16 checksum
0d0a = end
If you put 1f1211020d0a041ec901c53d4a054db68c00381402d4060c5a007a790012 in any crc16 calc tool, you’ll see it’s a valid packet, so that packages could have 0d0a inside the data, because data is not converted into string as the end of the packet is.
If you put it into this tool, select HEX and click “Calc CRC-16”, you will see that the checksum matches the CRC-16/X-25 result;
http://crccalc.com/
[EDIT]
PS. I have all of this working for 6 years in a Delphi service application, and it works. If there is any way to get if there’s nothing after “0d0a”… That would be a way to know this is the packet end.
Tnx.