...
Including µC/TFTPc Stack Source Code
As indicated in the Figure - TFTPc Folder Tree, all the files in the "Source" folder of the µC/TFTPc parent directory must be added to your project tree.
...
\Micrium\Software\uC-TFTPc
...
Copy the file from the µC/TFTPc configuration folder into your application as illustrated below.
Panel | ||
---|---|---|
| ||
Adding µC/TFTPc Example Application Code
...
Note that some sections of the source code have been removed or modified to help focus on the µC/TFTPc module use.
Code Block | ||||
---|---|---|---|---|
| ||||
#define TFTPc_TEST_SERVER_IP "192.168.1.102" #define TFTPc_TEST_SERVER_PORT 69 #define TFTPc_TEST_FILE_NAME_LOCAL "\\file_local" #define TFTPc_TEST_FILE_NAME_REMOTE_GET "file_remote_get" #define TFTPc_TEST_FILE_NAME_REMOTE_PUT "test_remote_put" static void App_TestTFTPc (void) { NET_IP_ADDR ip_server; NET_ERR err_net; TFTPc_ERR err; ip_server = NetASCII_Str_to_IP(TFTPc_TEST_SERVER_IP, /* See Note #1. */ &err_net); if (err_net != NET_ASCII_ERR_NONE) { printf("Error - NetASCII_Str_to_IP: %d\n\r", err_net); return; } TFTPc_Init(&TFTPc_Cfg, &err); /* See Note #2. */ if (err != TFTPc_ERR_NONE) { printf("Error - TFTPc Initialization: %d\n\r", err); return; } (void)TFTPc_Get(DEF_NULL, /*See Note #3. |
...
*/
TFTPc_TEST_FILE_NAME_LOCAL,
TFTPc_TEST_FILE_NAME_REMOTE_GET,
TFTPc_MODE_NETASCII,
&err);
if (err != TFTPc_ERR_NONE) {
printf("Error - TFTPc_Get: %d\n\r", err);
}
(void)TFTPc_Put(DEF_NULL, /*See Note #4. */
TFTPc_TEST_FILE_NAME_LOCAL,
TFTPc_TEST_FILE_NAME_REMOTE_PUT,
TFTPc_MODE_NETASCII,
&err);
if (err != TFTPc_ERR_NONE) {
printf("Error - TFTPc_Put: %d\n\r", err);
}
} |
Panel | ||
---|---|---|
| ||
|