In test VS2017 these days, for the operation of the serial port using CSerial class. There are two types of serial port is hanged on computer, one kind is CH340, one kind is the CDC virtual serial port, similar ATMEL debugger, edbug virtual port.
Through a serial port assistant test, can normal send and receive data. Cross sent (CH340, edebug virtual port). There is no problem. A serial port is no problem.
Use VS2017 compiled software testing, the use of two CH340 serial port, two for the hair, there is no problem, it can be seen that the software is ok.
But using this software, open the above edbug Virtual port, step through, can be opened, can enter the send function, writefile, but there is no data.
And I can't again to send function.
In this case, if using the debug aides open the virtual port, you can see the data sent to and from the phenomenon, the data seems to be in the buffer of the serial port, but don't understand why the data in VS2017.
Online to find a lot of serial port access to relevant information, but did not encounter this kind of problem.
Trouble warrior.
thank you
CodePudding user response:
GetCommState see if there is a handshake protocol?Good DCB SetCommState structure
CodePudding user response:
Check the writefile return valuesVS2017 bring Cserial?
But many online Cserial this name,
CodePudding user response:
Some class has a serial port can not be opened more than 10 serial interface bug, checkCodePudding user response:
Thank you, this problem has not been solved, in c #, behind can be normal use.Because of copyright issues, cannot use MFC, so turn to c #.
CodePudding user response: