发布网友 发布时间:2023-07-27 04:17
共1个回答
热心网友 时间:2024-12-13 02:25
字节1 字节2 字节3 字节4 字节5 字节6 字节7 字节8 STX 地址码 指令码1 指令码2 数据码1 数据码2 ETX 校验码 1.该协议中所有数值都为十六进制数 2.STX始终为A0H
3.地址码为摄像机的逻辑地址号,地址范围:00H–1FH 4.指令码表示不同的动作
5.数据码1、2分别表示水平、垂直方向速度(00-3FH),在有关预制点的操作时,数据码2表示预制点值 6.ETX始终为AFH
7.校验码(XOR sum of Bytes 1-6) = 字节1 ^ 字节2 ^ 字节3 ^ 字节4 ^ 字节5 ^ 字节6
以地址码0x01为例:
{0xa0,0x01,0x00,0x08,0x00,0x30,0xaf,0x39,}//上
{0xa0,0x01,0x00,0x10,0x00,0x30,0xaf,0x21,}//下
{0xa0,0x01,0x00,0x04,0x10,0x00,0xaf,0x15,}//左
{0xa0,0x01,0x00,0x02,0x10,0x00,0xaf,0x13,}//右
{0xa0,0x01,0x00,0x40,0x00,0x00,0xaf,0x41,}//变倍短
{0xa0,0x01,0x00,0x20,0x00,0x00,0xaf,0x21,}//变倍长
{0xa0,0x01,0x02,0x00,0x00,0x00,0xaf,0x03,}//聚焦近
{0xa0,0x01,0x01,0x00,0x00,0x00,0xaf,0x00,}//聚焦远
{0xa0,0x01,0x08,0x00,0x00,0x00,0xaf,0x09,}//光圈小
{0xa0,0x01,0x04,0x00,0x00,0x00,0xaf,0x05,}//光圈大
无命令字发送//灯光关 无命令字发送//灯光开
{0xa0,0x01,0x00,0x96,0x00,0x20,0xaf,0xb7,}//自动巡航
{0xa0,0x01,0x00,0x99,0x00,0x20,0xaf,0xb8,}//关闭自动巡航 {0xa0,0x01,0x00,0x07,0x00,0x01,0xaf,0x07,}//转至预置点001 {0xa0,0x01,0x00,0x03,0x00,0x01,0xaf,0x03,}//设置预置点001 {0xa0,0x01,0x00,0x05,0x00,0x01,0xaf,0x01,}//删除预置点001
以上对应的停命令均是(上下左右、变倍、聚焦、光圈均有停命令): {0xa0,0x01,0x00,0x00,0x00,0x00,0xaf,0x01,}