#include #include "../../src/definitions.h" #include "../../src/robot.h" #include #define NB_TEST 50 #define NB_RETRIES_MAX 5 #define DELAY_BETWEEN_RETRIES 10000 // 10 ms #define DELAY_BETWEEN_TEST 1000000 // 1 seconde int nb_retries; int nb_test; int laststatus; int nb_success; int nb_timeout; int nb_unknown_cmd; int flipflop; int main() { if (open_communication_robot("/dev/ttyUSB0") != 0) { std::cout << "Unable to open com port" << std::endl; return -1; } std::cout << "Debut du test de stress" << std::endl; time_t t_debut, t_fin; struct tm *tm_debut, *tm_fin; time(&t_debut); tm_debut = (struct tm*)malloc (sizeof(struct tm)); tm_debut = localtime((const time_t*)&t_debut); std::cout << "[heure debut]: " << asctime(tm_debut) << std::endl; nb_retries=-1; do { usleep(DELAY_BETWEEN_RETRIES); nb_retries++; laststatus = send_command_to_robot(DMB_START_WITHOUT_WD); } while ((nb_retries