XTR1.0 Protocol

Top  Previous 

XTR1.0 is a protocol developed by XmediaStudio for easy integration of user programs with XmediaStudio applications. The typical applications of the protocol are:

 

Interfacing external applications with XtraSense through TCP port (default 99999).
Remote control

 

Syntax

A string complies with XTR1.0 protocol consists of two parts: authentication code and command string. There is no special sequence for the two portions. You can put authentication code in front of command string or vice versa. You can have as many commands as you want in the command string portion. Both authentication code and commands should end with a semicolon, which is used to tell XtraSense the end of instruction.

clip0053

 

You will get a confirmation for each command in the command list sent through TCP port. You will not get any reply for commands sent by email. The confirmation message will be "COMMAND OK:" followed by the command you sent. For example, "COMMAND OK: CAM_ON[0][1][6]" will be returned if you sent CAM_ARM [0][1][6].

 

Command List

Following commands are supported in XTR1.0 protocol:

 

Command:

MAIL

Syntax:

MAIL [camera number];

Description:

Ask system to send specified camera's picture(.jpg) by email to pre-defined address. You can get multiple pictures at same time by specifying more than one camera number.

Example:

To email picture of camera 0, 5 and 13:

MAIL [0][5][13];

You will get an email at predefined address with camera 0, 5 and 13 screen capture attached as JPEG files.

 

 

Command:

CAM_ARM

Syntax:

CAM_ARM [camera number];

Description:

Turn on motion detection on specified camera(s). You can arm multiple cameras at same time by appending more than one camera number.

Example:

To turn on motion detection on camera 0, 5 and 13:

CAM_ARM [0][5][13];

 

 

Command:

CAM_DISARM

Syntax:

CAM_DISARM [camera number];

Description:

Turn off motion detection on specified camera(s). You can disarm multiple cameras at same time by appending more than one camera number.

Example:

To turn of motion detection on camera 0, 5 and 13:

CAM_DISARM [0][5][13];

 

 

Command:

REC_START

Syntax:

REC_START [camera number];

Description:

Start video recording on specified camera(s). You can start recording on multiple cameras at same time by appending more than one camera number.

Example:

To start video recording on camera 0, 5 and 13:

REC_START [0][5][13];

 

 

Command:

REC_STOP

Syntax:

REC_STOP [camera number];

Description:

Stop video recording on specified camera(s). You can stop recording on multiple cameras at same time by appending more than one camera number.

Example:

To stop video recording on camera 0, 5 and 13:

REC_STOP [0][5][13];

 

 

Command:

FTP_ON

Syntax:

FTP_ON [camera number];

Description:

Enable FTP uploading of video frame on specified camera(s). You can enable FTP on multiple cameras at same time by appending more than one camera number.

Example:

To enable FTP on camera 0, 5 and 13:

FTP_ON [0][5][13];

 

 

Command:

FTP_OFF

Syntax:

FTP_OFF [camera number];

Description:

Disable FTP uploading of video frame on specified camera(s). You can disable FTP on multiple cameras at same time by appending more than one camera number.

Example:

To disable FTP on camera 0, 5 and 13:

FTP_OFF[0][5][13];

 

 

Command:

SYSTEM_STATUS

Syntax:

SYSTEM_STATUS;

Description:

Get camera and sensor status. The returned string will look like:

 

CAMERA[001][110]...[000]SENSOR[00010100]

 

The camera status starts with string "CAMERA" and followed by each camera's status code. The three digit code inside square brackets represents the camera's FTP, REC and ARM on/off status respectively. For example, if FTP and motion detection are enabled on camera number 2, the status code for camera 2 will be [111] if recording is in progress or [101] if not in standby mode.

 

The sensor status starts with string "SENSOR" and followed by sensor status code. The eight digit code in square brackets represents eight sensors' status, of which "0" stands for "normal" and "1" means "alarm". If all sensors are "normal", the returned code will be [00000000].

Example:

If you have a system of maximum 4 cameras and 8 sensors with following status:

 

Camera 0: FTP enabled, recording in progress and motion detection is OFF.  ( code [110] )

Camera 1: FTP disabled, No recording and motion detection is ON.               ( code [001] )

Camera 2: FTP disabled, No recording and motion detection is OFF.              ( code [000] )

Camera 3: FTP disabled, Recording in progress and motion detection is OFF. ( code [010] )

Sensor 0: Normal (code 0)

Sensor 1: Normal (code 0)

Sensor 2: Alarm was triggered (code 1)

Sensor 3: Normal (code 0)

Sensor 4: Normal (code 0)

Sensor 5: Normal (code 0)

Sensor 6: Normal (code 0)

Sensor 7: Alarm was triggered (code 1)

 

When you send command SYSTEM_STATUS;, you will get

 

CAMERA[110][001][000][010]SENSOR[00100001]

 

as return code.

 

 

Command:

REPORT

Syntax:

REPORT;

Description:

Create a system report and send to predefined email address. A system report will tell you how many times the alarm was triggered, how much free space left and all cameras and sensors' status. The difference between REPORT and SYSTEM_STATUS is that the REPORT provides system status and alarm statistics in a human readable format. Unlike SYSTEM_STATUS, REPORT is meant for remote email control. if you send REPORT command through TCP port, the system report will be created and sent through email instead of TCP port.

Example:

A sample report for 4 camera system:

 

FROM: XtraSense.Surveillance@XmediaStudio.com

TO: MyEmail@MyISP.com

SUBJECT: XtraSense Surveillance System Daily Report

MESSAGE BODY:

# XTRASENSE SURVEILLANCE SYSTEM DAILY REPORT - 07/05/2004 #

 

/* MOTION ALARM STATISTICS */

0 time(s) on camera 0(Camera 0)

0 time(s) on camera 1(Camera 1)

0 time(s) on camera 2(Camera 2)

0 time(s) on camera 3(Camera 3)

TOTAL: 0

 

/* SENSOR ALARM STATISTICS */

0 time(s) on camera 0(Fire)

0 time(s) on camera 1(Gas)

0 time(s) on camera 2(Smoke)

0 time(s) on camera 3(Door)

0 time(s) on camera 4(Window)

0 time(s) on camera 5(Fire)

0 time(s) on camera 6(Gas)

0 time(s) on camera 7(Smoke)

TOTAL: 0

 

/* SYSTEM INFORMATION */

Current Log Folder: C:\XSLog\

Free Space Available: 19327 Mb

Camera 0 Status: MOTION DETECT[OFF], FTP[OFF], RECORDING[NO],

Camera 1 Status: MOTION DETECT[OFF], FTP[OFF], RECORDING[NO],

Camera 2 Status: MOTION DETECT[OFF], FTP[OFF], RECORDING[NO],

Camera 3 Status: MOTION DETECT[OFF], FTP[OFF], RECORDING[NO],

 

# END OF REPORT #