Skip to content

Commit

Permalink
Merge branch 'feat/better-udp-socket' of github.com:tier4/nebula into…
Browse files Browse the repository at this point in the history
… feat/better-udp-socket
  • Loading branch information
mojomex committed Nov 22, 2024
2 parents 95eb54f + 23311cb commit 86961ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nebula_hw_interfaces/test/common/test_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ int main(int argc, char * argv[])
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
};
};
7 changes: 3 additions & 4 deletions nebula_hw_interfaces/test/common/test_udp/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ std::optional<int> udp_send(
return {};
}

template<typename _T, typename _R>
template <typename _T, typename _R>
std::optional<
std::pair<std::vector<uint8_t>, nebula::drivers::connections::UdpSocket::ReceiveMetadata>>
receive_once(
nebula::drivers::connections::UdpSocket & sock, std::chrono::duration<_T, _R> timeout)
receive_once(nebula::drivers::connections::UdpSocket & sock, std::chrono::duration<_T, _R> timeout)
{
std::condition_variable cv_received_result;
std::mutex mtx_result;
Expand All @@ -75,4 +74,4 @@ receive_once(
cv_received_result.wait_for(lock, timeout, [&result]() { return result.has_value(); });
sock.unsubscribe();
return result;
}
}

0 comments on commit 86961ef

Please sign in to comment.