OpenSDK  V4.2.0
Functions
Data API

Functions

OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetDevListEx (int iPageStart, int iPageSize, void **pBuf, int *iLength)
 Get camera list. More...
 
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetSharedDevList (int iPageStart, int iPageSize, void **pBuf, int *iLength)
 Get shared camera list. More...
 
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetDevDetailInfo (const char *szDevSerial, const int iChannelNo, const bool bUpdate, void **pDevDetailInfo, int *iLength)
 Get device details, including preview level, PTZ, intercom capability level etc. More...
 
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetDeviceInfo (const char *szAccessToken, const char *szDeviceSerial, void **pBuf, int *iLength)
 Get single device information. More...
 
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetAlarmListEx (const char *szDevSerial, const int iChannelNo, const char *szStartTime, const char *szEndTime, AlarmType iAlarmType, int iStatus, int iPageStart, int iPageSize, void **pBuf, int *iLength)
 Get alarm list. More...
 
OPENSDK_API int CALLBACK OpenSDK_DecryptPicture (const char *szAccessToken, const char *szPicURL, const char *szSerail, const char *szSafeKey, void **pPicBuf, int *iPicLen)
 Decrypt the alarm picture (calling encrypted picture and downloading unencrypted picture is suggested. Distinguish whether the picture is encrypted via the "isEncrypted=1" in the URL. More...
 
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_SetAlarmRead (const char *szAccessToken, const char *szAlarmId)
 Set alarm information as read. More...
 
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_DeleteDevice (const char *szAccessToken, const char *szDeviceId)
 Delete device. More...
 
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_Free (void *pBuf)
 Destroy the memory allocated by SDK. More...
 

Detailed Description

Function Documentation

OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_DeleteDevice ( const char *  szAccessToken,
const char *  szDeviceId 
)

Delete device.

Parameters
[in]szAccessTokenVerification Token
[in]szDeviceIdDevice ID
Returns
Return 0 on success, non-0 on failure
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_Free ( void *  pBuf)

Destroy the memory allocated by SDK.

Parameters
[in]pBufMemory allocated by SDK
Returns
Return 0 on success, -1 on failure
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetAlarmListEx ( const char *  szDevSerial,
const int  iChannelNo,
const char *  szStartTime,
const char *  szEndTime,
AlarmType  iAlarmType,
int  iStatus,
int  iPageStart,
int  iPageSize,
void **  pBuf,
int *  iLength 
)

Get alarm list.

Parameters
[in]szDevSerialDevice serial No.
[in]iChannelNoDevice channel No.
[in]szStartTimeStart time
[in]szEndTimeEnd time
[in]iAlarmTypeAlarm type, refers to AlarmType
[in]iStatusAlarm status, 0- unread, 1-read, 2-all
[in]iPageStartStart page, start from 0
[in]iPageSizePage size
[out]pBufAlarm information list
[out]iLengthLength of alarm information list
Returns
Return 0 on success, -1 on failure
Note
Time format:yyyy-MM-dd hh:mm:ss
See the JSON format of alarm information list below:
1 {
2  "resultCode":"200",
3  "count":1, iji
4  "alarmList":[
5  {
6  "alarmId" : "24027912025641573", // Alarm No.
7  "alarmName" : "C2(497413183)", // Alarm name
8  "alarmPicUrl" : "", // ALarm picture URL
9  "alarmStart" : "2016-02-24 18:27:48", // Alarm triggered time
10  "alarmType" : 10000, // Alarm type
11  "deviceSerial" : "497413183", // Device serial No.
12  "channelNo" : 1, // Device channal No.
13  "delayTime" : 30, // Delay time
14  "isChecked" : 0, // Message reading status: read, unread
15  "isEncrypt" : 1, // Message encryption status: encrypted, unencrypted
16  "preTime" : 10,
17  "relationAlarms" : [], // Linkage information
18  "customerInfo" : , // User-defined information
19  "customerType" : // User-definede type
20  }
21  ]
22 }
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetDevDetailInfo ( const char *  szDevSerial,
const int  iChannelNo,
const bool  bUpdate,
void **  pDevDetailInfo,
int *  iLength 
)

Get device details, including preview level, PTZ, intercom capability level etc.

Parameters
[in]szDevSerialDevice serial No.
[in]iChannelNoDevice channel No.
[in]bUpdateWhether to re-obtain the device details, true: re-take the data from the fluorite platform, otherwise take the cache information. True time for the user to re-login or need to refresh the device information.
[out]pDevDetailInfoDevice detail info, Need to call the OpenSDK_FreeData interface to release
[out]iLengthDevice detail length
Note
See the JSON format of camera list below:
1 {
2  "devSerial":"426931084", // Device serial No.
3  "channelNo":1, // Device channel No.
4  "videoLevel":2, // Video level 2-High Definition 1-Balanced 0-Fluent
5  "type":1, // 1-IPC 2-Analog Camera
6  "isEncrypt":0, // Whether to open the safe mode: 1 - open, 0 - off, that is, whether the video image encryption
7  "support_talk":1, // Whether to support talk: 1 - support, 0 - not supported
8  "support_ptz":0, // Whether to support PTZ control: 1 - support, 0 - not supported
9  "ptz_top_bottom":1, // Whether to support PTZ top and bottom: 1 - support, 0 - not supported
10  "ptz_left_right":1 // Whether to support PTZ left and right: 1 - support, 0 - not supported
11  "ptz_preset":1, // Whether to support PTZ preset: 1 - support, 0 - not supported
12  "videoQualityInfos": [ // The device supports the ability to preview the level of detail
13  {
14  "videoQualityName":"Fluent",// Video quality name
15  "videoLevel":0, // Video level value
16  "streamType":2 // Video streamtype
17  },
18  {
19  "videoQualityName":"Balanced",
20  "videoLevel":1,
21  "streamType":2
22  },
23  {
24  "videoQualityName":"High-Definition",
25  "videoLevel":2,
26  "streamType":1
27  }
28  ]
29 }
Returns
Return 0 on success, non-0 on failure
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetDeviceInfo ( const char *  szAccessToken,
const char *  szDeviceSerial,
void **  pBuf,
int *  iLength 
)

Get single device information.

Parameters
[in]szDeviceSerialDevice serial No.
[out]pBufJSON string of device information
[out]iLengthlength of the obtained data
Returns
Return 0 on success, non-0 on failure
Note
See the JSON format of device information below:
1 {
2  "result": {
3  "data": [
4  {
5  "deviceId": "", // Device ID
6  "deviceSerial": "421877673", // Device serial No.
7  "cameraId": "", // Camera ID
8  "cameraNo": 1, // Device channel No.
9  "cameraName": "", // Camera name
10  "status": 1, // Camera online status, 0-offline, 1-online
11  "isShared": "0", // Device sharing status,0-unshared, 1-sharer, 2-receiver
12  "picUrl": "", // Camera pictur URL
13  "isEncrypt": 0 // Encryption status, 0- unencrypted, 1-encrypted
14  "defence" : 1, // Arming/Disarming status, 0-disarmed, 1-armed.
15  "videoLevel" : 0 // Video resolution, 0-fluent, 1-balance, 2-HD
16  }
17  ],
18  "code": "200",
19  "msg": "Operating completed."
20  }
21 }
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetDevListEx ( int  iPageStart,
int  iPageSize,
void **  pBuf,
int *  iLength 
)

Get camera list.

Parameters
[in]iPageStartStart page, start from 0
[in]iPageSizePage size, Limit 1000, default 100, support small than 100
[out]pBufJSON string of camera list
[out]iLengthlength of the pBuf
Returns
Return 0 on success, -1 on failure
Note
See the JSON format of alarm message below:
1 {
2  "page" : {
3  "page" : 0, //Page number
4  "size" : 20, //Page size, means current page the number of device
5  "total" : 1 //Device total size
6  },
7  "data" : [
8  {
9  "addTime" : 1512652274000.0, //Device add timer, unit milliseconds
10  "alarmSoundMode" : 0, //Alarm sound mode
11  "cameraNum" : 1, //Camera number
12  "category" : "UNKNOWN", //Device category
13  "defence" : 0, //Defence status, A1 Device 0:sleep 8:at-home 16:out-door; non-A1 device, 0-undefence 1-defence
14  "detectorNum" : 0, //Detector number
15  "detectorInfo" : null, //Dectector information
16  "deviceCover" : "https://i.ys7.com/image/DVR/1.jpeg", //Device cover
17  "deviceName" : "DS-7104N-SN/C(129103497)", //Device name
18  "deviceSerial" : "129103497", //Device subserial
19  "deviceType" : "DS-7104N-SN/C", //Device type
20  "deviceVersion" : "V3.0.21 build 170417", //Device version
21  "isEncrypt" : 0, //Encrypt status, 0:Unencrypted, 1:encrypt
22  "status" : 2, //Online state, 1:online, 2:offline
23  "supportExtShort" : "1|1|1|1|0|0|0|1|1|0|0|-1|0...", //Device apability
24  "cameraInfo" : [ //Camera information
25  {
26  "cameraCover" : "https://i.ys7.com/...", //Camera cover
27  "cameraName" : "Video1@DS-7104N-SN/C(129103497)",//Camera name
28  "cameraNo" : 1, //Camera No
29  "deviceSerial" : "129103497", //Device subserial
30  "isShared" : "0", //Share status, 1:share-owner, 0:non-shared, 2:share-recipient(means camera is shared by someone)
31  "videoLevel" : 0, //Video level, 0-fluent, 1-balance, 2-HD, 3-super
32  "videoQualityInfos" : [
33  {
34  "streamType" : 2,
35  "videoLevel" : 0,
36  "videoQualityName" : "fluent"
37  },
38  {
39  "streamType" : 1,
40  "videoLevel" : 2,
41  "videoQualityName" : "balance"
42  }
43  ]
44  }
45  ]
46  }
47  ]
48 }
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetSharedDevList ( int  iPageStart,
int  iPageSize,
void **  pBuf,
int *  iLength 
)

Get shared camera list.

Parameters
[in]iPageStartStart page, start from 0
[in]iPageSizePage size, Limit 1000, default 100, support small than 100
[out]pBufJSON string of camera list
[out]iLengthlength of the pBuf
Returns
Return 0 on success, -1 on failure
Note
See the JSON format of alarm message below:
1 {
2  "page" : {
3  "page" : 0, //Page number
4  "size" : 20, //Page size, means current page the number of device
5  "total" : 1 //Device total size
6  },
7  "data" : [
8  {
9  "addTime" : 1512652274000.0, //Device add timer, unit milliseconds
10  "alarmSoundMode" : 0, //Alarm sound mode
11  "cameraNum" : 1, //Camera number
12  "category" : "UNKNOWN", //Device category
13  "defence" : 0, //Defence status, A1 Device 0:sleep 8:at-home 16:out-door; non-A1 device, 0-undefence 1-defence
14  "detectorNum" : 0, //Detector number
15  "detectorInfo" : null, //Dectector information
16  "deviceCover" : "https://i.ys7.com/image/DVR/1.jpeg", //Device cover
17  "deviceName" : "DS-7104N-SN/C(129103497)", //Device name
18  "deviceSerial" : "129103497", //Device subserial
19  "deviceType" : "DS-7104N-SN/C", //Device type
20  "deviceVersion" : "V3.0.21 build 170417", //Device version
21  "isEncrypt" : 0, //Encrypt status, 0:Unencrypted, 1:encrypt
22  "status" : 2, //Online state, 1:online, 2:offline
23  "supportExtShort" : "1|1|1|1|0|0|0|1|1|0|0|-1|0...", //Device apability
24  "cameraInfo" : [ //Camera information
25  {
26  "cameraCover" : "https://i.ys7.com/...", //Camera cover
27  "cameraName" : "Video1@DS-7104N-SN/C(129103497)",//Camera name
28  "cameraNo" : 1, //Camera No
29  "deviceSerial" : "129103497", //Device subserial
30  "isShared" : "0", //Share status, 1:share-owner, 0:non-shared, 2:share-recipient(means camera is shared by someone)
31  "videoLevel" : 0, //Video level, 0-fluent, 1-balance, 2-HD, 3-super
32  "videoQualityInfos" : [
33  {
34  "streamType" : 2,
35  "videoLevel" : 0,
36  "videoQualityName" : "fluent"
37  },
38  {
39  "streamType" : 1,
40  "videoLevel" : 2,
41  "videoQualityName" : "balance"
42  }
43  ]
44  }
45  ]
46  }
47  ]
48 }
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_SetAlarmRead ( const char *  szAccessToken,
const char *  szAlarmId 
)

Set alarm information as read.

Parameters
[in]szAlarmIdAlarm ID
Returns
Return 0 on success, non-0 on failure
OPENSDK_API int CALLBACK OpenSDK_DecryptPicture ( const char *  szAccessToken,
const char *  szPicURL,
const char *  szSerail,
const char *  szSafeKey,
void **  pPicBuf,
int *  iPicLen 
)

Decrypt the alarm picture (calling encrypted picture and downloading unencrypted picture is suggested. Distinguish whether the picture is encrypted via the "isEncrypted=1" in the URL.

Parameters
[in]szAccessTokenVerification Token
[in]szPicURLPicture URL,https://wuhancloudpictest.ys7.com:8083/HIK_1456730366_5264003FD9BE63c4_06CE56000475472014644?isEncrypted=1&isCloudStored=0
[in]szSerailCorresponding device serial No. of alarm picture
[in]szSafeKeyDecription key, by deffault, it is the device verification code
[out]pPicBufDecripted picture content (call OpenSDK_Data_Free to release the memory.)
[out]iPicLenpPicBuf length
Returns
Return 0 on success, -1 on failure. If returning failed, call GetLastErrorCode() tp get the error code.
See also
OpenSDK_Alarm_StartRecv()