From 6487c9cfcc9795affc7607f6e3e6f3580480b638 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 27 Mar 2023 18:35:39 +0200 Subject: [PATCH] No default init of max message buffer. (#220) This is not necessary and can take a long time on a MCU. --- src/Publisher.ipp | 2 +- src/ServiceClient.ipp | 2 +- src/ServiceServer.ipp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Publisher.ipp b/src/Publisher.ipp index 7de94e4f..c92da11c 100644 --- a/src/Publisher.ipp +++ b/src/Publisher.ipp @@ -42,7 +42,7 @@ bool Publisher::publish(T const & msg) #pragma GCC diagnostic pop /* Serialize message into payload buffer. */ - std::array msg_buf{}; + std::array msg_buf; nunavut::support::bitspan msg_buf_bitspan{msg_buf}; auto const rc = serialize(msg, msg_buf_bitspan); if (!rc) return false; diff --git a/src/ServiceClient.ipp b/src/ServiceClient.ipp index f28c0d71..ba717a21 100644 --- a/src/ServiceClient.ipp +++ b/src/ServiceClient.ipp @@ -51,7 +51,7 @@ bool ServiceClient::request(CanardNodeID const remot #pragma GCC diagnostic pop /* Serialize message into payload buffer. */ - std::array req_buf{}; + std::array req_buf; nunavut::support::bitspan req_buf_bitspan{req_buf}; auto const req_rc = serialize(req, req_buf_bitspan); if (!req_rc) return false; diff --git a/src/ServiceServer.ipp b/src/ServiceServer.ipp index ff671ad5..66212ffd 100644 --- a/src/ServiceServer.ipp +++ b/src/ServiceServer.ipp @@ -46,7 +46,7 @@ bool ServiceServer::onTransferReceived(CanardRxTransf T_RSP const rsp = _on_request_cb(req); /* Serialize the response message. */ - std::array rsp_buf{}; + std::array rsp_buf; nunavut::support::bitspan rsp_buf_bitspan{rsp_buf}; auto const rsp_rc = serialize(rsp, rsp_buf_bitspan); if (!rsp_rc) return false;