P6SCoreSDK(Android)DOC

Catalogue

P6SCoreSDK(Android)DOCCatalogueInitializationInitialization/DeinitializationIntegrationInitialize SDK1.call init method2.Set SDK command of recepetion and callback3.init cacheoptimizeDevice ConnectionP2P ConnectionQuery the P2P connection status of the device and connect the deviceLogin DeviceLogin Device support sharingGet device InformationGet device InformationDisconnect DeviceQuery the status of the device on the serverGet the last time the device was on the serverDevice offline callbackLAN detection equipmentStart detecting LAN devicesStop detecting LAN devicesDevice binding processAdd device to user device listConnecting devicesLogin DeviceGet SCode code of the deviceUpload device scode codeGet Device ListEquipment distribution networkDevice network interfaceGet netcard informationGet network configGet Wifi informationSet wifiSet network by QR codeGenerate QR codeLAN detection equipmentAdd DeviceSet Network by APStep of Set Network by Apadd DevicePreviewLive broadcastPage Set Monitor for playing videoRegister video stream data callbackEnable Live PreviewClose Live PreviewThe specific process of opening the live broadcastAudioTurn audio streaming on/offAudio switch controlVideo RecordTurn recording on/offIntercomTurn on/off intercomSend intercom dataOpen/close remote device talkbackControl remote device talkback playToggle SharpnessGet Video QualitySet Video QualityCodeRatePTZ functionObtain PTZ capabilityObtain Equipment CapabilityPTZ OperationTurn on/off watchSet/Call presetPlaybackSD card/hard disk playbackGet monthly videoGet Daily VideoEnable playbackClose PlaybackPlayback PositioningPlayback PausePlayback Audio playbackPlayback progressSnapshotLocal videoForce I frameTurn off local recordingMultiply playback settingsEnable multi speed playbackCard Video Query ConditionsCard video queryRegistration and logout of download progress interfaceDownload completed broadcastDownload SettingsStart downloadingClose DownloadFile conversionFunctional processPlayback processDouble speed playback processLocal video recording processCard video download processDual cameraliveviewPlaybacklocal recordDomestic (HuaWei) Cloud PlaybackGet Monthly videoGet Daily VideoAcquire I frame informationPlayback SettingsEnable PlaybackClose PlaybackPlayback Positioning SettingsStart PositioningPlayback PausePlayback audio playbackSnapshotVideo stream registration/logoutLocal videoTurn off local recordingCloud video downloadFile conversionFile conversionFunctional processPlayback processPlayback PositioningCloud video download processDevice Configurationcmd902Get Device CapabilityAcquiring AI CapabilitiesMirror ConfigurationGet Image ConfigurationSet mirror configurationTime ConfigurationGet system timeSet System TimeGet system NTP configurationSet system NTP configurationGet system DST configurationSet system DST configurationMotion Detection ConfigurationGet device capabilitiesGet device UUIDObtain motion detection configuration informationObtain the configuration information of the motion detection areaSet motion detection configuration informationSet the configuration information of the motion detection areaOSD settingsGet device capabilitiesGet device timeGet OSD configurationSet OSD configurationGet multi-line OSD configurationSet multi-line OSD configurationMemory card settingsGet device capabilitiesGet memory card configuration informationFormat memory cardVideo settingsGet memory card configuration informationGet video configuration informationSet memory card configuration informationHuman detection configurationGet device capabilitiesGet device UUIDObtain humanoid detection configuration informationSet humanoid detection configuration informationHumanoid Tracking ConfigurationGet the PTZ capability of the deviceGet device capabilitiesGet humanoid tracking configuration informationSet humanoid detection configuration informationLow-power DeviceSetting Low-Power Device PrefixObtain the online status of the low-power device on the serverSet the AOV device playback flagThe playback positioning time of AOV equipment is accurate

Initialization

Initialization/Deinitialization

Integration

use file in lib directory

Initialize SDK

1.call init method

2.Set SDK command of recepetion and callback

3.init cache

 

optimize

we add return number for some methods of command,the type is short with data in the middle of [1, 23767],if the return number is not in the scope, it means send command error, for example:

short cmdSeq = DevicesManage.getInstance().cmd902();

we add serial number for broadcast,it same with the return number ,for example

short receiveSeq = intent.getShortExtra(CmdSeqManager.SERIAL, (short) 0);

 

Device Connection

P2P Connection

Query the P2P connection status of the device and connect the device

  1. Function function description

    • Query the P2P status of the device

    • Connect device

    • Declaration class

  2. Declare class description context (dependent interfaces or which interfaces are used with)

    • You need to call this command before using the SDK to operate the device
  3. Param

    ParamDetails
    didDevice DID
  4. Return

    ReturnDetails
    actionConstantsCore.Action.GET_DEVICES_STATE
    statusDevice status: 1:online 2:offline
    ConstantsCore.DIDDevice DID
  5. Simple sample code

Example:

Login Device

  1. Function function description

    • Login device (i.e. V1 authentication)

    • Declaration class

  2. Declare class description context (dependent interfaces or which interfaces are used with)

    • After connecting to the device, log in to the device and then perform other operations
  3. Param

    ParamDetails
    didDevice DID
    userDevice user name
    passwordDevice password
  4. Return

    ReturnDetails
    actionConstantsCore.Action.RET_AUTH
    resultLogin status: ok: Login success pwd : Password error usr : Not user nomore_session : The maximum number of devices allowed to log in has been reached. Login is denied WeakPassword : Weak password
    ConstantsCore.DIDDevice DID
    DeviceShared1:Support sharing
    AutoBind1:Support resetting and unbinding
  5. Simple sample code

Example:

 

Login Device support sharing

  1. Function function description

    • Login Device support sharing

    • Declaration class

  2. Declare class description context (dependent interfaces or which interfaces are used with)

    • After connecting to the device, need login device
  3. Param

    ParamDetails
    didDevice DID
    userDevice user name
    passwordDevice password
    user_role_infoget “encrypt” value from server api
    roleuse “OWN” or “GUE”
  4. Return

    ReturnDetails
    actionConstantsCore.Action.RET_AUTHV2
    resultLogin status: ok: Login success
    ConstantsCore.DIDDevice DID
    ScodeFailed"1":when user-role-info error
    AutoBindSupport resetting and unbinding
  5. Simple sample code

Example:

###

Get device Information

  1. Function function description

    • Get the basic information of the device immediately after login. Get the basic information of the device before real-time preview and remote playback.g

    • Declaration class

  2. Param

    ParamDetails
    didDevice DID
  3. Return

    ReturnDetails
    actionConstantsCore.Action.RET_DEVICEINFO
    ConstantsCore.DIDDevice DID
    modelDevice model
    vendorName of manufacturer
    serial_noDevice serial number
    channelCount of channels
    versionVersion information
    dev_typeDevice type: such as IPC, DVR, NVR, IPD,
  4. Simple sample code

Example:

###

Get device Information

  1. Function function description

    • acquiring capability of device

    • Declaration class

  2. Param

    ParamDetails
    didDevice DID
  3. Return

    ReturnDetails
    actionConstantsCore.Action.RET_DEVICECAP
    ConstantsCore.DIDDevice DID
    sd"yes" support tf card
    wifi"yes" support wifi
  4. Simple sample code

Example:

###

Disconnect Device

  1. Function function description

    • Disconnect the device

    • Declaration class

  2. Declare class description context (dependent interfaces or which interfaces are used with)

    • Disconnect the device after the operation is completed
  3. Param

    ParamDetails
    didsDevice DID,(one or more DIDs)
  4. Return

    Nothing

  5. Simple sample code

Query the status of the device on the server

  1. Function function description

    • Query the status of the device on the server

    • Declaration class

  2. Declare class description context (dependent interfaces or which interfaces are used with)

    • Query the status of the device on the server and detect the status of the device on the server for subsequent display
  3. Param

    ParamDetails
    didDevice DID
  4. Return

    ReturnDetails
    actionConstantsCore.Action.GET_DEVICES_SERVER_STATE
    statusDevice status:1:online, -3:timeout,-6:offline
  5. Simple sample code

