From d7ebe933378239e0848c75c6690e025af85faaf4 Mon Sep 17 00:00:00 2001 From: claire Date: Thu, 2 Jan 2025 14:20:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=89=E5=9C=88=E9=80=9F?= =?UTF-8?q?=E5=BA=A6=E8=8C=83=E5=9B=B4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/gb28181/controller/PtzController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PtzController.java b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PtzController.java index 1f9cfa27..233050b6 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PtzController.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PtzController.java @@ -163,6 +163,12 @@ public class PtzController { log.debug("设备光圈控制 API调用,deviceId:{} ,channelId:{} ,command:{} ,speed:{} ",deviceId, channelId, command, speed); } + if (speed == null) { + speed = 100; + }else if (speed < 0 || speed > 255) { + throw new ControllerException(ErrorCode.ERROR100.getCode(), "speed 为 0-255的数字"); + } + int cmdCode = 0x40; switch (command){ case "in":