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 = {});
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#include "wire.h"
|
||||
#include "usb_cdc.h"
|
||||
|
||||
extern std::string_view firmware_name;
|
||||
|
||||
void handle_picoboot(usb_cdc& usb, uint32_t message_id);
|
||||
void handle_info(usb_cdc& usb, uint32_t message_id);
|
||||
std::vector<std::vector<uint8_t>> handle_picoboot(uint32_t message_id);
|
||||
std::vector<std::vector<uint8_t>> handle_info(uint32_t message_id);
|
||||
|
||||
Reference in New Issue
Block a user