DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ControlClient.hpp
Go to the documentation of this file.
1#ifndef DAPHNE_CONTROL_CLIENT_HPP
2#define DAPHNE_CONTROL_CLIENT_HPP
3#pragma once
4
5#include <string>
6#include <cstdint>
7#include <zmq.hpp>
8
9#include "daphnemodules/daphne_control_envelope.pb.h"
11
12namespace daphne::zmq {
13
23{
24public:
25 using Milliseconds = std::chrono::milliseconds;
26
27 ControlClient(zmq::context_t& ctx,
28 std::string_view ip,
29 uint16_t port,
30 Milliseconds timeout = Milliseconds{500});
31
33 daphnemodules::ConfigureResponse
34 configure(const daphnemodules::ConfigureRequest& req);
35
37 daphnemodules::ConfigureCLKsResponse
38 configure_clks(const daphnemodules::ConfigureCLKsRequest& req);
39
40private:
41 zmq::socket_t socket_;
42};
43
44} // namespace daphne::zmq
45#endif /* DAPHNE_CONTROL_CLIENT_HPP */
Thin RAII wrapper that sends Configure* protobuf requests and returns the corresponding responses.
daphnemodules::ConfigureCLKsResponse configure_clks(const daphnemodules::ConfigureCLKsRequest &req)
daphnemodules::ConfigureResponse configure(const daphnemodules::ConfigureRequest &req)
std::chrono::milliseconds Milliseconds
ControlClient(zmq::context_t &ctx, std::string_view ip, uint16_t port, Milliseconds timeout=Milliseconds{500})