Example:

Get the last time the device was on the server

  1. Function function description

    • Get the last time the device was on the server, unit: second, max is 86400*365, over one year or never login return -1

    • Declaration class

  2. Declare class description context (dependent interfaces or which interfaces are used with)

    • Detect the status of the device on the server for subsequent display
  3. Param

    ParamDetails
    didDevice DID
  4. Return

    ReturnDetails
    actionConstantsCore.Action.GET_DEVICES_SERVER_OFFLINE
    offlineOffline time of equipment
  5. Simple sample code

Example:

Device offline callback

  1. Function function description

    set offline listner

     

  2. Declare class description context (dependent interfaces or which interfaces are used with)

    After the connection is successful, if the interface is registered, a callback will be received when the device is disconnected

  3. Param

    ParamDetails
    diddevice did
  4. Sample

 

LAN detection equipment

Note: initialize shakemanager before using SDK, and then complete the authentication operation

Related Classes

Initialization

Start detecting LAN devices

 

  1. Function function description

    • Start detecting LAN devices

    • Declaration class

  2. Declare class description context (dependent interfaces or which interfaces are used with)

    • You need to call this command before connecting to the LAN device
  3. Param

    Nothing

  4. Return

    ReturnDetails
    ipDevice ip address
    DIDDevice DID
    macDevice mac address
    qrKeyScan the QR code of the distribution network to determine whether the equipment matches
    firmVersionDevice version
  5. Simple sample code

Example:

 

Stop detecting LAN devices

 

  1. Function function description

    • Stop detecting LAN devices

    • Declaration class

  2. Declare class description context (dependent interfaces or which interfaces are used with)

    • Called when the probe needs to be stopped manually
  3. Param

    Nothing

  4. Return

    Nothing

  5. Simple sample code

Example:

 

Device binding process

The flow chart of device binding is as follows:

 

Add device to user device list

  1. Path:/safe/add-device

  2. Type:POST

  3. Function function description

    • Add device to user list
    • This is the CGI interface to interact with the server, so please call it in HTTP mode
  4. Describe the context (dependent interfaces or used with those interfaces)

    • The device must be added to the user device list before binding. Devices that do not support sharing or reset unbinding do not need to be bound
  5. Param

    ParamDetails
    didDevice DID
    snEnterprise serial number
    aliasDevice alias
  6. Return

    ReturnDetails
    datacode 200 indicates success
    codeThe return code 200 indicates success
    errorPrompt information
  7. Simple sample code

Connecting devices

For details, please checkQuery the P2P connection status of the device and connect the device

Login Device

For details, please checkLogin Device

Get SCode code of the device

  1. Function function description

    • Get SCode code of the device

    • Declaration class

  2. Describe the context (dependent interfaces or used with those interfaces)

    • Only devices that support resetting and unbinding have scode codes. Devices that can obtain scode codes need to unbind first
    • The data returned by the device is XML text, which needs to be converted into key value pairs by itself
  3. Param

    ParamDetails
    didDevice DID
  4. Return

    ReturnDetails
    SCodeVaildfalse:No Scode ,or true
    SCodeWhen SCodeVaild is true, scode code can be obtained
  5. Simple sample code

Upload device scode code

  1. Function function description

    • Upload device scode code

    • Declaration class

  2. Describe the context (dependent interfaces or used with those interfaces)

    • The device that supports resetting and unbinding gets the new scode code after binding and uploads it to the device. After the upload is successful, V2 authentication is performed
    • XML text is required to upload to the device
  3. Param

    ParamDetails
    SCodeSCode
  4. Return

    ReturnDetails
    requestURLRequest URL
    statusCodestatus,0:Request Success
  1. Simple sample code

    6.Unbinding Device

    1. Function function description

      • Unbinding device
    2. Describe the context (dependent interfaces or used with those interfaces)

      • If the device that supports resetting and unbinding can obtain the scode code, unbind the device first
    3. Param

      ParamDetails
      didDevice DID
      sCodeDevice sCode
    4. Return

    5. Simple sample code

      7.Only shared device binding is supported

      1. Function function description

        • Device binding supporting sharing
      2. Describe the context (dependent interfaces or used with those interfaces)

        • The method of binding a device that only supports sharing and a device that supports resetting and unbinding to become a master is different
        • Unbinding devices that support reset must support sharing
        • After becoming the master, do V2 authentication directly
      3. Param

        ParamDetails
        didDevice DID
        snEnterprise serial number
      4. Return

        ReturnDetails
        dataDevice identity encryption information
        codeThe return code 200 indicates success
        errorPrompt information
    6. Simple sample code

      8.Support resetting unbound device binding

      1. Function function description

        • Support sharing and resetting unbound device binding
      2. Describe the context (dependent interfaces or used with those interfaces)

        • The method of binding a device that only supports sharing and a device that supports resetting and unbinding to become a master is different
        • Unbinding devices that support reset must support sharing
        • After becoming the master, you need to get the scode code of the server and upload it to the device. After the upload is successful, you need to do V2 authentication
      3. Param

        ParamDetails
        didDevice DID
        snEnterprise serial number
      4. Return

        ReturnDetails
        codeThe return code 200 indicates success
        dataKey value pair
        errorPrompt information
        data键值对Details
        sCodeScode used for unbinding
        encryptDevice authentication information
        idDevice table ID
      5. Simple sample code

      9.V2 Authentication

      1. Function function description

        • V2 authentication

        • Declaration class

      2. Describe the context (dependent interfaces or used with those interfaces)

        • Support sharing devices. The incoming device identity encryption information is secretstring
        • For devices that support unbinding after resetting, the incoming device authentication information is secretstring
      3. Param

        ParamDetails
        didDevice DID
        userNameDevice user name
        passwordDevice password
        attr1Device authentication key
        attr3is host."OWN":host,"GUE":guest
      4. Return

        ReturnDetails
        actionConstants.Action.RET_AUTHV2
        resultok:success,failed:failed
        ScodeFailedScode is ok,1:Scode is failed
        didDevice DID
      5. Simple sample code

Get Device List

  1. Function function description

    • Get device list
  2. Describe the context (dependent interfaces or used with those interfaces)

    • After V1 authentication is successful, get the device list and get the data of the corresponding did from the device list. First get the encrypt data from the extracted data. If encrypt is not empty, use the encrypt data as the secret string for V2 authentication. If encrypt is empty, use attr1 data. If attr1 is not empty, use attr1 data as the secret string for V2 authentication. If attr1 is also empty, use nothing method for V2 authentication
  3. Param

    ParamDetails
    snEnterprise serial number
  4. Return

    ReturnDetails
    dataContains entries key value pairs
    codeThe return code 200 indicates success
    errorPrompt information
    entriesDetails
    idDevice table id
    dtypeEquipment type [1-ipc; 2-nvr; 3-dvr; 4-panorama; 5-alarm box; 6-low power consumption]
    snEnterprise serial number
    accountaccount
    didDevice DID
    pwdDevice password
    aliasDevice alias
    usernameDevice user name
    auth 
    attr1Device authentication key
    attr2List of functions supported by device sharing
    attr3Device identity information (empty is the old device; 0 is the master device; other numbers are the guest devices)
    attr5Multi function field
    createTime 
    hostDevice owner account information
    shareNumberQuantity shared
    encrptDevice verification information
    passwordHintPrompt to change password (false - no prompt; true - prompt)
  5. Simple sample code

 

Equipment distribution network

Device network interface

Get netcard information

  1. Function function description

    Obtain the network card information of the camera to obtain the network type of the camera and which mode is currently in the STA or AP .

    Declaration class

  1. Parameters
ParametersDescribe
diddevicd DID
  1. 返回值
ReturnDescribe
actionConstantsCore.Action.RET_GET_NETCARD_INFO
resultok: get information success
other error
ConstantsCore.DIDdevice DID
netcardTypeunknown,wired1,wired2;wifi,3G,4G,5G
apModeunknown , STA , AP
  1. sample

     

Get network config

  1. Function function description

    Get the network parameters of the camera, including information such as IP address and mac address.

    Declaration class

  1. Parameters
