Made the file size configurable.
This commit is contained in:
parent
ddd245ed15
commit
3f72907b41
1 changed files with 9 additions and 1 deletions
|
@ -50,6 +50,10 @@
|
||||||
#define SINK_ID 1
|
#define SINK_ID 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef FILE_SIZE
|
||||||
|
#define FILE_SIZE 1000
|
||||||
|
#endif
|
||||||
|
|
||||||
PROCESS(deluge_test_process, "Deluge test process");
|
PROCESS(deluge_test_process, "Deluge test process");
|
||||||
AUTOSTART_PROCESSES(&deluge_test_process);
|
AUTOSTART_PROCESSES(&deluge_test_process);
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -77,9 +81,13 @@ PROCESS_THREAD(deluge_test_process, ev, data)
|
||||||
cfs_close(fd);
|
cfs_close(fd);
|
||||||
process_exit(NULL);
|
process_exit(NULL);
|
||||||
}
|
}
|
||||||
cfs_close(fd);
|
|
||||||
|
if(cfs_seek(fd, FILE_SIZE, CFS_SEEK_SET) != FILE_SIZE) {
|
||||||
|
printf("failed to seek to the end\n");
|
||||||
|
}
|
||||||
|
|
||||||
deluge_disseminate("test", node_id == SINK_ID);
|
deluge_disseminate("test", node_id == SINK_ID);
|
||||||
|
cfs_close(fd);
|
||||||
|
|
||||||
etimer_set(&et, CLOCK_SECOND * 5);
|
etimer_set(&et, CLOCK_SECOND * 5);
|
||||||
for(;;) {
|
for(;;) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue