1
This commit is contained in:
parent
ba07a6fe15
commit
16a05d9fc6
@ -38,11 +38,15 @@ struct VehicleMQTTTopics
|
|||||||
{
|
{
|
||||||
std::string heartbeat_up;
|
std::string heartbeat_up;
|
||||||
std::string video_down;
|
std::string video_down;
|
||||||
|
std::string record_query;
|
||||||
|
std::string record_play;
|
||||||
|
|
||||||
void fill_with_veh_id(const std::string& vehId)
|
void fill_with_veh_id(const std::string& vehId)
|
||||||
{
|
{
|
||||||
heartbeat_up = "/kun/vehicle/video/status/" + vehId;
|
heartbeat_up = "/kun/vehicle/video/status/" + vehId;
|
||||||
video_down = "/kun/vehicle/video/request/" + vehId;
|
video_down = "/kun/vehicle/video/request/" + vehId;
|
||||||
|
record_query = "/kun/vehicle/video/record/query/" + vehId;
|
||||||
|
record_play = "/kun/vehicle/video/record/play/" + vehId;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -67,6 +67,8 @@ static void on_mqtt_connected()
|
|||||||
{
|
{
|
||||||
LOG_INFO("[MQTT] Connected to broker: " + g_app_config.mqtt.server_ip);
|
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.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); }
|
static void on_mqtt_disconnected() { LOG_WARN("[MQTT] Disconnected from broker: " + g_app_config.mqtt.server_ip); }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user