Handlers return multiple responses, dispatch polls sockets for UDP commands
This commit is contained in:
@@ -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 = {});
|
||||
|
||||
Reference in New Issue
Block a user