Remove payloadReceived() signal from HAL_Driver

This commit is contained in:
Alex Spataru 2024-11-17 19:38:00 -05:00
parent b4f74abf4f
commit 48dd861d03
3 changed files with 3 additions and 52 deletions

View File

@ -40,72 +40,27 @@ namespace IO
*/
class HAL_Driver : public QObject
{
// clang-format off
Q_OBJECT
// clang-format on
signals:
/**
* @brief Emitted when the driver's configuration changes.
*/
void configurationChanged();
/**
* @brief Emitted when data is successfully written to the device.
*/
void dataSent(const QByteArray &data);
/**
* @brief Emitted when data is received and should be appended to a buffer.
*/
void dataReceived(const QByteArray &data);
/**
* @brief Emitted when data is received and should be processed directly.
*/
void payloadReceived(const QByteArray &data);
public:
/**
* @brief Close the device connection.
*/
virtual void close() = 0;
/**
* @brief Check if the device is open.
*/
[[nodiscard]] virtual bool isOpen() const = 0;
/**
* @brief Check if the device is ready for reading.
*/
[[nodiscard]] virtual bool isReadable() const = 0;
/**
* @brief Check if the device is ready for writing.
*/
[[nodiscard]] virtual bool isWritable() const = 0;
/**
* @brief Check if the device configuration is valid.
*/
[[nodiscard]] virtual bool configurationOk() const = 0;
/**
* @brief Write data to the device. Returns the number of bytes written.
*/
[[nodiscard]] virtual quint64 write(const QByteArray &data) = 0;
/**
* @brief Open the device in the specified mode.
*/
[[nodiscard]] virtual bool open(const QIODevice::OpenMode mode) = 0;
protected:
/**
* Process incoming data.
* @param data The received data to process.
*/
void processData(const QByteArray &data)
{
QByteArray dataCopy(data);

View File

@ -303,8 +303,6 @@ void IO::Manager::connectDevice()
{
connect(driver(), &IO::HAL_Driver::dataReceived, &m_frameReader,
&FrameReader::processData, Qt::QueuedConnection);
connect(driver(), &IO::HAL_Driver::payloadReceived, this,
&IO::Manager::processPayload, Qt::QueuedConnection);
}
// Error opening the device
@ -330,8 +328,6 @@ void IO::Manager::disconnectDevice()
// Disconnect bus signals/slots
disconnect(driver(), &IO::HAL_Driver::dataReceived, &m_frameReader,
&FrameReader::processData);
disconnect(driver(), &IO::HAL_Driver::payloadReceived, this,
&IO::Manager::processPayload);
// Close driver device
driver()->close();

View File

@ -366,7 +366,7 @@ void JSON::FrameParser::paste()
*/
void JSON::FrameParser::apply()
{
(void) save(false);
(void)save(false);
}
/**
@ -387,7 +387,7 @@ void JSON::FrameParser::reload()
// Load default template
m_textEdit.setPlainText(defaultCode());
(void) save(true);
(void)save(true);
}
/**
@ -419,7 +419,7 @@ void JSON::FrameParser::import()
{
auto data = file.readAll();
m_textEdit.setPlainText(QString::fromUtf8(data));
(void) save(true);
(void)save(true);
}
}
}