|
@@ -75,20 +75,7 @@ public class ProjectionLightController extends BaseController {
|
|
ProjectionLightDTO projectionLightDTO = projectionLightService.getProjectionLightDetailsById(id);
|
|
ProjectionLightDTO projectionLightDTO = projectionLightService.getProjectionLightDetailsById(id);
|
|
if (projectionLightDTO == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL, version);
|
|
if (projectionLightDTO == null) return toolUtils.response(InterfaceResultEnum.PARAM_FAIL, version);
|
|
|
|
|
|
- String sendTopic;
|
|
|
|
- String resTopic;
|
|
|
|
- if (projectionLightDTO.getWifiModel() == 3 || projectionLightDTO.getWifiModel() == 6) {
|
|
|
|
- sendTopic = "/WEGW3/TransIn/";
|
|
|
|
- resTopic = "/WEGW3/TransOut/";
|
|
|
|
- } else if (projectionLightDTO.getWifiModel() == 1 || projectionLightDTO.getWifiModel() == 5) {
|
|
|
|
- sendTopic = "/WEGW2/TransIn/";
|
|
|
|
- resTopic = "/WEGW2/TransOut/";
|
|
|
|
- } else {
|
|
|
|
- sendTopic = "/WEGW/TransIn/";
|
|
|
|
- resTopic = "/WEGW/TransOut/";
|
|
|
|
- }
|
|
|
|
- sendTopic += projectionLightDTO.getWifiNum();
|
|
|
|
- resTopic += projectionLightDTO.getWifiNum();
|
|
|
|
|
|
+ projectionLightDTO.setTopic(projectionLightDTO.getWifiModel(), projectionLightDTO.getWifiNum());
|
|
|
|
|
|
// 发送的指令内容:投影灯选择图案片
|
|
// 发送的指令内容:投影灯选择图案片
|
|
String cmd;
|
|
String cmd;
|
|
@@ -104,15 +91,17 @@ public class ProjectionLightController extends BaseController {
|
|
return toolUtils.response(InterfaceResultEnum.IMAGE_NUMBER_ERROR, version);
|
|
return toolUtils.response(InterfaceResultEnum.IMAGE_NUMBER_ERROR, version);
|
|
}
|
|
}
|
|
|
|
|
|
- projectionLightDTO.setSerialNum(projectionLightDTO.getSerialPort());
|
|
|
|
String cmdInfo;
|
|
String cmdInfo;
|
|
if (projectionLightDTO.getWifiModel() == 3 || projectionLightDTO.getWifiModel() == 6) { // 云盒G300
|
|
if (projectionLightDTO.getWifiModel() == 3 || projectionLightDTO.getWifiModel() == 6) { // 云盒G300
|
|
|
|
+ projectionLightDTO.setSerialNum(projectionLightDTO.getSerialPort());
|
|
cmdInfo = ToolUtils.getRandomString() + projectionLightDTO.getSerialNum() + cmd;
|
|
cmdInfo = ToolUtils.getRandomString() + projectionLightDTO.getSerialNum() + cmd;
|
|
} else {
|
|
} else {
|
|
cmdInfo = ToolUtils.getRandomString() + cmd;
|
|
cmdInfo = ToolUtils.getRandomString() + cmd;
|
|
}
|
|
}
|
|
|
|
|
|
- String backResult = toolUtils.sendMqttCmd(sendTopic, toolUtils.hexString2Bytes(cmdInfo), resTopic);
|
|
|
|
|
|
+ String sendTopic = projectionLightDTO.getSendTopic();
|
|
|
|
+ String backTopic = projectionLightDTO.getBackTopic();
|
|
|
|
+ String backResult = toolUtils.sendMqttCmd(sendTopic, toolUtils.hexString2Bytes(cmdInfo), backTopic);
|
|
if (backResult != null && !backResult.trim().isEmpty()) {
|
|
if (backResult != null && !backResult.trim().isEmpty()) {
|
|
projectionLightDTO.setUpdateTime(ToolUtils.getNowTime());
|
|
projectionLightDTO.setUpdateTime(ToolUtils.getNowTime());
|
|
projectionLightDTO.setImageNumber(imageNumber);
|
|
projectionLightDTO.setImageNumber(imageNumber);
|