minhtham Posted September 27, 2016 Share Posted September 27, 2016 I'm trying to read data from a device has a problem with myprotocol. is how to get all the data received from the buffer RX: 002+address+indeex+data+003+2 byte check because no fixed number of data bytes that can not use the READ (number of bytes) nor use readuntil () because it undefined 2byte check How get the data of "RX" including the 2 byte check Link to comment Share on other sites More sharing options...
AzeoTech Posted September 28, 2016 Share Posted September 28, 2016 Actually you can use ReadUntil(): readUntil(3). Then do a second read(2) to read the last 2 bytes after the end of line marker. This only works if there are no 003 in the read of the packet. I'm assuming this is an ASCII packet? Link to comment Share on other sites More sharing options...
minhtham Posted September 28, 2016 Author Share Posted September 28, 2016 ok. thank for your help ! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.