Hi Mark,
I was able to get TFTP to transfer a file to the PC when I enabled the TEST_TFTP using the simulator. Thanks.
However, I could not send a file to the NE64 until I made two changes in the code:
1. In file tftp.c, function fnGetFileMode(), I had to change !uStrEquiv(cOctet, Data) to uStrEquiv(cOctet, Data). The code is looking for a match in the TFTP transfer mode and the logic was reversed. Once I made the change, I could get a bit further so that TFTP transfer could be initiated.
2. In file tftp.c, function fnTFTPListner(), the line:
else if (!(ucTFTP_state & TFTP_STATE_CLIENT) && (!uMemcpy(ucIP, cucBroadcast, IPV4_LENGTH))) {
had to be changed to :
else if (!(ucTFTP_state & TFTP_STATE_CLIENT) && (!uMemcmp(ucIP, cucBroadcast, IPV4_LENGTH))) {
It lookse like the original call to uMemcpy should have been Memcmp. The comment was "// server not allowed to accept a broadcast address" so it seems you would want to do a mem compare rather than a mem copy.
Once I made those changes I could send a file and verify it was recieved by connecting via FTP and getting a directory listing. Are these correct changes?
Now that I see TFTP working, I am a bit unclear on how one would enable this for application use. The define for TEST_TFTP suggests that this is only used for testing the TFTP functionality.
For application use, would one simply call fnStartTFTP_client() at start up (or maybe at some user initiated prompt during runtime) to activate the TFTP functionality?
Also, there would probably have to be some way to set and save the TFTP server IP at runtime as hard coding it at compile time would likely impose an unacceptable constraint for most applications. This should be simple enough for me to do via a webpage.
Jamie