IRSOL
C++ code implementing socket server for interacting with Baumer camera.
inquiry_integration_time.cpp
Go to the documentation of this file.
2
3#include "irsol/macros.hpp"
6#include "irsol/utils.hpp"
7
8namespace irsol {
9namespace server {
10namespace handlers {
14
15std::vector<out_message_t>
17 std::shared_ptr<irsol::server::ClientSession> session,
19{
20 auto& cam = session->app().camera();
21 auto exposure = cam.getExposure();
22
23 std::vector<out_message_t> result;
25 message,
26 static_cast<int>(
27 1.0 * std::chrono::duration_cast<std::chrono::microseconds>(exposure).count() / 1000)));
28 return result;
29}
30} // namespace handlers
31} // namespace server
32} // namespace irsol
Main server application managing client connections and camera streaming.
std::vector< out_message_t > process(std::shared_ptr< irsol::server::ClientSession > session, protocol::Inquiry &&message) final override
Processes an inquiry message to retrieve the integration time.
InquiryIntegrationTimeHandler(std::shared_ptr< Context > ctx)
Constructs the InquiryIntegrationTimeHandler.
Generic handler base class for protocol messages.
Definition base.hpp:39
Declaration of the InquiryIntegrationTimeHandler class.
Common portability and diagnostic macros for the irsol library.
#define IRSOL_MAYBE_UNUSED
Suppresses compiler warnings about unused variables or parameters.
Definition macros.hpp:39
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
Definition factory.hpp:28
Declaration of the ClientSession class.
Represents a value inquiry in the protocol.
Definition inquiry.hpp:32
static Success from(const Assignment &msg, std::optional< irsol::types::protocol_value_t > overrideValue=std::nullopt)
Creates a success message from an Assignment.
Definition success.hpp:75
auto result
General utility functions used throughout the irsol library.