Index: tools/AgentSim/AgentSimController.cpp =================================================================== diff -u -rf9c6b488aa4135e8cd47ccd3fdc6c3ae1cd831aa -ra5781739bcbe58c754aff8861561495624bc5b67 --- tools/AgentSim/AgentSimController.cpp (.../AgentSimController.cpp) (revision f9c6b488aa4135e8cd47ccd3fdc6c3ae1cd831aa) +++ tools/AgentSim/AgentSimController.cpp (.../AgentSimController.cpp) (revision a5781739bcbe58c754aff8861561495624bc5b67) @@ -23,7 +23,7 @@ * \brief AgentSimController::AgentSimController * \details Constructor. Loads the INI configuration and wires the server newConnection signal. * \param configPath Path to the INI configuration file. - * \param parent Optional QObject parent. + * \param parent QObject parent. */ AgentSimController::AgentSimController(const QString &configPath, QObject *parent) : QObject(parent), _settings(configPath, QSettings::IniFormat) @@ -35,7 +35,7 @@ * \brief AgentSimController::listen * \details Reads the socket path from the INI configuration, removes any stale * socket file, then starts the server. - * \return true on success, false if the server could not bind. + * \return true on success, false if the server could not bind to the socket. */ bool AgentSimController::listen() { @@ -85,39 +85,39 @@ /*! * \brief AgentSimController::onReadyRead * \details Appends incoming bytes to the receive buffer and drains it through - * the AgentMessage parser. Logs each complete frame and sends an Ack. + * the RtMessage parser. Logs each complete frame and sends an Ack. */ void AgentSimController::onReadyRead() { _rxBuf.append(_client->readAll()); - AgentMessage::FeedResult result; + RtMessage::FeedResult result; do { result = _rxMsg.feed(_rxBuf); switch (result) { - case AgentMessage::FeedResult::Complete: + case RtMessage::FeedResult::Complete: handleMessage(_rxMsg); _rxMsg.reset(); break; - case AgentMessage::FeedResult::HeaderError: + case RtMessage::FeedResult::HeaderError: qWarning().noquote() << "AgentSim: header CRC error — frame dropped"; break; - case AgentMessage::FeedResult::PayloadError: + case RtMessage::FeedResult::PayloadError: qWarning().noquote() << "AgentSim: payload CRC error — frame dropped"; break; - case AgentMessage::FeedResult::Incomplete: + case RtMessage::FeedResult::Incomplete: break; } - } while (result == AgentMessage::FeedResult::Complete && !_rxBuf.isEmpty()); + } while (result == RtMessage::FeedResult::Complete && !_rxBuf.isEmpty()); } /*! * \brief AgentSimController::handleMessage * \details Decodes a received frame and prints its typed body as JSON, generically * via the protobuf descriptor pool (msgId -> message name -> dynamic parse). - * \param msg The complete AgentMessage frame. + * \param msg The complete RtMessage frame. */ -void AgentSimController::handleMessage(const AgentMessage &msg) +void AgentSimController::handleMessage(const RtMessage &msg) { const QByteArray payload = msg.payload(); logMessage(msg.msgId(), msg.sequence(), payload); @@ -173,7 +173,7 @@ * \param sequence Sequence number from the parsed frame. * \param payload Payload bytes of the parsed frame. */ -void AgentSimController::logMessage(AgentMessage::MsgId msgId, quint16 sequence, const QByteArray &payload) +void AgentSimController::logMessage(RtMessage::MsgId msgId, quint16 sequence, const QByteArray &payload) { qInfo().noquote() << QString("AgentSim: rx MsgId=0x%1 seq=%2 payloadLen=%3") .arg(static_cast(msgId), 4, 16, QChar('0'))