From 08af41b1dd568e9607279da918391c192d137d1d Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Wed, 10 Jun 2020 14:22:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=8F=98=E7=84=A6=E9=80=9F?= =?UTF-8?q?=E5=BA=A6=E8=AE=A1=E7=AE=97=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java index 9b9ca2b5..b70f353e 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java @@ -101,7 +101,7 @@ public class SIPCommander implements ISIPCommander { * @param upDown 镜头上移下移 0:停止 1:上移 2:下移 * @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大 * @param moveSpeed 镜头移动速度 默认 0XFF (0-255) - * @param zoomSpeed 镜头缩放速度 默认 0X1 (0-15) + * @param zoomSpeed 镜头缩放速度 默认 0X1 (0-255) */ public static String cmdString(int leftRight, int upDown, int inOut, int moveSpeed, int zoomSpeed) { int cmdCode = 0; @@ -127,12 +127,10 @@ public class SIPCommander implements ISIPCommander { strTmp = String.format("%02X", moveSpeed); builder.append(strTmp, 0, 2); builder.append(strTmp, 0, 2); - // strTmp = String.format("%X", zoomSpeed); - int zs=(zoomSpeed<<4 & 0XF0); - strTmp = String.format("%X", zs); + strTmp = String.format("%X", zoomSpeed); builder.append(strTmp, 0, 1).append("0"); //计算校验码 - int checkCode = (0XA5 + 0X0F + 0X01 + cmdCode + moveSpeed + moveSpeed + zs/*(zoomSpeed << 4 & 0XF0)*/) % 0X100; + int checkCode = (0XA5 + 0X0F + 0X01 + cmdCode + moveSpeed + moveSpeed + (zoomSpeed /*<< 4*/ & 0XF0)) % 0X100; strTmp = String.format("%02X", checkCode); builder.append(strTmp, 0, 2); return builder.toString();