From 110598780b96829a9ee26de26cbca4dd66395b3e Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 16 May 2017 21:02:52 +0200 Subject: [PATCH 1/7] Makefile update (input cleaned) + global makefile --- Makefile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ plane/Makefile | 4 ++-- sgca/Makefile | 8 ++++---- 3 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7eeb330 --- /dev/null +++ b/Makefile @@ -0,0 +1,47 @@ + +default: + @echo "install - will compile and create executables"; + @echo "clean - will remove executables and clean"; + + + +install-sgca: + @echo "(1) Compiling SGCA"; + @make --directory=./sgca > /dev/null; + +install-plane: + @echo "(2) Compiling PLANE"; + @make --directory=./plane > /dev/null; + +link-sgca: + @echo "(3) Linking SGCA executable"; + @ln -fs ./sgca/boot x-sgca; + +link-plane: + @echo "(4) Linking PLANE executable"; + @ln -fs ./plane/boot x-plane; + +link-viewTerm: + @echo "(4) Linking VIEW TERMINAL executable"; + @echo -e "#!/bin/bash\n\njava -jar ./viewTerm/viewTerm.jar;\n" > ./x-viewTerm; + @chmod ug+x ./x-viewTerm; + +link-ctrlTerm: + @echo "(5) Linking CTRL TERMINAL executable"; + @echo -e "#!/bin/bash\n\njava -jar ./ctrlTerm/commandTerm.jar;\n" > ./x-ctrlTerm; + @chmod ug+x ./x-ctrlTerm; + + +install: install-sgca install-plane link-sgca link-plane link-viewTerm link-ctrlTerm + @echo; + @echo "*** Executables created:"; + @ls -a . | grep -P "^x-*" | sed 's/^x-/ (*) x-/'; + + +clean: + @find ./x-sgca > /dev/null 2>&1 && rm ./x-sgca || return 0; + @find ./x-plane > /dev/null 2>&1 && rm ./x-plane || return 0; + @find ./x-viewTerm > /dev/null 2>&1 && rm ./x-viewTerm || return 0; + @find ./x-ctrlTerm > /dev/null 2>&1 && rm ./x-ctrlTerm || return 0; + @make clean --directory=./sgca > /dev/null; + @make clean --directory=./plane > /dev/null; \ No newline at end of file diff --git a/plane/Makefile b/plane/Makefile index de56c35..566baf4 100644 --- a/plane/Makefile +++ b/plane/Makefile @@ -23,5 +23,5 @@ all: clean boot # cleans the compiled files clean: - find ./lib/network/**/*.o && rm ./lib/network/**/*.o || return 0; - find boot && rm boot || return 0; + @find ./lib/network/**/*.o >/dev/null 2>&1 && rm ./lib/network/**/*.o || return 0; + @find ./boot >/dev/null 2>&1 && rm ./boot || return 0; diff --git a/sgca/Makefile b/sgca/Makefile index 544119e..284be0c 100644 --- a/sgca/Makefile +++ b/sgca/Makefile @@ -35,7 +35,7 @@ all: clean boot # cleans the compiled files clean: - find lib/network/*.o && rm lib/network/*.o || return 0; - find lib/network/**/*.o && rm lib/network/**/*.o || return 0; - find lib/local/*.o && rm lib/local/*.o || return 0; - find boot && rm boot || return 0; + @find lib/network/*.o >/dev/null 2>&1 && rm lib/network/*.o || return 0; + @find lib/network/**/*.o >/dev/null 2>&1 && rm lib/network/**/*.o || return 0; + @find lib/local/*.o >/dev/null 2>&1 && rm lib/local/*.o || return 0; + @find boot >/dev/null 2>&1 && rm boot || return 0; From 821808a42089485a7e87c2f16597ca0f0e439312 Mon Sep 17 00:00:00 2001 From: SeekDaSky Date: Thu, 18 May 2017 20:24:39 +0200 Subject: [PATCH 2/7] fix compilation --- plane/Makefile | 2 +- sgca/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plane/Makefile b/plane/Makefile index 566baf4..2698714 100644 --- a/plane/Makefile +++ b/plane/Makefile @@ -19,7 +19,7 @@ boot: lib/network/tcp/client.o lib/network/udp/server.o plane.h plane.c # Run full compilation -all: clean boot +all: boot # cleans the compiled files clean: diff --git a/sgca/Makefile b/sgca/Makefile index 284be0c..384e1e9 100644 --- a/sgca/Makefile +++ b/sgca/Makefile @@ -31,7 +31,7 @@ boot: lib/network/common.o lib/network/tcp/server.o lib/network/udp/server.o lib # Run full compilation -all: clean boot +all: boot # cleans the compiled files clean: From c8da1b3ba619053d946f306b0377d5ab7dad4afb Mon Sep 17 00:00:00 2001 From: SeekDaSky Date: Thu, 18 May 2017 20:43:32 +0200 Subject: [PATCH 3/7] ControlTerm - final --- ctrlTerm/commandTerm.jar | Bin 12752 -> 13121 bytes .../src/ControlTerminal/ControlTerminal.java | 8 ++++++-- ctrlTerm/src/ControlTerminal/Plane.java | 2 +- .../src/ControlTerminal/PlaneContainer.java | 18 ++++++++++++++++++ viewTerm/src/ViewTerminal/Plane.java | 2 +- viewTerm/viewTerm.jar | Bin 10210 -> 10210 bytes 6 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ctrlTerm/commandTerm.jar b/ctrlTerm/commandTerm.jar index 562e7b46dc97fd847bd2fca800bd2b94b2a765c1..a4f6a3df90232c789a3c1524731fd04ec533e7e0 100644 GIT binary patch delta 7086 zcmY*;Ra6{Gur2QH5ZoEu2N?nccXtR*(BQ$s;K6Os5L|=X5F7?~m%%MqaEFADn{(D% z_nq7Q(W|QWs;=sf?y6lgHZXf!EmdR`5(Eqk3^wK~kk^og?Hf*(5|_{hnEmqO+dwPkDG z@Q&d#53ad!tAi~KB6w+x5@~icp~i7o1Y6YxX_v5zGJtOWmt1e=VjL2eeX4#@8DxI-Dn%5H=rbvjdzD=}(Qd0|h1)FIT&*sD_>MK8;B zwnSi{^DQbmRcdCYtfT}@T{%$51!fTH3bBV}0qVFY?&G_YGfS$g^LoCnu}*Ku_cXa= zpop`A=H;rxRigwMAdQTIi-+kMmR~CgZsU9ZSwt*#8qn2e0!sjYqZW$E|!YL~Dg6-`O))&+c z#unb`ycMpI^;~IG9qnw>bqT1Ep3{L^UReIjyXw3kFvJdnO1`kEFdaE>YyE5Y0q=7@Xs;^*%%TQ9t>mtVU2R)q)7r(w@Of%{riv<^NOz-2MfKO8G!n2>?w{gFb z_9Wmvm>o2Gnbv?dVpX<%IVXtw)^ponqs8Y3s5??%(mIa^g>l|sWs2%heM(1ebN6?3 zjKx?<5*3q={5cOZ)ct*m4V;GQ9By)u_*p_nv9KXm(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%Y`p8bj7NB{ua ze*wM_LTP!0Y5tTNmH!>)8UIVjh!_gOW`-8i0P{~*`(rN$uD`4Q0l(~r8~^|S diff --git a/ctrlTerm/src/ControlTerminal/ControlTerminal.java b/ctrlTerm/src/ControlTerminal/ControlTerminal.java index fea2a93..a9999ab 100644 --- a/ctrlTerm/src/ControlTerminal/ControlTerminal.java +++ b/ctrlTerm/src/ControlTerminal/ControlTerminal.java @@ -167,7 +167,11 @@ public class ControlTerminal { plane.setSpeed(data); flags = (byte) (flags|0x04); break; - } + default: + System.out.println("Wrong input please retry"); + s.nextLine(); + break; + } }catch(Exception e){ System.out.println("Wrong input please retry"); s.nextLine(); @@ -180,7 +184,7 @@ public class ControlTerminal { break; } } - System.out.println("flags: "+flags); + container.setExpectedFlags(flags); buf = ByteBuffer.allocate(27); buf.put(flags); buf.put(plane.toBytes()); diff --git a/ctrlTerm/src/ControlTerminal/Plane.java b/ctrlTerm/src/ControlTerminal/Plane.java index a437024..adb19cb 100644 --- a/ctrlTerm/src/ControlTerminal/Plane.java +++ b/ctrlTerm/src/ControlTerminal/Plane.java @@ -98,7 +98,7 @@ public class Plane{ case 4: if(this.isDead){ return "\033[4;37;41m ATTENTION: avion hors ligne\t|\033[0m"; - }else if(this.speed<50){ + }else if(this.speed<300){ return "\033[5;37;41m --Speed: "+this.speed+"\t\t\t|\033[0m"; }else{ return "\033[0m --Speed: "+this.speed+"\t\t\t|"; diff --git a/ctrlTerm/src/ControlTerminal/PlaneContainer.java b/ctrlTerm/src/ControlTerminal/PlaneContainer.java index fdbb4b4..ba82d67 100644 --- a/ctrlTerm/src/ControlTerminal/PlaneContainer.java +++ b/ctrlTerm/src/ControlTerminal/PlaneContainer.java @@ -12,6 +12,7 @@ public class PlaneContainer { private HashMap map; private AsynchronousDatagramSocket socket; private Printer printer; + private byte expectedFlags = 0x01; public PlaneContainer(){ this.map = new HashMap(); @@ -25,6 +26,10 @@ public class PlaneContainer { this.printer = p; } + public void setExpectedFlags(byte flags){ + this.expectedFlags = flags; + } + public void notifyReceive() throws InvalidFlagException{ DatagramPacket packet = this.socket.synchronousReceive(); @@ -41,6 +46,19 @@ public class PlaneContainer { //System.out.println("Processing "+nbrPlane+" planes"); + if(this.expectedFlags != flag){ + System.out.println("\033[5;37;41m Plane could not apply data \033[0m"); + if((flag&(byte)0x10) == 1){ + System.out.println("\033[5;37;41m Plane crashed gracefully \033[0m"); + } + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + if(flag == 0){ //this is a ping response return; diff --git a/viewTerm/src/ViewTerminal/Plane.java b/viewTerm/src/ViewTerminal/Plane.java index 0e11ede..00579a6 100644 --- a/viewTerm/src/ViewTerminal/Plane.java +++ b/viewTerm/src/ViewTerminal/Plane.java @@ -95,7 +95,7 @@ public class Plane { case 4: if(this.isDead){ return "\033[4;37;41m ATTENTION: avion hors ligne\t|\033[0m"; - }else if(this.speed<50){ + }else if(this.speed<300){ return "\033[5;37;41m --Speed: "+this.speed+"\t\t\t|\033[0m"; }else{ return "\033[0m --Speed: "+this.speed+"\t\t\t|"; diff --git a/viewTerm/viewTerm.jar b/viewTerm/viewTerm.jar index 5dafac4bbe05a96a20f145b11687d99b7a57167c..0c8f5a6c46ebdec9cec5078cde7c3af2ceb5d685 100644 GIT binary patch delta 1318 zcmV+>1=;%IPvTDuP)h>@6aWYa2mq&Tkqoo~lWnoW)&l~QZL^vLBnASLZIi$XDFTyi zv+D{61pu6I}T!*f# z3p(1-A<(&G70l(`olUcxe=#=mQdBW({b(hrM@8SqEw2c5T8kDR61`(cD#vneQI3|uB+Y?)#D0sX09(ea<^i412n#>DjujD zo1UCyDq2>}FliUu0B%sFQvdVwgZ8c0={&z{<#T2^fR6;aA{&#le^;-~PEPE^S^P{q zh&jyjCMMastz!{)2-+x>%mU%1+-h@b$WB3+_oxh-rtNXC`#L^Gg49-vYFPje8W673 z5dv7D6CK$Y-ywwy#bP;EnTdbL5k6s@M|5u7igJ=PLr0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UFMJ3q2GuF|wgTL9d2(_}J>#;75S1^BPoX4QdEV>w<<3X~i{Y z(t1ZjC(bD7TCob|>fY|Qe_2i&+j$|Xm@)DjM%m)NJ?O3OSQQ05E2nEjlKnZex+E&n zlNfQUiN8``5Oz^2L{f-Pg)}Oiw<0>;M5;cuDF-)Y@3HK01vxXvK9U?pgV)Sq|Vs1!p5$e^YZ;ugy(O?8aIA zY&?j0Eb=DmY~9kZjN1flluBlS@RDw|IW=UbAk4c|231w}IoLf7A0a_%t3|mifcs4d zlXZju*62h>w#Ii!;Zm_!&Q@mQ-*SYH8RsFL8@HmIBu&%NrH1$AySTa^0Bw|3k7txP z18u~WChZI9^zv#tf3>zc8#i8B#X@|iSgyqLR<2;G`|KIO6FNDOt?9Z)GATBUV?8BF ztWmCeuHcNFtFdBR0i9>XQqZ|xH8Nk^H%j)Q4XzjW${F*vB|74;jDEx&O%b}p`z-Yig+Fjve~XZQf4PRRK3GGa9<5X$IydI2t!9NF4C&IG7XIl z1Hxi_MOZALO;{|!BPxMQA76L* zSplBW^F2L3h2{>p^sg}ZE9N&tAH2l^-}NIbh3?Sn2&n@xvC?W{RZjFB;X!DfCiq@7 z*%7use`$7jBpsqWQI8}Me4$OYV%?KJ+BjQsZH(7`)*R$n(?mT;$lx!OM`)a(GX^}Q zN~P&@wn01f2zRiF=Xio2@D#7fI)s5Y*v4Zc)7Y|rQa0#Hi_2;&#FNpS=K051vv4FFI}0|XQR2nYxOGh?%B8|4QArDC&E zBbNaJv160#B!L2@Vv}wqQv#)8lfxxj0;OV;ASO8irDBs?CPo6KVw0mLOAV!Bq)Ou# cwn=dW001wO`zAR8Gh>rBCrtvSVv~g@U3{8WKmY&$ From 4636c79334bafa8b7a06e8a5e411c38ebe84d95c Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 19 May 2017 08:49:05 +0200 Subject: [PATCH 4/7] fixed socket reference conflicts in vTerm+cTerm as in plane --- sgca/lib/local/handler.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/sgca/lib/local/handler.c b/sgca/lib/local/handler.c index 0d06a80..865fd5a 100644 --- a/sgca/lib/local/handler.c +++ b/sgca/lib/local/handler.c @@ -215,9 +215,11 @@ void* manageViewTerm(void* THREADABLE_ARGS){ int sent; // compteurs d'envoi int i, index = -1; // Compteurs globaux char* buffer = malloc(1); // Buffer d'envoi + int SOCKET; /* 2. On récupère les arguments */ struct handler_arg* arg = THREADABLE_ARGS; + memcpy(&SOCKET, &arg->socket, sizeof(int)); /* 3. On récupère le rang dans les "managers" */ for( i = 0 ; i < MAX_UDP_THR ; i++ ) @@ -228,7 +230,7 @@ void* manageViewTerm(void* THREADABLE_ARGS){ /* 4. Attente d'un client */ len = sizeof(struct sockaddr_in); - if( recvfrom(arg->socket, buffer, MAX_BUF_LEN*sizeof(char), 0, (struct sockaddr*) &clientInfo, &len) < 0 ){ + if( recvfrom(SOCKET, buffer, MAX_BUF_LEN*sizeof(char), 0, (struct sockaddr*) &clientInfo, &len) < 0 ){ printf("{udp_vterm}{com}(%d) No terminal detected, exiting\n", index); loop = 0; } @@ -248,7 +250,7 @@ void* manageViewTerm(void* THREADABLE_ARGS){ =========================================================*/ /* 2. Envoi */ len = sizeof(struct sockaddr_in); - sent = sendto(arg->socket, buffer, buflen + 1, 0, (struct sockaddr*) &clientInfo, len); + sent = sendto(SOCKET, buffer, buflen + 1, 0, (struct sockaddr*) &clientInfo, len); /* 3. Gestion erreur */ if( sent <= 0 ){ @@ -261,7 +263,7 @@ void* manageViewTerm(void* THREADABLE_ARGS){ =========================================================*/ /* 1. Réception feedback (0x10) */ len = sizeof(struct sockaddr_in); - sent = recvfrom(arg->socket, buffer, 1, 0, (struct sockaddr*) &clientInfo, &len); + sent = recvfrom(SOCKET, buffer, 1, 0, (struct sockaddr*) &clientInfo, &len); /* 2. Gestion erreur (erreur ou mauvais feedback != 0x10) */ if( sent <= 0 || buffer[0] != TERMREQ_OFF ){ @@ -284,7 +286,7 @@ void* manageViewTerm(void* THREADABLE_ARGS){ arg->activeUDPManagers[index] = 0; /* 2. On ferme la socket + libère la mémoire */ - close(arg->socket); + close(SOCKET); free(buffer); @@ -331,10 +333,13 @@ void* manageCtrlTerm(void* THREADABLE_ARGS){ char* dataBuffer = malloc(1); struct term_req request; // Requête char flags; + int SOCKET; + struct in_addr* ip = malloc(sizeof(struct in_addr)); /* 2. On récupère les arguments */ struct handler_arg* arg = THREADABLE_ARGS; + memcpy(&SOCKET, &arg->socket, sizeof(int)); /* 3. On récupère le rang dans les "managers" */ for( i = 0 ; i < MAX_UDP_THR ; i++ ) @@ -344,11 +349,16 @@ void* manageCtrlTerm(void* THREADABLE_ARGS){ /* 4. Attente d'un client */ len = sizeof(struct sockaddr_in); - if( recvfrom(arg->socket, buffer, MAX_BUF_LEN*sizeof(char), 0, (struct sockaddr*) &clientInfo, &len) < 0 ){ + if( recvfrom(SOCKET, buffer, MAX_BUF_LEN*sizeof(char), 0, (struct sockaddr*) &clientInfo, &len) < 0 ){ printf("{udp_cterm}{com}(%d) No terminal detected, exiting\n", index); loop = 0; - }else - printf("{udp_cterm}{com}(%d) Terminal connected\n", index); + }else{ + ip->s_addr = clientInfo.sin_addr.s_addr; + printf("{udp_cterm}{com}(%d) Terminal connected from %s:%d\n", index, inet_ntoa(*ip), ntohs(clientInfo.sin_port)); + } + + free(ip); + while( loop ){ @@ -360,14 +370,14 @@ void* manageCtrlTerm(void* THREADABLE_ARGS){ /* 1. On lit sur la socket */ len = sizeof(struct sockaddr_in); bzero(buffer, sizeof(char)*MAX_BUF_LEN); - count = recvfrom(arg->socket, buffer, MAX_BUF_LEN, 0, (struct sockaddr*) &clientInfo, &len); + count = recvfrom(SOCKET, buffer, MAX_BUF_LEN, 0, (struct sockaddr*) &clientInfo, &len); /* 2. Si erreur reception */ if( count <= 0 ) // because of timeout or error break; if( count < TERMREQ_LEN ){ - send(arg->socket, "\0\0", sizeof(char)*2, 0); + send(SOCKET, "\0\0", sizeof(char)*2, 0); if( DEBUGMOD&BUF ) printf("{udp_cterm}{com}(%d) Error receiving request\n", index); continue; } @@ -390,7 +400,7 @@ void* manageCtrlTerm(void* THREADABLE_ARGS){ update = ( request.flags&TERMREQ_ALT || request.flags&TERMREQ_CAP || request.flags&TERMREQ_SPD ); fbk = request.flags&TERMREQ_FBK; if( !( update || fbk ) ){ - send(arg->socket, "\x00\0", sizeof(char)*2, 0); + send(SOCKET, "\x00\0", sizeof(char)*2, 0); if( request.flags != 0 ) printf("{udp_cterm}{com}(%d) Invalid flags\n", index); continue; @@ -500,7 +510,7 @@ void* manageCtrlTerm(void* THREADABLE_ARGS){ =========================================================*/ printf("{udp_cterm}{com}(%d) Sending response { flags: %d; n: %d }\n", index, dataBuffer[0], dataBuffer[1]); len = sizeof(struct sockaddr_in); - if( sendto(arg->socket, dataBuffer, dataLen, 0, (struct sockaddr*) &clientInfo, len) < 0 ) + if( sendto(SOCKET, dataBuffer, dataLen, 0, (struct sockaddr*) &clientInfo, len) < 0 ) printf("{udp_cterm}{com}(%d) Cannot answer to terminal\n", index); @@ -514,7 +524,7 @@ void* manageCtrlTerm(void* THREADABLE_ARGS){ arg->activeUDPManagers[index] = 0; /* 2. On ferme la socket */ - close(arg->socket); + close(SOCKET); free(dataBuffer); /* 3. On arrête le THREAD */ From 87509e8efed408a9efe15c09ecc920a3ce6fb527 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 19 May 2017 08:50:44 +0200 Subject: [PATCH 5/7] Fixed Makefile-s --- plane/Makefile | 4 ++-- sgca/Makefile | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plane/Makefile b/plane/Makefile index 2698714..6df6eb2 100644 --- a/plane/Makefile +++ b/plane/Makefile @@ -23,5 +23,5 @@ all: boot # cleans the compiled files clean: - @find ./lib/network/**/*.o >/dev/null 2>&1 && rm ./lib/network/**/*.o || return 0; - @find ./boot >/dev/null 2>&1 && rm ./boot || return 0; + @rm ./lib/network/**/*.o; + @rm ./boot; diff --git a/sgca/Makefile b/sgca/Makefile index 384e1e9..173faad 100644 --- a/sgca/Makefile +++ b/sgca/Makefile @@ -35,7 +35,7 @@ all: boot # cleans the compiled files clean: - @find lib/network/*.o >/dev/null 2>&1 && rm lib/network/*.o || return 0; - @find lib/network/**/*.o >/dev/null 2>&1 && rm lib/network/**/*.o || return 0; - @find lib/local/*.o >/dev/null 2>&1 && rm lib/local/*.o || return 0; - @find boot >/dev/null 2>&1 && rm boot || return 0; + @rm lib/network/*.o; + @rm lib/network/**/*.o; + @rm lib/local/*.o; + @rm boot; From 710a5def490866683d8e9d88e067c2590491ab30 Mon Sep 17 00:00:00 2001 From: SeekDaSky Date: Fri, 19 May 2017 09:35:50 +0200 Subject: [PATCH 6/7] fix --- ctrlTerm/commandTerm.jar | Bin 13121 -> 13254 bytes .../src/ControlTerminal/PlaneContainer.java | 12 +++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ctrlTerm/commandTerm.jar b/ctrlTerm/commandTerm.jar index a4f6a3df90232c789a3c1524731fd04ec533e7e0..6e3fd5632343522086c12ea9830f24b1a903e6a0 100644 GIT binary patch delta 2493 zcmYk8XFMBPAID=vQDRd>wY4Kg!lf#xrnf~jh&?Na)tb?pnlV~?Tw>R1i{7XzqV@`+ zt*u<6_NZ0VsIB_6o)^z^-h9vJKhE#XdGVz>ce=0}q8J!?0nE(I03CfwGJ6aIBZ`uo zCHor{?^S`nNuguP`R}FRViw(b1;O6K#&AiWLb@oVN<0ZP{vz_TQMp&QT^oh6c9dcK zGoAn8pNkF*(qxlxIf1yRnA|+cR~uoA;_7O2YtFc5o>Me6)p1F@Y#$6fVPc3WKu`60 zc;Y>4;~KnLP6XEdM}nvEDFe!KNlX6dzQE>;{*&OAnuC+2pYqMDv;3#lR79ABh|Ewm zCPt&4n5L{RH&`wEJgZ*ZJ(6tAilG1ZLKV_VcopfPegU)svo5$sE&{qYfYBo=+#VBE zJ>E6xpo=DZmypHIE^@Z^__~hH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*fE2 z3-(SF-mRUgv~@O0?f&3~abgkJ-LIBlwF&qWJ}jugz6 zUnq>4c z>Eli4s1S(6wVt;#SKdTtUzW4?yQF%X1$7<~R6%-@3MjC40z(A-;WH#_&MXJoljFtt zDSLz)p&4;4pM7&}g7MiTuo?3ZhH`_qMs68g736%pQPSRfK3qwY2#*4;F5uKg^sR2! z(~wVD@%qhBG&3LDdw23=*4dQCp^{Y6$)?D!+JLVS8Nsn#u+46uU1H@Hn4W zj{hMGx1LCLYonhs6b|f-X^*Qbp7R=~bk9Y~w}KtLHl|oL*PFrb{7*z7N`gYT{(OC8 z=Bx!db-*AL0B@}H?5pM-oj+#%cZ;^?5aVS#nXLijIMZ$D_H_GMAuU9i#4389W_c zk(M8QG(L=~Clixvl zoXa>C4QT!FHdXD45SpgZ&6MB!DbT8j6&;vGpvz&Q6A4_coxzCjaWO`%^mR$DX-X^% zdsq{)Ry9|Rv@lw!wyD49VzZf1!9t-3c}Hb mi(3rvPaFMKg6~zl?fs=&I}8A5{M!hqS0Q3`&hSnhZ2t=*F>s>* diff --git a/ctrlTerm/src/ControlTerminal/PlaneContainer.java b/ctrlTerm/src/ControlTerminal/PlaneContainer.java index ba82d67..60bb4a3 100644 --- a/ctrlTerm/src/ControlTerminal/PlaneContainer.java +++ b/ctrlTerm/src/ControlTerminal/PlaneContainer.java @@ -47,11 +47,21 @@ public class PlaneContainer { //System.out.println("Processing "+nbrPlane+" planes"); if(this.expectedFlags != flag){ - System.out.println("\033[5;37;41m Plane could not apply data \033[0m"); + if((this.expectedFlags&(byte)0x02) == 2 && (flag&(byte)0x02) != 2){ + System.out.println("\033[5;37;41m Could not apply cap \033[0m"); + } + if((this.expectedFlags&(byte)0x04) == 4 && (flag&(byte)0x04) != 4){ + System.out.println("\033[5;37;41m Could not apply speed \033[0m"); + } + if((this.expectedFlags&(byte)0x08) == 8 && (flag&(byte)0x08) != 8){ + System.out.println("\033[5;37;41m Could not apply alt \033[0m"); + } + System.out.println("\033[5;37;41m One or more fields could not be updated \033[0m"); if((flag&(byte)0x10) == 1){ System.out.println("\033[5;37;41m Plane crashed gracefully \033[0m"); } try { + this.expectedFlags = 0x01; Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block From 2d176987ea2f51048a8ad96c8979c84167a00a16 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 19 May 2017 09:45:15 +0200 Subject: [PATCH 7/7] last fix std99 --- plane/plane.c | 3 ++- sgca/central-manager.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plane/plane.c b/plane/plane.c index 586efad..159d624 100644 --- a/plane/plane.c +++ b/plane/plane.c @@ -378,4 +378,5 @@ int main(){ // on se déplace une fois toutes les initialisations faites printf("\n=== COMMUNICATION PROTOCOL ===\n"); update(); -} \ No newline at end of file + return EXIT_SUCCESS; +} diff --git a/sgca/central-manager.c b/sgca/central-manager.c index 36a5951..ea7d595 100644 --- a/sgca/central-manager.c +++ b/sgca/central-manager.c @@ -76,7 +76,8 @@ int main(int argc, char* argv[]){ /* [2] On attends la fin de tous les THREADS ==========================================================*/ - for( char i = 0 ; i < 4 ; i++ ) + char i; + for( i = 0 ; i < 4 ; i++ ) pthread_join(listenManagers[(int)i], NULL); @@ -452,4 +453,4 @@ void* MCAST_PUBLISH(void* THREADABLE_ARGS){ close(SOCKET); return NULL; -} \ No newline at end of file +}