1. 简化球机移动的传参逻辑

This commit is contained in:
kunmeng
2025-02-27 15:29:12 +08:00
parent 7eae57ef1c
commit 7ff62da8e2
2 changed files with 13 additions and 11 deletions

View File

@@ -401,14 +401,15 @@ func (this *BallCamera) retrySend(handle Core.LONG, cmd []byte, maxRetries int,
}
func (receiver *BallCamera) StartBus(direction int, speed int) error {
err := Core.PTZControlWithSpeed_Other(receiver.userId, Core.LONG(receiver.deviceInfo.ByStartChan), Core.DWORD(direction), Core.DWORD(0), Core.DWORD(speed))
err := Core.PTZControlWithSpeed_Other(receiver.userId, Core.LONG(receiver.deviceInfo.ByStartChan), Core.DWORD(PTZEnum.toHikPTZEnum(direction)), Core.DWORD(0), Core.DWORD(speed))
if err != nil {
return err
}
return nil
}
func (receiver *BallCamera) StopBus(direction int, speed int) error {
err := Core.PTZControlWithSpeed_Other(receiver.userId, Core.LONG(receiver.deviceInfo.ByStartChan), Core.DWORD(direction), Core.DWORD(1), Core.DWORD(speed))
err := Core.PTZControlWithSpeed_Other(receiver.userId, Core.LONG(receiver.deviceInfo.ByStartChan), Core.DWORD(PTZEnum.toHikPTZEnum(direction)), Core.DWORD(1), Core.DWORD(speed))
if err != nil {
return err
}