Home > Net >  Extracting caching threads of the cycle in a serial port to send and receive data on how to handle?
Extracting caching threads of the cycle in a serial port to send and receive data on how to handle?

Time:11-22

Want to extract the received serial data byte [], the complete 3 c 0 d end processing, remove, after a few more together with 0 x0d next time, next time dealing with don't know how the
 
0 x3c... 0 x0d 0 x3c... 0 x0d 0 x3c... 0 x0d 0 x3c...

And this method can guarantee data is not lost for a long time? .

CodePudding user response:

The received byte [] in a list or array, and then open a thread to detect this list or array, detect the length is not null, try to get 3 c began to 0 at the end of the d, if successful, then removed from a list or array, if not success will continue to wait
  •  Tags:  
  • C#
  • Related