v2.0.0
Loading...
Searching...
No Matches
rt_data_client.h File Reference

TCP client for the mne_rt_server raw-data port (4218): pulls FiffInfo, digitizer points and streamed sample buffers. More...

#include "../com_global.h"
#include <fiff/fiff_stream.h>
#include <fiff/fiff_info.h>
#include <fiff/fiff_tag.h>
#include <fiff/fiff_digitizer_data.h>
#include <utility>
#include <QSharedPointer>
#include <QString>
#include <QTcpSocket>
Include dependency graph for rt_data_client.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

 Value-type aggregate of the FIFF metadata blocks mne_rt_server sends at the start of a measurement. More...
class  COMLIB::RtDataClient
 QTcpSocket subclass that talks the FIFF wire dialect of the mne_rt_server data port (default 4218). More...

Namespaces

namespace  COMLIB
 Real-time client/server communication primitives for talking to mne_rt_server.

Detailed Description

TCP client for the mne_rt_server raw-data port (4218): pulls FiffInfo, digitizer points and streamed sample buffers.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

COMLIB::RtDataClient is a thin QTcpSocket subclass that speaks the binary FIFF dialect mne_rt_server uses on its data port. The server’s wire protocol is a sequence of FIFF tags rather than a custom framing format, so this class reuses FIFFLIB::FiffStream and FIFFLIB::FiffTag to parse what it receives — the same code paths that read measurement files from disk.

Three message exchanges are supported. getClientId() asks the server to allocate an integer handle the server then uses to route subsequent buffers back to this socket. readInfo() / readMetadata() pull the channel layout, sampling rate and (when available) the head-shape digitiser point set captured during the measurement session. readRawBuffer() blocks until the next sample matrix arrives, reshapes the raw bytes into an Eigen::MatrixXf of n_channels × buffer_size, and reports the FIFF tag kind so the caller can distinguish data buffers from control frames (FIFF_BLOCK_START / FIFF_BLOCK_END / measurement stop).

The companion COMLIB::MetaData struct bundles FiffInfo and FiffDigitizerData so a single call carries both pieces of the session header without forcing callers to introduce a tuple type.

Definition in file rt_data_client.h.