![]() You increment the end-of-data pointer by 2. So when your program starts, both pointers will be the same. One to the buffer, the other to the end of the data in the buffer. If I understand your question correctly, one way to avoid having to 'post-process' is to move the pointer passed to ReadFile to the end of the available data, so the ReadFile call is appending to the buffer, instead of overwriting.Įssentially, you would have two pointers. Basically I want to avoid to post-process sZBuff to concat '88' and '89\n'. At the next iteration '89\n' is saved into sZBuff. And the command ReadFile saves '88' into szBuff. I send 8889 from the Arduino, which places it in the COM port. My current C code reads the information from the buffer, but there is not an accepted end of line, which implies that my numbers (integers) are received cut. ![]() The goal of my code would be something like num = ReadSerialCOM(hSerial, "%d") ReadFile(hSerial, LPVOID(szBuff), 4,
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |