You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing an occasional hangup with my application. I am using the Windows Serial transport on the Client side and my own USB-CDC port on the Server side. Normally, when the Sever is sending a response to a Client request, I see the following:
Sever sends a 4 byte header
Client performs serial read, gets 4 bytes
Server sends the message (16 bytes in this case)
Client performs serial read, gets 16 bytes
All is well, Client moves on
In the error state, I see this:
Server sends a 4 byte header
Server sends the message (16 bytes in this case)
Client performs serial read, gets 20 bytes
Client is now stuck in the 'serial_read' function because it read more than the 4 bytes is was expecting
To fix this, I would propose changing the 'nNumberOfBytesToRead' paremeter in the 'ReadFile' call to use the requested read size as a maximum rather than the Rx buffer size. Here is a screenshot of the fix (line 226):
Thanks in advance! This has been a great application to work with!
The text was updated successfully, but these errors were encountered:
Hello,
I am experiencing an occasional hangup with my application. I am using the Windows Serial transport on the Client side and my own USB-CDC port on the Server side. Normally, when the Sever is sending a response to a Client request, I see the following:
In the error state, I see this:
To fix this, I would propose changing the 'nNumberOfBytesToRead' paremeter in the 'ReadFile' call to use the requested read size as a maximum rather than the Rx buffer size. Here is a screenshot of the fix (line 226):
![image](https://user-images.githubusercontent.com/46002946/119165147-cfa0ac00-ba22-11eb-9689-9aef1fb79422.png)
Thanks in advance! This has been a great application to work with!
The text was updated successfully, but these errors were encountered: