通过三星协议控制三星摄像头的菜单,进行快门等调节

来源:互联网 发布:知乎 猎头公司排名 编辑:程序博客网 时间:2024/05/19 06:19
        最近做的一个项目,要求根据不同光照度对三星摄像头的快门进行控制,而三星摄像头快门必需通过菜单来进行设置,所以对三星协议进行了一下学习。
        三星协议和PELCO一样,也是一个串行控制协议,其内容如下:

 

SAMSUNG   Protocol

 

 

1. PROTOCOL

  Data Communication :  RS485, Start-Stop Synchronized serial interface

  Protocol :  8bit data ,1 Stop bit, None Parity 

  Transmission speed :  4800, 9600, 19200, 38400 bps

 
2. Data Format

           

                                  9 Byte Fixed

 Data Byte

Type

Contents

Remarks

Byte 1

Start Code

A0H

Data Packet Starting Point

Byte 2

Sender Addr

Sender address

*Samsung WebTX: FEH

 

Byte 3

Target Addr

Target address

 

Byte 4

Command

   *Camera Adjustment: 00H

     (Factory Use Only)

   Pan/Tilt Command: 01H

   System Command: 03H

 

 

Byte 5

 

 

Byte 6

 

 

Byte 7

 

 

Byte 8

 

 

Byte 9

Check Sum

 LSB* of  (FFFFH - ( Sum from Byte2 to Byte8))

Start Code

A0H(1)

Sender

Addr(1)

Target

Addr(1)

Command (5)

Check sum

(1)

       Byte 1              Byte2                   Byte 3                    Byte 4 ~ 8                                                      Byte 9

 

    LSB : Less Significant Byte

 

 3. ACK Format

                                   9Byte Fixed

     Byte 1       Byte 2           Byte 3            Byte 4           Byte 5            Byte 6       Byte 7       Byte 8            Byte 9

A0H(1)

Sender

Addr(1)

Target

Addr(1)

FFH(1)

*

*

*

FFH

FFH

                                              

ACK       Return Code of Camera

 

 

l      ACK is applicable only in case that Byte 4 is 03H

 

"       00H : OK

     01H : Error (Request Retransmission)

#      Camera Mode

-. Manual Mode : 00H

-. Pattern Mode : 02H

-. Scan Mode : 03H

-. Auto Pan Mode : 04H

$  In case of Pattern Mode(Byte6=02H), this byte means Pattern Number (1~3).

                                     

Byte3

Byte4

Byte5

Byte6

Byte7

Byte8

Target

Address

(*ID set-up in menu)

 

 00H 

 

 

 

 

 

4. Camera Adjustment Command (Factory Use Only)

 
5. Camera Pan/Tilt Command

 

Byte4

Byte5

Byte6

Byte7

Byte8

Bit0

01H

Focus Far

Pan Left

Pan Motor

Speed

00H~40H

Tilt Motor

Speed

00H~40H

Bit1

Focus Near

Pan Right

Bit2

One AF

Tilt Up

Bit3

Iris Open

Tilt Down

Bit4

Iris Close

 

Bit5

Zoom Tele

 

Bit6

Zoom Wide

 

Bit7

 

 

 

Pan/Tilt/Zoom/Focus Command

 

Pan (Left)

Tilt (Down)

Zoom (Wide)

Focus (Near)

Pan (Right)

Tilt (Up)

Zoom (Tele)

Focus (Far)

Function

 

0

0

Stop

1

0

Motion of value “1”

0

1

Motion of value “1”

1

1

Keep the Current Motion

Ex)

 Step 1) Select “Focus Far”

                    Byte 5  Bit 7                                               Bit 0

0

0

0

0

0

0

0

1

 

Step 2) “Focus Far” Continued  

                        Byte 5  Bit 7                                               Bit 0

0

0

0

0

0

0

1

1

 

Step 3) Stop “Focus Far”   

                        Byte 5  Bit 7                                               Bit 0

0

0

0

0

0

0

0

0

 

Step 2) Select “Focus Near”   

                        Byte 5  Bit 7                                               Bit 0

0

0

0

0

0

0

0

1

 

6. System Command

 

 

Category

Items

Byte4

Byte5

Byte6

Byte7

Byte8

Note

1

 

Numeric

Key

0 Key

03H

00H

FFH

FFH

FFH

 

2

1 Key

03H

01H

FFH

FFH

FFH

 

3

2 Key (a)

03H

02H

FFH

FFH

FFH

 

4

3 Key

03H

04H

FFH

FFH

FFH

 

5

4 Key(^)

03H

05H

FFH

FFH

FFH

 

6

5 Key

03H

06H

FFH

FFH

FFH

 

7

6 Key(`)

03H

07H

FFH

FFH

FFH

 

8

7 Key

03H

08H

FFH

FFH

FFH

 

9

8 Key(e)

03H

09H

FFH

FFH

FFH

 

10

9 Key

03H

0AH

FFH

FFH

FFH

 

11

 

CAM

03H

12H

XX

FFH

FFH

XX : CAM

 NUMBER

12

SCAN

03H

13H

XX

FFH

FFH

XX :

 01H-START

 00H-STOP

13

MENU

03H

17H

XX

FFH

FFH

XX :

 01H-MENU ON

 00H-MENU OFF

14

ENTER

03H

18H

FFH

FFH

FFH

 

15

PRESET MOVE

03H

19H

XX

FFH

FFH

XX : PRESET NO.

    (0 ~ 127)

16

AUTO PAN

03H

1AH

XX

FFH

FFH

XX :

 01H - START

 00H - STOP

17

PATTERN

03H

1BH

XX

YY

FFH

XX : PATTERN

    NO. (1 ~ 3)

YY :

 01H - START

 00H - STOP

18

RESET

03H

1EH

FFH

FFH

FFH

 

19

DOWNLOAD START

03H

30H

FFH

FFH

FFH

 

20

DOWNLOAD END

03H

31H

FFH

FFH

FFH

 

21

UPLOAD START

03H

32H

FFH

FFH

FFH

 

22

UPLOAD END

03H

33H

FFH

FFH

FFH

 

23

FACTORY RESET

03H

40H

FFH

FFH

FFH

 

24

PRESET SAVE

03H

50H

XX

FFH

FFH

XX : PRESET NO.

    (0 ~ 127)

25

PRESET DELETE

03H

51H

XX

FFH

FFH

XX : PRESET NO.

    (0 ~ 127)

 其中MENU命令可打开和关闭菜单;

ENTER对当前命令进行确认;

Numeric Key中的3、9、5、7命令可对菜单光标进行上下左右移动操作。

操作成功后,摄像头会返回正确指令应答。A0 01 00 FF 00 00 00 FF FF等。