Handlers return multiple responses, dispatch polls sockets for UDP commands

This commit is contained in:
Ian Gulliver
2026-04-06 20:22:40 +09:00
parent f837937cb7
commit b8c0e6be66
5 changed files with 55 additions and 23 deletions

View File

@@ -1,12 +1,14 @@
#pragma once
#include <cstdint>
#include <span>
#include "usb_cdc.h"
#include <vector>
#include "w6300.h"
struct handler_entry {
int8_t type_id;
void (*handle)(usb_cdc&, uint32_t);
std::vector<std::vector<uint8_t>> (*handle)(uint32_t message_id);
};
void dispatch_init();
[[noreturn]] void dispatch_run(std::span<const handler_entry> handlers);
[[noreturn]] void dispatch_run(std::span<const handler_entry> handlers,
std::span<const w6300::socket_id> sockets = {});