Commit 08af41b1dd568e9607279da918391c192d137d1d

Authored by Lawrence
1 parent 76a75bf3

改进变焦速度计算方式

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
... ... @@ -101,7 +101,7 @@ public class SIPCommander implements ISIPCommander {
101 101 * @param upDown 镜头上移下移 0:停止 1:上移 2:下移
102 102 * @param inOut 镜头放大缩小 0:停止 1:缩小 2:放大
103 103 * @param moveSpeed 镜头移动速度 默认 0XFF (0-255)
104   - * @param zoomSpeed 镜头缩放速度 默认 0X1 (0-15)
  104 + * @param zoomSpeed 镜头缩放速度 默认 0X1 (0-255)
105 105 */
106 106 public static String cmdString(int leftRight, int upDown, int inOut, int moveSpeed, int zoomSpeed) {
107 107 int cmdCode = 0;
... ... @@ -127,12 +127,10 @@ public class SIPCommander implements ISIPCommander {
127 127 strTmp = String.format("%02X", moveSpeed);
128 128 builder.append(strTmp, 0, 2);
129 129 builder.append(strTmp, 0, 2);
130   - // strTmp = String.format("%X", zoomSpeed);
131   - int zs=(zoomSpeed<<4 & 0XF0);
132   - strTmp = String.format("%X", zs);
  130 + strTmp = String.format("%X", zoomSpeed);
133 131 builder.append(strTmp, 0, 1).append("0");
134 132 //计算校验码
135   - int checkCode = (0XA5 + 0X0F + 0X01 + cmdCode + moveSpeed + moveSpeed + zs/*(zoomSpeed << 4 & 0XF0)*/) % 0X100;
  133 + int checkCode = (0XA5 + 0X0F + 0X01 + cmdCode + moveSpeed + moveSpeed + (zoomSpeed /*<< 4*/ & 0XF0)) % 0X100;
136 134 strTmp = String.format("%02X", checkCode);
137 135 builder.append(strTmp, 0, 2);
138 136 return builder.toString();
... ...