Changeset View
Changeset View
Standalone View
Standalone View
src/core/seriallayer.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | /** | 53 | /** | ||
54 | * @brief The SerialLayerPrivate class | 54 | * @brief The SerialLayerPrivate class | ||
55 | */ | 55 | */ | ||
56 | class SerialLayer::SerialLayerPrivate | 56 | class SerialLayer::SerialLayerPrivate | ||
57 | { | 57 | { | ||
58 | public: | 58 | public: | ||
59 | bool _serialOpened; //!< @param _serialOpened: is serial port opened | 59 | /** _serialOpened: is Serial port opened */ | ||
60 | QSerialPort::SerialPortError _lastError; //!< @param _lastError: the last reported error | 60 | bool _serialOpened = false; | ||
61 | QByteArray _rawData; //!< @param _rawData: the raw serial data | 61 | /** _lastError: the last reported error */ | ||
62 | QVector<QByteArray> _rByteCommands; //!< @param _rByteCommand: received Messages | 62 | QSerialPort::SerialPortError _lastError = QSerialPort::NoError; | ||
63 | QVector<QByteArray> _sByteCommands; //!< @param _sByteCommand: sent Messages | 63 | /** _rawData: the raw serial data */ | ||
64 | QByteArray _rawData; | ||||
65 | /** _rByteCommand: received Messages */ | ||||
66 | QVector<QByteArray> _rByteCommands; | ||||
67 | /** _sByteCommand: sent Messages */ | ||||
68 | QVector<QByteArray> _sByteCommands; | ||||
64 | }; | 69 | }; | ||
65 | 70 | | |||
66 | SerialLayer::SerialLayer(const QString &port, int32_t baud, QObject *parent) : | 71 | SerialLayer::SerialLayer(const QString &port, int32_t baud, QObject *parent) : | ||
67 | QSerialPort(parent), d(new SerialLayerPrivate()) | 72 | QSerialPort(parent), d(new SerialLayerPrivate()) | ||
68 | { | 73 | { | ||
69 | setPortName(port); | 74 | setPortName(port); | ||
70 | setBaudRate(baud); | 75 | setBaudRate(baud); | ||
71 | if (open(QIODevice::ReadWrite)) { | 76 | if (open(QIODevice::ReadWrite)) { | ||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |