From 33777c91dc6b7ab89a21b08009ab2aa6d00b33f5 Mon Sep 17 00:00:00 2001 From: skhinach Date: Sun, 28 Apr 2019 16:53:29 +0200 Subject: [PATCH] Test --- Network/Makefile | 2 +- Sioux/Tableau.css | 7 ++++++- Sioux/http.c | 17 +++++++++++++++-- Tangible/#socket.h# | 0 Tangible/ethernet.h | 0 Tangible/socket.c | 0 Tangible/socket.h | 0 Tangible/socket.o | Bin 7408 -> 0 bytes Tangible/spi.h | 0 Tangible/tangibleInterface.hex | 0 Tangible/tangibleInterface.o | Bin 4728 -> 0 bytes Tangible/w5100.c | 0 Tangible/w5100.h | 0 Threads/threadSocket.c | 11 +++-------- bin/serverTCP | Bin 0 -> 46464 bytes bin/sonde | Bin 0 -> 22312 bytes includes/http.h | 0 libs/libnet.a | Bin 0 -> 44024 bytes libs/libthrd.a | Bin 0 -> 30654 bytes src/serverTCP.c | 0 20 files changed, 25 insertions(+), 12 deletions(-) mode change 100644 => 100755 Sioux/Tableau.css mode change 100644 => 100755 Sioux/http.c mode change 100644 => 100755 Tangible/#socket.h# mode change 100644 => 100755 Tangible/ethernet.h mode change 100644 => 100755 Tangible/socket.c mode change 100644 => 100755 Tangible/socket.h mode change 100644 => 100755 Tangible/socket.o mode change 100644 => 100755 Tangible/spi.h mode change 100644 => 100755 Tangible/tangibleInterface.hex mode change 100644 => 100755 Tangible/tangibleInterface.o mode change 100644 => 100755 Tangible/w5100.c mode change 100644 => 100755 Tangible/w5100.h create mode 100755 bin/serverTCP create mode 100755 bin/sonde mode change 100644 => 100755 includes/http.h create mode 100644 libs/libnet.a create mode 100644 libs/libthrd.a mode change 100644 => 100755 src/serverTCP.c diff --git a/Network/Makefile b/Network/Makefile index 1959a1f..969d01a 100755 --- a/Network/Makefile +++ b/Network/Makefile @@ -16,7 +16,7 @@ LDFLAGS=-lpthread -lpcap all: $(LIB) $(LIB): sender.o sniffer.o tcpserver.o - rm -f $@ + rm -f $(LDIR)$@ $(CLIBS) $(LDIR)$@ $^ ranlib $(LDIR)$@ rm -f *.o diff --git a/Sioux/Tableau.css b/Sioux/Tableau.css old mode 100644 new mode 100755 index 0e13066..c4960a0 --- a/Sioux/Tableau.css +++ b/Sioux/Tableau.css @@ -53,7 +53,12 @@ li .etat { - flex-basis: 60%; + flex-basis: 30%; +} + +.commande +{ + flex-basis: 30%; } .no_inter diff --git a/Sioux/http.c b/Sioux/http.c old mode 100644 new mode 100755 index 1ab64c9..1254a07 --- a/Sioux/http.c +++ b/Sioux/http.c @@ -1,5 +1,5 @@ #include "http.h" - +#include void freePage(struct PageWeb** page) { @@ -76,7 +76,7 @@ void createPage(struct PageWeb** page, struct interface_info* interfaces[20]) } strcat((*page)->html_contents,"

Interfaces Tangibles

    "); - strcat((*page)->html_contents,"
  • Interfaces
    Etat
  • "); + strcat((*page)->html_contents,"
  • Interfaces
    Etat
    Commande
  • "); int nbr_interfaces=0; @@ -101,9 +101,22 @@ void createPage(struct PageWeb** page, struct interface_info* interfaces[20]) case(1): strcat((*page)->html_contents,"
