SynchroTime
|
#include <QCommandLineOption>
#include <QLoggingCategory>
#include <QDebug>
#include <QDateTime>
#include <QElapsedTimer>
#include "helper.h"
Functions | |
static QT_USE_NAMESPACE QTextStream | standardOutput (stdout) |
void | setCommandLineParser (QCommandLineParser &parser) |
Set Command Line Parser's parameters and optins. More... | |
int | handleResetRequest (Session *const session) |
Request for the Reset of the device. More... | |
int | handleInformationRequest (Session *const session) |
Request for the Information of the device. More... | |
int | handleAdjustmentRequest (Session *const session) |
Request for the Adjustment of the device. More... | |
int | handleCalibrationRequest (Session *const session) |
Request for the Calibration of the device. More... | |
int | handleSetRegisterRequest (Session *const session, const float value) |
Request to update the register value. More... | |
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.
[in] | session | Pointer to the current session. |
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.
[in] | session | Pointer to the current session. |
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.
[in] | session | Pointer to the current session. |
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 | ) |
Request for the Reset of the device.
The function creates a connection to the device and sends a request for Reset using the Reset protocol of the form: {@r}, 2 bytes long.
[in] | session | Pointer to the current session. |
0 | |
1 |
References Interface::closeSocket(), Session::getInterface(), Interface::getReceivedData(), Interface::openSocket(), Interface::readTheData(), RECEIVED_BYTES, standardOutput(), TIME_WAIT, and Interface::writeTheData().
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.
[in] | session | Pointer to the current session. |
[in] | value |
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 | ) |
|
static |
Referenced by handleAdjustmentRequest(), handleCalibrationRequest(), handleInformationRequest(), handleResetRequest(), and handleSetRegisterRequest().