tcp test
This commit is contained in:
29
include/net/net.h
Normal file
29
include/net/net.h
Normal 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
|
||||
Reference in New Issue
Block a user