.
- . - :
<ID><SIZE><DATA....><CHECKSUM>
, SIZE, ( 1000 115200, ).
, , ( ), #, ( ). 2- , TimeOutException ( ), , 1 ( 5 ). , , SerialPort.Read().
, ErrorReceived, , -...
Regarding Array.Resize (), I wrote this if the SerialPort.Read () returned data has fewer bytes than expected. The buffer is predefined at the maximum size of my SerialPort buffer (4096). As for my second error in the code, you are quite right. I should use a more appropriate exception :)
source
share