Changeset View
Changeset View
Standalone View
Standalone View
src/core/seriallayer.h
1 | /* AtCore | 1 | /* AtCore | ||
---|---|---|---|---|---|
2 | Copyright (C) <2016> | 2 | Copyright (C) <2016 - 2018> | ||
3 | 3 | | |||
4 | Authors: | 4 | Authors: | ||
5 | Patrick José Pereira <patrickjp@kde.org> | 5 | Patrick José Pereira <patrickjp@kde.org> | ||
6 | Chris Rizzitello <rizzitello@kde.org> | 6 | Chris Rizzitello <rizzitello@kde.org> | ||
7 | Tomaz Canabrava <tcanabrava@kde.org> | 7 | Tomaz Canabrava <tcanabrava@kde.org> | ||
8 | 8 | | |||
9 | This library is free software; you can redistribute it and/or | 9 | This library is free software; you can redistribute it and/or | ||
10 | modify it under the terms of the GNU Lesser General Public | 10 | modify it under the terms of the GNU Lesser General Public | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 49 | signals: | |||
56 | void pushedCommand(const QByteArray &comm); | 56 | void pushedCommand(const QByteArray &comm); | ||
57 | 57 | | |||
58 | /** | 58 | /** | ||
59 | * @brief Emit signal when command is received | 59 | * @brief Emit signal when command is received | ||
60 | * | 60 | * | ||
61 | * @param comm : Command | 61 | * @param comm : Command | ||
62 | */ | 62 | */ | ||
63 | void receivedCommand(const QByteArray &comm); | 63 | void receivedCommand(const QByteArray &comm); | ||
64 | | ||||
65 | /** | ||||
66 | * @brief Emit a signal if an error has happened. | ||||
67 | * @param error: the Error | ||||
68 | */ | ||||
69 | void serialError(QSerialPort::SerialPortError error); | ||||
64 | public: | 70 | public: | ||
65 | 71 | | |||
66 | /** | 72 | /** | ||
67 | * @brief SerialLayer Class to realize communication | 73 | * @brief SerialLayer Class to realize communication | ||
68 | * | 74 | * | ||
69 | * @param port : Port (/dev/ttyUSB ACM) | 75 | * @param port : Port (/dev/ttyUSB ACM) | ||
70 | * @param baud : Baud rate (115200) | 76 | * @param baud : Baud rate (115200) | ||
71 | * @param parent : Parent | 77 | * @param parent : Parent | ||
Show All 11 Lines | |||||
83 | /** | 89 | /** | ||
84 | * @brief Add command to be pushed | 90 | * @brief Add command to be pushed | ||
85 | * | 91 | * | ||
86 | * @param comm : Command, default terminator will be used | 92 | * @param comm : Command, default terminator will be used | ||
87 | */ | 93 | */ | ||
88 | void add(const QByteArray &comm); | 94 | void add(const QByteArray &comm); | ||
89 | 95 | | |||
90 | /** | 96 | /** | ||
97 | * @brief handleError Handle Errors from the serial port | ||||
98 | * @param error: The reported error | ||||
99 | */ | ||||
100 | void handleError(QSerialPort::SerialPortError error); | ||||
101 | | ||||
102 | /** | ||||
91 | * @brief Push command directly | 103 | * @brief Push command directly | ||
92 | * | 104 | * | ||
93 | * @param comm : Command | 105 | * @param comm : Command | ||
94 | * @param term : Terminator | 106 | * @param term : Terminator | ||
95 | */ | 107 | */ | ||
96 | void pushCommand(const QByteArray &comm, const QByteArray &term); | 108 | void pushCommand(const QByteArray &comm, const QByteArray &term); | ||
97 | 109 | | |||
98 | /** | 110 | /** | ||
Show All 26 Lines |