|
|
@ -269,6 +269,35 @@ public class DeviceService { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 开始加热 |
|
|
|
* |
|
|
|
* @param temperature 温度值 |
|
|
|
*/ |
|
|
|
public boolean startHeating(int temperature) { |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
params.put("temperature", temperature); |
|
|
|
DeviceFeedback deviceFeedback = tcpClient.sendCommand("startHeating", params); |
|
|
|
if (deviceFeedback == null || deviceFeedback.getError() != null) { |
|
|
|
log.error("TCP startHeating 指令执行错误 {}", JSONUtil.toJsonStr(deviceFeedback)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 停止加热 |
|
|
|
*/ |
|
|
|
public boolean stopHeating() { |
|
|
|
DeviceFeedback deviceFeedback = tcpClient.sendCommand("stopHeating"); |
|
|
|
if (deviceFeedback == null || deviceFeedback.getError() != null) { |
|
|
|
log.error("TCP stopHeating 指令执行错误 {}", JSONUtil.toJsonStr(deviceFeedback)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 抬起托盘到指定高度 |
|
|
|
* |
|
|
|
* @param distance 距离 |
|
|
|