Add dbus server
This commit is contained in:
+28
-1
@@ -19,12 +19,39 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include "wivrn_packets.h"
|
||||
#include <memory>
|
||||
#include <wivrn_sockets.h>
|
||||
|
||||
extern std::unique_ptr<xrt::drivers::wivrn::TCP> tcp;
|
||||
|
||||
namespace from_monado
|
||||
{
|
||||
struct headsdet_connected
|
||||
{};
|
||||
struct headsdet_disconnected
|
||||
{};
|
||||
|
||||
using packets = std::variant<xrt::drivers::wivrn::from_headset::headset_info_packet, headsdet_connected, headsdet_disconnected>;
|
||||
} // namespace from_monado
|
||||
|
||||
namespace to_monado
|
||||
{
|
||||
struct disconnect
|
||||
{};
|
||||
|
||||
using packets = std::variant<disconnect>;
|
||||
} // namespace to_monado
|
||||
|
||||
extern std::optional<xrt::drivers::wivrn::typed_socket<xrt::drivers::wivrn::UnixDatagram, to_monado::packets, from_monado::packets>> wivrn_ipc_socket_monado;
|
||||
|
||||
std::optional<to_monado::packets> receive_from_main();
|
||||
template <typename T>
|
||||
void send_to_main(T && packet)
|
||||
{
|
||||
wivrn_ipc_socket_monado->send(std::forward<T>(packet));
|
||||
}
|
||||
|
||||
void init_cleanup_functions();
|
||||
void add_cleanup_function(void (*callback)(uintptr_t), uintptr_t userdata);
|
||||
void remove_cleanup_function(void (*callback)(uintptr_t), uintptr_t userdata);
|
||||
|
||||
Reference in New Issue
Block a user