c# - When and how often does the EV_RXCHAR event fire (from WaitCommEvent)? -
i've been digging through reference sources .net serialport , serialstream classes, , have found fire datareceived events waiting on waitcommevent().
the event fires once, when serial port has received amount of data. when event fires, transmission has finished: need read once of data. however, event finishes before data has been received. in case, event fire second time, , can read rest of data then.
this leads me question: when ev_rxchar event fire? after first byte of data received? after data has been received , amount of time has passed without receiving more?
it's explained in more detail in msdn page on communications events:
for example, if specify ev_rxchar event wait-satisfying event, call waitcommevent satisfied if there characters in driver's input buffer have arrived since last call waitcommevent or setcommmask.
so ev_rxchar fire when 1 or more characters arrive. if not read bytes instead call waitcommevent again immediately, wouldn't fire again until more (new) characters arrive.
Comments
Post a Comment