[PD] pd and serial object

Winfried Ritsch ritsch at iem.kug.ac.at
Thu Apr 25 12:04:57 CEST 2002


 > in mail http://iem.kug.ac.at/mailinglists/pd-list/2001-12/0159.html
 > from mark newman seems to be a solution for the win2k comport
 > object:
 > //////////////////////////////////////////////////////////////
 >  I grabbed Winfried Ritsch's comport object and code from
 >  http://iem.kug.ac.at/ritsch/programmier/pd_externals/

 >     fd = CreateFile( sys_com_port[com_nr],
 >              rw,
 >              0,
 >              0,
 >              OPEN_EXISTING,
 >              /* FILE_FLAG_OVERLAPPED */ 0, // changed to non-overlapped
 > --mwn
 >              0);
 >   ... and now it works. I believe this is the correct way to open the
 > port, since the code is in fact polling (every millisecond, by default)
 > and not in fact using asynchronous reads. Changing the object to use
 > overlapped/asynchronous reads would probably be an even better fix, but
 > that'll have to be for another time.

the problem I saw (read), that there is no garantuee that with this
fix the serial will not block for a amount of time (like it does on
W95 up to 10ms if I set this) since "no overlap" means in my opinion
that it waits for a input until time out (at least a win scheduler
tick), but maybe it is correct anyway...

can anyone confirm if "overlap" is not needed on Win platforms for i/o?

I have no w2k plattform to test, just want to release a working version.


		  mfg winfried

More information about the Pd-list mailing list