32#define WIFI_BUFFER_SIZE 2048
34#define WIFI_TCP_PORT 4242
36#define WIFI_POLL_TIME_S 20
38#define WIFI_MAX_MESSAGE_LENGTH 1024
48#define DEBUG_PRINT(...) printf(__VA_ARGS__)
50#define DEBUG_PRINT(...)
81 __unused
struct tcp_pcb *p_tpcb,
#define WIFI_BUFFER_SIZE
Buffer size for messages sent out via wifi.
Definition: wifi.h:32
Struct representing a TCP server connection.
Definition: wifi.h:62
int run_count
Counter for tracking the state of the connection.
Definition: wifi.h:70
int sent_len
Length of sent data.
Definition: wifi.h:68
int recv_len
Length of received data.
Definition: wifi.h:69
bool is_complete
Flag indicating whether the connection is complete.
Definition: wifi.h:65
uint8_t buffer_recv[WIFI_BUFFER_SIZE]
Buffer for received data.
Definition: wifi.h:67
uint8_t buffer_sent[WIFI_BUFFER_SIZE]
Buffer for sent data.
Definition: wifi.h:66
struct tcp_pcb * p_server_pcb
Pointer to the server PCB.
Definition: wifi.h:63
struct tcp_pcb * p_client_pcb
Pointer to the client PCB.
Definition: wifi.h:64
err_t wifi_tcp_server_send_data(void *p_arg, struct tcp_pcb *p_tpcb)
This function is a callback from lwIP, so cyw43_arch_lwip_begin is not required. However,...
Definition: wifi.c:77
err_t wifi_tcp_server_recv(void *p_arg, __unused struct tcp_pcb *p_tpcb, struct pbuf *p_buf, __unused err_t err)
This function is called by lwIP when data is received from a TCP client. It receives the data and che...
Definition: wifi.c:117
void wifi_tcp_server_begin_init(void)
Initializes the TCP server by initializing standard input/output, initializing the CYW43 architecture...
Definition: wifi.c:218
void wifi_run_tcp_server_test(void)
Runs a TCP server and opens it. Then, it enters a loop to check for Wi-Fi driver or lwIP work that ne...
Definition: wifi.c:178
void wifi_tcp_server_begin(void)
Begins a TCP server by connecting to Wi-Fi with the given SSID and password.
Definition: wifi.c:229
struct wifi_tcp_server wifi_tcp_server_t
Struct representing a TCP server connection.