Files
MyrysRover/Code/protocol.c
2026-05-27 06:45:41 +02:00

30 lines
492 B
C

/*
* MYRYS ROVER
* Low level communication protocol
*
* new Wed May 27 03:58.27 AM UTC 2026
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "protocol.h"
int send_a_ping(int code, char *texte, int k)
{
unsigned int foo, bar;
fprintf(stderr, "\tpid %ld is sending \"%s\"\n", (long)getpid(), texte);
foo = 3 + (rand() % 8);
#if DEBUG_LEVEL
fprintf(stderr, "+++ in %s, foo is %u\n", __func__, foo);
#endif
bar = sleep(foo);
return bar;
}