This commit is contained in:
2026-04-10 13:11:27 +02:00
parent e825475df3
commit b74366a546
5 changed files with 216 additions and 17 deletions

29
include/net/net.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef NET_H
#define NET_H
// net.h
// Includes
#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
#include <stdbool.h>
#include <stdint.h>
typedef struct {
char ssid[32];
char password[64];
} net_creds_t;
typedef struct {
uint16_t port;
uint16_t maxClients;
void (*onConnect)(int clientId);
void (*onDisconnect)(int clientId);
void (*onData)(int clientId, const uint8_t* data, size_t len);
} net_server_t;
net_server_t* Net_Init(net_creds_t* creds);
bool Net_Listen(net_server_t* server);
void Net_Destroy(net_server_t* server);
#endif