Simplify handler signatures: return response struct, typed_handler does encoding

This commit is contained in:
Ian Gulliver
2026-04-10 22:21:31 +09:00
parent e2a5d97dae
commit 58db392bf3
5 changed files with 19 additions and 21 deletions

View File

@@ -21,7 +21,7 @@ size_t typed_handler(uint32_t message_id, std::span<const uint8_t> payload, span
return encode_response_into(out, message_id, DeviceError{1, "decode request ext_id=" +
std::to_string(Req::ext_id) + ": msgpack error " + std::to_string(static_cast<int>(r.error()))});
}
return Fn(message_id, req, out);
return encode_response_into(out, message_id, Fn(req));
}
void dispatch_init();