Motion Master 6.0.0-alpha.111
Next-generation motion control software
Loading...
Searching...
No Matches
capture.h
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <cstdint>
5#include <expected>
6#include <functional>
7#include <span>
8#include <string>
9
13
14namespace mm::capture {
15
18using FrameSink = std::function<void(int64_t timestampNs, std::span<const uint8_t> bytes)>;
19
25std::expected<void, std::string> captureFrames(const std::string& adapter,
26 std::chrono::milliseconds duration,
27 const FrameSink& sink);
28
29} // namespace mm::capture
adapter
Definition config.h:230
Definition capture.h:14
std::expected< void, std::string > captureFrames(const std::string &adapter, std::chrono::milliseconds duration, const FrameSink &sink)
Captures the EtherCAT frames that leave or enter adapter for duration.
Definition capture_linux.cc:32
std::function< void(int64_t timestampNs, std::span< const uint8_t > bytes)> FrameSink
Called for every frame, with nanoseconds since the Unix epoch and the frame from the Ethernet header ...
Definition capture.h:18
std::size_t bytes
Definition spoe_connection.cc:24