Switch to IPv4 zeroconf, add test framework with discovery test, fix serial enumeration

This commit is contained in:
Ian Gulliver
2026-04-07 06:58:39 +09:00
parent b8c0e6be66
commit e60479bad8
14 changed files with 308 additions and 33 deletions

View File

@@ -15,7 +15,7 @@ void dispatch_init() {
[[noreturn]] void dispatch_run(std::span<const handler_entry> handlers,
std::span<const w6300::socket_id> sockets) {
std::unordered_map<int8_t, std::vector<std::vector<uint8_t>> (*)(uint32_t)> handler_map;
std::unordered_map<int8_t, std::vector<std::vector<uint8_t>> (*)(uint32_t, std::span<const uint8_t>)> handler_map;
for (auto& entry : handlers) {
handler_map[entry.type_id] = entry.handle;
}
@@ -50,7 +50,7 @@ void dispatch_init() {
auto it = handler_map.find(msg->type_id);
if (it != handler_map.end()) {
for (auto& response : it->second(msg->message_id)) {
for (auto& response : it->second(msg->message_id, msg->payload)) {
usb.send(response);
}
if (msg->type_id == RequestPICOBOOT::ext_id) {
@@ -73,7 +73,7 @@ void dispatch_init() {
auto it = handler_map.find(msg->type_id);
if (it != handler_map.end()) {
for (auto& response : it->second(msg->message_id)) {
for (auto& response : it->second(msg->message_id, msg->payload)) {
w6300::sendto(sn, std::span<const uint8_t>{response}, src_addr, src_port);
}
}