Hi Alex,
On 2009.09.08., at 5:16, Alex Strickland wrote:
Hi Viktor
I have changed a few things here, made it a bit more consistent
(setting queue size and timeouts) and added to your parameter
checking (initialised the port handles to -1). I have changed the
name of the Error() method to ErrorText() (I discovered was an
unfortunate choice). I dropped restoring the parameters, and a few
other small things. It seems to work ok in a small test.
Initialization is better be done dynamically if we want to
avoid consuming a relatively large amount of space in .exe files.
This needs some extra logic. Of course the while thing could
get dynamically allocated COM port structures to really
make it scalable.
Two questions, do you think 256 ports is necessary, it seems a lot,
maybe 32 or 64 would be ok? win_prt.c and win_tprt.prg makes me
think of printer - maybe something like win_comm.c and win_tcom.prg?
256 is the maximum offered by NT systems, so if we don't
to create an artificial Harbour limit, we should support
all of them. COM numbers aren't necessary assigned sequentially,
so it's possible to have a higher numbered one on any systems.
As for the naming, the class name is WIN_PORT, and the API
prefix is also WIN_PORT*() so, while I don't like 'prt' in
the filenames (reminds me of 'printer'), if we do some renaming,
we should do it consistently. Probably WIN_COM*() would be
better overall. Probably not a huge compatibility concern
yet, so maybe we should do it now.
Can I send you the source?
Yes, please do.
Brgds,
Viktor
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour