數據格式
1位起始位、8位數據、1位停止位,無校驗位。波特率:9600B/S
命令格式
位元組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 2-6) = 位元組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,}