#include "session.h"
#include <QCommandLineParser>
Go to the source code of this file.
#define RECEIVED_BYTES 1U |
#define RECEIVED_BYTES_CALIBR 7U |
#define RECEIVED_BYTES_INFO 15U |
int handleAdjustmentRequest |
( |
Session *const |
session | ) |
|
Request for the Adjustment of the device.
The function creates a connection to the device and sends a request for Adjustment using the Adjustment protocol of the form: {@a|time|ms}, 2+4+2 bytes long.
- Parameters
-
[in] | session | Pointer to the current session. |
- Return values
-
0 | if no error occurs, |
1 | terminate with an error. |
References Interface::closeSocket(), Session::getInterface(), Interface::getReceivedData(), Interface::openSocket(), Interface::readTheData(), RECEIVED_BYTES, standardOutput(), TIME_WAIT, and Interface::writeTheData().
int handleCalibrationRequest |
( |
Session *const |
session | ) |
|
Request for the Calibration of the device.
The function creates a connection to the device and sends a request for Calibration using the Calibration protocol of the form: {@c|time|ms}, 2+4+2 bytes long.
- Parameters
-
[in] | session | Pointer to the current session. |
- Return values
-
0 | if no error occurs, |
1 | terminate with an error. |
References Interface::closeSocket(), Session::getInterface(), Interface::getReceivedData(), Interface::openSocket(), Interface::readTheData(), RECEIVED_BYTES_CALIBR, standardOutput(), TIME_WAIT, and Interface::writeTheData().
int handleInformationRequest |
( |
Session *const |
session | ) |
|
Request for the Information of the device.
The function creates a connection to the device and sends a request for Information using the Information protocol of the form: {@i|time|ms}, 2+4+2 bytes long.
- Parameters
-
[in] | session | Pointer to the current session. |
- Return values
-
0 | if no error occurs, |
1 | terminate with an error. |
References Interface::closeSocket(), Session::getInterface(), Interface::getReceivedData(), Interface::openSocket(), Interface::readTheData(), RECEIVED_BYTES_INFO, standardOutput(), TIME_WAIT, and Interface::writeTheData().
int handleResetRequest |
( |
Session *const |
session | ) |
|
int handleSetRegisterRequest |
( |
Session *const |
session, |
|
|
const float |
value |
|
) |
| |
Request to update the register value.
The function creates a connection to the device and sends a request for SetRegister using the SetRegister protocol of the form: {@s|value}, 2+4 bytes long.
- Parameters
-
[in] | session | Pointer to the current session. |
[in] | value | |
- Return values
-
0 | if no error occurs, |
1 | terminate with an error. |
References Interface::closeSocket(), Session::getInterface(), Interface::getReceivedData(), Interface::openSocket(), Interface::readTheData(), RECEIVED_BYTES, standardOutput(), TIME_WAIT, and Interface::writeTheData().
void setCommandLineParser |
( |
QCommandLineParser & |
parser | ) |
|