ParametersDescribe
diddevice DID
  1. Return
ReturnDescribe
actionConstantsCore.Action.RET_GET_NETCFG
resultok: get information
other error
ConstantsCore.DIDdevice did
networkList
  1. sample

 

Get Wifi information

  1. Function function description

    Get device Wifi information

    Declaration class

  1. Parameters
ParametersDescribe
diddevice DID
macdevice mac ,get from getNetcfg(did)
  1. Return
ReturnDescribe
actionConstantsCore.Action.RET_GET_WIFI_INFO
resultok: get information success,
other error
ConstantsCore.DIDdevice DID
macwireless mac
ssidwifi ssid
randomrandom number
  1. Sample

 

Set wifi

  1. Function function description

    Set the camera to connect to the specified wifi

    Declaration class

  1. Parameters
ParametersDescribe
diddevice DID
macdevice mac
wifiNamethe name of the wifi that needs to be connected
randomRandom number, which is obtained by getting WiFi information from the device when getWifiInfo (did, mac) is called
passwordbase64(random+":"+password)
  1. Return
ReturnDescribe
actionConstantsCore.Action.RET_SET_WIFI_INFO and ConstantsCore.Action.RET_SET_WIFI_INFO_V2
resultok: Set wifi information successfully.
other error:
ConstantsCore.DIDdevice DID
macThe physical address of the camera wireless network card
ssidwifi SSID
randomRandom number
  1. Sample

return:

####

 

Set network by QR code

The flow chart is as follows:

Generate QR code

  1. Reset device
  2. QR code content:

"S="+ssid+"&P="+ pwd +"&T="+rowStr+"&K="+key+"&A="+ipAddress+"+"+ipPort

ssid and pwd need encode by base64 ;delete"/n"

rowStr:timezone different(*60),for example "+480" or negative timezone "480"

key:random string , length 5

ipAddress:uppercase hex LAN ip, for example:192.168.250.199 to C7FAA8C0

ipPort:uppercase hex idle port,forexample:39531 to 6B9A

LAN detection equipment

SeeLAN detection equipment

or lib/Include/UDPReceiverUtil.java

Add Device

SeeDevice binding process

 

Set Network by AP

The flow chart is as follows:

Step of Set Network by Ap

  1. reset device

  2. record wifi ssid and password

  3. connect device ap hotspot start with "ZWAP_", password "01234567",get device did and login device

  4. set wifi

    get wireless mac

    DevicesManage.getInstance().getNetcfg()

    get random number

    DevicesManage.getInstance().getWifiInfo()

    set wifi

    DevicesManage.getInstance().setWifiInfo()

add Device

SeeDevice binding process

 

Preview

Live broadcast

Page Set Monitor for playing video

1.Layout file

2.Set did and channel for Monitor

Register video stream data callback

1.method

2.parameter

parameterdirections
didequipment did
channelequipment channel number,from 0
monitormonitor control

3.example

Enable Live Preview

1.method

2.parameter

parameterdirections
didequipment did
channelequipment channel number,from 0

3.example

4.Return value (Broadcast monitoring for callback ConstantsCore.Action.RET_OPENSTREA)

Return valuedirections
resultok open successfully
channelequipment channel number,from 0
DIDequipment did

Close Live Preview

1.method

2.parameter

parameterdirections
didequipment did
channelequipment channel number,from 0

3.example

4.Return value (Broadcast monitoring for callback ConstantsCore.Action.RET_CLOSESTREAM)

Return valuedirections
resultok open successfully
channelequipment channel number,from 0
DIDequipment did

 

The specific process of opening the live broadcast

  1. Layout the Monitor control on the interface

  2. Set did and channel for Monitor

  1. Register the Monitor callback to enable the Monitor to receive the video stream data of the specific channel of the device

  2. Call the stream opening command, and the Monitor starts playing the video.

  3. Send the command to close the video stream, cancel the registration of the monitor, and clear the dids and channels of the monitor

 

Audio

Turn audio streaming on/off

  1. Function Description

    • Turn audio streaming on/off
  2. Describe the context (dependent interfaces or interfaces used together)

    • Only when the real-time preview video stream is enabled
  3. parameter

    parameterdirections
    in_strDIDequipment did
    iChannelequipment channel number,from 0
  4. Return value

    • none
  5. Simple sample code

Audio switch control

  1. Function Description

    • Control audio switch
  2. Describe the context (dependent interfaces or interfaces used together)

    • To turn audio streaming on/off first
  3. parameter

    parameterdirections
    didequipment did
  4. Return value

    • none
  5. Simple sample code

 

Video Record

Turn recording on/off

  1. Function Description

    • Start/end recording
  2. Describe the context (dependent interfaces or interfaces used together)

    • Only when the real-time preview video stream is enabled
  3. parameter

    parameterdirections
    bIsRecodYES Record Audio NO Close Record Audio
    pathVideo file storage path
    didequipment did
    channelequipment channel number,from 0
    mp4ConvertOverthe successful callback of prv to mp4 returns the mp4 file path
  4. Return value

    • none
  5. Simple sample code

Intercom

Turn on/off intercom

  1. Function Description

    • Start/stop talkback, need audio record permission
  2. Describe the context (dependent interfaces or interfaces used together)

    • Only when the real-time preview video stream is enabled
  3. parameter

    parameterdirections
    didequipment did
    channelequipment channel number,from 0
  4. Return value

    • none
  5. Simple sample code

Send intercom data

  1. Function Description

    • Start/end recording
  2. Describe the context (dependent interfaces or interfaces used together)

    • It can only be used when intercom has been started
  3. parameter

    parameterdirections
    didequipment did
    parameterStart or stop sending intercom data, start: start sending stop: stop sending
  4. Return value

    • none
  5. Simple sample code

 

Open/close remote device talkback

  1. Function Description

    • Open/close remote device talkback
  2. Describe the context (dependent interfaces or interfaces used together)

    • call with startTalkByChannel/stopTalkByChannel
  3. parameter

    parameterdirections
    diddevice did
    channelSizechannel size
    fullDuplexsupport full-duplex talkback or not
  4. Return value

    • none
  5. Simple sample code

 

Control remote device talkback play

  1. Function Description

    • control remote device talkback play
  2. Describe the context (dependent interfaces or interfaces used together)

    • call when open remote device talkback
  3. parameter

    parameterdirections
    notPlay"true":close play, "false":open play
  4. Return value

    • none
  5. Simple sample code

 

 

Toggle Sharpness

Get Video Quality

  1. Function Description

    • Get video quality
  2. Describe the context (dependent interfaces or interfaces used together)

    • Use when Live Preview is turned on
  3. parameter

    parameterdirections
    in_strDIDequipment did
    iChannelequipment channel number,from 0
  4. Return value(Notification return code:RET_GET_QUALITY)

    Receive broadcast actionConstantsCore.Action.RET_GET_DEVICEQUALITY
    Return valuedirections
    resultOk: Get the device image quality successfully< br />auth_ Failure: Validation error
    Invalid_ Channel: wrong channel number
    other error: other unknown errors
    qualityThe image quality of the current channel of the device, 5: smooth 1: clear 6: high-definition
    channeequipment channel number,from 0
    DIDequipment did
  5. Simple sample code

 

Set Video Quality

1.Function Description

  1. Describe the context (dependent interfaces or interfaces used together)

    • Use when Live Preview is turned on
  2. parameter

    parameterdirections
    in_strDIDequipment did
    iChannelequipment channel number,from 0
    stDeviceQualitydefinition
  3. Return value

    Receiving broadcast actionConstantsCore.Action.RET_SET_DEVICEQUALITY
    Return valuedirections
    resultOk: The image quality is set successfully< br />auth_ Failure: Validation error
    Invalid_ Channel: wrong channel number
    invalid_ codec_ Type: wrong encoding type
    invalid_ Parameters: wrong parameters
    other error: other unknown errors
    channeequipment channel number,from 0
    DIDequipment did
  4. Simple sample code

