Commit ceef8241ed160c804909f299654bd024f767a02b
1 parent
cdb865f1
fix(Python): Commentaires de code
Showing
2 changed files
with
5 additions
and
4 deletions
Show diff stats
Python/client.py
1 | import socket | 1 | import socket |
2 | 2 | ||
3 | if __name__ == '__main__': | 3 | if __name__ == '__main__': |
4 | + # TODO : Prendre en arguments les donnees et l'adresse de la RPi | ||
4 | clientSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); | 5 | clientSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); |
5 | - data = "Hello Server!"; | ||
6 | - clientSocket.sendto(data.encode(),("172.26.145.62",9090)); | 6 | + data = "Hello Server!"; # TODO : Modifer les donnees a prendre |
7 | + clientSocket.sendto(data.encode(),("172.26.145.62",9090)); # TODO : Modifier adresse avec adresse de la raspberry | ||
7 | dataFromServer,sourceAddress = clientSocket.recvfrom(1024); | 8 | dataFromServer,sourceAddress = clientSocket.recvfrom(1024); |
8 | print(dataFromServer.decode()); | 9 | print(dataFromServer.decode()); |
Python/serveur.py
@@ -2,8 +2,8 @@ import socket | @@ -2,8 +2,8 @@ import socket | ||
2 | 2 | ||
3 | if __name__=='__main__': | 3 | if __name__=='__main__': |
4 | server.Socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); | 4 | server.Socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); |
5 | - serverSocket.bind(("172.26.145.62",9090)); # Adresse du serveur à modifer selon l'IP de la RASPBERRY (TODO : prendre un argument qui sera donné par le serveur Web) | 5 | + serverSocket.bind(("172.26.145.62",9090)); # Adresse du serveur à modifer selon l'IP de la RASPBERRY |
6 | while(True): | 6 | while(True): |
7 | dataFromClient, sourceAddress = serverSocket.recvfrom(1024); | 7 | dataFromClient, sourceAddress = serverSocket.recvfrom(1024); |
8 | print("Data from %s is %s"%(sourceAddress,dataFromClient.decode())); | 8 | print("Data from %s is %s"%(sourceAddress,dataFromClient.decode())); |
9 | - serverSocket.sendto("Hello Client!".encode(),sourceAddress); | 9 | + serverSocket.sendto("Hello Client!".encode(),sourceAddress); # TODO : Modifier les donnees a renvoyer au serveur Web |