Readme + commentaires

This commit is contained in:
Samuel 2026-01-31 22:45:56 +01:00
parent bb126ada4e
commit 6f4340c032
2 changed files with 13 additions and 6 deletions

View File

@ -1,4 +1,7 @@
Projet modèle pour le Rpi Pico (RP2040) Point d'accès wifi avec UDP in & out
======================================= =======================================
Ce projet est un example pour le RPI Pico, tentant d'être le plus prêt à l'emploi possible. Les principales fonctionnalités sont :
- Point accès Wifi (avec DHCP et DNS), basé sur l'example du SDK
- Émission de trames UDP, basé sur l'example du SDK
- Réception de trames UDP, basé sur [Xilinx udp_perf_server](https://github.com/Xilinx/embeddedsw/blob/master/lib/sw_apps/lwip_udp_perf_server/src/udp_perf_server.c)

View File

@ -1,6 +1,7 @@
/** /**
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd. * Copyright (c) 2022 Raspberry Pi (Trading) Ltd
* * Copyright (c) 2025 Keuronde
*
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
@ -386,13 +387,16 @@ int main() {
// UDP Callback // UDP Callback
struct udp_pcb * udp_pcd_received = udp_new(); struct udp_pcb * udp_pcd_received = udp_new();
err_t err = udp_bind(udp_pcd_received, IP_ADDR_ANY, 4444); // Réserve le port et l'IP pour ce "Protocol Control Block" (udp_pcb)
err_t err = udp_bind(udp_pcd_received, IP_ADDR_ANY, 4444); // Réservation du port
if(err != ERR_OK){ if(err != ERR_OK){
printf("udb_bind err = %d\n", err); printf("udb_bind err = %d\n", err); // Le couple IP/port était déjà réservé
}else{ }else{
printf("udb_bind ok\n"); printf("udb_bind ok\n");
} }
/// Lie la callback `udp_receive_callback` aux trames entrantes correspondantes
/// aux caractéristiques définies par udp_pcd_received
udp_recv(udp_pcd_received, udp_receive_callback, NULL); udp_recv(udp_pcd_received, udp_receive_callback, NULL);
if (!tcp_server_open(state, ap_name)) { if (!tcp_server_open(state, ap_name)) {