CodeRate

  1. Function Description

    • get code rate of liveview
  2. Describe the context (dependent interfaces or interfaces used together)

    • call it in period after openVideoStream,for example 1s
  3. parameter

    parameterdirections
    didequipment did
    channelequipment channel number,from 0
  4. Return value

    parameterdirections
    intKbps

 

PTZ function

Obtain PTZ capability

  1. Function Description

    • obtain PTZ capability
  2. Describe the context (dependent interfaces or interfaces used together)

    • Before using PTZ function, you must first obtain PTZ capability
  3. parameter

    parameterdirections
    in_strDIDequipment did
  4. Return value

    Return valuedirections
    FocusFocus
    Supporttrue:Support focus false:Focus is not supported
    Return valuedirections
    TrackTrack
    Supporttrue:Support track false: Track is not supported
    CountNumber of tracks
    Return valuedirections
    AutoScanAutoScan
    Supporttrue:Support AutoScan false:AutoScan is not supported
    Return valuedirections
    Apertureaperture
    Supporttrue:Support aperture false:aperture is not supported
    Return valuedirections
    PresetPreset
    Supporttrue:Support preset false:Preset is not supported
    CountAPP number of preset points (supports 1-255 set points, 1-48 for some devices))
    APPCountAPP number of preset points (advanced preset function is available only when APPCount is 256)
    Return valuedirections
    ZoomZoom
    Supporttrue:Support zoom false:Zoom is not supported
    AFTrackTracking zoom(Support,true:Support tracking zoom false:Tracking zoom is not supported )
