diff --git a/document/gb28181.md b/document/gb28181.md index 98a449a..ec354d1 100644 --- a/document/gb28181.md +++ b/document/gb28181.md @@ -254,7 +254,7 @@ Method: POST "channel_id": , // 通道ID "iris_in": , // 光圈小 "iris_out": // 光圈大 - "focus_near": // 聚焦远 + "focus_near": // 聚焦近 "focus_far": // 聚焦远 "speed": // 步长,1~8 } diff --git a/gb28181/ptz.go b/gb28181/ptz.go index 4ce0f59..f36ecdf 100644 --- a/gb28181/ptz.go +++ b/gb28181/ptz.go @@ -93,10 +93,11 @@ func (p *Ptz) Pack() string { buf[0] = PTZFirstByte buf[1] = getAssembleCode() buf[2] = 0 - if p.ZoomIn { + if p.ZoomOut { buf[3] |= 1 << 5 } - if p.ZoomOut { + + if p.ZoomIn { buf[3] |= 1 << 4 } if p.Up { @@ -113,7 +114,7 @@ func (p *Ptz) Pack() string { } buf[4] = p.Speed buf[5] = p.Speed - buf[6] = p.Speed + buf[6] = p.Speed << 4 getVerificationCode(buf) return hex.EncodeToString(buf) }