Add support for authentication and encryption

This commit is contained in:
Guillaume Meunier
2024-11-26 23:59:35 +01:00
committed by Patrick Nicolas
parent 447b77c35c
commit c6e773fd22
45 changed files with 1516 additions and 455 deletions
+8 -8
View File
@@ -77,8 +77,7 @@ public:
class wivrn_session : public xrt_system_devices
{
friend wivrn_comp_target_factory;
wivrn_connection connection;
from_headset::headset_info_packet info{};
std::unique_ptr<wivrn_connection> connection;
u_system & xrt_system;
xrt_space_overseer * space_overseer;
@@ -113,12 +112,12 @@ class wivrn_session : public xrt_system_devices
std::jthread thread;
wivrn_session(TCP && tcp, u_system &);
wivrn_session(std::unique_ptr<wivrn_connection> connection, u_system &);
public:
~wivrn_session();
static xrt_result_t create_session(TCP && tcp,
static xrt_result_t create_session(std::unique_ptr<wivrn_connection> connection,
u_system & system,
xrt_system_devices ** out_xsysd,
xrt_space_overseer ** out_xspovrs,
@@ -128,7 +127,7 @@ public:
bool connected();
const from_headset::headset_info_packet & get_info()
{
return info;
return connection->info();
};
void add_predict_offset(std::chrono::nanoseconds off)
@@ -139,8 +138,9 @@ public:
void set_enabled(to_headset::tracking_control::id id, bool enabled);
void set_enabled(device_id id, bool enabled);
void operator()(from_headset::handshake &&) {}
void operator()(from_headset::crypto_handshake &&) {}
void operator()(from_headset::headset_info_packet &&);
void operator()(from_headset::handshake &&) {}
void operator()(from_headset::trackings &&);
void operator()(const from_headset::tracking &);
void operator()(from_headset::hand_tracking &&);
@@ -155,13 +155,13 @@ public:
template <typename T>
void send_stream(T && packet)
{
connection.send_stream(std::forward<T>(packet));
connection->send_stream(std::forward<T>(packet));
}
template <typename T>
void send_control(T && packet)
{
connection.send_control(std::forward<T>(packet));
connection->send_control(std::forward<T>(packet));
}
std::array<to_headset::foveation_parameter, 2> set_foveated_size(uint32_t width, uint32_t height);