Return valuedirections
GuardGuard position (watch)
Supporttrue:Support guard position false: Guard position is not supported
Return valuedirections
AuxControlAuxiliary functions
Supporttrue:Support auxiliary functions false: Auxiliary functions is not supported
MenuMenu(Support,true:Support menu false:Menu is not supported)
LightLight (Support,true:Support light false: Light is not supported)
WipeWipe (Support,true:Support wipe false:Wipe is not supported)
HeatHeat(Support,true:Support heat false: Heat is not supported)
FanFan(Support,true:Support fan false:fan is not supported)
PowerPower (Support,true:Power false:Power is not supported)
Return valuedirections
PanTileorientation
Supporttrue:Support orientation false:orientation is not supported
UpDownUp /Down(Support,true:Support up /down false:Up /Down is not supported)
LeftRightLeft/Right(Support,true:Support left/right( false:Left/Right is not supported)
ExtendLeft up 、Left down 、Right up、Right down(Eight directions)(Support,true:Support eight directions false:Eight directions is not supported)
OneStepSingle step control(Support,true:Support single step control false:single step control is not supported)
Return valuedirections
CruiseCruise
Supporttrue:Support cruise false: Cruise is not supported
CountNumber of cruise lines
  1. Simple sample code

Obtain Equipment Capability

  1. Function Description

    • Set Video Quality
  2. Describe the context (dependent interfaces or interfaces used together)

    • When the ptz capability is not obtained, use the device capability to control the PTZ
  3. parameter

    parameterdirections
    in_strDIDequipment did
  4. Return value (only the fields valid for PTZ are described)

    Return valuedirections
    PTZ_Advance_CruiseAdvance_Cruise function
    PTZ_Advance_WatchAdvance_Watch function
    ShakingHeadIs it a head shaking machine(support,true:yes false:no 。The head shaking machine removes the functions of watching, cruising, optical zoom and optical focusing, and the preset point function adopts the scene memory mode)
    Motormotor
  5. Simple sample code

PTZ Operation

  1. Function Description

    • Set the camera to rotate up, down, left and right, zoom and focus

    • Declare class

  2. Describe the context (dependent interfaces or interfaces used together)

    • To obtain ptz capability first
  3. parameter

    parameterdirections
    in_strDIDequipment did
    nSpeedSpeed (0-9 supported)
    nLastTimeDuration (ms)
    iChannelChannel number, starting from 0
    directionAdjustment type (zoom in: zoom out, zoom out: zoom in, focus_near: close focus, focus_far: far focus, up: upward rotation, left: left rotation, down: downward rotation, right: right rotation)
    actionPTZ controls the rotation of the PTZ of the equipment through action start or stop (after the start rotation is set, stop must be set to stop the rotation, and both need to be used together),or use null instead
  4. | Return value

5.Simple sample code

Turn on/off watch

1.Function Description

  1. Describe the context (dependent interfaces or interfaces used together)

    • obtain ptz capability first
  2. parameter

    parameterdirections
    in_strDIDequipment did
    param@"Param1=1"(Fixed writing)
  3. Return value

  4. Simple sample code

 

Set/Call preset

  1. Function Description

    • Set/call preset
  2. Describe the context (dependent interfaces or interfaces used together)

    • obtain ptz capability first
  3. parameter

    in_strDIDequipment did
    param"Param1=%d"is default number. The range of values is 0-127。
    ChannelIDChannel number, starting from one
    parameterdirections
  4. Return value

5.Call simple sample code

 

Playback

SD card/hard disk playback

Get monthly video

  1. Function

To obtain the monthly video distribution of the equipment in a certain month and year, you must log in the equipment successfully before using it

  1. Parameters
ParameterDescription 
didThe device's dids
channelThe channel number of the device, starting from 0
sizeTotal number of channels of the device
recordTypeThe video type only supports all types to transfer the value to all temporarily
yearQuery the year of the video recording
monthmonth of the video query
  1. Return value
ActionConstantsCore.Action.RET_GET_RECORDINFO_BY_MONTH
Intent character resultok: Encryption catalogues such as information successfully
auth_failure: Error
Invalid_channel: Invalid path
other error: Other unknown error
Intent character queryResulteveryday It means there are videos every day
nothing shows a month without video data
10001 00000 00000 00000 00000 000001
shows month 1, month 5,month 31 with video data.

4.Example

 

Get Daily Video

  1. Functions

To obtain the daily video distribution of the device on a certain day, month and year, you must log in the device successfully before you can use it

  1. Parameters
ParameterDescription
didThe device's dids
channelThe channel number of the device, starting from 0
sizeTotal number of channels of the device
recordTypeThe video type only supports all types to transfer the value to all temporarily
yearQuery the year of the video recording
monthMonth of the video query
dayQuery the dayof the video recording
listenerQuery result callback, which changes the previous broadcast mode to callback mode, not UI thread
  1. Return value
Callback interfaceReturn value description
onSuccess(List list)Linked List of daily video distribution information
RecordListVO is the video information entity class provided by the SDK
onFail()The query returns an error
RecordListVOtype:"manaul" manual recording "ai" intelligent recording "time" timing recording "motion" event recording
start_time:Recording start time
end_time:Recording end time
  1. Examples

Enable playback

  1. Functions

Enable remote playback

  1. Parameters
ParameterDescription
didThe device's dids
channelThe channel number of the device, starting from 0
sizeTotal number of channels of the device
recordTypeThe video type only supports all types to transfer the value to all temporarily
startTimeThe time format for starting playback is "20160604 00:00:00"
endTimeThe time format for stopping playback is "20160604 23:59:59"
cmdEnable the main and sub code stream differentiation, which can be null. The default sub code stream is "main", "sub"
  1. Return value
Broadcast ActionConstantsCore.Action.RET_PLAYBACK_START
Intent field resultok: Playback is successfully opened
auth_failure: validation error
Invalid_channel: wrong channel number
other error: other unknown errors
  1. Examples

Close Playback

  1. Functions

Close Remote Playback

  1. Parameters
ParameterDescription
didThe device's did
channelThe channel number of the device, starting from 0
  1. Return value
Broadcast ActionConstantsCore.Action.RET_PLAYBACK_CLOSE
Intent field resultok: playback is closed successfully
auth_failure: validation error
Invalid_channel: wrong channel number
other error: other unknown errors
  1. Examples

 

Playback Positioning

  1. Functions

Remote playback location jumps to a certain point in time for playback. It can only be used when remote playback is enabled

  1. Parameters
ParameterDescription
didThe device's did
timeThe time point format of playback positioning is required to be "20160604 23:59:59"
  1. Return value
Broadcast ActionConstantsCore.Action.RET_PLAYBACK_SEEK
Intent field resultok: Playback positioning succeeded
auth_failure:validation error
Invalid_channel: wrong channel numbe
other error: other unknown errors
  1. Examples

 

Playback Pause

  1. Functions

The remote playback can be paused or played only when the remote playback stream is successfully opened. If the playback is paused,

When the playback is closed, you need to call once and set it to false

  1. Parameters
ParameterDescription
didThe device's did
pausePause or play, true: pause false play
  1. Examples

 

Playback Audio playback

  1. Functions

The pause or play of remote playback audio can only be used when the remote playback stream is successfully opened

  1. Parameters
ParameterDescription
didThe device's did
channelThe channel of the device, starting from 0
isPlayControlPause or play, true: Pause false play
  1. Examples

 

Playback progress

1.Functions

Gets the current playback time

2.Examples

 

 

Snapshot

  1. Functions

Get the screenshot of the current video

  1. Parameters
ParameterDescription
yuvm_ YuvData of the currently playing video monitor property
widthm_ Width of the currently playing video monitor property
heighm_ Height of the currently playing video monitor property
  1. Examples

 

Local video

  1. Functions

Local video recording can only be called after the preview or playback is successful

  1. Parameters
ParameterDescription
DidsThe device's dids
ChannelThe channel number of the device, starting from 0
DesPathVideo storage path. The video format is private and the suffix is fixed prv
EnableVoiceWhether audio is required for video recording, true: Yes
ListenerAfter the video recording is completed, the result of prv converting to mp4 is called back, and the mp4 file path is returned after success
  1. Examples

 

Force I frame

  1. Functions

After video recording is started, force the device to send an I frame to start recording the first frame

  1. Methods
  1. Examples

Turn off local recording

  1. Functions

Turn off local video recording

  1. Parameters
ParameterDescription
DidsThe device's dids
  1. Examples

 

Multiply playback settings

  1. Functions

The fast playback setting can only be used when the remote playback is successful. In addition, the device needs to support fast playback

  1. Parameters
ParameterDescription
DidsThe device's dids
SpeedPlayback speed 1: normal speed, 4:4 speed, 8:8 speed
TimeStrThe time point format of playback positioning is required to be "20160604 23:59:59"
  1. Return value
Broadcast ActionConstantsCore. Action RET_ PLAYBACK_ SPEED
Intent field resultok: Fast playback is set successfully. After success, you need to
call changePlaybackSpeedSuccess to enable fast playback
  1. Examples

 

Enable multi speed playback

  1. Functions

Start Multiply Playback

  1. Parameters

 

ParameterDescription
DidsThe device's dids
ChannelThe channel of the device, starting from 0
speedCurrent fast playback rate

 

  1. Examples

 

Card Video Query Conditions

  1. Functions

Specify the search time period for remote video recording of the device, and the number of remote video recordings displayed per page. Due to remote recording of equipment

There are many clips of. Therefore, you must specify the number of remote video pages for paging before obtaining remote video

If specified, paging will be performed according to the default number of devices

  1. Parameters
ParameterDescription
SnapshotFileSumCountDoes not work, temporarily set to 0
SnapshotFileCountPerPageThe number of pages for remote video recording
begin_ TimeStart time of obtaining remote video recording, format 20180507 020445
end_ TimeGet the end time of remote video recording. The format is 20180507 020445
timezone_ min_ between_ UtcDoes not work, temporarily set to 480
  1. Methods
  1. Return value
Broadcast ActionConstantsCore. Action GET_ SET_ CONFIG_ BY_ HTTP
ResponseStatus0: Setting succeeded
  1. Examples

Card video query

  1. Functions

To obtain the video recording list of a page in a certain period of time, you must use/RecordFileList/Attribute before using

Specify time period and number of pages

  1. Parameters
ParameterDescription
PageGet the video clip data of the page, starting from 1
  1. Methods
  1. Return value
broadcast ActionConstantsCore.Action.GET_SET_CONFIG_BY_HTTP
RecordFileList


!—ro,req,xs:string--
!—ro,req,xs:string--




  1. Examples

 

Registration and logout of download progress interface

  1. Functions

Registration and logoff of remote file download progress interface

  1. Parameters
ParameterDescription
DidsThe device's dids
IFileDownloadListenerRemote file download progress interface

Download completed broadcast

  1. Functions

Remote file download completed broadcasting

Download Settings

  1. Functions

Remote file download settings

  1. Parameters
ParameterDescription
DidsThe device's dids
FilePathThe absolute path of the remote file on the device
FileTypeRemote file type, picture: picture, video, video
FileIndexThe file index, which does not work temporarily, can be written as 0 by default
SavefilePathThe path to save the phone after downloading the remote file
  1. Return value
broadcast ActionConstantsCore.Action.RET_START_DOWNLOAD
Intent field resultok: set successfully
Intent field task_ IDRemote download task ID, used when file download is enabled
Intent field file_ SizeRemote download file size

4.Examples

 

Start downloading

  1. Functions

Enable remote file download

  1. Parameters
ParameterDescription
DidsThe device's dids
TaskIdTask ID of remote download
ActionStart file transfer or stop file transfer, start: Start file transfer, stop: Stop file transfer
  1. Return value
Broadcast ActionConstantsCore. Action RET_ DOWNLOAD
Intent field resultok: set successfully
  1. Examples

 

Close Download

  1. Functions

Close Remote File Download

  1. Parameters
ParameterDescription
DidsThe device's dids
TaskIdTask ID of remote download

3.Example

 

File conversion

  1. Functions

Convert local prv file to mp4 file

  1. Parameters
ParameterDescription
SrcPathprv local file path
listenerCall back the result of converting prv to mp4, and return the mp4 file path after success
  1. Examples

 

Functional process

Playback process

! [WeChat picture editor_20220430104000] (img/WeChat picture editor_20220430104000. jpg)

 

 

Double speed playback process

! [WeChat screenshot _20220430104100] (img/WeChat screenshot _20220430104100. png)

 

Local video recording process

! [WeChat screenshot _20220430104127] (img/WeChat screenshot _20220430104127. png)

 

Card video download process

! [WeChat screenshot _20220430104113] (img/WeChat screenshot _20220430104113. png)

 

Dual camera

liveview

liveview video and audio stream interface is as normal,use channel 1 when open/close other channel

 

audio play limit

1.Functions

close the other channel audio play

2.Parameter

ParameterDescribe
channel1

Playback

local record

 

Domestic (HuaWei) Cloud Playback

Get Monthly video

  1. Functions

 

Obtain the monthly video distribution of equipment cloud storage in a certain month and year

 

  1. Parameters
ParameterDescription
timeQuery events, such as "2019-10"
utcTime zone conversion character, time zone identifier, such as Asia/Shanghai
deviceIdDevice ID
channelChannel number, default to 1
typeNot used temporarily
streamStream type, default to 0, all 0, more than 1
listenerQuery callback. The query monthly video interface will call back the getInfoByMonth() method to return the monthly video distribution. For example, 1010000000000000000000000000000000 indicates that there are videos on the first and third days of the month
  1. Examples

 

Get Daily Video

  1. Functions

Get the daily video distribution of the equipment on a certain day, month, year

  1. Parameters
ParameterDescription
startTimeStart time, such as "20220101 000000"
endTimeEnd time, such as "20220101 240000"
deviceIdDevice ID
channelChannel number, default to 1
streamStream type, default to 0, all 0, more than 1
userIdUser ID
listenerQuery result callback code: 200 data: {entries [], total: value} (message: exception information)
  1. Return value
FieldExplanation
durationFile duration
sizeFile size
streamStream type
beginTimeStart time
endtimeEnd time
fileUrlFile path
typeVideo type
0: all videos
1: manual video
2: planned video
3: alarm video
4: motion detection video
5: intelligent video
6: humanoid detection video
7: face detection video
8: face recognition video

4.Example

 

Acquire I frame information

  1. Functions

Get the latest I frame information of the start time

  1. Parameters
ParameterDescription
deviceIdDevice ID
channelChannel number, default to 1
streamStream type, default to 0, all 0, more than 1
searchTimeQuery time, such as "20220101 150000"
minScaleStart time, such as "20220101 000000"
maxScaleEnd time, such as "20220101 240000"
userIdUser ID
listenerQuery callback. Querying the monthly video interface will call back the retObsFile() method
  1. Return value
FieldExplanation
OBS_FILEWhether the callback object is empty. If it is empty, the query fails. Otherwise, the query succeeds
  1. Examples

 

Playback Settings

  1. Functions

playback settings

  1. Parameters
ParameterDescription
channelChannel number, default to 1
keyNumeric characters in the middle of the device dids
  1. Return value
FieldExplanation
return0:Setting succeeded
  1. Examples

Enable Playback

  1. Functions

Enable Cloud Playback

  1. Parameters
ParameterDescription
deviceIdDevice ID
channelThe channel number of the device, starting from 0
listenerStart playing the callback onPlay()
  1. Examples

 

Close Playback

  1. Functions

Close Cloud Playback

  1. Parameters
ParameterDescription
deviceIdDevice ID
channelThe channel number of the device, starting from 0
  1. Examples

 

Playback Positioning Settings

  1. Functions

Cloud Playback Positioning Settings

  1. Examples

Start Positioning

  1. Functions

Start Positioning Playback

  1. Examples

Playback Pause

  1. Functions

Cloud Playback Paused

  1. Parameters
ParameterDescription
deviceIdDevice ID
channelThe channel number of the device, starting from 0
isPausetrue: Pause; False: play
  1. Examples

Playback audio playback

  1. Functions

Cloud playback audio playback control

  1. Parameters
ParameterDescription
enabletrue: Play false: Do not play
  1. Examples

 

Snapshot

  1. Functions

Get the screenshot of the current video

  1. Parameters
ParameterDescription
Yuvm of the currently playing video monitor_ YuvData property
Widthm of the currently playing video monitor_ Width property
heighm of the currently playing video monitor_ Height property
  1. Examples

 

Video stream registration/logout

  1. Functions

Provide video stream registration and logout interface, register before stream opening, and logout when stream closing

  1. Parameters
ParameterDescription
DeviceIdDevice ID
ChannelThe channel number of the device, starting from 0
ListenerVideo stream callback interface
  1. Examples

Local video

  1. Functions

Cloud playback of local video can only be called after successful playback

  1. Parameters
ParameterDescription
FilePathVideo storage path. The video format is private and the suffix is fixed prv
ListenerAfter the video recording is completed, the result of prv converting to mp4 is called back, and the mp4 file path is returned after success
  1. Examples

Turn off local recording

  1. Functions

Close cloud playback of local video

  1. Examples

Cloud video download

  1. Functions

Download cloud video files according to the cloud video file path

  1. Parameters
ParameterDescription
obsFileUrlCloud storage file path obtained by querying video
filePathThe local storage path of the file. The file suffix is prv
keyNumeric characters in the middle of the device dids
listenerThis callback is used for the file download progress callback and the prv to mp4 result callback. If successful, the mp4 file path is returned
  1. Examples

 

File conversion

  1. Functions

Convert local prv file to mp4 file

  1. Parameters
ParameterDescription
FilePathprv local file path

File conversion

  1. Functions

Convert local prv file to mp4 file

  1. Parameters
ParameterDescription
FilePathprv local file path

3.Example

Functional process

Playback process

! [WeChat picture editor_20220430104142. jpg] (img/WeChat picture editor_20220430104142. jpg)

 

 

Playback Positioning

! [WeChat screenshot _20220430104158. png] (img/WeChat screenshot _20220430104158. png)

 

 

 

 

Cloud video download process

! [WeChat screenshot _20220430105138. png] (img/WeChat screenshot _20220430105138. png)

 

 

 

 

Device Configuration

Common device configurations mainly include: image configuration, time configuration, device information, mobile detection configuration, OSD settings, memory card settings, video settings, humanoid detection configuration, humanoid tracking configuration, etc. Generally, when entering the device configuration page, you need to first obtain the device capabilities, and then decide whether to display some configuration information according to the device capabilities.

 

cmd902

1.Function

send HTTP command to get or put device configuration

2.Param

Paramdescribe
diddevice did
httpcgi command
tagdeprecated
  1. return
returndescribe
actionConstantsCore.Action.GET_SET_CONFIG_BY_HTTP
deviceIddevice did
httpreturn http format data

4.示例

 

 

Get Device Capability

  1. Function Description

    • Get device capability of single channel equipment, such as IPC device

    • Acquire the device capability of multi-channel devices, such as NVR and HVR devices

  2. Describe the context (dependent interfaces or with which interfaces)

    • You need to determine where configuration information is displayed based on the capabilities of the device
  3. Param

    ParamDescription
    didDevice did
  4. Return

     

  5. Simple sample codeSimple sample code

 

Acquiring AI Capabilities

  1. Function description

    • Obtain the device capability of a single-channel device, such as: IPC device

    • Obtain the device capabilities of multi-channel devices, such as: NVR, HVR devices

  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • Where it is necessary to determine whether to display configuration information based on device capabilities
  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

 

Mirror Configuration

Get Image Configuration

  1. Function description

    • Obtain device image configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • The mirror configuration page shows where mirror configuration information is displayed
  3. Parameter

    ParameterDetails
    didDevice did
    channelIdDevice channel number
  4. Return

    ReturnDetails
    resultSuccess: ok; Failure: unsupport, other error
    modeUp and down: up-down; Left and right: left-right; Center: center; Close: disable
  5. Simple sample code

     

Set mirror configuration

  1. Function description

  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    The mirror configuration page is where the mirror configuration information is set

  3. Parameter

    ParameterDetails
    didDevice did
    channelIdDevice channel number
    modeMirror mode (up and down: up-down; left and right: left-right; center: center; off: disable)
  4. Return

    ReturnDetails
    resultSuccess: ok; Failure: unsupport, other error
  5. Simple sample code

     

Time Configuration

Get system time

  1. Function description

    • Obtain system time, mainly used for system time display and manual time adjustment
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • The time setting page displays the system time
  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI command: GET /System/Time
  4. Return

    ReturnDetails
    DateTimeFormatTime format:
    YYYYMMDDWhhmmss,
    YYYYMMDDhhmmss,
    MMDDYYYYWhhmmss,
    MMDDYYYYhhmmss,
    DDMMYYYYWhhmmss,
    DDMMYYYYhhmmss
    TimeFormatTime format: 12-hour system/24-hour system
    SystemTimesystem time

    Return example:

  5. Simple sample code

     

Set System Time

  1. Function description

    • Set the system time, mainly calling the CGI 902 command
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • The time setting page is used to call when the system time is saved after setting
  3. Parameter

    ParameterDetails
    DateTimeFormatTime format:
    YYYYMMDDWhhmmss,
    YYYYMMDDhhmmss,
    MMDDYYYYWhhmmss,
    MMDDYYYYhhmmss,
    DDMMYYYYWhhmmss,
    DDMMYYYYhhmmss
    TimeFormatTime format: 12-hour system/24-hour system
    SystemTimesystem time
  4. Return

    ReturnDetails
    requestURLRequest Url, here is: PUT /System/Time
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

 

Get system NTP configuration

  1. Function description

    • To obtain the system network time synchronization configuration information, mainly call the CGI 902 command
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • The time setting page is used to obtain the system network time synchronization information
  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI command: GET /System/NTP
  4. Return

    ReturnDetails
    EnableWhether to enable network time synchronization
    ServerNameServers, mainly include:"pool.ntp.org", "time.windows.com", "time.list.gov", "time-nw.nist.gov" , "ntp1.inrim.it", "time.kriss.re.kr", "time.nuri.net", "time.apple.com"
    TimeZoneTime zone
    TimeSyncIntervaltime interval

    return example:

  5. Simple sample code

     

Set system NTP configuration

  1. Function description

    • Set the system NTP time synchronization information, mainly call the CGI902 command
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • The time setting page is used to call when the network time synchronization is saved
  3. Parameter

    ParameterDetails
    EnableWhether to enable network time synchronization
    ServerNameserver, mainly:"pool.ntp.org", "time.windows.com", "time.list.gov", "time-nw.nist.gov" , "ntp1.inrim.it", "time.kriss.re.kr", "time.nuri.net", "time.apple.com"
    TimeZoneTime zone
    TimeSyncIntervaltime interval
  4. Return

    ReturnDetails
    requestURLRequest Url, here is: PUT /System/NTP
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

 

Get system DST configuration

  1. Function description

    • Obtain system DST configuration information, mainly calling the CGI902 command
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • The time setting page is used to obtain the daylight saving time information
  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI command: GET /System/DST
  4. Return

    ReturnDetails
    EnableWhether to enable daylight saving time
    ModeDaylight saving mode: day of the week, date
    TimeDifferenceTime difference
    DateModeStartdate pattern start time
    DateModeStopdate pattern end time
    WeekModeStartWeek mode start time
    WeekModeStopend of week mode

    return example:

  5. Simple sample code

     

Set system DST configuration

  1. Function description

    • Set system daylight saving time information, mainly call CGI902 command
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • The time setting page is used to call when the daylight saving time is saved
  3. Parameter

    ParameterDetails
    EnableWhether to enable daylight saving time
    ModeDaylight saving mode: day of the week, date
    TimeDifferenceTime difference
    DateModeStartdate pattern start time
    DateModeStopdate pattern end time
    WeekModeStartWeek mode start time
    WeekModeStopend of week mode
  4. Return

    ReturnDetails
    requestURLRequest Url, here is: PUT /System/DST
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

     

Motion Detection Configuration

Get device capabilities

  1. Function description

    • Obtain device capabilities and determine the support level of motion detection sensitivity
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • According to the device capability, display the motion detection sensitivity support level
  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    HighestWhether to support the highest
    HigherWhether to support higher
    HighWhether to support high
    MiddleIs it supported
    LowWhether to support low
    LowerWhether the support is low
    LowestDoes it support the minimum

    return example:

     

  5. Simple sample code

     

Get device UUID

  1. Function description

    • Obtain the device UUID and determine whether the device UUID supports push (whether it contains "#")
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • Display the motion detection push button according to whether the device supports push
  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI command: GET /Network/P2PV2
  4. Return

    ReturnDetails
    UUIDDevice UUID

    return example:

  5. Simple sample code

     

Obtain motion detection configuration information

  1. Function description

    • Obtain information such as motion detection switch, sensitivity, linkage configuration switch, arming time, etc.
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • The device capability interface returns the sensitivity level, and the device UUID interface returns whether the device supports push
  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI command: GET /Pictures/ChannelID/Motion
  4. Return

    ReturnDetails
    EnableWhether to enable motion detection
    Senstivesensitivity
    Triggerlinkage configuration
    Schedulearming time

    Return:

     

  5. Simple sample code

 

Obtain the configuration information of the motion detection area

  1. Function description

    • Obtain the configuration information of the motion detection arming area
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI commands:GET /Pictures/ChannelID/Motion/RegionsV2
  4. Return

    ReturnDetails
    RegionX_(0-11)The arming area is divided into a 16x12 grid, each item corresponds to a row, and the value of the grid area is 1 when arming

    Return:

     

  5. Simple sample code

     

Set motion detection configuration information

  1. Function description

    • Set motion detection switch, sensitivity, linkage configuration switch, arming time and other information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

  3. Parameter

    ParameterDetails
    EnableWhether to enable motion detection
    Senstivesensitivity
    Triggerlinkage configuration
    Schedulearming time
  4. Return

    ReturnDetails
    requestURLRequest Url
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

     

Set the configuration information of the motion detection area

  1. Function description

    • Set motion detection arming area configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

  3. Parameter

    ParameterDetails
    RegionX_(0-11)The arming area is divided into a 16x12 grid, each item corresponds to a row, and the value of the grid area is 1 when arming
  4. Return

    ReturnDetails
    requestURLRequest Url
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

     

OSD settings

Get device capabilities

  1. Function description

    • Obtain device capabilities and determine whether the device supports multi-line OSD
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • Support multi-line OSD, request multi-line OSD configuration interface; do not support multi-line OSD, request single-line OSD configuration interface
  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    multi_osdWhether to support multi-line OSD

    Return:

  5. Simple sample code

     

Get device time

  1. Function description

    • Get the current time of the device and display the OSD time
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    CalendarTime instance, including year-month-day-hour-minute-second
  5. Simple sample code

     

Get OSD configuration

  1. Function description

    • Get a single line of OSD configuration information, including name and time
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • After obtaining the device capability, the device that does not support multi-line OSD requests this interface
  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI commands:GET /Pictures/ChannelID/OSD
  4. Return

    ReturnDetails
    DisplayTime-EnableOSD time display switch
    DisplayTime-PosXOSD time display X coordinate
    DisplayTime-PosYOSD time display Y coordinate
    DisplayName-EnableOSD name display switch
    DisplayName-PosXOSD name display X coordinate
    DisplayName-PosYOSD name display Y coordinate
    DisplayName-NameOSD name display

    Return:

     

  5. Simple sample code

     

Set OSD configuration

  1. Function description

    • Set single-line OSD configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

  3. Parameter

    ParameterDetails
    DisplayTime-EnableOSD time display switch
    DisplayTime-PosXOSD time display X coordinate
    DisplayTime-PosYOSD time display Y coordinate
    DisplayName-EnableOSD name display switch
    DisplayName-PosXOSD name display X coordinate
    DisplayName-PosYOSD name display Y coordinate
    DisplayName-NameOSD name display
  4. Return

    ReturnDetails
    requestURLRequest Url
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

     

Get multi-line OSD configuration

  1. Function description

    • Get multiple lines of OSD configuration information, including name and time
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • Devices that support multi-line OSDs request this interface after obtaining device capabilities
  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI commands:GET /Pictures/ChannelID/MultiOSDV2
  4. Return

    ReturnDetails
    DisplayTime-EnableOSD time display switch
    DisplayTime-PosXOSD time display X coordinate
    DisplayTime-PosYOSD time display Y coordinate
    IDSingle line OSD name ID
    TextSingle line OSD name content
    xSingle line OSD name X coordinate
    ySingle line OSD name Y coordinate

    Return:

     

  5. Simple sample code

     

Set multi-line OSD configuration

  1. Function description

    • Set multi-line OSD configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

  3. Parameter

    ParameterDetails
    DisplayTime-EnableOSD time display switch
    DisplayTime-PosXOSD time display X coordinate
    DisplayTime-PosYOSD time display Y coordinate
    IDSingle line OSD name ID
    TextSingle line OSD name content
    xSingle line OSD name X coordinate
    ySingle line OSD name Y coordinate
  4. Return

    ReturnDetails
    requestURLRequest Url
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

     

Memory card settings

Get device capabilities

  1. Function description

    • Obtain device capabilities and determine whether the device supports memory cards
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    StorageCapacityWhether to support memory card

    Return:

  5. Simple sample code

     

Get memory card configuration information

  1. Function description

    • Get memory card configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • After obtaining the device capabilities, support memory card devices to obtain device memory card configuration information
  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    DiskIDmemory card ID
    DiskTypeNamememory card namememory card name
    TotalCapacitytotal capacity
    AvailableCapacityavailable capacity
    DiskStorageTypeMemory card type: SD card, samba
    DiskStorageAttributecurrent status:
    idle::idle
    writting:writing
    reading:reading
    diskexception:The memory card is abnormal, please format it
    diskerror:disk error
    readonly:read only
    readwrite:readable and writable
    nodisk:no card inserted
    exceptionneedformat:The memory card is formatted abnormally
    exceptionneedChangeDisk:The memory card is abnormal, please change the card
    formatfailedneed reboot:SD card format failed
    PictureCapacityPercentImage Occupancy Ratio
    RecordCapacityPercentVideo Occupancy Ratio
    DiskFormatStatusformat status:
    unformatted:unformatted
    formatting:formatting
    formatted:formatted successfully
    format failure:The memory card is abnormal, please change the card
    umount failure:Formatting failed, please restart and try formatting again
    device is busy:The device is busy, please restart and try to format again

    Return:

     

  5. Simple sample code

     

Format memory card

  1. Function description

    • format memory card
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    None

  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI commands:PUT /Record/Format/Call
  4. Return

    ReturnDetails
    requestURLRequest Url
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

     

Video settings

Get memory card configuration information

  1. Function description

    • Get memory card configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • When the device is inserted into the memory card, the recording configuration information will be obtained, and if there is no memory card, it will not be obtained
  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    DiskStorageAttributecurrent status:
    idle::idle
    writting:writting
    reading:reading
    diskexception:The memory card is abnormal, please format it
    diskerror:disk error
    readonly:read only
    readwrite:readable and writable
    nodisk:no card inserted
    exceptionneedformat:The memory card is formatted abnormally
    exceptionneedChangeDisk:The memory card is abnormal, please change the card
    formatfailedneed reboot:SD card format failed

    Return:

    When the value of DiskStorageAttribute is not nodisk, Details has inserted the memory card and is ready to obtain the recording configuration information

  5. Simple sample code

     

Get video configuration information

  1. Function description

    • Get video configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • After obtaining the memory card configuration information, the video recording configuration information will be obtained only when the memory card has been inserted
  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI commands:GET /Record/ChannelID/RecordScheduleV2
  4. Return

    ReturnDetails
    EnableWhether to enable recording settings
    RecordTypeVideo type:
    SequenceRecord:continuous video
    EventRecord:event video
    TimeBlock_(0-5)Recording period:
    00:00-24:00:all day
    08:00-20:00:daytime
    other:Custom

    Return:

  5. Simple sample code

     

Set memory card configuration information

  1. Function description

    • Set memory card configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    None

  3. Parameter

    ParameterDetails
    EnableWhether to enable recording settings
    RecordTypeVideo type:
    SequenceRecord: continuous video
    EventRecord:event video
    TimeBlock_(0-5)Recording period:
    00:00-24:00:all day
    08:00-20:00:daytime
    other:Custom
  4. Return

    ReturnDetails
    requestURLRequest Url
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

     

Human detection configuration

Get device capabilities

  1. Function description

    • Obtain device capabilities to determine whether humanoid detection sensitivity supports 1-100 settings
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • After obtaining the device capability, support the setting of 1-100 to request the PeopleDetectV1 interface, otherwise request the PeopleDetect interface
  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    SupportWhether to support sensitivity 1-100 configuration

    return example:

     

  5. Simple sample code

     

Get device UUID

  1. Function description

    • Obtain the device UUID and determine whether the device UUID supports push (whether it contains "#")
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • Display the motion detection push button according to whether the device supports push
  3. Parameter

    ParameterDetails
    didDevice did
    cmdCGI commands:GET /Network/P2PV2
  4. Return

    ReturnDetails
    UUIDDevice UUID

    return example:

  5. Simple sample code

     

Obtain humanoid detection configuration information

  1. Function description

    • Obtain humanoid detection configuration information (sensitivity supports 1-100)

    • Obtain humanoid detection configuration information (sensitivity does not support 1-100)

  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • According to the device capability, support 1-100 settings to request the PeopleDetectV1 interface, otherwise request the PeopleDetect interface
  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    EnableWhether to enable humanoid detection
    SenstiveHuman figure sensitivity
    Support 1-100: 1-100
    Not support 1-100: high (high), middle (medium), low (low)
    BeepAlertalarm sound
    Mailtrigger mail
    FtpTrigger FTP
    PushLinkage push
    AlarmOuttrigger alarm output
    SnapshotTrigger SD card capture
    RecordTrigger SD card recording
    AllDayWhether the arming time is all day
    TimeBlockListarming time
    TopLeftXX coordinate of the upper left corner of the arming area
    TopLeftYY coordinate of the upper left corner of the arming area
    BottomRightXThe X coordinate of the lower right corner of the armed area
    BottomRightYThe Y coordinate of the lower right corner of the armed area

    return example:

     

  5. Simple sample code

 

Set humanoid detection configuration information

  1. Function description

    • Set humanoid detection configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

  3. Parameter

    ParameterDetails
    EnableWhether to enable humanoid detection
    SenstiveHuman figure sensitivity
    Support 1-100: 1-100
    Not support 1-100: high (high), middle (medium), low (low)
    BeepAlertalarm sound
    Mailtrigger mail
    FtpTrigger FTP
    PushLinkage push
    AlarmOuttrigger alarm output
    SnapshotTrigger SD card capture
    RecordTrigger SD card recording
    AllDayWhether the arming time is all day
    TimeBlockListarming time
    TopLeftXX coordinate of the upper left corner of the arming area
    TopLeftYY coordinate of the upper left corner of the arming area
    BottomRightXThe X coordinate of the lower right corner of the armed area
    BottomRightYThe Y coordinate of the lower right corner of the armed area
  4. Return

    ReturnDetails
    requestURLRequest Url
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

     

Humanoid Tracking Configuration

Get the PTZ capability of the device

  1. Function description

    • Obtain the PTZ capability of the device, and determine whether the humanoid tracking zoom is displayed
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    None

  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    SupportWhether to zoom in on humanoid tracking

    return example:

     

  5. Simple sample code

     

Get device capabilities

  1. Function description

    • Obtain device capabilities to determine whether humanoid detection sensitivity supports 1-100 settings
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • After obtaining the device capability, support the setting of 1-100 to request the PeopleDetectV1 interface, otherwise request the PeopleDetect interface
  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    SupportWhether to support sensitivity 1-100 configuration

    return example:

     

  5. Simple sample code

     

Get humanoid tracking configuration information

  1. Function description

    • Obtain humanoid tracking configuration information (sensitivity supports 1-100)

    • Obtain humanoid tracking configuration information (sensitivity does not support 1-100)

  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    • According to the device capability, support 1-100 settings to request the PeopleDetectV1 interface, otherwise request the PeopleDetect interface
  3. Parameter

    ParameterDetails
    didDevice did
  4. Return

    ReturnDetails
    TrackWhether humanoid tracking is turned on
    TrackZoomWhether the humanoid tracking zoom is turned on

    return example:

     

  5. Simple sample code

 

Set humanoid detection configuration information

  1. Function description

    • Set humanoid detection configuration information
  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    None

  3. Parameter

    ParameterDetails
    TrackWhether humanoid tracking is turned on
    TrackZoomWhether the humanoid tracking zoom is turned on
  4. Return

    ReturnDetails
    requestURLRequest Url
    statusCodeSave result status code, success: 0, failure: other
  5. Simple sample code

 

Low-power Device

 

Setting Low-Power Device Prefix

  1. Function description

    set low-power device prefix

  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    Before connecting a low-power device, you need to set the low-power device prefix. The data about the low-power device prefix is obtained from the server interface

  3. Parameter

    ParameterDetails
    Listprefix list
  4. Return

     

  5. sample

Obtain the online status of the low-power device on the server

1.Function description

Obtain the offline time of the low-power device

2.Explain the context relationship (depending on the interface or which interfaces are used with it)

Low power device The server online status is not obtained using the checkServerStatus interface. The server last login time checkServerOffline is obtained first. If the server is offline for the 70s, the server is considered online

2.Parameter

ParameterDetails
diddevice did

3.Return

ParameterDetails
diddevice did
offline0~70:device online
>70:device offline,
<0:device offline,use offline time from checkServerOffline

 

4.sample

 

Set the AOV device playback flag

  1. Function description

    set the AOV device playback flag

  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    call it before aov device playbackStart

  3. Parameter

    ParameterDetails
    booleanaov device set true
  4. Return

     

  5. Sample

 

The playback positioning time of AOV equipment is accurate

  1. Function description

    Calibration time when aov device playback seek

  2. Explain the context relationship (depending on the interface or which interfaces are used with it)

    call it after aov device playbackSeek

  3. Parameter

    ParameterDetails
    longaov Calibration seek time
  4. Return

     

  5. Sample