v2.0.0
Loading...
Searching...
No Matches
COMLIB::RtCmdClient Class Reference

TCP client for sending JSON commands to and receiving responses from mne_rt_server (port 4217). More...

#include <rt_cmd_client.h>

Public Types

typedef QSharedPointer< RtCmdClientSPtr
typedef QSharedPointer< const RtCmdClientConstSPtr

Signals

void response (QString p_sResponse)

Public Member Functions

 RtCmdClient (QObject *parent=nullptr)
bool hasCommand (const QString &p_sCommand) const
QString sendCLICommand (const QString &p_sCommand)
void sendCommandJSON (const Command &p_command)
QString readAvailableData ()
qint32 requestBufsize ()
void requestCommands ()
qint32 requestConnectors (QMap< qint32, QString > &p_qMapConnectors)
bool waitForDataAvailable (qint32 msecs=30000) const
Commandoperator[] (const QString &key)
const Command operator[] (const QString &key) const

Detailed Description

TCP client for sending JSON commands to and receiving responses from mne_rt_server (port 4217).

The real-time command client class provides an interface to communicate with the command port 4217 of a running mne_rt_server.

Definition at line 71 of file rt_cmd_client.h.

Inheritance diagram for COMLIB::RtCmdClient:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

typedef QSharedPointer<const RtCmdClient> COMLIB::RtCmdClient::ConstSPtr

Const shared pointer type for RtCmdClient.

Definition at line 77 of file rt_cmd_client.h.

◆ SPtr

typedef QSharedPointer<RtCmdClient> COMLIB::RtCmdClient::SPtr

Shared pointer type for RtCmdClient.

Definition at line 76 of file rt_cmd_client.h.

Constructor & Destructor Documentation

◆ RtCmdClient()

RtCmdClient::RtCmdClient ( QObject * parent = nullptr)
explicit

Creates the real-time command client.

Parameters
[in]parentParent QObject (optional).

Definition at line 64 of file rt_cmd_client.cpp.

Member Function Documentation

◆ hasCommand()

bool COMLIB::RtCmdClient::hasCommand ( const QString & p_sCommand) const
inline

Checks if a command is managed;

Parameters
p_sCommandCommand to check.
Returns
true if part of command manager, false otherwise.

Definition at line 208 of file rt_cmd_client.h.

◆ operator[]() [1/2]

Command & RtCmdClient::operator[] ( const QString & key)

Subscript operator [] to access commands by command name

Parameters
[in]keythe command key word.
Returns
Command object related to command key word.

Definition at line 349 of file rt_cmd_client.cpp.

◆ operator[]() [2/2]

const Command RtCmdClient::operator[] ( const QString & key) const

Subscript operator [] to access commands by command name

Parameters
keythe command key word.
Returns
Command object related to command key word.

Definition at line 356 of file rt_cmd_client.cpp.

◆ readAvailableData()

QString COMLIB::RtCmdClient::readAvailableData ( )
inline

Returns the available data.

Returns
the available data.

Definition at line 196 of file rt_cmd_client.h.

◆ requestBufsize()

qint32 RtCmdClient::requestBufsize ( )

Request buffer size from mne_rt_server

Definition at line 180 of file rt_cmd_client.cpp.

◆ requestCommands()

void RtCmdClient::requestCommands ( )

Request available commands from mne_rt_server

Definition at line 212 of file rt_cmd_client.cpp.

◆ requestConnectors()

qint32 RtCmdClient::requestConnectors ( QMap< qint32, QString > & p_qMapConnectors)

Request available connectors from mne_rt_server

Parameters
[in]p_qMapConnectorslist of connectors.
Returns
the active connector.

Definition at line 241 of file rt_cmd_client.cpp.

◆ response

void COMLIB::RtCmdClient::response ( QString p_sResponse)
signal

Emits the received response.

Parameters
[in]p_sResponsethe received response.

◆ sendCLICommand()

QString RtCmdClient::sendCLICommand ( const QString & p_sCommand)

Sends a command line formatted command to a connected mne_rt_server

Parameters
[in]p_sCommandThe command to send.
Returns
mne_rt_server reply.

Definition at line 73 of file rt_cmd_client.cpp.

◆ sendCommandJSON()

void RtCmdClient::sendCommandJSON ( const Command & p_command)

Sends a command to a connected mne_rt_server

Parameters
[in]p_commandThe command to send.
Returns
mne_rt_server reply.

Definition at line 98 of file rt_cmd_client.cpp.

◆ waitForDataAvailable()

bool RtCmdClient::waitForDataAvailable ( qint32 msecs = 30000) const

Wait for ready read until data are available.

Parameters
[in]msecstime to wait in milliseconds, if -1 function will not time out. Default value is 30000.
Returns
Command object related to command key word.

Definition at line 329 of file rt_cmd_client.cpp.


The documentation for this class was generated from the following files: