Revision 1441 trunk/code/projects/hunter_prey/testbench/main.c
| main.c (revision 1441) | ||
|---|---|---|
| 20 | 20 |
|
| 21 | 21 |
#include <stdlib.h> |
| 22 | 22 |
#include <stdio.h> |
| 23 |
#include <time.h> |
|
| 24 |
#include <wl_basic.h> |
|
| 23 |
#include <unistd.h> |
|
| 24 |
#include "../../libwireless/lib/wl_basic.h" |
|
| 25 | 25 |
#include "../../libwireless/lib/wireless.h" |
| 26 | 26 |
#include "hunter_prey.h" |
| 27 | 27 |
|
| ... | ... | |
| 71 | 71 |
wl_basic_send_global_packet(TYPE, send_buffer, 2); |
| 72 | 72 |
|
| 73 | 73 |
// Wait for an ACK |
| 74 |
delay_ms(800); // wait for 800 ms before sending ACK |
|
| 74 |
usleep(800000); // wait for 800 ms before sending ACK |
|
| 75 | 75 |
packet_data = wl_basic_do_default(&data_length); |
| 76 | 76 |
|
| 77 | 77 |
// Check ACK for presence and correctness |
| ... | ... | |
| 90 | 90 |
if (data_length >= 2 && packet_data[0] == HUNTER_PREY_ACTION_TAG) |
| 91 | 91 |
{
|
| 92 | 92 |
// wait before sending ACK back |
| 93 |
delay_ms(900); |
|
| 93 |
usleep(900000); |
|
| 94 | 94 |
|
| 95 | 95 |
if (wl_basic_do_default(&data_length)) |
| 96 | 96 |
printf("FAILED\n");
|
| ... | ... | |
| 115 | 115 |
|
| 116 | 116 |
if (data_length >= 2 && packet_data[0] == HUNTER_PREY_ACTION_TAG) |
| 117 | 117 |
{
|
| 118 |
delay_ms(5000); // wait 5 seconds to see if they TAG again |
|
| 118 |
usleep(5000000); // wait 5 seconds to see if they TAG again |
|
| 119 | 119 |
|
| 120 | 120 |
if (wl_basic_do_default(&data_length)) |
| 121 | 121 |
printf("FAILED\n");
|
Also available in: Unified diff