添加开机功能
This commit is contained in:
parent
b9e9b99b3f
commit
02a6b3ecf8
|
|
@ -29,7 +29,7 @@ public class TuohengPowerOnInstruction extends AbstractInstruction {
|
||||||
payload.put("value", "1"); // 1=开机, 0=关机
|
payload.put("value", "1"); // 1=开机, 0=关机
|
||||||
payload.put("channel", 1);
|
payload.put("channel", 1);
|
||||||
|
|
||||||
String topic = "/topic/v1/airportControl/" + sn;
|
String topic = "/topic/v1/airportNest/" + sn + "/control";
|
||||||
|
|
||||||
context.getMqttClient().sendMessage(topic, payload.toJSONString());
|
context.getMqttClient().sendMessage(topic, payload.toJSONString());
|
||||||
log.info("拓恒开机指令发送成功: topic={}, payload={}", topic, payload.toJSONString());
|
log.info("拓恒开机指令发送成功: topic={}, payload={}", topic, payload.toJSONString());
|
||||||
|
|
@ -38,10 +38,9 @@ public class TuohengPowerOnInstruction extends AbstractInstruction {
|
||||||
@Override
|
@Override
|
||||||
public CallbackConfig getMethodCallbackConfig(InstructionContext context) {
|
public CallbackConfig getMethodCallbackConfig(InstructionContext context) {
|
||||||
String sn = context.getSn();
|
String sn = context.getSn();
|
||||||
|
|
||||||
// 监听机场确认消息
|
// 监听机场确认消息
|
||||||
return CallbackConfig.builder()
|
return CallbackConfig.builder()
|
||||||
.topic("/topic/v1/airportNest/" + sn + "/confirm")
|
.topic("/topic/v1/airportNest/" + sn + "/control/confirm")
|
||||||
.fieldPath("code")
|
.fieldPath("code")
|
||||||
.expectedValue("DronePower")
|
.expectedValue("DronePower")
|
||||||
.timeoutMs(10000)
|
.timeoutMs(10000)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ public class TuohengMqttClientService {
|
||||||
|
|
||||||
private static final String AIRPORT_NEST_REALTIME_TOPIC = "/topic/v1/airportNest/+/realTime/data";
|
private static final String AIRPORT_NEST_REALTIME_TOPIC = "/topic/v1/airportNest/+/realTime/data";
|
||||||
private static final String AIRPORT_NEST_BASIC_TOPIC = "/topic/v1/airportNest/+/realTime/basic";
|
private static final String AIRPORT_NEST_BASIC_TOPIC = "/topic/v1/airportNest/+/realTime/basic";
|
||||||
private static final String AIRPORT_NEST_CONFIRM_TOPIC = "/topic/v1/airportNest/+/confirm";
|
private static final String AIRPORT_NEST_CONFIRM_TOPIC = "/topic/v1/airportNest/+/control/confirm";
|
||||||
private static final String AIRPORT_DRONE_REALTIME_TOPIC = "/topic/v1/airportDrone/+/realTime/data";
|
private static final String AIRPORT_DRONE_REALTIME_TOPIC = "/topic/v1/airportDrone/+/realTime/data";
|
||||||
private static final String PRODUCT_OSD_TOPIC = "thing/product/+/osd";
|
private static final String PRODUCT_OSD_TOPIC = "thing/product/+/osd";
|
||||||
private static final String PRODUCT_EVENTS_TOPIC = "thing/product/+/events";
|
private static final String PRODUCT_EVENTS_TOPIC = "thing/product/+/events";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue