websocket_bridge#
-
namespace heph
-
namespace ws#
Functions
-
bool saveSchemaToDatabase(const foxglove::Channel &channel_definition, ProtobufSchemaDatabase &schema_db)#
-
bool saveSchemaToDatabase(const foxglove::Service &service_definition, ProtobufSchemaDatabase &schema_db)#
-
bool saveSchemaToDatabase(const foxglove::ServiceResponseDefinition &service_request_definition, ProtobufSchemaDatabase &schema_db)#
-
std::unique_ptr<google::protobuf::Message> retrieveRequestMessageFromDatabase(foxglove::ServiceId service_id, const ProtobufSchemaDatabase &schema_db)#
-
std::unique_ptr<google::protobuf::Message> retrieveResponseMessageFromDatabase(foxglove::ServiceId service_id, const ProtobufSchemaDatabase &schema_db)#
-
std::unique_ptr<google::protobuf::Message> retrieveMessageFromDatabase(const std::string &schema_name, const ProtobufSchemaDatabase &schema_db)#
-
std::pair<std::string, std::string> retrieveSchemaNamesFromServiceId(foxglove::ServiceId service_id, const ProtobufSchemaDatabase &schema_db)#
-
std::string retrieveSchemaNameFromChannelId(foxglove::ChannelId channel_id, const ProtobufSchemaDatabase &schema_db)#
-
template<typename T>
void setRandomValue(google::protobuf::Message *message, const google::protobuf::FieldDescriptor *field, RandomGenerators &generators)#
-
void fillRepeatedField(google::protobuf::Message *message, const google::protobuf::FieldDescriptor *field, RandomGenerators &generators, int depth)#
-
void fillMessageWithRandomValues(google::protobuf::Message *message, RandomGenerators &generators, int depth = 0)#
-
std::unique_ptr<google::protobuf::Message> generateRandomMessageFromSchemaName(const std::string &schema_name, ProtobufSchemaDatabase &schema_db)#
-
std::string convertSerializationTypeToString(const serdes::TypeInfo::Serialization &serialization)#
-
void debugPrintMessage(const google::protobuf::Message &message)#
-
void printBinary(const uint8_t *data, size_t length)#
-
struct ProtobufSchemaDatabase#
-
bool saveSchemaToDatabase(const foxglove::Channel &channel_definition, ProtobufSchemaDatabase &schema_db)#
-
namespace ws#
-
namespace heph
-
namespace ws
Functions
-
std::optional<std::unique_ptr<google::protobuf::Message>> receiveResponse(const WsServiceResponse &service_response, WsAdvertisements &ws_server_ads, ServiceCallState &state)#
-
void receiveFailureResponse(const std::string &error_msg, ServiceCallState &state)#
-
bool allServiceCallsFinished(const ServiceCallStateMap &state)#
-
void printServiceCallStateMap(ServiceCallStateMap &state)#
-
void printAdvertisedServices(const WsAdvertisements &ws_server_ads)#
-
void printAdvertisedTopics(const WsAdvertisements &ws_server_ads)#
-
void printClientChannelAds(const std::vector<WsClientChannelAd> &client_ads)#
-
struct ServiceCallState#
Public Types
Typedefs
-
using WsClientNoTls = foxglove::Client<foxglove::WebSocketNoTls>#
-
using ServiceCallStateMap = std::map<uint32_t, ServiceCallState>#
-
std::optional<std::unique_ptr<google::protobuf::Message>> receiveResponse(const WsServiceResponse &service_response, WsAdvertisements &ws_server_ads, ServiceCallState &state)#
-
namespace ws
-
namespace heph
-
namespace ws
-
class WebsocketBridge#
-
class WebsocketBridge#
-
namespace ws
-
namespace heph
-
namespace ws
Functions
-
bool convertIpcRawServiceResponseToWsServiceResponse(WsServiceId service_id, WsServiceCallId call_id, const ipc::zenoh::ServiceResponse<std::vector<std::byte>> &raw_response, WsServiceResponse &ws_response)#
-
std::optional<WsChannelAd> convertWsJsonMsgToChannel(const nlohmann::json &channel_json)#
-
std::optional<WsServiceAd> convertWsJsonMsgToService(const nlohmann::json &service_json)#
-
bool parseWsAdvertisements(const nlohmann::json &server_txt_msg, WsAdvertisements &ws_server_ads)#
-
bool parseWsServiceFailure(const nlohmann::json &server_txt_msg, WsServiceFailure &service_failure)#
-
struct WsAdvertisements#
Public Members
-
std::unordered_map<WsChannelId, WsChannelAd> channels#
-
std::unordered_map<WsServiceId, WsServiceAd> services#
-
ProtobufSchemaDatabase schema_db#
-
std::unordered_map<WsChannelId, WsChannelAd> channels#
-
struct WsClientComparator#
Public Functions
-
inline bool operator()(const ClientHandleWithName &lhs, const ClientHandleWithName &rhs) const#
-
inline bool operator()(const ClientHandleWithName &lhs, const ClientHandleWithName &rhs) const#
-
struct WsServiceFailure#
Typedefs
-
using WsClientHandle = foxglove::ConnHandle#
-
using WsInterface = foxglove::ServerInterface<WsClientHandle>#
-
using WsInterfacePtr = std::unique_ptr<WsInterface>#
-
using WsHandlers = foxglove::ServerHandlers<WsClientHandle>#
-
using WsFactory = foxglove::ServerFactory#
-
using WsInfo = foxglove::ServerOptions#
-
using WsLogLevel = foxglove::WebSocketLogLevel#
-
using WsChannelId = foxglove::ChannelId#
-
using WsChannelInfo = foxglove::ChannelWithoutId#
-
using WsChannelAd = foxglove::Channel#
-
using WsClientChannelId = foxglove::ClientChannelId#
-
using WsClientChannelIdSet = std::unordered_set<WsClientChannelId>#
-
using WsClientChannelAd = foxglove::ClientAdvertisement#
-
using WsSubscriptionId = foxglove::SubscriptionId#
-
using WsClientMessage = foxglove::ClientMessage#
-
using WsServiceId = foxglove::ServiceId#
-
using WsServiceCallId = uint32_t#
-
using WsServiceInfo = foxglove::ServiceWithoutId#
-
using WsServiceAd = foxglove::Service#
-
using WsServiceRequestDefinition = foxglove::ServiceRequestDefinition#
-
using WsServiceResponseDefinition = foxglove::ServiceResponseDefinition#
-
using WsServiceRequest = foxglove::ServiceRequest#
-
using WsServiceResponse = foxglove::ServiceResponse#
-
using WsBinaryOpCode = foxglove::BinaryOpcode#
-
using WsClientBinaryOpCode = foxglove::ClientBinaryOpcode#
-
using ClientHandleWithName = std::pair<WsClientHandle, std::string>#
-
using WsClientHandleSet = std::set<ClientHandleWithName, WsClientComparator>#
-
bool convertIpcRawServiceResponseToWsServiceResponse(WsServiceId service_id, WsServiceCallId call_id, const ipc::zenoh::ServiceResponse<std::vector<std::byte>> &raw_response, WsServiceResponse &ws_response)#
-
namespace ws
-
namespace heph
-
namespace ws
Functions
-
bool shouldBridgeIpcTopic(const std::string &topic, const WebsocketBridgeConfig &config)#
-
bool shouldBridgeIpcService(const std::string &service, const WebsocketBridgeConfig &config)#
-
bool shouldBridgeWsTopic(const std::string &topic, const WebsocketBridgeConfig &config)#
-
WebsocketBridgeConfig loadBridgeConfigFromYaml(const std::string &yaml_file_path)#
-
void saveBridgeConfigToYaml(const WebsocketBridgeConfig &config, const std::string &path)#
-
std::string convertBridgeConfigToString(const WebsocketBridgeConfig &config)#
-
struct WebsocketBridgeConfig#
Public Members
- WsInfo ws_server_config = {.capabilities = {foxglove::CAPABILITY_CLIENT_PUBLISH,foxglove::CAPABILITY_SERVICES,foxglove::CAPABILITY_CONNECTION_GRAPH,},.supportedEncodings = {},.metadata = {},.sendBufferLimitBytes = foxglove::DEFAULT_SEND_BUFFER_LIMIT_BYTES,.useTls = false,.certfile = "",.keyfile = "",.sessionId ="session_" +std::to_string(std::chrono::system_clock::now().time_since_epoch().count()),.numWorkerThreads = 1,.useCompression = true,.clientTopicWhitelistPatterns = parseRegexStrings({ ".*" }),}
-
uint16_t ws_server_port = DEFAULT_WS_SERVER_PORT#
-
bool ws_server_verbose_bridge_state = false#
-
bool ws_server_verbose_ipc_graph_state = false#
-
int ipc_service_call_timeout_ms = DEFAULT_IPC_SERVICE_CALL_TIMEOUT_MS#
-
bool ipc_service_service_request_async = true#
-
bool ipc_advertise_topics_based_on_subscribers = true#
-
bool shouldBridgeIpcTopic(const std::string &topic, const WebsocketBridgeConfig &config)#
-
namespace ws
-
namespace heph
-
namespace ws
-
class IpcEntityManager#
Public Functions
-
~IpcEntityManager()#
-
void start()#
-
void stop()#
-
void addSubscriber(const std::string &topic, const serdes::TypeInfo &topic_type_info, const TopicSubscriberWithTypeCallback &subscriber_cb)#
-
RawServiceResponses callService(uint32_t call_id, const ipc::TopicConfig &topic_config, std::span<const std::byte> buffer, std::chrono::milliseconds timeout)#
-
std::future<void> callServiceAsync(uint32_t call_id, const ipc::TopicConfig &topic_config, std::span<const std::byte> buffer, std::chrono::milliseconds timeout, AsyncServiceResponseCallback callback)#
-
~IpcEntityManager()#
-
class IpcEntityManager#
-
namespace ws
-
namespace heph
-
namespace ws
-
class WebsocketBridgeState#
Public Functions
-
WebsocketBridgeState() = default#
-
void printBridgeState() const#
-
bool checkConsistency() const#
-
std::string getIpcTopicForWsChannel(const WsChannelId &channel_id) const#
-
WsChannelId getWsChannelForIpcTopic(const std::string &topic) const#
-
void addWsChannelToIpcTopicMapping(const WsChannelId &channel_id, const std::string &topic)#
-
void removeWsChannelToIpcTopicMapping(const WsChannelId &channel_id, const std::string &topic)#
-
bool hasWsChannelMapping(const WsChannelId &channel_id) const#
-
bool hasWsChannelWithClients(const WsChannelId &channel_id) const#
-
void addWsChannelToClientMapping(const WsChannelId &channel_id, const WsClientHandle &client_handle, const std::string &client_name)#
-
void removeWsChannelToClientMapping(const WsChannelId &channel_id)#
-
void removeWsChannelToClientMapping(const WsChannelId &channel_id, const WsClientHandle &client_handle)#
-
std::optional<WsClientHandleSet> getClientsForWsChannel(const WsChannelId &channel_id) const#
-
std::string getIpcServiceForWsService(const WsServiceId &service_id) const#
-
WsChannelId getWsServiceForIpcService(const std::string &service_name) const#
-
void addWsServiceToIpcServiceMapping(const WsServiceId &service_id, const std::string &service_name)#
-
void removeWsServiceToIpcServiceMapping(const WsServiceId &service_id, const std::string &service_name)#
-
bool hasWsServiceMapping(const WsChannelId &service_id) const#
-
bool hasCallIdToClientMapping(uint32_t call_id) const#
-
void addCallIdToClientMapping(uint32_t call_id, const WsClientHandle &client_handle, const std::string &client_name)#
-
void removeCallIdToClientMapping(uint32_t call_id)#
-
std::optional<ClientHandleWithName> getClientForCallId(uint32_t call_id) const#
-
std::string getTopicForClientChannel(const WsClientChannelId &client_channel_id) const#
-
WsClientChannelIdSet getClientChannelsForTopic(const std::string &topic) const#
-
void addClientChannelToTopicMapping(const WsClientChannelId &client_channel_id, const std::string &topic)#
-
void removeClientChannelToTopicMapping(const WsClientChannelId &client_channel_id)#
-
bool hasClientChannelMapping(const WsClientChannelId &client_channel_id) const#
-
bool hasClientForClientChannel(const WsClientChannelId &client_channel_id) const#
-
void addClientChannelToClientMapping(const WsClientChannelId &client_channel_id, const WsClientHandle &client_handle, const std::string &client_name)#
-
void removeClientChannelToClientMapping(const WsClientChannelId &client_channel_id)#
-
std::optional<ClientHandleWithName> getClientForClientChannel(const WsClientChannelId &client_channel_id) const#
-
WebsocketBridgeState() = default#
-
class WebsocketBridgeState#
-
namespace ws