zl程序教程

您现在的位置是:首页 >  其他

当前栏目

海康ehome协议分析(3):PTZ云台控制

2023-02-19 12:21:24 时间

废话不多说,直接贴信令,这里有点不同, 云台控制是平台发给设备3次数据,设备回复平台1次。

1. 请求(平台 to 设备)

需要发送三次udp报文

<?xml version="1.0" encoding="GB2312" ?>
<PPVSPMessage>
    <Version>2.5</Version>
    <Sequence>6256</Sequence>
    <CommandType>REQUEST</CommandType>
    <Method>CONTROL</Method>
    <Command>PTZCONTROL</Command>
    <Params>
        //设备的通道ID
        <Channel>2</Channel>
        //LEFT RIHGT UP DOWN
        <PTZCmd>LEFT</PTZCmd>
        //Start Stop
        <Action>Start</Action>
        //1-7
        <Speed>4</Speed>
    </Params>
</PPVSPMessage>
2. 回复(设备 to 平台)

设备就回复平台一次

<?xml version="1.0" encoding="GB2312"?>
<PPVSPMessage>
    <Version>2.0</Version>
    <Sequence>6256</Sequence>
    <CommandType>RESPONSE</CommandType>
    <WhichCommand>PTZCONTROL</WhichCommand>
    //成功这里返回 200
    <Status>401</Status>
    <Description>System Oper Faild.</Description>
    <Params/>
</PPVSPMessage>