Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@Oldfart This is just a simulation system. If required by reliability, I can tolerate any wireless part of this system being replaced by a wired solution.
I just used the function as an official example but ignored what it actually did. Also thanks for your three issues, I may have made more mistakes due to them.
@Tut: Yes, I did't notice that this function doesn't use Buf nor Len. I thought it is an official example, but ignored the data comes from USART, not Buf.
@bitsmack: yes, the number is correct. But it's only correct with the times I call VCP_DataTx(). If I call that function for 10 times, and transmit 6 bytes every time I call it, I get 10 0x00's rather than 60.