2026-04-05 21:04:56 +09:00
|
|
|
#pragma once
|
2026-04-07 07:34:24 +09:00
|
|
|
#include <array>
|
|
|
|
|
#include <cstdint>
|
2026-04-07 21:36:50 +09:00
|
|
|
#include <functional>
|
|
|
|
|
#include <span>
|
|
|
|
|
#include <vector>
|
2026-04-07 07:34:24 +09:00
|
|
|
|
|
|
|
|
struct net_state {
|
|
|
|
|
std::array<uint8_t, 6> mac;
|
|
|
|
|
std::array<uint8_t, 4> ip;
|
|
|
|
|
};
|
2026-04-05 21:04:56 +09:00
|
|
|
|
2026-04-07 21:36:50 +09:00
|
|
|
using net_handler = std::function<std::vector<std::vector<uint8_t>>(std::span<const uint8_t> payload)>;
|
|
|
|
|
|
2026-04-05 21:04:56 +09:00
|
|
|
bool net_init();
|
2026-04-07 07:34:24 +09:00
|
|
|
const net_state& net_get_state();
|
2026-04-07 21:36:50 +09:00
|
|
|
void net_set_handler(net_handler handler);
|
2026-04-07 07:34:24 +09:00
|
|
|
void net_poll();
|