[Oberon] pcreceive.sh not working for files that are multiples of 255

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Fri Jun 30 12:28:18 CEST 2017

Hi Paul,

Thanks for the quick reply. For some reason, my emails to the Oberon mailing list always take several days to appear there.

I managed to create a workaround, similar to the one you have described below (i.e. I just send another final zero-length "dummy" packet). But I did not really want to meddle with the code in pclink.c. First, it is not my code, and second I do not really understand 100% the part starting with "int pos = (rxcount - fnlen -1) % 256, followed by two cascaded if statements, one with condition pos == 0 and one with condition flen > 255". I would probably have written this in a different way, namely such that it *always* sends a zero-length packet at the end no matter what (after a loop that loops over all non-zero-length packets).

For now I'm fine. But if there is a new version of the emulator, I'm of course a happy taker.
Apart from that, it really works very well! A great piece of work!

Best regards,Andreas

On Friday, June 30, 2017, 12:13:38 PM GMT+2, Paul Reed <paulreed at paddedcell.com> wrote:

Hi Andreas,

>   ./pcreceive filename
> does not seem to work for files whose file size is a multiple of 255.

Thanks very much for pointing this out (it seems your email only emerged
today, even though it looks like you sent it nine days ago).

I just had a quick look, and to me the last half of PCLink_RData in
pclink.c suddenly appears to be utter rubbish - I humbly apologise, it's
obvious (now you point it out) that the PC needs to send (ie, emulate
having sent) a final zero-length (ie 1 byte) packet in these cases.

But I don't like the look of the rest of my code there either, so I think
it needs a really good coat of looking at, as a Mancunian colleague of
mine used to say...

Mea culpa

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20170630/5f3ee371/attachment.html>

More information about the Oberon mailing list