Closed Paulo-D2000 closed 2 years ago
The fact that cbInQue returns 0 means that no data is available to read, and therefore ReadFile will read 0 bytes, what you are describing is correct behaviour. The whole read section is designed to be non-blocking which is why it is written the way it is. It has been heavily tested over many years without any problems so I suggest the problem is elsewhere.
Note that I compile with VS2019 and cannot comment about behaviour with any other version of the Visual C++ family.
Hm strange... I wrote some code that does the same read/write and cbInQue is > 0, while mmvmhost always 0 :/
After commenting some parts of the code and initiailizing some structures now it works... strange....
The line https://github.com/g4klx/MMDVMHost/blob/fe195c4e405867eedc871c6c345257991f42e415/UARTController.cpp#L180 always returns 0, If its bypassed then https://github.com/g4klx/MMDVMHost/blob/fe195c4e405867eedc871c6c345257991f42e415/UARTController.cpp#L188 returns 0 bytes read...
Tested on Python with pyserial the serial.read() returns the correct buffer with mmdvm version and everything...
Win10 Vs2022 MMDVM Discovery