Add UDP transport with picomap port 28781, info -udp flag
This commit is contained in:
@@ -30,6 +30,14 @@ void dispatch_schedule_ms(uint32_t ms, std::function<void()> fn) {
|
||||
static usb_cdc usb;
|
||||
static static_vector<uint8_t, 256> usb_rx_buf;
|
||||
|
||||
net_set_handler([&](std::span<const uint8_t> payload) -> std::vector<std::vector<uint8_t>> {
|
||||
auto msg = try_decode(payload.data(), payload.size());
|
||||
if (!msg) return {};
|
||||
auto it = handler_map.find(msg->type_id);
|
||||
if (it == handler_map.end()) return {};
|
||||
return it->second(msg->message_id, msg->payload);
|
||||
});
|
||||
|
||||
while (true) {
|
||||
dlog_if_slow("tud_task", 1000, [&]{ tud_task(); });
|
||||
dlog_if_slow("drain", 1000, [&]{ usb.drain(); });
|
||||
|
||||
Reference in New Issue
Block a user