Refactor MQTT callback function names for consistency. Changed MessageCallback and ConnectionCallback to MessageCb and ConnectionCb in mqtt.hpp, mqtt.cpp, and custom_robot.cpp to improve code clarity and maintainability.

This commit is contained in:
2025-09-09 09:56:13 +08:00
parent e7bfce9dcb
commit cf58ad202a
3 changed files with 20 additions and 26 deletions

View File

@@ -178,8 +178,8 @@ bool CustomRobot::initializeMqtt() {
mqttClient_ = std::make_unique<MqttClient>(broker, port, clientId);
using namespace std::placeholders;
mqttClient_->setMessageCallback(std::bind(&CustomRobot::onMqttMessage, this, _1, _2));
mqttClient_->setConnectionCallback(std::bind(&CustomRobot::onMqttConnection, this, _1));
mqttClient_->setMessageCb(std::bind(&CustomRobot::onMqttMessage, this, _1, _2));
mqttClient_->setConnectionCb(std::bind(&CustomRobot::onMqttConnection, this, _1));
mqttClient_->startMessageProcessor();