single pipe for several A/C using the xbee sim

This commit is contained in:
Pascal Brisset
2006-08-24 14:51:58 +00:00
parent 561ba82e96
commit 7dc70b48c0
+4
View File
@@ -64,7 +64,11 @@ value sim_init(value unit) {
#ifdef SIM_UART #ifdef SIM_UART
/* open named pipe */ /* open named pipe */
char link_pipe_name[128]; char link_pipe_name[128];
#ifdef SIM_XBEE
sprintf(link_pipe_name, "/tmp/pprz_xbee");
#else
sprintf(link_pipe_name, "/tmp/pprz_link_%d", AC_ID); sprintf(link_pipe_name, "/tmp/pprz_link_%d", AC_ID);
#endif
struct stat st; struct stat st;
if (stat(link_pipe_name, &st)) { if (stat(link_pipe_name, &st)) {
if (mkfifo(link_pipe_name, 0644) == -1) { if (mkfifo(link_pipe_name, 0644) == -1) {