\n
Mode Eveillé
\n"); break; + } + if(interfaces[i]->commande>=0) + { + char tmp[10]; + sprintf(tmp, "%d", interfaces[i]->commande); + strcat((*page)->html_contents,"
"); + strcat((*page)->html_contents,tmp); + strcat((*page)->html_contents,"%
\n"); + } + else + { + strcat((*page)->html_contents,"
Inconnu
\n"); } strcat((*page)->html_contents,""); } + } } diff --git a/Tangible/#socket.h# b/Tangible/#socket.h# old mode 100644 new mode 100755 index 2bbc175..2bbc175 --- a/Tangible/#socket.h# +++ b/Tangible/#socket.h# diff --git a/Tangible/ethernet.h b/Tangible/ethernet.h old mode 100644 new mode 100755 index f84a152..f84a152 --- a/Tangible/ethernet.h +++ b/Tangible/ethernet.h diff --git a/Tangible/socket.c b/Tangible/socket.c old mode 100644 new mode 100755 index 193fb8e..193fb8e --- a/Tangible/socket.c +++ b/Tangible/socket.c diff --git a/Tangible/socket.h b/Tangible/socket.h old mode 100644 new mode 100755 index 11c17d9..11c17d9 --- a/Tangible/socket.h +++ b/Tangible/socket.h diff --git a/Tangible/socket.o b/Tangible/socket.o old mode 100644 new mode 100755 index 27c5e17..27c5e17 Binary files a/Tangible/socket.o and b/Tangible/socket.o differ diff --git a/Tangible/spi.h b/Tangible/spi.h old mode 100644 new mode 100755 index 6b41688..6b41688 --- a/Tangible/spi.h +++ b/Tangible/spi.h diff --git a/Tangible/tangibleInterface.hex b/Tangible/tangibleInterface.hex old mode 100644 new mode 100755 index 71b07e9..71b07e9 --- a/Tangible/tangibleInterface.hex +++ b/Tangible/tangibleInterface.hex diff --git a/Tangible/tangibleInterface.o b/Tangible/tangibleInterface.o old mode 100644 new mode 100755 index ee67a6b..ee67a6b Binary files a/Tangible/tangibleInterface.o and b/Tangible/tangibleInterface.o differ diff --git a/Tangible/w5100.c b/Tangible/w5100.c old mode 100644 new mode 100755 index 4972f94..4972f94 --- a/Tangible/w5100.c +++ b/Tangible/w5100.c diff --git a/Tangible/w5100.h b/Tangible/w5100.h old mode 100644 new mode 100755 index c90a979..c90a979 --- a/Tangible/w5100.h +++ b/Tangible/w5100.h diff --git a/Threads/threadSocket.c b/Threads/threadSocket.c index b3099ba..7ad02ee 100755 --- a/Threads/threadSocket.c +++ b/Threads/threadSocket.c @@ -118,29 +118,24 @@ int interfaceReponse(FILE* sockdial_stream, char packet[BUFF_SIZE], Arg_Thread* return -1; } - strcpy(buffer, "\x60\x00"); // Demande la commande en mémoire fprintf(sockdial_stream, "%s", buffer); // Transmission du message - fgets(packet, BUFF_SIZE, sockdial_stream); // Attente de reception du message - - if( strlen(packet)>=2 && (packet[0]&0xE0)==0x10 ) - argument->interfaces[i]->commande = (packet[0]&0x01)*256+packet[1]; + argument->interfaces[i]->commande = (packet[0]&0x1F)*256+packet[1]; else { argument->interfaces[i]->commande = -1; - return -1; // Si le message n'est pas reçu correctement + //return -1; // Si le message n'est pas reçu correctement } strcpy(buffer, "\xE0\x00"); // Signale la fin de l'interrogation - fprintf(sockdial_stream, "%s", buffer); // Transmission du message + fprintf(sockdial_stream, "%s", buffer); // Transmission du message - pthread_mutex_unlock(&(argument->requete_mutex)); // Libération de la section critique return 0; diff --git a/bin/serverTCP b/bin/serverTCP new file mode 100755 index 0000000..c1576db Binary files /dev/null and b/bin/serverTCP differ diff --git a/bin/sonde b/bin/sonde new file mode 100755 index 0000000..ef7f3a2 Binary files /dev/null and b/bin/sonde differ diff --git a/includes/http.h b/includes/http.h old mode 100644 new mode 100755 index 272fe95..272fe95 --- a/includes/http.h +++ b/includes/http.h diff --git a/libs/libnet.a b/libs/libnet.a new file mode 100644 index 0000000..83bd370 Binary files /dev/null and b/libs/libnet.a differ diff --git a/libs/libthrd.a b/libs/libthrd.a new file mode 100644 index 0000000..263d0f2 Binary files /dev/null and b/libs/libthrd.a differ diff --git a/src/serverTCP.c b/src/serverTCP.c old mode 100644 new mode 100755 index 5d24594..5d24594 --- a/src/serverTCP.c +++ b/src/serverTCP.c -- libgit2 0.21.2