package com.paul.drone.util.mqtt; /** * MQTT主题常量类 * 统一管理所有MQTT的topic */ public class MqttTopic { // 远程控制请求 public static final String REMOTE_CONTROL_REQUEST = "drone/remote/control/%s/request"; // 远程控制请求回复 public static final String REMOTE_CONTROL_REQUEST_REPLY = "drone/remote/control/%s/request_reply"; // 远程控制云台负载 public static final String REMOTE_CONTROL_PAYLOAD = "drone/remote/control/%s/payload"; // 远程控制飞行 public static final String REMOTE_CONTROL_FLY = "drone/remote/control/%s/flight"; // 远程控制飞行回复 public static final String REMOTE_CONTROL_FLY_REPLY = "drone/remote/control/%s/flight_reply"; // 远程直播 public static final String REMOTE_LIVE = "drone/remote/%s/live"; // 远程直播回复 public static final String REMOTE_LIVE_REPLY = "drone/remote/%s/live_reply"; public static final String REMOTE_LIVE_LIKE = "drone/remote/+/live"; // 设备OSD数据发布 public static final String PUBLISH_DEVICE_OSD = "thing/product/mobile/%s/osd"; /** * 获取完整主题 * @param template 主题模板 * @param args 参数列表 * @return 完整主题字符串 */ public static String getTopic(String template, Object... args) { return String.format(template, args); } }