diff --git a/include/app_config.hpp b/include/app_config.hpp index 2acfcdd..92af729 100644 --- a/include/app_config.hpp +++ b/include/app_config.hpp @@ -38,11 +38,15 @@ struct VehicleMQTTTopics { std::string heartbeat_up; std::string video_down; + std::string record_query; + std::string record_play; void fill_with_veh_id(const std::string& vehId) { heartbeat_up = "/kun/vehicle/video/status/" + vehId; video_down = "/kun/vehicle/video/request/" + vehId; + record_query = "/kun/vehicle/video/record/query/" + vehId; + record_play = "/kun/vehicle/video/record/play/" + vehId; } }; diff --git a/src/mqtt_client_wrapper.cpp b/src/mqtt_client_wrapper.cpp index 611f593..4ddc2d8 100644 --- a/src/mqtt_client_wrapper.cpp +++ b/src/mqtt_client_wrapper.cpp @@ -67,6 +67,8 @@ static void on_mqtt_connected() { LOG_INFO("[MQTT] Connected to broker: " + g_app_config.mqtt.server_ip); mqtt_client->subscribe(g_app_config.mqtt.topics.video_down); + mqtt_client->subscribe(g_app_config.mqtt.topics.record_query); + mqtt_client->subscribe(g_app_config.mqtt.topics.record_play); } static void on_mqtt_disconnected() { LOG_WARN("[MQTT] Disconnected from broker: " + g_app_config.mqtt.server_ip); }