Skip to content
This SDK only works with devices released within the past 3 years. We regularly optimize and update the SDK to ensure compatibility and performance. We do not guarantee compatibility or provide technical support for devices older than 3 years.

# SDK Interface Invocation Process

## Process Description

When implementing SDK interfaces, according to different functional requirements, they can be divided into 14 modules. The implementation of each module must follow these four basic processes:

### Basic Process

- Initialize SDK Interface

  - Initialize the entire network SDK system, including memory pre-allocation and other operations.

- Set Connection Timeout Interface(Optional)

  - Set the network connection timeout time in the SDK. If not set, the default value will be used.

- Related Interface Invocation

  - Choose the appropriate interface according to the function to be implemented.

- User Device Registration Interface

  - User registration function, the returned user ID serves as the unique identifier for subsequent operations.

### Functional Modules

#### 1. SDK Initialization, Device Registration, Basic Information Acquisition

- SDK Initialization
  - SDK initialization
  - Set reconnection time and number of attempts.
  - SDK resource release
- Device Active/Passive Registration, Logout.
  - After successful registration, the returned user ID serves as the unique identifier for other functional operations.
  - The SDK allows a maximum of 512 registered users.
  - The device supports up to 32 registered usernames, with a maximum of 128 users registered at the same time.
- Device Activation
- LAN Device Search
- Exception Message Callback
- Error Information Acquisition

#### 2. Preview

- Obtain real-time streams from the front-end server.
- Decode display and play control.

#### 3. Playback and Download

- Remote playback or download of video files by time.
- Support for resumable transfer.

#### 4. Remote Parameter Configuration

- Set and get device parameters, including:
  - Modify device time
  - Enter and exit configuration
  - Get configuration information
  - Modify network configuration
  - Log configuration
  - User management

#### 5. Remote Device Maintenance

- Log search
- Device upgrade
- Video recording event information search
- Configuration file import/export
- Disk management
- Close/Restart device

#### 6. Audio Intercom Forwarding

- Implement audio data intercom and acquisition.
- Support custom audio encoding format.

#### 7. Intelligent Alarm

- Subscribe/unsubscribe to intelligent events, when the device triggers an alarm, it will be pushed through the SDK.

#### 8. PTZ Control

- Implement basic operations of the PTZ, preset points, cruise, and trajectory control.
- Divided into two control modes:
  - Control through the handle returned by the image preview
  - Control without preview limitations, through the user registered ID number

#### 9. Video Snapshot

- Capture the current image of the device, save to file or buffer acquisition.
- Download/search for snapshots saved in the device.

#### 10. Protocol Pass-through

- Interact with the device using the device API interface. When the SDK-provided interfaces cannot achieve the required functionality, this method can be considered, and users need to parse the API return content (XML format) themselves.

#### 11. Device Alarm Information

- Get alarm information and alarm output status
- Manual alarm
- Arm/disarm
- Alarm callback

#### 12. Face Comparison

- Enable/disable face comparison function
- Face target management, face target group management, face comparison alarm configuration

#### 13. Fisheye Correction (Only supported on Windows)

- Set focus
- Get the current focus position in the corrected area
- Electronic PTZ movement
- Electronic PTZ zoom
- Set fisheye correction mode

#### 14. Get Device Information

- Device information
- Channel status
- Firmware type
- Functions supported by the device
- Device time
- Video recording status
- Device's RTSP URL
- Data SHA1 encryption

## Conclusion

This article provides a detailed introduction to the SDK interface invocation process, including the implementation of basic processes and functional modules, aiming to help developers effectively use the SDK for development and maintenance.

Error Code