Use same packet definitions for both sockets

This commit is contained in:
Patrick Nicolas
2023-12-16 14:16:47 +01:00
committed by Guillaume Meunier
parent 1792607ada
commit 94e60d4e8b
8 changed files with 9 additions and 22 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ wivrn_connection::wivrn_connection(TCP && tcp) :
}
}
std::optional<from_headset::control_packets> wivrn_connection::poll_control(int timeout)
std::optional<from_headset::packets> wivrn_connection::poll_control(int timeout)
{
pollfd fds{};
fds.events = POLLIN;
+3 -3
View File
@@ -28,8 +28,8 @@ using namespace xrt::drivers::wivrn;
class wivrn_connection
{
typed_socket<TCP, from_headset::control_packets, to_headset::control_packets> control;
typed_socket<UDP, from_headset::stream_packets, to_headset::stream_packets> stream;
typed_socket<TCP, from_headset::packets, to_headset::packets> control;
typed_socket<UDP, from_headset::packets, to_headset::packets> stream;
public:
wivrn_connection(TCP && tcp);
@@ -47,7 +47,7 @@ public:
stream.send(std::forward<T>(packet));
}
std::optional<from_headset::control_packets> poll_control(int timeout);
std::optional<from_headset::packets> poll_control(int timeout);
template <typename T>
int poll(T && visitor, int timeout)
+1 -1
View File
@@ -76,7 +76,7 @@ xrt_result_t xrt::drivers::wivrn::wivrn_session::create_session(xrt::drivers::wi
xrt_system_compositor ** out_xsysc)
{
std::shared_ptr<wivrn_session> self;
std::optional<xrt::drivers::wivrn::from_headset::control_packets> control;
std::optional<xrt::drivers::wivrn::from_headset::packets> control;
try
{
self = std::shared_ptr<wivrn_session>(new wivrn_session(std::move(tcp)));