Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1550 → Rev 1549

/demos/trunk/tftptest/tftptest.c
28,7 → 28,7
{
sys_shutdown_message("Exit from the program...\n");
sys_shutdown_message("Ctrl-C pressed!\n");
exit(1);
sys_end();
}
 
void augprog(KEY_EVT *k)
136,7 → 136,8
cprintf("Net Init from %s to %s\n", LOCAL_HOST_IP, REMOTE_HOST_IP);
} else {
cprintf("Net Init Failed...\n");
exit(1);
sys_end();
return(err);
}
 
sem_init(&m1, 0, 1);
144,7 → 145,8
 
if ((handle = tftp_open("test.txt")) == -1) {
cprintf("No slots available. Program aborted...\n");
exit(1);
sys_end();
return(1);
}
 
cprintf("Ctrl-A to proceed *** Ctrl-C to stop\n");
155,7 → 157,8
 
if ((err = tftp_upload(handle, 4096, &m1)) != 0) {
cprintf("Error %d calling tftp_upload(). Program aborted...\n", err);
exit(1);
sys_end();
return(1);
}
 
/* First we set the sender's task properties...*/
165,11 → 168,13
 
if ((p1 = task_create("test_upload", test_upload, &hard_m, NULL)) == NIL) {
cprintf("Error creating test_upload task. Program aborted...\n");
exit(1);
sys_end();
return(1);
}
if (task_activate(p1) == -1) {
cprintf("Error activating test_upload task. Program aborted...\n");
exit(1);
sys_end();
return(1);
}
 
 
177,7 → 182,8
 
if ((handle2 = tftp_open("test2.txt")) == -1) {
cprintf("No second slot available. Program aborted...\n");
exit(1);
sys_end();
return(1);
}
 
 
186,7 → 192,8
 
if ((err = tftp_upload(handle2, 4096, &m2)) != 0) {
cprintf("Error %d calling tftp_upload(). Program aborted...\n", err);
exit(1);
sys_end();
return(1);
}
 
/* First we set the sender's task properties...*/
196,11 → 203,13
 
if ((p2 = task_create("test_upload2", test_upload2, &hard_m, NULL)) == NIL) {
cprintf("Error creating test_upload2 task. Program aborted...\n");
exit(1);
sys_end();
return(1);
}
if (task_activate(p2) == -1) {
cprintf("Error activating test_upload2 task. Program aborted...\n");
exit(1);
sys_end();
return(1);
}
 
 
211,8 → 220,7
tftp_close(handle2, TFTP_STOP_NOW);
 
cprintf("\nProgram terminated correctly.\n");
sys_end();
 
exit(0);
 
return(0);
}