Switch to IPv4 zeroconf, add test framework with discovery test, fix serial enumeration
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user