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
use file in lib directory
DevicesManage.getInstance().initAll();
xxxxxxxxxx
DevicesOperate.getInstance().setCallBack(ReceiveSettingListener.getInstance(app));
xxxxxxxxxx
DevicesManage.getInstance().initMaxMemory(application);
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);
xxxxxxxxxx
public void checkStatus(final String did);
Function function description
Query the P2P status of the device
Connect device
Declaration class
xxxxxxxxxx
DevicesManage.java
Declare class description context (dependent interfaces or which interfaces are used with)
Param
Param | Details |
---|---|
did | Device DID |
Return
Return | Details |
---|---|
action | ConstantsCore.Action.GET_DEVICES_STATE |
status | Device status: 1:online 2:offline |
ConstantsCore.DID | Device DID |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().checkStatus(deviceDID);
Example:
x private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case ConstantsCore.Action.GET_DEVICES_STATE:
int status = intent.getIntExtra("status", Constants.DeviceState.OFFLINE);
break;
}
}
};
xxxxxxxxxx
public short verification(String did, String user, String password);
Function function description
Login device (i.e. V1 authentication)
Declaration class
xxxxxxxxxx
DevicesManage.java
Declare class description context (dependent interfaces or which interfaces are used with)
Param
Param | Details |
---|---|
did | Device DID |
user | Device user name |
password | Device password |
Return
Return | Details |
---|---|
action | ConstantsCore.Action.RET_AUTH |
result | Login 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.DID | Device DID |
DeviceShared | 1:Support sharing |
AutoBind | 1:Support resetting and unbinding |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().verification(did, userName, passWord);
Example:
xxxxxxxxxx
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case ConstantsCore.Action.RET_AUTH:
String result = intent.getStringExtra(ConstantsCore.RESULT);
String deviceShared = intent.getStringExtra("DeviceShared");
String autoBind = intent.getStringExtra("AutoBind");
break;
}
}
};
xxxxxxxxxx
public short verificationV2(String did, String user, String password, String user_role_info, String role);
Function function description
Login Device support sharing
Declaration class
xxxxxxxxxx
DevicesManage.java
Declare class description context (dependent interfaces or which interfaces are used with)
Param
Param | Details |
---|---|
did | Device DID |
user | Device user name |
password | Device password |
user_role_info | get “encrypt” value from server api |
role | use “OWN” or “GUE” |
Return
Return | Details |
---|---|
action | ConstantsCore.Action.RET_AUTHV2 |
result | Login status: ok: Login success |
ConstantsCore.DID | Device DID |
ScodeFailed | "1":when user-role-info error |
AutoBind | Support resetting and unbinding |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().verificationV2(did, userName, passWord, user_role_info, role);
Example:
xxxxxxxxxx
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case ConstantsCore.Action.RET_AUTHV2:
String result = intent.getStringExtra(ConstantsCore.RESULT);
break;
}
}
};
###
xxxxxxxxxx
public short getDeviceInfo(String did);
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
xxxxxxxxxx
DevicesManage.java
Param
Param | Details |
---|---|
did | Device DID |
Return
Return | Details |
---|---|
action | ConstantsCore.Action.RET_DEVICEINFO |
ConstantsCore.DID | Device DID |
model | Device model |
vendor | Name of manufacturer |
serial_no | Device serial number |
channel | Count of channels |
version | Version information |
dev_type | Device type: such as IPC, DVR, NVR, IPD, |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().getDeviceInfo(did);
Example:
xxxxxxxxxx
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case ConstantsCore.Action.RET_DEVICEINFO:
break;
}
}
};
###
xxxxxxxxxx
public short getDeviceCap(String did);
Function function description
acquiring capability of device
Declaration class
xxxxxxxxxx
DevicesManage.java
Param
Param | Details |
---|---|
did | Device DID |
Return
Return | Details |
---|---|
action | ConstantsCore.Action.RET_DEVICECAP |
ConstantsCore.DID | Device DID |
sd | "yes" support tf card |
wifi | "yes" support wifi |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().getDeviceCap(did);
Example:
xxxxxxxxxx
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case ConstantsCore.Action.RET_DEVICECAP:
break;
}
}
};
###
xxxxxxxxxx
public void disconnectDevice(String... dids);
Function function description
Disconnect the device
Declaration class
xxxxxxxxxx
DevicesManage.java
Declare class description context (dependent interfaces or which interfaces are used with)
Param
Param | Details |
---|---|
dids | Device DID,(one or more DIDs) |
Return
Nothing
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().disconnectDevice(did);
xxxxxxxxxx
public void checkServerStatus(final String did);
Function function description
Query the status of the device on the server
Declaration class
xxxxxxxxxx
DevicesManage.java
Declare class description context (dependent interfaces or which interfaces are used with)
Param
Param | Details |
---|---|
did | Device DID |
Return
Return | Details |
---|---|
action | ConstantsCore.Action.GET_DEVICES_SERVER_STATE |
status | Device status:1:online, -3:timeout,-6:offline |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().checkServerStatus(did);
Example:
xxxxxxxxxx
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case ConstantsCore.Action.GET_DEVICES_SERVER_STATE:
int status = intent.getIntExtra("status", Constants.DeviceServerState.OFFLINE);
break;
}
}
};
xxxxxxxxxx
public void checkServerOffline(final String did);
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
xxxxxxxxxx
DevicesManage.java
Declare class description context (dependent interfaces or which interfaces are used with)
Param
Param | Details |
---|---|
did | Device DID |
Return
Return | Details |
---|---|
action | ConstantsCore.Action.GET_DEVICES_SERVER_OFFLINE |
offline | Offline time of equipment |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().checkServerOffline(did);
Example:
xxxxxxxxxx
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case ConstantsCore.Action.GET_DEVICES_SERVER_OFFLINE:
int offline = intent.getIntExtra("offline", 0);
break;
}
}
};
xxxxxxxxxx
public void regStreamOfflineListener(String did, P2POfflineListener listener)
Function function description
set offline listner
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
Param
Param | Details |
---|---|
did | device did |
Sample
x
DevicesManage.getInstance().regStreamOfflineListener(mDid, new P2POfflineListener() {
public void onOffline(int errorCode) {
}
});
Note: initialize shakemanager before using SDK, and then complete the authentication operation
Related Classes
xxxxxxxxxx
ShakeManager.java
Initialization
xxxxxxxxxx
ShakeManager.getInstance().setHandler(handler);
ShakeManager.getInstance().setSearchTime(15 * 1000);
//optimize need <uses-permission android:name="android.permission.WAKE_LOCK" />
//WifiManager.MulticastLock lock = manager.createMulticastLock("localWifi");
//ShakeManager.getInstance().setLock(lock);
xxxxxxxxxx
public boolean shaking()
Function function description
Start detecting LAN devices
Declaration class
xxxxxxxxxx
ShakeManager.java
Declare class description context (dependent interfaces or which interfaces are used with)
Param
Nothing
Return
Return | Details |
---|---|
ip | Device ip address |
DID | Device DID |
mac | Device mac address |
qrKey | Scan the QR code of the distribution network to determine whether the equipment matches |
firmVersion | Device version |
Simple sample code
xxxxxxxxxx
ShakeManager.getInstance().shaking();
Example:
xxxxxxxxxx
{
"ip": "192.168.1.100",
"DID": "IOTBCC-726091-BJPVG",
"mac": "5A:58:E1:D2:5D:D8",
"sid": "36338956",
"qrKey": "\u0000\u0000\u0000\u0000\u0000",
"firmVersion": "S855/5520PHR-AI/WH\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"
}
xxxxxxxxxx
private Handler handler = new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case ShakeManager.HANDLE_ID_SEARCH_END:
break;
case ShakeManager.HANDLE_ID_RECEIVE_DEVICE_INFO:
String obj = msg.obj.toString();
LogUtils.e("rzk", "result: " + obj);
break;
}
}
}
xxxxxxxxxx
public void stopShaking();
Function function description
Stop detecting LAN devices
Declaration class
xxxxxxxxxx
ShakeManager.java
Declare class description context (dependent interfaces or which interfaces are used with)
Param
Nothing
Return
Nothing
Simple sample code
xxxxxxxxxx
if(ShakeManager.getInstance().isShaking()){
ShakeManager.getInstance().stopShaking();
}
Example:
xxxxxxxxxx
private Handler handler = new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case ShakeManager.HANDLE_ID_SEARCH_END:
break;
}
}
}
The flow chart of device binding is as follows:
Path:/safe/add-device
Type:POST
Function function description
Describe the context (dependent interfaces or used with those interfaces)
Param
Param | Details |
---|---|
did | Device DID |
sn | Enterprise serial number |
alias | Device alias |
Return
Return | Details |
---|---|
data | code 200 indicates success |
code | The return code 200 indicates success |
error | Prompt information |
xxxxxxxxxx
//Example
{
code = 200;
data = null;
error = null;
}
Simple sample code
xxxxxxxxxx
public static void addDevice(final Context context, final String did, String userName, String pwd,
String alias, String dtype, final AddDeviceCallback callBack) {
Map<String, Object> params = new HashMap<>();
params.put("sn", SN);
params.put("did", did);
params.put("username", userName);
params.put("pwd", pwd);
if (TextUtils.isEmpty(dtype)){
params.put("dtype",dtype);
}
params.put("alias", alias);
EasyHttp.getInstance().postJson(context, getUrl(ADD_DEVICE), params, new EasyCallBack() {
public void onSuccess(String result) {
String code = LoginDataUtils.getCode(result);
String data= LoginDataUtils.getData(result);
int codeInt = -1;
try {
codeInt = Integer.parseInt(code);
} catch (Exception e) {
e.printStackTrace();
}
if (callBack != null) {
callBack.onResult(codeInt, 0, result);
}
}
public boolean onFail(int status, String msg) {
if(callBack != null) {
callBack.onResult(status, 0, null);
}
return true;
}
});
}
For details, please checkQuery the P2P connection status of the device and connect the device
For details, please checkLogin Device
xxxxxxxxxx
DevicesManage.getInstance().cmd902(DID, GET_BIND_CONFIG, "");
Function function description
Get SCode code of the device
Declaration class
xxxxxxxxxx
DevicesManage.java
Describe the context (dependent interfaces or used with those interfaces)
Param
Param | Details |
---|---|
did | Device DID |
Return
Return | Details |
---|---|
SCodeVaild | false:No Scode ,or true |
SCode | When SCodeVaild is true, scode code can be obtained |
xxxxxxxxxx
<DeviceBindConfig>
<SCodeValid><!--ro,opt,xs:boolean”true”,”false”--></SCodeValid>
<SCode><!--rw,req,xs:string--></SCode>
</DeviceBindConfig>
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().cmd902(DID, GET_BIND_CONFIG, "");
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case Constants.Action.GET_SET_CONFIG_BY_HTTP:
String http = intent.getStringExtra("http");
if (!HttpUtils.checkInvalid(http)) {
return;
}
String responseXML = HttpUtils.getResponseXML(http);
String xmlInfo = HttpUtils.getHttpXmlInfo(responseXML);
if (xmlInfo == null) {
return;
}
String did = intent.getStringExtra("deviceId");
if (xmlInfo.equals("DeviceBindConfig")) {
BindConfig bc = XmlUtils.parseBindConfig(responseXML);
}
break;
}
}
};
public static BindConfig parseBindConfig(String response) {
SAXReader reader = new SAXReader();
BindConfig obs = null;
try {
Element root = reader.read(HttpUtils.str2Is(response)).getRootElement();
if ("DeviceBindConfig".equalsIgnoreCase(root.getName())) {
Iterator<Element> obsIt = root.elementIterator();
obs = new BindConfig();
while (obsIt.hasNext()) {
Element obsNode = obsIt.next();
if ("SCode".equalsIgnoreCase(obsNode.getName())) {
obs.SCode = obsNode.getText();
} else if ("SCodeValid".equalsIgnoreCase(obsNode.getName())) {
obs.SCodeValid = obsNode.getText();
}
}
}
} catch (DocumentException e) {
e.printStackTrace();
}
return obs;
}
xxxxxxxxxx
String cmd = "PUT /System/DeviceBindConfig" + "\r\n\r\n" + PutXMLString.getBindConfig(info.getsCode());
DevicesManage.getInstance().cmd902(info.getDid(), cmd, "");
Function function description
Upload device scode code
Declaration class
xxxxxxxxxx
DevicesManage.java
Describe the context (dependent interfaces or used with those interfaces)
Param
Param | Details |
---|---|
SCode | SCode |
Return
Return | Details |
---|---|
requestURL | Request URL |
statusCode | status,0:Request Success |
xxxxxxxxxx
<DeviceBindConfig>
<SCode><!--rw,req,xs:string--></SCode>
</DeviceBindConfig>
<ResponseStatus Version=\"1.0\">
<requestURL>/System/DeviceBindConfig</requestURL>
<statusCode>0</statusCode>
</ResponseStatus>
Simple sample code
xxxxxxxxxx
String cmd = "PUT /System/DeviceBindConfig" + "\r\n\r\n" + PutXMLString.getBindConfig(info.getsCode());
DevicesManage.getInstance().cmd902(info.getDid(), cmd, "");
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case Constants.Action.GET_SET_CONFIG_BY_HTTP:
String http = intent.getStringExtra("http");
if (!HttpUtils.checkInvalid(http)) {
return;
}
String responseXML = HttpUtils.getResponseXML(http);
String xmlInfo = HttpUtils.getHttpXmlInfo(responseXML);
if (xmlInfo == null) {
return;
}
String did = intent.getStringExtra("deviceId");
if (xmlInfo.equals("ResponseStatus")) {
RESPONSESTATUS response = XmlUtils.parseResponse(responseXML);
if (response.requestURL.contains("/System/DeviceBindConfig")){
if ("0".equals(response.statusCode)) {
}
}
}
break;
}
}
};
xxxxxxxxxx
public static String DEVICE_UNBIND = "/safe/device-unbind";
Function function description
Describe the context (dependent interfaces or used with those interfaces)
Param
Param | Details |
---|---|
did | Device DID |
sCode | Device sCode |
Return
xxxxxxxxxx
//Example
{
code = 200;
data = null;
error = null;
}
Simple sample code
xxxxxxxxxx
Map<String, Object> params = new HashMap<>();
params.put("did", did);
params.put("sCode", sCode);
EasyHttp.getInstance().postJson(mActivity, getUrl(DEVICE_UNBIND), params,new EasyCallBack() {
public void onSuccess(String result) {
bindDevice(did, dtype);
}
public boolean onFail(int status, String msg) {
connHostFailed();
return true;
}
});
xxxxxxxxxx
public static final String SHARE_ADD_HOST = "/safe/device-to-host";
Function function description
Describe the context (dependent interfaces or used with those interfaces)
Param
Param | Details |
---|---|
did | Device DID |
sn | Enterprise serial number |
Return
Return | Details |
---|---|
data | Device identity encryption information |
code | The return code 200 indicates success |
error | Prompt information |
xxxxxxxxxx
//Example
{
code = 200;
data = "SMjOwVRLRHr/5Ct+yG/q655hpOoyShhszVNSL1ll7TaJl8LniWGMMJ/QyTatjNn0IqpqvXMAYQs=";;
error = null;
}
Simple sample code
xxxxxxxxxx
public static void deviceToHost(Context context, String sn, String did, final AddHostCallback callback){
Map<String, Object> params = new HashMap<>();
params.put("sn", sn);
params.put("did", did);
EasyHttp.getInstance().postJson(context,HttpConst.getUrl(SHARE_ADD_HOST), params, new EasyCallBack() {
public void onSuccess(String result) {
String data = LoginDataUtils.getData(result);
String code = LoginDataUtils.getCode(result);
if(callback != null) {
if(!TextUtils.isEmpty(data)) {
callback.onSuccess(data);
} else {
callback.onFailed(code, data);
}
}
}
public boolean onFail(int status, String msg) {
if(callback != null) {
callback.onFailed("-5000", null);
}
return true;
}
});
}
xxxxxxxxxx
public static String DEVICE_BIND = "/safe/device-bind";
Function function description
Describe the context (dependent interfaces or used with those interfaces)
Param
Param | Details |
---|---|
did | Device DID |
sn | Enterprise serial number |
Return
Return | Details |
---|---|
code | The return code 200 indicates success |
data | Key value pair |
error | Prompt information |
data键值对 | Details |
---|---|
sCode | Scode used for unbinding |
encrypt | Device authentication information |
id | Device table ID |
xxxxxxxxxx
//Example
{
"code": 200,
"data": {
"encrypt": "SMjOwVRLRHr/5Ct+yG/q655hpOoyShhszVNSL1ll7TaJl8LniWGMMJ/QyTatjNn0IqpqvXMAYQs=",
"id": 2553182,
"sCode": "164938234123568514602102-0400000"
},
"error": null
}
Simple sample code
xxxxxxxxxx
private void bindDevice(final String did, String dtype) {
DeviceInfo info = fList.getDeviceInfoById(did);
if (info == null) return;
Map<String, Object> params = new HashMap<>();
params.put("sn", HttpConst.SN);
params.put("did", did);
params.put("dtype", dtype);
params.put("alias", info.getNickName());
params.put("username", info.getUsername());
params.put("pwd", info.getPassword());
EasyHttp.getInstance().postJson(mActivity, getUrl(DEVICE_BIND), params,
new EasyCallBack() {
public void onSuccess(String result) {
DeviceInfo info = FList.getInstance().getDeviceInfoById(did);
if (result == null || result.length() == 0 || info == null) {
return;
}
String data = LoginDataUtils.getData(result);
LocalLogUtil.writeLog(mActivity, "bindDeviceHandler result:" + result);
JSONObject jsonData;
String sCode = "";
String encrypt = "";
try {
jsonData = new JSONObject(data);
sCode = jsonData.getString("sCode");
encrypt = jsonData.getString("encrypt");
} catch (JSONException e) {
e.printStackTrace();
}
}
public boolean onFail(int status, String msg) {
return true;
}
});
}
xxxxxxxxxx
//设备复位绑定
public short verificationV2(String did, String userName, String password, String attr1, String attr3);
Function function description
V2 authentication
Declaration class
xxxxxxxxxx
DevicesManage.java
Describe the context (dependent interfaces or used with those interfaces)
Param
Param | Details |
---|---|
did | Device DID |
userName | Device user name |
password | Device password |
attr1 | Device authentication key |
attr3 | is host."OWN":host,"GUE":guest |
Return
Return | Details |
---|---|
action | Constants.Action.RET_AUTHV2 |
result | ok:success,failed:failed |
ScodeFailed | Scode is ok,1:Scode is failed |
did | Device DID |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().verificationV2(curDeviceInfo.getDid(), curDeviceInfo.getUsername(), curDeviceInfo.getPassword(), curDeviceInfo.getAttr1(), attr3);
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case Constants.Action.RET_AUTHV2:
String result = intent.getStringExtra(ConstantsCore.RESULT);
String did = intent.getStringExtra(ConstantsCore.DID);
String scodeFailed = intent.getStringExtra("ScodeFailed");
break;
}
}
};
xxxxxxxxxx
//Get device list
public static String GET_DEVICE_LIST = "/safe/get-device-list/" + SN; // Get device list
Function function description
Describe the context (dependent interfaces or used with those interfaces)
Param
Param | Details |
---|---|
sn | Enterprise serial number |
Return
Return | Details |
---|---|
data | Contains entries key value pairs |
code | The return code 200 indicates success |
error | Prompt information |
entries | Details |
---|---|
id | Device table id |
dtype | Equipment type [1-ipc; 2-nvr; 3-dvr; 4-panorama; 5-alarm box; 6-low power consumption] |
sn | Enterprise serial number |
account | account |
did | Device DID |
pwd | Device password |
alias | Device alias |
username | Device user name |
auth | |
attr1 | Device authentication key |
attr2 | List of functions supported by device sharing |
attr3 | Device identity information (empty is the old device; 0 is the master device; other numbers are the guest devices) |
attr5 | Multi function field |
createTime | |
host | Device owner account information |
shareNumber | Quantity shared |
encrpt | Device verification information |
passwordHint | Prompt to change password (false - no prompt; true - prompt) |
xxxxxxxxxx
//Example
{
"code": 200,
"data": {
"entries": [{
"id": 2591515,
"dtype": "1",
"sn": null,
"account": null,
"did": "IOTDAA-706571-PMKNZ",
"pwd": "",
"alias": "706571",
"username": "admin",
"auth": null,
"attr1": "NIN3g5Ot/bY+0INKgwftHJ2yx/2xMmN7",
"attr2": null,
"attr3": "0",
"attr5": {
"uuidpush": "IOTDAA-706571-PMKNZ,WZXACQ#WLTBEC",
"aiotuiedit": "true",
"cloudStoreAbility": "1",
"mac": "30:7b:c9:3a:86:a5"
},
"createTime": null,
"host": null,
"shareNumber": 0,
"encrypt": "NIN3g5Ot/bY+0INKgwftHDfgxQ1w974KDOo2sHc3/tqp9C7P0AMIE1MrQQOxhwn76vzXdg/ofZ8=",
"subStatus": null
}]
},
"error": "成功!"
}
Simple sample code
xxxxxxxxxx
public static void findDevice(Context context, final Handler handler){
EasyHttp.getInstance().get(context, getUrl(GET_DEVICE_LIST), null, new EasyCallBack() {
public void onSuccess(String result) {
String data = LoginDataUtils.getData(result);
Message e = handler.obtainMessage();
e.what = DeviceAddTypeQRConnActivity.FIND_DEVICE_SUC;
Bundle bundle = new Bundle();
bundle.putString("device_json", data);
e.setData(bundle);
handler.sendMessage(e);
}
public boolean onFail(int status, String msg) {
handler.sendEmptyMessage(DeviceAddTypeQRConnActivity.FIND_DEVICE_FAIL);
return true;
}
});
}
xxxxxxxxxx
public short getNetcardInfo(String did)
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
xxxxxxxxxx
DevicesManage.java
Parameters | Describe |
---|---|
did | devicd DID |
Return | Describe |
---|---|
action | ConstantsCore.Action.RET_GET_NETCARD_INFO |
result | ok: get information success other error |
ConstantsCore.DID | device DID |
netcardType | unknown,wired1,wired2;wifi,3G,4G,5G |
apMode | unknown , STA , AP |
sample
xxxxxxxxxx
DevicesManage.getInstance().getNetcardInfo(did);
xxxxxxxxxx
public short getNetcfg(String did)
Function function description
Get the network parameters of the camera, including information such as IP address and mac address.
Declaration class
xxxxxxxxxx
DevicesManage.java
Parameters | Describe |
---|---|
did | device DID |
Return | Describe |
---|---|
action | ConstantsCore.Action.RET_GET_NETCFG |
result | ok: get information other error |
ConstantsCore.DID | device did |
network | List |
sample
xxxxxxxxxx
DevicesManage.getInstance().getNetcfg(did);
NetworkVO
package:com.echosoft.gcd10000.core.entity
private String type; //wire ,wireless
private String dhcp; //true DHCP
private String ip; //IP
private String netmask;
private String gw;
private String mac;
private String dns1; //main DNSmain
private String dns2;
xxxxxxxxxx
public short getWifiInfo(String did, String mac)
Function function description
Get device Wifi information
Declaration class
xxxxxxxxxx
DevicesManage.java
Parameters | Describe |
---|---|
did | device DID |
mac | device mac ,get from getNetcfg(did) |
Return | Describe |
---|---|
action | ConstantsCore.Action.RET_GET_WIFI_INFO |
result | ok: get information success, other error |
ConstantsCore.DID | device DID |
mac | wireless mac |
ssid | wifi ssid |
random | random number |
Sample
xxxxxxxxxx
DevicesManage.getInstance().getWifiInfo(did);
xxxxxxxxxx
public short setWifiInfo(String did, String mac, String wifiName, String random, String password);
public short setWifiInfoV2(String did, String mac, String wifiName, String random, String password);//support chinese ssid
Function function description
Set the camera to connect to the specified wifi
Declaration class
xxxxxxxxxx
DevicesManage.java
Parameters | Describe |
---|---|
did | device DID |
mac | device mac |
wifiName | the name of the wifi that needs to be connected |
random | Random number, which is obtained by getting WiFi information from the device when getWifiInfo (did, mac) is called |
password | base64(random+":"+password) |
Return | Describe |
---|---|
action | ConstantsCore.Action.RET_SET_WIFI_INFO and ConstantsCore.Action.RET_SET_WIFI_INFO_V2 |
result | ok: Set wifi information successfully. other error: |
ConstantsCore.DID | device DID |
mac | The physical address of the camera wireless network card |
ssid | wifi SSID |
random | Random number |
Sample
xxxxxxxxxx
String password = random + ":" + wifiPassword;
//判断是否是Acsii码的WiFi名
//正则:public static final String REGEX_WIFI_SSID = "^[\\w\\x21-\\x7e]+$";
if (RegexUtil.isAsciiWifiName(wifiName)) {
DevicesManage.getInstance().setWifiInfo(did, mac, wifiName, random, Base64Util.encode(password.getBytes()));
} else {
DevicesManage.getInstance().setWifiInfoV2(did, mac, wifiName, random, Base64Util.encode(password.getBytes()));
}
return:
xxxxxxxxxx
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
String did = intent.getStringExtra(ConstantsCore.DID);
switch (action) {
case Constants.Action.RET_SET_WIFI_INFO_V2:
case Constants.Action.RET_SET_WIFI_INFO: {
if (ConstantsCore.CommandResult.AUTH_SUCCESS.equals(result)) {
String retAPmac = intent.getStringExtra("mac");
String retSsid = intent.getStringExtra("ssid");
String retRandom = intent.getStringExtra("random");
} else {
}
}
}
}
};
####
The flow chart is as follows:
"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
xxxxxxxxxx
String qrStr = "S=" + ssid
+ "&P=" + pwd
+ "&T=" + rowStr
+ "&K=" + key
+ "&A=" + ipAddress
+ "+" + ipPort;
if (qrStr.contains("\n")) {
qrStr = qrStr.replace("\n", "");
}
Bitmap netfits = QrCodeUtils.generateBitmap(qrStr, 1000, 1000);
public static Bitmap generateBitmap(String content, int width, int height) {
if (TextUtils.isEmpty(content)) {
return null;
}
if (width < 0 || height < 0) {
return null;
}
HmsBuildBitmapOption options = new HmsBuildBitmapOption.Creator()
.setBitmapMargin(4)
.create();
try {
return ScanUtil.buildBitmap(content, HmsScan.QRCODE_SCAN_TYPE, width, height, options);
} catch (WriterException e) {
e.printStackTrace();
}
return null;
}
or lib/Include/UDPReceiverUtil.java
The flow chart is as follows:
reset device
record wifi ssid and password
connect device ap hotspot start with "ZWAP_", password "01234567",get device did and login device
set wifi
get wireless mac
DevicesManage.getInstance().getNetcfg()
get random number
DevicesManage.getInstance().getWifiInfo()
set wifi
DevicesManage.getInstance().setWifiInfo()
1.Layout file
xxxxxxxxxx
<com.echosoft.gcd10000.core.device.custom.Monitor
android:id="@+id/single_monitor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true" />
2.Set did and channel for Monitor
xxxxxxxxxx
monitor.setDID(did);
monitor.setMchannel(channel);
1.method
xxxxxxxxxx
public void regAVListener(String did, int channel, Monitor monitor)
2.parameter
parameter | directions |
---|---|
did | equipment did |
channel | equipment channel number,from 0 |
monitor | monitor control |
3.example
xxxxxxxxxx
DevicesManage.getInstance().regAVListener(did, channel, iAVListener);
1.method
xxxxxxxxxx
public short openVideoStream(String did, String channel)
2.parameter
parameter | directions |
---|---|
did | equipment did |
channel | equipment channel number,from 0 |
3.example
xxxxxxxxxx
DevicesManage.getInstance().openVideoStream(did, channel);
4.Return value (Broadcast monitoring for callback ConstantsCore.Action.RET_OPENSTREA)
Return value | directions |
---|---|
result | ok open successfully |
channel | equipment channel number,from 0 |
DID | equipment did |
1.method
xxxxxxxxxx
public short closeVideoStream(String did, channel)
2.parameter
parameter | directions |
---|---|
did | equipment did |
channel | equipment channel number,from 0 |
3.example
xxxxxxxxxx
DevicesManage.getInstance().closeVideoStream(did, channel);
4.Return value (Broadcast monitoring for callback ConstantsCore.Action.RET_CLOSESTREAM)
Return value | directions |
---|---|
result | ok open successfully |
channel | equipment channel number,from 0 |
DID | equipment did |
Layout the Monitor control on the interface
xxxxxxxxxx
<com.echosoft.gcd10000.core.device.custom.Monitor
android:id="@+id/single_monitor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true" />
Set did and channel for Monitor
xxxxxxxxxx
monitor.setDID(did);
monitor.setMchannel(channel);
Register the Monitor callback to enable the Monitor to receive the video stream data of the specific channel of the device
xxxxxxxxxx
DevicesManage.getInstance().regAVListener(did, channel, iAVListener);
Call the stream opening command, and the Monitor starts playing the video.
xxxxxxxxxx
DevicesManage.getInstance().openVideoStream(did, channel);
Send the command to close the video stream, cancel the registration of the monitor, and clear the dids and channels of the monitor
xxxxxxxxxx
public synchronized void closeVideoStream(String did, channel)
monitor.setMchannel(-1);
monitor.setDID(null);
xxxxxxxxxx
public short openAudioStream(String in_strDID, String iChannel);
public short closeAudioStream(String in_strDID, String iChannel);
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
in_strDID | equipment did |
iChannel | equipment channel number,from 0 |
Return value
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().openAudioStream(did, channel);
DevicesManage.getInstance().closeAudioStream(did, channel);
xxxxxxxxxx
public void openAudioDecode(String did);
public void closeAudioDecode(String did);
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
did | equipment did |
Return value
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().openAudioDecode(did);
DevicesManage.getInstance().closeAudioDecode(did);
xxxxxxxxxx
public void startRecord(String did, int channel, String path, boolean bIsRecod, OnMp4ConvertOver mp4ConvertOver)
DevicesManage.getInstance().stopRecord(String did);
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
bIsRecod | YES Record Audio NO Close Record Audio |
path | Video file storage path |
did | equipment did |
channel | equipment channel number,from 0 |
mp4ConvertOver | the successful callback of prv to mp4 returns the mp4 file path |
Return value
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().startRecord(did, channel, path, b, new OnMp4ConvertOver() {
public void onFail() {
}
public void onSuccess(String s) {
}
public void onProgress(int i) {
}
});
xxxxxxxxxx
public short startTalkByChannel(String did, int channel);
public short stopTalkByChannel(String did, int channel);
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
did | equipment did |
channel | equipment channel number,from 0 |
Return value
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().startTalkByChannel(did, channel);
DevicesManage.getInstance().stopTalkByChannel(did, channel);
xxxxxxxxxx
public short speak(String did, String action);
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
did | equipment did |
parameter | Start or stop sending intercom data, start: start sending stop: stop sending |
Return value
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().speak(did, "start");
xxxxxxxxxx
public short openRemoteSpeakStream(String did, int channelSize, boolean fullDuplex);
public short closeRemoteSpeakStream(String did, boolean fullDuplex);
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
did | device did |
channelSize | channel size |
fullDuplex | support full-duplex talkback or not |
Return value
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().openRemoteSpeakStream (did, 1, false);
DevicesManage.getInstance().closeRemoteSpeakStream (did, false);
xxxxxxxxxx
public void remoteSpeakNotPlay(boolean notPlay)
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
notPlay | "true":close play, "false":open play |
Return value
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().remoteSpeakNotPlay (true);
open intercom process
xxxxxxxxxx
DevicesManage.getInstance().startTalkByChannel(did, channel);
DevicesManage.getInstance().openRemoteSpeakStream (did, 1, false);
DevicesManage.getInstance().speak(did, "start");
close intercom process
xxxxxxxxxx
DevicesManage.getInstance().speak(did, "stop");
DevicesManage.getInstance().stopTalkByChannel(did, channel);
DevicesManage.getInstance().closeRemoteSpeakStream (did, false);
xxxxxxxxxx
public short getDeviceImageQuality(String in_strDID, String iChannel);
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
in_strDID | equipment did |
iChannel | equipment channel number,from 0 |
Return value(Notification return code:RET_GET_QUALITY)
Receive broadcast action | ConstantsCore.Action.RET_GET_DEVICEQUALITY |
---|---|
Return value | directions |
result | Ok: Get the device image quality successfully< br />auth_ Failure: Validation error Invalid_ Channel: wrong channel number other error: other unknown errors |
quality | The image quality of the current channel of the device, 5: smooth 1: clear 6: high-definition |
channe | equipment channel number,from 0 |
DID | equipment did |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().getDeviceImageQuality(did, channel);
xxxxxxxxxx
public short setDeviceImageQuality(String in_strDID, int iChannel, String stDeviceQuality);
1.Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
in_strDID | equipment did |
iChannel | equipment channel number,from 0 |
stDeviceQuality | definition |
Return value
Receiving broadcast action | ConstantsCore.Action.RET_SET_DEVICEQUALITY |
---|---|
Return value | directions |
result | Ok: 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 |
channe | equipment channel number,from 0 |
DID | equipment did |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().setDeviceImageQuality(did,channel, stDeviceQuality);
xxxxxxxxxx
public int getCodeRateByChannel(String did, int channel)
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
did | equipment did |
channel | equipment channel number,from 0 |
Return value
parameter | directions |
---|---|
int | Kbps |
xxxxxxxxxx
"GET /System/PTZCap"
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
in_strDID | equipment did |
Return value
Return value | directions |
---|---|
Focus | Focus |
Support | true:Support focus false:Focus is not supported |
Return value | directions |
---|---|
Track | Track |
Support | true:Support track false: Track is not supported |
Count | Number of tracks |
Return value | directions |
---|---|
AutoScan | AutoScan |
Support | true:Support AutoScan false:AutoScan is not supported |
Return value | directions |
---|---|
Aperture | aperture |
Support | true:Support aperture false:aperture is not supported |
Return value | directions |
---|---|
Preset | Preset |
Support | true:Support preset false:Preset is not supported |
Count | APP number of preset points (supports 1-255 set points, 1-48 for some devices)) |
APPCount | APP number of preset points (advanced preset function is available only when APPCount is 256) |
Return value | directions |
---|---|
Zoom | Zoom |
Support | true:Support zoom false:Zoom is not supported |
AFTrack | Tracking zoom(Support,true:Support tracking zoom false:Tracking zoom is not supported ) |
Return value | directions |
---|---|
Guard | Guard position (watch) |
Support | true:Support guard position false: Guard position is not supported |
Return value | directions |
---|---|
AuxControl | Auxiliary functions |
Support | true:Support auxiliary functions false: Auxiliary functions is not supported |
Menu | Menu(Support,true:Support menu false:Menu is not supported) |
Light | Light (Support,true:Support light false: Light is not supported) |
Wipe | Wipe (Support,true:Support wipe false:Wipe is not supported) |
Heat | Heat(Support,true:Support heat false: Heat is not supported) |
Fan | Fan(Support,true:Support fan false:fan is not supported) |
Power | Power (Support,true:Power false:Power is not supported) |
Return value | directions |
---|---|
PanTile | orientation |
Support | true:Support orientation false:orientation is not supported |
UpDown | Up /Down(Support,true:Support up /down false:Up /Down is not supported) |
LeftRight | Left/Right(Support,true:Support left/right( false:Left/Right is not supported) |
Extend | Left up 、Left down 、Right up、Right down(Eight directions)(Support,true:Support eight directions false:Eight directions is not supported) |
OneStep | Single step control(Support,true:Support single step control false:single step control is not supported) |
Return value | directions |
---|---|
Cruise | Cruise |
Support | true:Support cruise false: Cruise is not supported |
Count | Number of cruise lines |
xxxxxxxxxx
//Example of return value
{
"Focus" = {
"Support" = true,
},
"Track" = {
"Support" = false,
"Count" = 10,
},
"AutoScan" = {
"Support" = false,
},
"Aperture" = {
"Support" = false,
},
"Preset" = {
"Support" = true,
"Count" = 6,
},
"Zoom" = {
"Support" = true,
"AFTrack" = {
"Support" = true,
},
},
"Support" = true,
"Guard" = {
"Support" = false,
},
"_ChannelID" = 0,
"__name" = Channel,
"AuxControl" = {
"Menu" = {
"Support" = false,
},
"Light" = {
"Support" = true,
},
"Wipe" = {
"Support" = false,
},
"Heat" = {
"Support" = false,
},
"Support" = true,
"Fan" = {
"Support" = false,
},
"Power" = {
"Support" = false,
},
},
"PanTile" = {
"Extend" = {
"Support" = false,
},
"UpDown" = {
"Support" = true,
},
"OneStep" = {
"Support" = true,
},
"LeftRight" = {
"Support" = true,
},
},
"Cruise" = {
"Support" = true,
"Count" = 16,
},
}
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().cmd902(did, GET_PTZCAP, "");
xxxxxxxxxx
"GET /System/DeviceCap"
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
in_strDID | equipment did |
Return value (only the fields valid for PTZ are described)
Return value | directions |
---|---|
PTZ_Advance_Cruise | Advance_Cruise function |
PTZ_Advance_Watch | Advance_Watch function |
ShakingHead | Is 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) |
Motor | motor |
xxxxxxxxxx
//Example of return value
{
"__name" = Device,
"FunctionList" = {
"AutoIP" = false,
"WiredAlarm" = false,
"SD" = true,
"FTP" = true,
"SubHistoryStreamSupport" = true,
"cloud_upgrade" = true,
"Snapshot" = false,
"TimeSnapshot" = true,
"ShakingHead" = true,
"P2PUpgrade" = true,
"Motor" = true,
"NoPtzAf" = false,
"CloudStorage" = {
"Support" = true,
},
"AudioAlarm" = true,
"ParamFixed" = true,
"AP" = true,
"WiredNetwork" = false,
"AudioAlarmAudioFormat" = {
"G711u" = true,
"AMR" = false,
},
"DisableIrLed" = true,
"VoiceCustom" = true,
"AppUI" = {
"AdvancedPeopleTrack" = true,
"StorageCapacity" = true,
"FlipSwitch" = true,
"EmailV2" = true,
},
"Email" = true,
"WIFI" = true,
"DeviceShareAndSelfUnbind" = true,
"Restore" = true,
"Wavelink" = false,
"DeviceShared" = true,
"PasswordModify" = true,
"TwoWayAudio" = true,
"SerialTransparent" = false,
"Smartlink" = false,
"RemoteReboot" = true,
},
"FunctionListAboutChannel" = {
"FunctionListSdCard" = {
"fast_playback" = true,
},
"ChannelList" = {
"Channel" = {
"Motion" = true,
"MotionSenstive" = {
"Middle" = true,
"Higher" = false,
"High" = true,
"Lowest" = false,
"Low" = true,
"Lower" = false,
"Highest" = false,
},
"multi_osd" = false,
"mosd_cord" = 16,
"LocalRecordFormat" = {
"PRV" = true,
"AVI" = false,
},
"IrCutMode" = {
"VariableWhite" = false,
"VariableInfrared" = false,
},
"PTZ_Advance_Watch" = false,
"SmartEvent" = {
"AiFace" = true,
"PeopleDetect" = true,
"PeopleTrack" = true,
"BehaviorAnalysis" = false,
"TalkingForward" = false,
"PIR" = false,
"Ai265Plus" = true,
"FaceSnap" = false,
"FaceBase" = false,
"FaceReco" = false,
},
"PTZ_Advance_Cruise" = false,
"mosd_cnt" = 16,
"RTMP" = false,
"IntelligentNight" = false,
"_ChannelID" = 0,
"ImageMode" = {
"_enable" = true,
"Normal" = true,
"LicensePlate" = true,
"FaceNoExposure" = true,
},
"Audio" = true,
"ColorNight" = false,
},
},
},
"AlarmOutCount" = 0,
"StreamCount" = 2,
"AlarmInCount" = 0,
}
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().cmd902(did, GET_DEVCAP, "");
xxxxxxxxxx
public short ptzNormal(String in_strDID, String iChannel, String direction, String nSpeed, String nLastTime, String action)
Function Description
Set the camera to rotate up, down, left and right, zoom and focus
Declare class
xxxxxxxxxx
EchoP2PClient.h
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
in_strDID | equipment did |
nSpeed | Speed (0-9 supported) |
nLastTime | Duration (ms) |
iChannel | Channel number, starting from 0 |
direction | Adjustment 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) |
action | PTZ 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 |
| Return value
xxxxxxxxxx
//Example of return value
{
DID = "IOTBEE-287139-CGKGT";
key = 301;
result = ok;
}
5.Simple sample code
xxxxxxxxxx
//start
DevicesManage.getInstance().ptzNormal(in_strDID, iChannel, direction, nSpeed, nLastTime, "start");
//stop
DevicesManage.getInstance().ptzNormal(in_strDID, iChannel, direction, nSpeed, nLastTime, "stop");
xxxxxxxxxx
"PUT /PTZ/1/Watch/StartWatch HTTP/1.1"
"PUT /PTZ/1/Watch/StopWatch HTTP/1.1"
1.Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
parameter | directions |
---|---|
in_strDID | equipment did |
param | @"Param1=1"(Fixed writing) |
Return value
xxxxxxxxxx
//Example of return value
{
"__name" = ResponseStatus,
"_Version" = 1.0,
"statusCode" = 0,
"requestURL" = /PTZ/1/Watch/StartWatch,
}
Simple sample code
xxxxxxxxxx
//Open Watch
String cmdWS = PUT_PTZ_WATCH_START + "\r\n\r\n" + "Param1=1";
DevicesManage.getInstance().cmd902(did, cmdWS, "");
//Close Watch
String cmdWE = PUT_PTZ_WATCH_STOP + "\r\n\r\n" + "Param1=1";
DevicesManage.getInstance().cmd902(did, cmdWE, "");
xxxxxxxxxx
"PUT /PTZ/ChannelID/Presets/Set"
"PUT /PTZ/ChannelID/Presets/Goto"
Function Description
Describe the context (dependent interfaces or interfaces used together)
parameter
in_strDID | equipment did |
---|---|
param | "Param1=%d"is default number. The range of values is 0-127。 |
ChannelID | Channel number, starting from one |
parameter | directions |
Return value
xxxxxxxxxx
//Example of return value
{
"__name" = ResponseStatus,
"_Version" = 1.0,
"statusCode" = 0,
"requestURL" = /PTZ/1/Presets/Set,
}
5.Call simple sample code
xxxxxxxxxx
// set
String cmd = "PUT /PTZ/" + (channel + 1) + "/Presets/Set" + "\r\n\r\n" + param;
DevicesManage.getInstance().cmd902(did, cmd, "");
//call
String cmd = "PUT /PTZ/" + (channel + 1) + "/Presets/Goto" + "\r\n\r\n" + param;
DevicesManage.getInstance().cmd902(did, cmd, "");
xxxxxxxxxx
public short getRecordinfoByMonth(String did, int channel, int size, String recordType, String year, String month)
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
ParameterDescription | |
---|---|
did | The device's dids |
channel | The channel number of the device, starting from 0 |
size | Total number of channels of the device |
recordType | The video type only supports all types to transfer the value to all temporarily |
year | Query the year of the video recording |
month | month of the video query |
Action | ConstantsCore.Action.RET_GET_RECORDINFO_BY_MONTH |
---|---|
Intent character result | ok: Encryption catalogues such as information successfully auth_failure: Error Invalid_channel: Invalid path other error: Other unknown error |
Intent character queryResult | everyday 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
xxxxxxxxxx
DevicesManage.getInstance(). getRecordinfoByMonth(did, channel,size, "all", year, month);
xxxxxxxxxx
public short getRecordInfoByDay(String did, int channel, int size, String recordType, String year, String month, String day, DevRetCallback.GetRecordInfoByDayListener listener)
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
Parameter | Description |
---|---|
did | The device's dids |
channel | The channel number of the device, starting from 0 |
size | Total number of channels of the device |
recordType | The video type only supports all types to transfer the value to all temporarily |
year | Query the year of the video recording |
month | Month of the video query |
day | Query the dayof the video recording |
listener | Query result callback, which changes the previous broadcast mode to callback mode, not UI thread |
Callback interface | Return value description |
---|---|
onSuccess(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 |
RecordListVO | type:"manaul" manual recording "ai" intelligent recording "time" timing recording "motion" event recording start_time:Recording start time end_time:Recording end time |
xxxxxxxxxx
DevicesManage.getInstance().getRecordInfoByDay(did, channel,size, "all", year, month, day,
new DevRetCallback.GetRecordInfoByDayListener() {
public void onSuccess(List<RecordListVO> list) {
runOnUiThread(new Runnable() {
public void run() {
//UI operation
}
});
}
public void onFail() {
runOnUiThread(new Runnable() {
public void run() {
//UI operation
}
});
}
});
xxxxxxxxxx
public short playbackStart(String did, int channel, int size, String recordType, String startTime, String endTime, String cmd)
Enable remote playback
Parameter | Description |
---|---|
did | The device's dids |
channel | The channel number of the device, starting from 0 |
size | Total number of channels of the device |
recordType | The video type only supports all types to transfer the value to all temporarily |
startTime | The time format for starting playback is "20160604 00:00:00" |
endTime | The time format for stopping playback is "20160604 23:59:59" |
cmd | Enable the main and sub code stream differentiation, which can be null. The default sub code stream is "main", "sub" |
Broadcast Action | ConstantsCore.Action.RET_PLAYBACK_START |
---|---|
Intent field result | ok: Playback is successfully opened auth_failure: validation error Invalid_channel: wrong channel number other error: other unknown errors |
xxxxxxxxxx
DevicesManage.getInstance().playbackStart(did, channel,size,"all", ppcsStartTime,
ppcsEndTime, null);
xxxxxxxxxx
public short playbackClose(String did, int channel)
Close Remote Playback
Parameter | Description |
---|---|
did | The device's did |
channel | The channel number of the device, starting from 0 |
Broadcast Action | ConstantsCore.Action.RET_PLAYBACK_CLOSE |
---|---|
Intent field result | ok: playback is closed successfully auth_failure: validation error Invalid_channel: wrong channel number other error: other unknown errors |
xxxxxxxxxx
DevicesManage.getInstance().playbackClose(did, channel);
xxxxxxxxxx
public short playbackSeek(String did, String time)
Remote playback location jumps to a certain point in time for playback. It can only be used when remote playback is enabled
Parameter | Description |
---|---|
did | The device's did |
time | The time point format of playback positioning is required to be "20160604 23:59:59" |
Broadcast Action | ConstantsCore.Action.RET_PLAYBACK_SEEK |
---|---|
Intent field result | ok: Playback positioning succeeded auth_failure:validation error Invalid_channel: wrong channel numbe other error: other unknown errors |
xxxxxxxxxx
DevicesManage.getInstance().playbackSeek(did, seekTime);
xxxxxxxxxx
public void playbackPauseControl(String did, boolean pause)
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
Parameter | Description |
---|---|
did | The device's did |
pause | Pause or play, true: pause false play |
xxxxxxxxxx
DevicesManage.getInstance().playbackPauseControl(did,pause)
xxxxxxxxxx
public void playAudioClose(String did, int channel, boolean isPlayControl)
The pause or play of remote playback audio can only be used when the remote playback stream is successfully opened
Parameter | Description |
---|---|
did | The device's did |
channel | The channel of the device, starting from 0 |
isPlayControl | Pause or play, true: Pause false play |
xxxxxxxxxx
DevicesManage.getInstance().playAudioClose (did, channel, false)
1.Functions
Gets the current playback time
2.Examples
xxxxxxxxxx
//register after playback start
DevicesManage.getInstance().regAVListener(did, IAVListener.DEFAULT_CHANNEL_ONE, this);
this impliments IAVListener
//unregister after playback close
DevicesManage.getInstance().unregAVListener(did, IAVListener.DEFAULT_CHANNEL_ONE, this);
updateMoreDataAVInfoDate(String did, int channel, int in_iMsec, byte cPositionId)
//use in_iMsec
//backTime = (long) (in_iMsec) * 1000 - (calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET))
xxxxxxxxxx
public static Bitmap convertBitmap(byte[] yuv, int width, int heigh) {
Get the screenshot of the current video
Parameter | Description |
---|---|
yuv | m_ YuvData of the currently playing video monitor property |
width | m_ Width of the currently playing video monitor property |
heigh | m_ Height of the currently playing video monitor property |
xxxxxxxxxx
Bitmap bitmap = Monitor.convertBitmap(mMonitor.m_yuvDatas, mMonitor.m_width, mMonitor.m_height);
xxxxxxxxxx
public void startRecord(String did, int channel, String desPath, boolean enableVoice, OnMp4ConvertOver listener)
Local video recording can only be called after the preview or playback is successful
Parameter | Description |
---|---|
Dids | The device's dids |
Channel | The channel number of the device, starting from 0 |
DesPath | Video storage path. The video format is private and the suffix is fixed prv |
EnableVoice | Whether audio is required for video recording, true: Yes |
Listener | After the video recording is completed, the result of prv converting to mp4 is called back, and the mp4 file path is returned after success |
xxxxxxxxxx
DevicesManage.getInstance().startRecord(did, channel, recordFilePath, true, new
OnMp4ConvertOver() {
public void onFail() {
}
public void onSuccess(String s) {
}
public void onProgress(int i) {
}
});
xxxxxxxxxx
/System/%d/RemoteForceIFrame
After video recording is started, force the device to send an I frame to start recording the first frame
xxxxxxxxxx
PUT
xxxxxxxxxx
//channel 从0开始
String cmd = String.format("PUT /System/%d/RemoteForceIFrame", channel+1);
DevicesManage.getInstance().cmd902(did, cmd, "");
xxxxxxxxxx
public void stopRecord(String did)
Turn off local video recording
Parameter | Description |
---|---|
Dids | The device's dids |
xxxxxxxxxx
DevicesManage.getInstance().stopRecord(did);
xxxxxxxxxx
public short playbackSpeed(String did, int speed, String timeStr)
The fast playback setting can only be used when the remote playback is successful. In addition, the device needs to support fast playback
Parameter | Description |
---|---|
Dids | The device's dids |
Speed | Playback speed 1: normal speed, 4:4 speed, 8:8 speed |
TimeStr | The time point format of playback positioning is required to be "20160604 23:59:59" |
Broadcast Action | ConstantsCore. Action RET_ PLAYBACK_ SPEED |
---|---|
Intent field result | ok: Fast playback is set successfully. After success, you need to call changePlaybackSpeedSuccess to enable fast playback |
xxxxxxxxxx
DevicesManage.getInstance().playbackSpeed (did, 4, “20160604 23:59:59”)
xxxxxxxxxx
public void changePlaybackSpeedSuccess(String did, int channel, int speed)
Start Multiply Playback
Parameter | Description |
---|---|
Dids | The device's dids |
Channel | The channel of the device, starting from 0 |
speed | Current fast playback rate |
xxxxxxxxxx
DevicesManage.getInstance().changePlaybackSpeedSuccess (did, channel, 4)
xxxxxxxxxx
/RecordFileList/Attribute
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
Parameter | Description |
---|---|
SnapshotFileSumCount | Does not work, temporarily set to 0 |
SnapshotFileCountPerPage | The number of pages for remote video recording |
begin_ Time | Start time of obtaining remote video recording, format 20180507 020445 |
end_ Time | Get the end time of remote video recording. The format is 20180507 020445 |
timezone_ min_ between_ Utc | Does not work, temporarily set to 480 |
xxxxxxxxxx
PUT
Broadcast Action | ConstantsCore. Action GET_ SET_ CONFIG_ BY_ HTTP |
---|---|
ResponseStatus | 0: Setting succeeded |
xxxxxxxxxx
private static final String getPutRemoteRecordXML(String startTime, String endTime) {
StringBuilder strSnapshotFileLis = new StringBuilder(350);
strSnapshotFileLis.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n")
.append("<RecordFileListAttribute Version=\"1.0\">\n")
.append("<begin_time>").append(startTime).append("</begin_time>\n")
.append("<end_time>").append(endTime).append("</end_time>\n")
.append("<timezone_min_between_utc>480</timezone_min_between_utc>\n")
.append("<RecordFileSumCount>0</RecordFileSumCount>\n")
.append("<RecordFileCountPerPage>15</RecordFileCountPerPage>\n")
.append("</RecordFileListAttribute>\n");
return strSnapshotFileLis.toString();
}
String cmd = "PUT /RecordFileList/Attribute" + "\r\n\r\n" +
getPutRemoteRecordXML(startTime, endTime);
DevicesManage.getInstance().cmd902(did, cmd, "");
xxxxxxxxxx
/RecordFileList/Pages/%d?Pathtype=1
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
Parameter | Description |
---|---|
Page | Get the video clip data of the page, starting from 1 |
xxxxxxxxxx
GET
broadcast Action | ConstantsCore.Action.GET_SET_CONFIG_BY_HTTP |
---|---|
RecordFileList |
xxxxxxxxxx
String cmd = String.format("GET /RecordFileList/Pages/%d?Pathtype=1 HTTP/1.1", curPage);
DevicesManage.getInstance().cmd902(did, cmd, "");
xxxxxxxxxx
public void regFileDownloadListener(String did, IFileDownloadListener iAVListener)
public void unregFileDownloadListener(String did, IFileDownloadListener iAVListener)
Registration and logoff of remote file download progress interface
Parameter | Description |
---|---|
Dids | The device's dids |
IFileDownloadListener | Remote file download progress interface |
xxxxxxxxxx
broadcast Action ConstantsCore.Action.RET_REMOTE_IMAGE_DOWNLOAD_FINISH
Remote file download completed broadcasting
xxxxxxxxxx
public short startDownload(String did, String filePath, String fileType, String fileIndex, String savefilePath)
Remote file download settings
Parameter | Description |
---|---|
Dids | The device's dids |
FilePath | The absolute path of the remote file on the device |
FileType | Remote file type, picture: picture, video, video |
FileIndex | The file index, which does not work temporarily, can be written as 0 by default |
SavefilePath | The path to save the phone after downloading the remote file |
broadcast Action | ConstantsCore.Action.RET_START_DOWNLOAD |
---|---|
Intent field result | ok: set successfully |
Intent field task_ ID | Remote download task ID, used when file download is enabled |
Intent field file_ Size | Remote download file size |
4.Examples
xxxxxxxxxx
DevicesManage.getInstance().startDownload(did, filePath, "video", "0", savefilePath);
xxxxxxxxxx
public short download(String did, String taskId, String action)
Enable remote file download
Parameter | Description |
---|---|
Dids | The device's dids |
TaskId | Task ID of remote download |
Action | Start file transfer or stop file transfer, start: Start file transfer, stop: Stop file transfer |
Broadcast Action | ConstantsCore. Action RET_ DOWNLOAD |
---|---|
Intent field result | ok: set successfully |
xxxxxxxxxx
DevicesManage.getInstance().download(did, task_id, "start");
xxxxxxxxxx
public short stopDownload(String did, String taskId)
Close Remote File Download
Parameter | Description |
---|---|
Dids | The device's dids |
TaskId | Task ID of remote download |
3.Example
xxxxxxxxxx
DevicesManage.getInstance().stopDownload(did, task_id);
xxxxxxxxxx
DevicesManage.getInstance().convertPrv2Mp4(String srcPath, OnMp4ConvertOver listener)
Convert local prv file to mp4 file
Parameter | Description |
---|---|
SrcPath | prv local file path |
listener | Call back the result of converting prv to mp4, and return the mp4 file path after success |
xxxxxxxxxx
DevicesManage.getInstance().convertPrv2Mp4(remoteRecordName, new OnMp4ConvertOver() {
public void onFail() {
}
public void onSuccess(final String s) {
}
public void onProgress(int i) {
}
});
! [WeChat picture editor_20220430104000] (img/WeChat picture editor_20220430104000. jpg)
xxxxxxxxxx
1. Obtain daily video distribution according to monthly video distribution
DevicesManage.getInstance().getRecordInfoByDay(did, channel, channelSize, "all", year, month, day, listener);
2. Create Registration Monitor
<com.echosoft.gcd10000.core.device.custom.Monitor
android:id="@+id/monitor"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_centerInParent="true" />
monitor.setDID(did);
monitor.setMchannel(channel);
DevicesManage.getInstance().regAVListener(did, channel, monitor);
DevicesManage.getInstance().playbackStart(did, channel, channelSize, "all", startTime, endTime, null);
3. Close Remote Playback
DevicesManage.getInstance().playbackClose(did, channel);
! [WeChat screenshot _20220430104100] (img/WeChat screenshot _20220430104100. png)
xxxxxxxxxx
1. Double speed playback setting
DevicesManage.getInstance().playbackSpeed(did, speed, timeStr);
2. After the setting is successful, turn on double speed playback
DevicesManage.getInstance().changePlaybackSpeedSuccess(did, channel, speed);
! [WeChat screenshot _20220430104127] (img/WeChat screenshot _20220430104127. png)
! [WeChat screenshot _20220430104113] (img/WeChat screenshot _20220430104113. png)
liveview video and audio stream interface is as normal,use channel 1 when open/close other channel
audio play limit
xxxxxxxxxx
public void audioPlayLimit(int channel)
1.Functions
close the other channel audio play
2.Parameter
Parameter | Describe |
---|---|
channel | 1 |
xxxxxxxxxx
/**
* dual camera open the other one playback, call after first channel open playback success
* return ConstantsCore.Action.RET_PLAYBACK_INSERT
* "result"
* @param did
* @param channel use 1
* @return
*/
public short playbackInsert(String did, int channel)
/**
* dual camera close the other one playback,call after first channel close playback
* return ConstantsCore.Action.RET_PLAYBACK_REMOVE
* "result"
* @param did
* @param channel use 1
* @return
*/
public short playbackRemove(String did, int channel)
xxxxxxxxxx
/**
* dual camera start record
* @param did
* @param filePath1 the first channel record path, end with".prv"
* @param filePath2 the second channel record path, end with".prv"
* @param voiceEnable
* @param listener prv convert mp4, callback will be called twice
*/
public void startDualRecord(String did, String filePath1, String filePath2, boolean
voiceEnable, OnMp4ConvertOver listener)
/**
* dual camera stop record
*/
public void stopDualRecord()
xxxxxxxxxx
public void obsGetRecordInfoByMonth(String time, String utc, String deviceId, String channel, String type, String stream, ObsRetListener listener)
Obtain the monthly video distribution of equipment cloud storage in a certain month and year
Parameter | Description |
---|---|
time | Query events, such as "2019-10" |
utc | Time zone conversion character, time zone identifier, such as Asia/Shanghai |
deviceId | Device ID |
channel | Channel number, default to 1 |
type | Not used temporarily |
stream | Stream type, default to 0, all 0, more than 1 |
listener | Query 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 |
xxxxxxxxxx
DevicesManage.getInstance().obsGetRecordInfoByMonth(year_month, timezoneID, deviceId, obsChannel, type, stream, new ObsRetListener() {
public void retObsRecordList(List<RecordListVO> list) {
}
public void retObsFile(OBS_FILE obs_file) {
}
public void getInfoByMonth(String s) {
}
});
xxxxxxxxxx
public void obsGetRecordInfoByDay(String startTime, String endTime, String deviceId, String channel, String stream, long userId, ObsNetCallback listener)
Get the daily video distribution of the equipment on a certain day, month, year
Parameter | Description |
---|---|
startTime | Start time, such as "20220101 000000" |
endTime | End time, such as "20220101 240000" |
deviceId | Device ID |
channel | Channel number, default to 1 |
stream | Stream type, default to 0, all 0, more than 1 |
userId | User ID |
listener | Query result callback code: 200 data: {entries [], total: value} (message: exception information) |
Field | Explanation |
---|---|
duration | File duration |
size | File size |
stream | Stream type |
beginTime | Start time |
endtime | End time |
fileUrl | File path |
type | Video 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
xxxxxxxxxx
DevicesManage.getInstance().obsGetRecordInfoByDay(startTime, endTime, deviceId, channel, stream, userId, new ObsNetCallback() {
public void onFail(int i) {
//i = -1
}
public void onSuccess(Response response) {
String result = response.body().string();
}
});
xxxxxxxxxx
public void obsGetIFrameByTime(String deviceId, String channel, String stream, String searchTime, String minScale, String maxScale, long userId, ObsRetListener listener)
Get the latest I frame information of the start time
Parameter | Description |
---|---|
deviceId | Device ID |
channel | Channel number, default to 1 |
stream | Stream type, default to 0, all 0, more than 1 |
searchTime | Query time, such as "20220101 150000" |
minScale | Start time, such as "20220101 000000" |
maxScale | End time, such as "20220101 240000" |
userId | User ID |
listener | Query callback. Querying the monthly video interface will call back the retObsFile() method |
Field | Explanation |
---|---|
OBS_FILE | Whether the callback object is empty. If it is empty, the query fails. Otherwise, the query succeeds |
xxxxxxxxxx
DevicesManage.getInstance().obsGetIFrameByTime(deviceId, channel, "0", startTime, mimTime, maxTime, userId, new ObsRetListener() {
public void retObsRecordList(List<RecordListVO> list) {
}
public void retObsFile(OBS_FILE obs_file) {
if (obs_file == null) {
return;
}
}
public void getInfoByMonth(String s) {
}
});
xxxxxxxxxx
public int obsPlaybackPrepare(String channel, String key)
playback settings
Parameter | Description |
---|---|
channel | Channel number, default to 1 |
key | Numeric characters in the middle of the device dids |
Field | Explanation |
---|---|
return | 0:Setting succeeded |
xxxxxxxxxx
int status = DevicesManage.getInstance().obsPlaybackPrepare(channel, key);
xxxxxxxxxx
public void obsPlaybackStart(String deviceId, String channel, ObsPlayListener listener)
Enable Cloud Playback
Parameter | Description |
---|---|
deviceId | Device ID |
channel | The channel number of the device, starting from 0 |
listener | Start playing the callback onPlay() |
xxxxxxxxxx
DevicesManage.getInstance().obsPlaybackStart(deviceId, channel, new ObsPlayListener() {
public void onPlay() {
}
});
xxxxxxxxxx
public void obsPlaybackStop(String deviceId, String channel)
Close Cloud Playback
Parameter | Description |
---|---|
deviceId | Device ID |
channel | The channel number of the device, starting from 0 |
xxxxxxxxxx
DevicesManage.getInstance().obsPlaybackStop(deviceId, channel);
xxxxxxxxxx
public void obsSeekPrepare()
Cloud Playback Positioning Settings
xxxxxxxxxx
DevicesManage.getInstance().obsSeekPrepare();
xxxxxxxxxx
public void obsSeekPlaybackStart()
Start Positioning Playback
xxxxxxxxxx
DevicesManage.getInstance().obsSeekPlaybackStart();
xxxxxxxxxx
public void obsPlaybackPause(String deviceId, String channel, boolean isPause)
Cloud Playback Paused
Parameter | Description |
---|---|
deviceId | Device ID |
channel | The channel number of the device, starting from 0 |
isPause | true: Pause; False: play |
xxxxxxxxxx
DevicesManage.getInstance().obsPlaybackPause(deviceId, channel, true);
xxxxxxxxxx
public void obsIsAudioPlayEnable(boolean enable)
Cloud playback audio playback control
Parameter | Description |
---|---|
enable | true: Play false: Do not play |
xxxxxxxxxx
DevicesManage.getInstance().obsIsAudioPlayEnable(true);
xxxxxxxxxx
public static Bitmap convertBitmap(byte[] yuv, int width, int heigh) {
Get the screenshot of the current video
Parameter | Description |
---|---|
Yuv | m of the currently playing video monitor_ YuvData property |
Width | m of the currently playing video monitor_ Width property |
heigh | m of the currently playing video monitor_ Height property |
xxxxxxxxxx
Bitmap bitmap = Monitor.convertBitmap(mMonitor.m_yuvDatas, mMonitor.m_width, mMonitor.m_height);
xxxxxxxxxx
public void obsRegAVListener(String deviceId, int channel, IAVListener listener)
public void obsUnRegAVListener(String deviceId, int channel, IAVListener listener)
Provide video stream registration and logout interface, register before stream opening, and logout when stream closing
Parameter | Description |
---|---|
DeviceId | Device ID |
Channel | The channel number of the device, starting from 0 |
Listener | Video stream callback interface |
xxxxxxxxxx
DevicesManage.getInstance(). obsRegAVListener(deviceId, channel, mMonitor);
xxxxxxxxxx
public void obsStartRecord(String filePath, OnMp4ConvertOver listener)
Cloud playback of local video can only be called after successful playback
Parameter | Description |
---|---|
FilePath | Video storage path. The video format is private and the suffix is fixed prv |
Listener | After the video recording is completed, the result of prv converting to mp4 is called back, and the mp4 file path is returned after success |
xxxxxxxxxx
DevicesManage.getInstance().obsStartRecord(filePath, new OnMp4ConvertOver() {
public void onFail() {
}
public void onSuccess(String s) {
}
public void onProgress(int i) {
}
});
xxxxxxxxxx
public void obsStopRecord()
Close cloud playback of local video
xxxxxxxxxx
DevicesManage.getInstance().obsStopRecord();
xxxxxxxxxx
public void obsDownloadFile(String obsFileUrl, String filePath, String key, OnMp4ConvertOver listener)
Download cloud video files according to the cloud video file path
Parameter | Description |
---|---|
obsFileUrl | Cloud storage file path obtained by querying video |
filePath | The local storage path of the file. The file suffix is prv |
key | Numeric characters in the middle of the device dids |
listener | This callback is used for the file download progress callback and the prv to mp4 result callback. If successful, the mp4 file path is returned |
xxxxxxxxxx
DevicesManage.getInstance().obsDownloadFile(record.fileUrl, filePath, key, new OnMp4ConvertOver() {
public void onFail() {
}
public void onSuccess(String s) {
}
public void onProgress(int i) {
}
});
xxxxxxxxxx
public void obsConvertDownload(String filePath)
Convert local prv file to mp4 file
Parameter | Description |
---|---|
FilePath | prv local file path |
xxxxxxxxxx
public void obsConvertDownload(String filePath)
Convert local prv file to mp4 file
Parameter | Description |
---|---|
FilePath | prv local file path |
3.Example
xxxxxxxxxx
DevicesManage.getInstance().obsConvertDownload(filePath);
! [WeChat picture editor_20220430104142. jpg] (img/WeChat picture editor_20220430104142. jpg)
xxxxxxxxxx
1.Video recorded according to the query days
DevicesManage.getInstance().obsGetRecordInfoByDay(startTime, endTime, deviceId, channel, stream, userId, new ObsNetCallback() {
public void onFail(int i) {
//i = -1
}
public void onSuccess(Response response) {
String result = response.body().string();
}
});
2. Get I frame information
DevicesManage.getInstance().obsGetIFrameByTime(deviceId, channel, "0", startTime, mimTime, maxTime, userId, new ObsRetListener() {
public void retObsRecordList(List<RecordListVO> list) {
}
public void retObsFile(OBS_FILE obs_file) {
if (obs_file == null) {
return;
}
}
public void getInfoByMonth(String s) {
}
});
3.Create Registration Monitor
<com.echosoft.gcd10000.core.device.custom.Monitor
android:id="@+id/monitor"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_centerInParent="true" />
monitor.setDID(deviceId);
monitor.setMchannel(channel);
DevicesManage.getInstance().obsRegAVListener(deviceId, Integer.parseInt(channel), monitor);
4. Playback Settings and Open Playback
int status = DevicesManage.getInstance().obsPlaybackPrepare(channel, key);
if (status == 0) {
DevicesManage.getInstance().obsPlaybackStart(deviceId, channel, new ObsPlayListener() {
public void onPlay() {
}
});
}
5. Close playback and log off listening
DevicesManage.getInstance().obsUnregAVListener();
DevicesManage.getInstance().obsPlaybackStop(deviceId, channel);
! [WeChat screenshot _20220430104158. png] (img/WeChat screenshot _20220430104158. png)
xxxxxxxxxx
1. Get I frame information
DevicesManage.getInstance().obsGetIFrameByTime(deviceId, channel, "0", startTime, mimTime, maxTime, userId, new ObsRetListener() {
public void retObsRecordList(List<RecordListVO> list) {
}
public void retObsFile(OBS_FILE obs_file) {
if (obs_file == null) {
return;
}
}
public void getInfoByMonth(String s) {
}
});
2. Playback Positioning Settings
DevicesManage.getInstance().obsSeekPrepare();
3. Playback settings and start positioning
int status = DevicesManage.getInstance().obsPlaybackPrepare(channel, key);
if (status == 0) {
DevicesManage.getInstance().obsSeekPlaybackStart();
}
! [WeChat screenshot _20220430105138. png] (img/WeChat screenshot _20220430105138. png)
xxxxxxxxxx
1. Video recorded according to the query days
DevicesManage.getInstance().obsGetRecordInfoByDay(startTime, endTime, deviceId, channel, stream, userId, new ObsNetCallback() {
public void onFail(int i) {
//i = -1
}
public void onSuccess(Response response) {
String result = response.body().string();
}
});
2. Cloud video download and file conversion
private boolean isDownloading = true;
DevicesManage.getInstance().obsDownloadFile(record.fileUrl, filePath, key, new OnMp4ConvertOver() {
public void onFail() {
}
public void onSuccess(String s) {
}
public void onProgress(int i) {
if(isDownloading) {
if(100 == i) {
//Download complete
isDownloading = false;
runOnUiThread(new Runnable() {
public void run() {
DevicesManage.getInstance().obsConvertDownload(filePath);
}
});
}
}
}
});
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.
xxxxxxxxxx
public short cmd902(final String did, final String http, final String tag);
public short cmd902(String did, String http, byte[] data)
1.Function
send HTTP command to get or put device configuration
2.Param
Param | describe |
---|---|
did | device did |
http | cgi command |
tag | deprecated |
return | describe |
---|---|
action | ConstantsCore.Action.GET_SET_CONFIG_BY_HTTP |
deviceId | device did |
http | return http format data |
4.示例
xxxxxxxxxx
DevicesManage.getInstance().cmd902(did, "GET /System/DeviceCap", "");
xxxxxxxxxx
GET /System/DeviceCap
Function Description
Get device capability of single channel equipment, such as IPC device
xxxxxxxxxx
GET /System/DeviceCap
Acquire the device capability of multi-channel devices, such as NVR and HVR devices
xxxxxxxxxx
GET /System/DeviceCap/ChannelID
Describe the context (dependent interfaces or with which interfaces)
Param
Param | Description |
---|---|
did | Device did |
Return
xxxxxxxxxx
<Device>
<StreamCount>0</StreamCount>
<AlarmOutCount>0</AlarmOutCount>
<AlarmInCount>0</AlarmInCount> /**!Enter the number of alarms**/
<SubHistoryStreamSupport><!--xs:boolean--></SubHistoryStreamSupport> /**!Whether remote playback substreams are supported**/
<FunctionList> /**!Channel-independent functionality**/
<BasicAuthCryptoV1><!--xs:boolean--></BasicAuthCryptoV1>/**!Authentication encryption algorithm**/
<SD><!--xs:boolean--></SD>/**! SD card, disk, remote playback function**/
<WIFI><!--xs:boolean--></WIFI> /**! WIFI function**/
<Motor><!—xs:boolean--></Motor> /**! Whether motors are supported**/
<SerialTransparent><!--xs:boolean--></SerialTransparent>/**!Whether to support serial port transmission**/
<WiredAlarm><!--xs:boolean--></WiredAlarm> /**!Whether wired alarms are supported**/
<WiredNetwork><!--xs:boolean--></WiredNetwork>/**!Whether wired networks are supported**/
<DisableIrLed><!--xs:boolean--></DisableIrLed> /**!Whether to force infrared shutdown is supported**/
<ShakingHead><!--xs:boolean--></ShakingHead> /**!Whether it is a bobblehead machine**/
<TwoWayAudio><!--xs:boolean--></TwoWayAudio> /**!Intercom function**/
<AP><!--xs:boolean--></AP> /**!Whether AP mode is supported**/
<Wavelink><!--xs:boolean--></Wavelink>
<Smartlink><!--xs:boolean--></Smartlink>
<Email><!--xs:boolean--></Email> /**! Email function**/
<FTP><!--xs:boolean--></FTP> /**! FTP function**/
<RemoteReboot><!--xs:boolean--></RemoteReboot> /**!Remote restart**/
<Restore><!--xs:boolean--></Restore> /**!Factory reset**/
<PasswordModify><!--xs:boolean--></PasswordModify> /**!Password modification**/
<AutoIP><!--xs:boolean--></AutoIP> /**!Adaptive IP**/
<AudioAlarm><!--xs:boolean--></AudioAlarm> /**!Audible alarm**/
<AudioAlarmAudioFormat> /**!Audible alarm supported audio formats for recording**/
<G711u><!--xs:boolean--></G711u>
<AMR><!--xs:boolean--></AMR>
</AudioAlarmAudioFormat>
<AudioAlarmType> /**!Types of audible alarm support**/
<Custom><!--xs:boolean--></Custom>
<Alarm><!--xs:boolean--></Alarm>
<dog><!--xs:boolean--></dog>
<warning><!--xs:boolean--></warning>
<monitoring><!--xs:boolean--></monitoring>
<welcome><!--xs:boolean--></welcome>
<DeepWater><!--xs:boolean--></DeepWater>
<PrivateTerritory><!--xs:boolean--></PrivateTerritory>
<DangerZone><!--xs:boolean--></DangerZone>
<ValuableObjects><!--xs:boolean--></ValuableObjects>
<HighWarning><!--xs:boolean--></HighWarning>
<PrivateParking><!--xs:boolean--></PrivateParking>
<HasFaceMask><!--xs:boolean--></HasFaceMask>
<NoFaceMask><!--xs:boolean--></NoFaceMask> //Pay attention to your belongings
<MindPersonalBelongings><!--xs:boolean--></MindPersonalBelongings> //Catch the thief
<CatchThief><!--xs:boolean--></CatchThief> //Help me
<Help><!--xs:boolean--></Help> //Garbage sorting
<Classification><!--xs:boolean--></Classification> //Recyclable garbage
<RecyclableWaste><!--xs:boolean--></RecyclableWaste> //Food waste
<HouseholdFoodWaste><!--xs:boolean--></HouseholdFoodWaste> //Hazardous waste
<HazardousWaste><!--xs:boolean--></HazardousWaste> //Other garbage
<ResidualWaste><!--xs:boolean--></ResidualWaste> //Garbage sorting circular broadcast
<ClassificationAll><!--xs:boolean--></ClassificationAll>
</AudioAlarmType>
<CarAudioAlarmType> /**!Types of vehicle sound alarm support**/
<Custom><!--xs:boolean--></Custom>
<Alarm><!--xs:boolean--></Alarm>
<dog><!--xs:boolean--> </dog>
<warning><!--xs:boolean--></warning>
<monitoring><!--xs:boolean--></monitoring>
<welcome><!--xs:boolean--></welcome>
<DeepWater><!--xs:boolean--></DeepWater>
<PrivateTerritory><!--xs:boolean--></PrivateTerritory>
<DangerZone><!--xs:boolean--></DangerZone>
<ValuableObjects><!--xs:boolean--></ValuableObjects>
<HighWarning><!--xs:boolean--></HighWarning>
<PrivateParking><!--xs:boolean--></PrivateParking>
<HasFaceMask><!--xs:boolean--></HasFaceMask>
<NoFaceMask><!--xs:boolean--></NoFaceMask>
<NoParking><!--xs:boolean--></NoParking> //no parking
</CarAudioAlarmType>
<TimeSnapshot><!--xs:boolean--></TimeSnapshot>/**!Timed capture**/
<Snapshot><!--xs:boolean--></Snapshot> /**!Capture configuration**/
<cloud_upgrade><!--xs:boolean--></cloud_upgrade>/**!Cloud upgrades**/
<ParamFixed>!—xs:Boolean--></ParamFixed>/**!Parameter curing**/
<P2PUpgrade><!—xs:boolean--></P2PUpgrade>/**! P2P upgrades**/
<UPNP><!—xs:boolean--></UPNP> /**!UPNP**/
<Buzzer><!—xs:boolean--></Buzzer> /**!buzzer**/
<FaceBaseDetectorShareNum><!--xs:interger--></FaceBaseDetectorShareNum> /*Number of face detectors, shared by all channels*/
<BehaviorAnalyzerNum><!--xs:interger--></BehaviorAnalyzerNum> /*Number of behavior detectors, shared by all channels*/
<PhotosensitiveDetect>
<ADC><!—xs:boolean--></ADC>
<GPIO><!—xs:boolean--></GPIO>
</PhotosensitiveDetect>
<CustomSubTypeName><!--xs:boolean--></ CustomSubTypeName >/*Custom information fields*/
<CloudStorage> /*Domestic cloud storage*/
<Support><!--xs:boolean--></Support>
</CloudStorage>
<INTCloudStorage> /*International cloud storage*/
<Support><!--xs:boolean--></Support>
</INTCloudStorage>
<AdvancedPeopleTrack><!--xs:boolean--></AdvancedPeopleTrack>
<FaceSnapshot><!--xs:boolean--></FaceSnapshot>
<FaceFunction>
<FaceSnapshot><!--xs:boolean--></FaceSnapshot>
<FaceReco><!--xs:boolean--></FaceReco>
</FaceFunction>
<CenterServer> /*Central server capabilities*/
<Support><!--xs:boolean--></Support>
<P6SProtocol><!--xs:boolean--></P6SProtocol > //Protocol type 0:P6S
</CenterServer>
<DeviceShareAndSelfUnbind>!--xs:boolean--></DeviceShareAndSelfUnbind>
<VoiceCustom><!--xs:boolean--></VoiceCustom>
<SystemLanguage>
<Language key=”Chinese”>中文</Language>
<Language key=”English”>英语</Language>
</SystemLanguage>
<Security>
<IPWhiteList><!--xs:boolean--></IPWhiteList> /*IP Whitelist function*/
</Security>
<FiberHome><!--xs:boolean--></FiberHome> //FH Custom version identification
<DeviceAutoRegisterV1><!--xs:boolean--></DeviceAutoRegisterV1>
<MQTT><!--xs:boolean--></MQTT>
<AlarmOut>
<OutMode><!--xs:boolean--></OutMode>
</AlarmOut>
<_4G><!--xs:boolean--></_4G>
<AIWorkMode>
<PeopleMode><!--xs:boolean--></PeopleMode> //Humanoid mode
<FaceMode><!--xs:boolean--></FaceMode> //Face mode
</AIWorkMode>
<Alarm>
<OneClickAlarmTrigger><!--xs:boolean--></OneClickAlarmTrigger> //One-key sound and light alarm, the device is //prompted by sound and light alarm when manually triggered
<LightAlarm> //Light alarm
<Support><!--xs:boolean--></Support> //Supported or not
</LightAlarm>
</Alarm> //Smart overlay
<AIOverlay>
<AllStreamUnity><!--xs:boolean--></AllStreamUnity> //Channel multi-stream synchronous overlay (superimpose all //code streams when turned on, superimpose code stream overlay when turned off)
<Human><!--xs:boolean--></Human> //Overlay the personoid box
<Face><!--xs:boolean--></Face> //Overlay face frames
<DetectArea><!--xs:boolean--></DetectArea> //Overlay arming frames
<PolygonRegion><!--xs:boolean--></PolygonRegion> //Overlay polygon arming areas
<TraverseLine><!--xs:boolean--></TraverseLine> //Overlay tripwires
<Car><!--xs:boolean--></Car> //Overlay the car-shaped frame
</AIOverlay>
<HTTPPush><!--xs:boolean--></HTTPPush> //Push function based on HTTP protocol
<DetectRegion> //Area arming
<TraverseLine> //Tripwires armed
<Support><!--xs:boolean--></Support> //Supported or not
<Direction> //Tripwire direction
<AB><!--xs:boolean--></AB> //Supported or not A->B
<BA><!--xs:boolean--></BA> //Supported or not B->A
<A-B><!--xs:boolean--></A-B> //Supported or not A-B
</Direction>
</TraverseLine>
<PolygonRegion> //Polygon area arming
<Support><!--xs:boolean--></Support> //Supported or not
<MaxLine><!--xs:interger--></MaxLine> //The maximum number of edges supported
</PolygonRegion>
</DetectRegion>
<AppUI> //APP Interface options
<EmailV2><!--xs:boolean--></EmailV2> //Displays the simplified version V2 mail configuration
<AdvancedPeopleTrack><!--xs:boolean--></AdvancedPeopleTrack> //Displays the humanoid tracking function
<FlipSwitch><!--xs:boolean--></FlipSwitch> //Displays the flip function
<StorageCapacity><!--xs:boolean--></StorageCapacity> //Displays memory card capacity information
<Encoder> //Encoding parameters
<FrameRate><!--xs:boolean--></FrameRate> //Displays the frame rate configuration
<BitRate><!--xs:boolean--></BitRate> //Displays the bitrate configuration
</Encoder>
<AIOTConfigV1><!--xs:boolean--></AIOTConfigV1> //AIOT Configuration Interface V1 version
</AppUI>
<WebUI> //WEB CLIENT INTERFACE OPTIONS
<Network> //Network configuration
<PPPOE><!--xs:boolean--></PPPOE> //Whether PPPOE configuration is supported
<DDNS><!--xs:boolean--></DDNS> //Whether DDNS configuration is supported
<UPNP><!--xs:boolean--></UPNP> //Whether UPNP configuration is supported
</Network>
</WebUI> //Smart capture
<AISnapshot>
<SnapSensitivity> //Capture sensitivity
<Support><!--xs:boolean--></Support> //Whether sensitivity configuration is supported
<LevelMin><!--xs:interger--></LevelMin> //Minimum sensitivity
<LevelMax><!--xs:interger--></LevelMax>//Maximum sensitivity
</SnapSensitivity>
</AISnapshot>
<LogoUploadV1> //Upload the logo
<Support><!--xs:boolean--></Support> //Supported or not
<StartupLogo> //Boot logo
<Support><!--xs:boolean--></Support> //Supported or not
<MaxWidth><!--xs:interger--></MaxWidth> //Maximum picture width
<MaxHeight><!--xs:interger--></MaxHeight> //Maximum image height
<MinWidth><!--xs:interger--></MinWidth> //Minimum image width
<MinHeight><!--xs:interger--></MinHeight> //Minimum image width
<MaxSize><!--xs:interger--></MaxSize> //Maximum image file size(KB)
<ImageFormat> //Picture file format
<JPEG><!--xs:boolean--></JPEG>
<PNG><!--xs:boolean--></PNG>
<BMP><!--xs:boolean--></BMP>
<LZMA_YUV420><!--xs:boolean--></LZMA_YUV420>
</ImageFormat>
<BitDepth><!--xs:string--></BitDepth> //Image bit depth, examples 8, 16, 24, 32
</StartupLogo>
<ChannelLogo> //Channel background logo
<Support><!--xs:boolean--></Support> //Supported or not
<MaxWidth><!--xs:interger--></MaxWidth> //Maximum picture width
<MaxHeight><!--xs:interger--></MaxHeight> //Maximum image height
<MaxSize><!--xs:interger--></MaxSize> //Maximum image file size(KB)
<ImageFormat> //Picture file format
<JPEG><!--xs:boolean--></JPEG>
<PNG><!--xs:boolean--></PNG>
<BMP><!--xs:boolean--></BMP>
</ImageFormat> //Image bit depth, examples 8, 16, 24, 32
<BitDepth><!--xs:string--></BitDepth>
</ChannelLogo>
<MenuLogo> //Menu logo
<Support><!--xs:boolean--></Support>
<MaxWidth><!--xs:interger--></MaxWidth> //Maximum picture width
<MaxHeight><!--xs:interger--></MaxHeight> //Maximum image height
<MaxSize><!--xs:interger--></MaxSize> //Maximum image file size(KB)
<ImageFormat> //Picture file format
<JPEG><!--xs:boolean--></JPEG>
<PNG><!--xs:boolean--></PNG>
<BMP><!--xs:boolean--></BMP>
</ImageFormat> //Image bit depth, examples 8, 16, 24, 32
<BitDepth><!--xs:string--></BitDepth>
</MenuLogo>
<Screensavers> //Screen saver image
<Support><!--xs:boolean--></Support> //Supported or not
<MaxWidth><!--xs:interger--></MaxWidth>//Maximum picture width
<MaxHeight><!--xs:interger--></MaxHeight> //Maximum image height
<MaxSize><!--xs:interger--></MaxSize> //Maximum image file size(KB)
<ImageFormat> //Picture file format
<JPEG><!--xs:boolean--></JPEG>
<PNG><!--xs:boolean--></PNG>
<BMP><!--xs:boolean--></BMP>
</ImageFormat> //Image bit depth, examples 8, 16, 24, 32
<BitDepth><!--xs:string--></BitDepth>
</Screensavers>
</LogoUploadV1>
<Decode> //Decoding capability
<Support><!--xs:boolean--></Support>
<Main> //Master code stream
<MaxResolution> //Maximum resolution
<Width><!--xs:interger--></Width> //Resolution width
<Height><!--xs:interger--></Height> //Resolution height
</MaxResolution>
<MaxFrameRate><!--xs:interger--></MaxFrameRate> //Maximum frame rate
</Main>
<Sub> //Substream
<MaxResolution> //Maximum resolution
<Width><!--xs:interger--></Width> //Resolution width
<Height><!--xs:interger--></Height> //Resolution height
</MaxResolution>
<MaxFrameRate><!--xs:interger--></MaxFrameRate> //Maximum frame rate
</Sub>
</Decode>
<PushFaceEventMode> //Face event push mode
<V2><!--xs:boolean--></V2> //The old version defaults to V1 mode, that is, face capture and face recognition events are pushed in separate event //V2 mode: face capture events are no longer pushed separately during face recognition, and the client needs to reuse capture events in face recognition
<BackgroundImage> //Push the background image
<Support>!--xs:boolean--></Support> //Supported or not
</BackgroundImage>
</PushFaceEventMode> //Privacy policy configuration
<PrivacyConfig>
<Support><!--xs:boolean--></Support> //Supported or not
</PrivacyConfig>
<LightCapability> //Light board capability interface, the new version of the light board capability interface, see the light board capability chapter
<Support><!--xs:boolean--></Support> //Supported or not
</LightCapability>
<Push>//Push function
<TraverseLine> //Tripwire function
<Support><!--xs:boolean--></Support>
</TraverseLine>
</Push>
<ImageProfile> //Image parameters
<WhiteBalance> //White balance
<Mode> //mode
<Auto1> //Auto white balance 1
<Support><!--xs:boolean--></Support> //Supported or not
</Auto1>
<Auto2> //Auto white balance 2
<Support><!--xs:boolean--></Support> //Supported or not
</Auto2>
</Mode>
</WhiteBalance>
</ImageProfile>
<Protocol> //Protocol capability
<P6STransHTTP> //Support P6S protocol transparent transmission HTTP function
<Support><!--xs:boolean--></Support> //Supported or not
</P6STransHTTP>
<Meglink> //The Meglink protocol is supported
<Support><!--xs:boolean--></Support> //Supported or not
</Meglink>
<ThirdParty> //Support for third-party protocols
<Support><!--xs:boolean--></Support> //Supported or not
</ThirdParty>
<GB28181> // The GB.28181 protocol is supported
<Support><!--xs:boolean--></Support> //Supported or not
</GB28181>
</Protocol>
<SerialPTZ> //Extended head control
<Support><!--xs:boolean--></Support> //Supported or not
</SerialPTZ>
<WIFIFunction> //WIFI function
<IncreasedPower> //WIFI power enhancement
<Support><!--xs:boolean--></Support> //Supported or not
</IncreasedPower>
</WIFIFunction>
<CloudUpgrade> //Cloud Upgrade
<FromNVR><!--xs:boolean--></FromNVR> //Supported or notUpgrade via NVR cloud
</CloudUpgrade>
<ActiveFunction> //mobilizing function
<Support><!--xs:boolean--></Support> //Supported or not
</ActiveFunction>
<RecordPlanV2> //Recording plan V2 configuration function
<Support><!--xs:boolean--></Support> //Supported or not
</RecordPlanV2> //playback speed control
<PlaybackSpeed>
<Support><!--xs:boolean--></Support> //Supported or not
<Max><!--xs:interger--></Max> //Double speed sequence: 1x, 2x, 4x, 8x, 16x, fast play and slow play keep the same speed //Maximum speed
</PlaybackSpeed>
<AlarmOutPlan> //Alarm Output Schedule Configuration
<Support><!--xs:boolean--></Support> //Supported or not
</AlarmOutPlan>
<LPR> //license plate recognition
<Support><!--xs:boolean--></Support> //Supported or not
</LPR>
<NFC> //NFC card swiping capability
<Support><!--xs:boolean--></Support> //Supported or not
</NFC>
<AudioAlarmPara> //Audible Alarm Parameters
<Plan> //arming plan
<Support><!--xs:boolean--></Support> //Supported or not
</Plan>
</AudioAlarmPara>
<Binocular> //binocular imaging
<Support><!--xs:boolean--></Support> //Supported or not
</Binocular>
<AuthV2> //Device Authorization V2
<Support><!--xs:boolean--></Support> //Supported or not
<ModifyDID><!--xs:boolean--></ModifyDID> //Support modification of DID number (only when V2 is supported and modification is supported, modification operation is allowed)
<UserAllocation><!--xs:boolean--></UserAllocation> //End users manually apply for a DID number
</AuthV2>
<AEC> //echo cancellation
<Support><!--xs:boolean--></Support> //Supported or not
</AEC>
<CarDetect> //Vehicle Shape Detection Capability
<Support><!--xs:boolean--></Support> //Supported or not
</CarDetect>
<RejectEmptyPassword> //Deny empty password capability
<Support><!--xs:boolean--></Support> //Supported or not
<Complex><!--xs:boolean--></Complex> //complex password
</RejectEmptyPassword>
<PowerLineFrequencyStrength>
<Support><!--xs:boolean--></Support> //Supported or not anti-flash intensity configuration
</PowerLineFrequencyStrength>
<Defrog>
<Support><!--xs:boolean--></Support> //Supported or not defogging configuration
<Level><!--xs:interger--></Level> //The number of levels (0 means that any value from 0 to 100 is allowed to be set, otherwise the level needs to be mapped)
</Defrog>
<PrivacyZone>
<Support><!--xs:boolean--></Support> //Supported or notPrivacy Mask
</PrivacyZone>
<VoiceTalk>
<Support><!--xs:boolean--></Support> //Supported or not voice intercom
<G711a><!--xs:boolean--></G711a> //Voice intercom coding format
<G711u><!--xs:boolean--></G711u>
<PCM><!--xs:boolean--></PCM>
</VoiceTalk>
</FunctionList>
<FunctionListSdCard>
<fast_playback><!—xs:boolean--></fast_playback>/**!fast playback**/
</FunctionListSdCard>
<FunctionListAboutChannel> /**!Channel-related functions**/
<ChannelList>
<Channel ChannelID="0">
<RTMP><!--xs:boolean--></RTMP> /**! RTMP function**/
<Audio><!--xs:boolean--></Audio> /**!audio**/
<AudioCodec>
<G711u><!--xs:boolean--></G711u>
<G711a><!--xs:boolean--></G711a>
</AudioCodec> /**!audio**/
<Motion><!--xs:boolean--></Motion> /**!Motion Detection**/
<ColorNight><!--xs:Boolean:”true”, ”false”--></ColorNight>/**!Full color night vision**/
<WarmLight><!--xs:Boolean:”true”, ”false”--></WarmLight>
<NormalWhite><!--xs:Boolean:”true”, ”false”--></NormalWhite>
<NormalInfrared><!--xs:boolean--></NormalInfrared>
<AutoFocus><!--xs:boolean--></AutoFocus> /**!auto focus lens**/
<ColorNightDetail><!--xs:boolean--></ColorNightDetail> /**!Full color night vision details**/
<IntelligentNight><!--xs:boolean--></IntelligentNight> /**!smart night vision**/
<IntelligentNightDetail><!--xs:boolean--></IntelligentNightDetail> /**!Smart Night Vision Details**/
<LocalRecordFormat> /**!video format**/
<PRV><!--xs:boolean--></PRV>
<AVI><!--xs:boolean--></AVI>
</LocalRecordFormat>
<MotionSenstive>
<Highest><!--xs:boolean--></Highest>
<Higher><!--xs:boolean--></Higher>
<High><!--xs:boolean--></High>
<Middle><!--xs:boolean--></Middle>
<Low><!--xs:boolean--></Low>
<Lower><!--xs:boolean--></Lower>
<Lowest><!--xs:boolean--></Lowest>
</MotionSenstive>
<multi_osd>true</multi_osd> //Supported or not multi-line OSD
<OverlayCodecParam> //Supported or not overlay encoding parameters
<Support><!--xs:boolean--></Support>
</OverlayCodecParam>
<mosd_cnt>16</mosd_cnt> //Number of supported OSDs
<mosd_char_cnt_every_osd>16</mosd_char_cnt_every_osd> //The total number of characters supported by each OSD
<mosd_line_every_osd>16</mosd_line_every_osd> //Number of rows supported per OSD
<mosd_cord>16</mosd_cord>
<mosd_char_count_every_line>16</mosd_char_count_every_line>//The maximum number of characters supported per line
<osd>
<osd_zoom>true</osd_zoom>
</osd>
<IrCutMode>
<VariableInfrared> //Promise Infrared
<Enable> <!--xs:boolean--></Enable> //Whether to enable Promise Infrared
<WorkMode><!--xs:boolean--></WorkMode> //Promise infrared working mode
<Brightness><!--xs:boolean--></Brightness> //Promise Infrared Brightness
</VariableInfrared>
<VariableWhite><!--xs:boolean--></VariableWhite> //Promise white light
<VarWriteControlMode><!--xs:boolean--></VarWriteControlMode> //Promise white light working mode
</IrCutMode>
<ImageMode enable=”true”>
<Normal>true</Normal>
<FaceNoExposure>true</FaceNoExposure>
<LicensePlate>true</LicensePlate>
</ImageMode>
<PTZ_Advance_Cruise><!--xs:boolean--></PTZ_Advance_Cruise> /**! Advanced cruise function**/
<PTZ_Advance_Watch><!--xs:boolean--></PTZ_Advance_Watch> /**! Advanced Overwatch featuresn**/
<PTZ_Advance_Track><!--xs:boolean--></PTZ_Advance_Track>/**!
Advanced trace function**/
<SmartEvent>
<PeopleDetect><!--xs:boolean--></PeopleDetect>
<Ai265Plus><!--xs:boolean--></Ai265Plus> /**!Smart rate control**/
<AiFace><!--xs:boolean--></AiFace>/**!Smart Face Exposure**/
<PeopleTrack><!--xs:boolean--></PeopleTrack>/**!Human Tracking**/
<FaceSnap><!--xs:boolean--></FaceSnap>/**!face capture**/
<FaceReco><!--xs:boolean--></FaceReco>/**!face comparison**/
<FaceBase><!--xs:boolean--></FaceBase> /**!Basic version face detection**/
<FaceBaseDetector>private/share</FaceBaseDetector> /**!private indicates that the channel has its own face detection function and does not share resources with other channels, share indicates that FaceBaseDetectorNum is shared with other channels **/
<BehaviorAnalysis><!--xs:boolean--></BehaviorAnalysis> /**!Whether to support behavior detection**/
<BehaviorAnalyzer>private/share</BehaviorAnalyzer>/**!private indicates that the channel has its own behavior analysis function and does not share resources with other channels, and share indicates that it shares BehaviorAnalyzer with other channels **/
<PIR><!--xs:boolean--></PIR>/**! PIR**/
<TalkingForward><!--xs:boolean--></TalkingForward>/**! The channel supports intercom forwarding**/
</SmartEvent>
<FaceSnapFilterRegion>
<MaxDetectFaceRegionSize>
<Support><!--xs:boolean--></Support>
<Width><!--xs:interger,0~10000--></Width>
<Height><!--xs:interger,0~10000--></Height>
</MaxDetectFaceRegionSize>
<MinDetectFaceRegionSize>
<Support><!--xs:boolean--></Support>
<Width><!--xs:interger,0~10000--></Width>
<Height><!--xs:interger,0~10000--></Height>
</MinDetectFaceRegionSize>
</FaceSnapFilterRegion>
<AudioAlarm><!--xs:boolean--></AudioAlarm> /**! Sound alarm**/
<AudioAlarmAudioFormat> /**! Recording audio format supported by sound alarm**/
<G711u><!--xs:boolean--></G711u>
<AMR><!--xs:boolean--></AMR>
</AudioAlarmAudioFormat>
<AudioAlarmType> /**! Sound alarm support type**/
<Custom><!--xs:boolean--></Custom>
<Alarm><!--xs:boolean--></Alarm>
<dog><!--xs:boolean--></dog>
<warning><!--xs:boolean--></warning>
<monitoring><!--xs:boolean--></monitoring>
<welcome><!--xs:boolean--></welcome>
<DeepWater><!--xs:boolean--></DeepWater>
<PrivateTerritory><!--xs:boolean--></PrivateTerritory>
<DangerZone><!--xs:boolean--></DangerZone>
<ValuableObjects><!--xs:boolean--></ValuableObjects>
<HighWarning><!--xs:boolean--></HighWarning>
<PrivateParking><!--xs:boolean--></PrivateParking>
<HasFaceMask><!--xs:boolean--></HasFaceMask>
<NoFaceMask><!--xs:boolean--></NoFaceMask>
</AudioAlarmType>
<AlarmOutCount>0</AlarmOutCount>/**! Number of alarm outputs**/
<AlarmInCount>0</AlarmInCount> /**! Number of alarm outputs**/
<LightFilling><!--xs:boolean--></LightFilling>
<FaceBrightness><!--xs:boolean--></FaceBrightness>
<MaskDetect>
<Support><!--xs:boolean--></Support>
</MaskDetect>
<LinkageAlarmSource>
<FaceMask><!--xs:boolean--></FaceMask>
</LinkageAlarmSource>
<FaceTemperatureDetect><!--xs:boolean--></FaceTemperatureDetect>
<WDR>//wide dynamic range
<Support><!--xs:boolean--></Support> //Supported or not
<Close><!--xs:boolean--></Close> //support closed
<Level>
<Min><!--xs:interger--></Min>
<Max><!--xs:interger--></Max>
</Level>
</WDR>
<HumanSensitivity> //Humanoid Detection Sensitivity
<Support><!--xs:boolean--></Support> //Supported or not sensitivity configuration
<LevelMin><!--xs:interger--> </LevelMin> //Minimum sensitivity
<LevelMax><!--xs:interger--></LevelMax> //Maximum sensitivity
</HumanSensitivity>
<MotionSensitivityV1> //Motion Detection Sensitivity
<Support><!--xs:boolean--></Support> //Supported or not sensitivity configuration
<LevelMin><!--xs:interger--></LevelMin> //Minimum sensitivity
<LevelMax><!--xs:interger--></LevelMax> //Maximum sensitivity
</MotionSensitivityV1>
<MotionLinkageFunction> //Motion detection linkage function item
<Audio><!--xs:boolean--></Audio> //Linkage sound alarm
<AlarmOut><!--xs:boolean--></AlarmOut> //Linkage alarm output
<Push><!--xs:boolean--></Push> //Linkage push
<FTP><!--xs:boolean--></FTP> //Linkage FTP
<Email><!--xs:boolean--></Email> //Linkage Email
<Light><!--xs:boolean--></Light> //Linkage light alarm
</MotionLinkageFunction>
</Channel>
</ChannelList>
</FunctionListAboutChannel>
<XVRChnResource>/**!Functions exclusive to HVR/NVR multi-channel devices**/
<AChNum><!--xs:interger,1~32--></AChNum> /**!Number of analog channels**/
<DChNum><!--xs:interger,1~36--></DChNum> /*!Number of IP (digital) channels*/
<DChStart><!--xs:interger,0~36--></DChStart>/**! IP channel start channel**/
</XVRChnResource>
</Device>
Simple sample codeSimple sample code
xxxxxxxxxx
DevicesManage.getInstance().cmd902(did, cmd, "");
xxxxxxxxxx
<AlarmOverlayInfo>
<MainStreamOverlay>true, false</MainStreamOverlay>
<SubStreamOverlay>true, false</SubStreamOverlay>
<MainStreamPeopleOverlay>true, false</MainStreamPeopleOverlay>
<MainStreamFaceOverlay>true, false</MainStreamFaceOverlay>
<MainStreamAreaOverlay>true, false</MainStreamAreaOverlay>
<MainStreamAssisstantLineOverlay>true, false</MainStreamAssisstantLineOverlay>
<SubStreamPeopleOverlay>true, false</SubStreamPeopleOverlay>
<SubStreamFaceOverlay>true, false</SubStreamFaceOverlay>
<SubStreamAreaOverlay>true, false</SubStreamAreaOverlay>
<SubStreamAssisstantLineOverlay>true, false</SubStreamAssisstantLineOverlay >
<MainStreamCarOverlay>true, false</MainStreamCarOverlay>
<MainStreamCarOverlay>true, false</MainStreamCarOverlay>
<MainStreamPFStatisticsOverlay>true, false</MainStreamPFStatisticsOverlay>
<SubStreamPFStatisticsOverlay>true, false</SubStreamPFStatisticsOverlay>
<MainStreamFireOverlay>true, false</MainStreamFireOverlay>
<SubStreamFireOverlay>true, false</SubStreamFireOverlay>
</AlarmOverlayInfo>
xxxxxxxxxx
GET /System/AICap
Function description
Obtain the device capability of a single-channel device, such as: IPC device
xxxxxxxxxx
GET /System/AICap
Obtain the device capabilities of multi-channel devices, such as: NVR, HVR devices
xxxxxxxxxx
GET /System/AICap/ChannelID
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
xxxxxxxxxx
<Channel ChannelID="1.0">
<SmartDetect>
<PassengerFlowStatisticsQuery>true</PassengerFlowStatisticsQuery> //Passenger flow statistics query ability
<PassengerFlowStatisticsOverlay>true</PassengerFlowStatisticsOverlay> //Passenger flow statistics superposition ability
<ElectronicFence> //electric fence
<support>true</support> //Supported or not
<MutuallyExclusive> "TraversePlane,OffDutyDetect,PassengerFlowStatics,ObjectTrack"</MutuallyExclusive> //mutex list
<DetectTarget>
<human>true</human>
<car>true</car>
</DetectTarget>
<OverlayArea>0</OverlayArea> //Overlay arming frame, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
<OverlayObject>0</OverlayObject> //Overlay target box, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
</ElectronicFence>
<TraversePlane> //Out of bounds detection
<support>true</support> //Supported or not
<MutuallyExclusive>"ElectronicFence,OffDutyDetect,PassengerFlowStatics,ObjectTrack"</MutuallyExclusive> //mutex list
<DetectTarget>
<human>true</human>
<car>true</car>
</DetectTarget>
<OverlayArea>0</OverlayArea> //Overlay arming frame, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
<OverlayObject>0</OverlayObject> //Overlay target box, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
</TraversePlane>
<OffDutyDetect> //Off-duty detection
<support>true</support> //Supported or not
<MutuallyExclusive>"ElectronicFence,TraversePlane,PassengerFlowStatics,ObjectTrack"</MutuallyExclusive> //mutex list
<OverlayArea>0</OverlayArea> //Overlay arming frame, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
<OverlayObject>0</OverlayObject> //Overlay target box, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
</OffDutyDetect>
<PassengerFlowStatics> //Passenger Statistics
<support>true</support> //Supported or not
<PushClient>true</PushClient> //Event push client (private protocol)
<MutuallyExclusive>"ElectronicFence,TraversePlane,OffDutyDetect,ObjectTrack"</MutuallyExclusive> //mutex list
<OverlayArea>0</OverlayArea> //Overlay arming frame, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
<OverlayObject>0</OverlayObject> //Overlay target box, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
<OverlayStatics>0</OverlayStatics> //Overlay statistical results, true means not supported, 1 means main sub stream, 2 means main stream, 3 means sub stream
</PassengerFlowStatics>
<ObjectTrack> //Smart Target Tracking
<support>true</support> //Supported or not
<MutuallyExclusive>"ElectronicFence,OffDutyDetect,PassengerFlowStatics,TraversePlane"</MutuallyExclusive> //mutex list
<DetectTarget>
<human>true</human>
<car>true</car>
</DetectTarget>
<OverlayArea>0</OverlayArea> //Overlay arming frame, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
<OverlayObject>0</OverlayObject> //Overlay target box, true means not supported, 1 means main stream, 2 means main stream, 3 means sub stream
</ObjectTrack>
<CryDetect> //cry detection
<support>true</support> //Supported or not
</CryDetect>
</SmartDetect>
<AudioAlarm>
<AudioAlarm>true</AudioAlarm>
<AudioAlarmAudioFormat>
<G711u>true</G711u>
<AMR>true</AMR>
</AudioAlarmAudioFormat>
<AudioAlarmPara>
<Plan>
<Support>true</Support>
</Plan>
</AudioAlarmPara>
<AudioAlarmType>
<ForHuman> //Humanoid Sound Alarm Supported Types
<support>true</support>
<AudioType>
<Custom>true</Custom>
<Alarm>true</Alarm>
<dog>true</dog>
<warning>true</warning>
<monitoring>true</monitoring>
<welcome>true</welcome>
<DeepWater>true</DeepWater>
<PrivateTerritory>true</PrivateTerritory>
<DangerZone>true</DangerZone>
<ValuableObjects>true</ValuableObjects>
<HighWarning>true</HighWarning>
<PrivateParking>true</PrivateParking>
<HasFaceMask>true</HasFaceMask>
<NoFaceMask>true</NoFaceMask>
<MindPersonalBelongings>true</MindPersonalBelongings> //Pay attention to belongings
<CatchThief>true</CatchThief> //catch the thief
<Help>true</Help> //Help
<Classification>true</Classification> //Garbage classification
<RecyclableWaste>true</RecyclableWaste> //recyclable trash
<HouseholdFoodWaste>true</HouseholdFoodWaste> //Kitchen waste
<HazardousWaste>true</HazardousWaste> //hazardous waste
<ResidualWaste>true</ResidualWaste> //other garbage
<ClassificationAll>true</ClassificationAll> //Garbage sorting cycle broadcast
</AudioType>
</ForHuman>
<ForCar> //Supported types of car shape sound alarm
<support>true</support>
<AudioType>
<Custom>true</Custom>
<Alarm>true</Alarm>
<dog>false</dog>
<warning>true</warning>
<monitoring>false</monitoring>
<welcome>true</welcome>
<DeepWater>false</DeepWater>
<PrivateTerritory>false</PrivateTerritory>
<DangerZone>true</DangerZone>
<ValuableObjects>false</ValuableObjects>
<HighWarning>false</HighWarning>
<PrivateParking>true</PrivateParking>
<HasFaceMask>false</HasFaceMask>
<NoFaceMask>false</NoFaceMask>
<NoParking>true</NoParking> //No parking
</AudioType>
</ForCar>
<ForFire> //Types of Flame Audible Alarm Support
<support>true</support>
<AudioType>
<Custom>true</Custom> //customize
<Alarm>true</Alarm> //Siren
</AudioType>
</ForFire>
<ForElectronicFence> //Types of geo-fence alarm support
<support>true</support>
<AudioType>
<Custom>true</Custom>//Custom
<dog>true</dog>
</AudioType>
</ForElectronicFence>
<ForTraversePlane> //Supported types of cross-border detection alarms
<support>true</support>
<AudioType>
<Custom>true</Custom> //Custom
<dog>true</dog>
</AudioType>
</ForTraversePlane>
<ForOffDutyDetect> //Supported types of out-of-service detection and alarm
<support>true</support>
<AudioType>
<Custom>true</Custom> //Custom
<dog>true</dog>
</AudioType>
</ForOffDutyDetect>
<ForVideoShelter> //Supported types of video tampering alarms
<support>true</support>
<AudioType>
<Custom>true</Custom> //Custom
<dog>true</dog>
</AudioType>
</ForVideoShelter>
<ForObjectTrack> //Supported Types of Smart Tracking Alarms
<support>true</support>
<AudioType>
<Custom>true</Custom> //Custom
<dog>true</dog>
</AudioType>
</ForObjectTrack>
<PassengerEnter> //Support voice prompts when guests enter
<Support>true</Support>
<AudioType>
<Custom>true</Custom> //Custom
<Welcome>true</Welcome> //welcome
<ThankYou>true</ThankYou> //ThankYou
</AudioType>
</PassengerEnter>
<PassengerLeave> //Support voice prompts when guests leave
<Support></Support>
<AudioType>
<Custom>true</Custom> //Custom
<Welcome>true</Welcome> //Welcome
<ThankYou>true</ThankYou> //ThankYou
</AudioType>
</PassengerLeave>
</AudioAlarmType>
</AudioAlarm>
<FireDetect> //flame detection
<support>true</support> //Supported or not
</FireDetect>
<VideoShelter> //video occlusion
<support>true</support> //Supported or not
</VideoShelter>
</Channel>
xxxxxxxxxx
DevicesManage.getInstance().getMirrorMode(did, channelId);
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
channelId | Device channel number |
Return
Return | Details |
---|---|
result | Success: ok; Failure: unsupport, other error |
mode | Up and down: up-down; Left and right: left-right; Center: center; Close: disable |
Simple sample code
xxxxxxxxxx
// send command
DevicesManage.getInstance().getMirrorMode(did, "0");
xxxxxxxxxx
// Receive data
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String result = intent.getStringExtra("result");
String mode = intent.getStringExtra("mode");
switch (intent.getAction()){
case Constants.Action.RET_GET_MIRROR_MODE:
if (RESULT_OK.equals(result)) {
if (MODE_UP_DOWN.equals(mode)) {
} else if (MODE_LEFT_RIGHT.equals(mode)) {
} else if (MODE_CENTER.equals(mode)) {
} else if (MODE_DISABLE.equals(mode)) {
}
}else {
if (RESULT_UNSUPPORT.equals(result)) {
} else {
}
}
break;
default:
break;
}
}
};
Function description
xxxxxxxxxx
DevicesManage.getInstance().setMirrorMode(did, channelId, mode);
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
Parameter
Parameter | Details |
---|---|
did | Device did |
channelId | Device channel number |
mode | Mirror mode (up and down: up-down; left and right: left-right; center: center; off: disable) |
Return
Return | Details |
---|---|
result | Success: ok; Failure: unsupport, other error |
Simple sample code
xxxxxxxxxx
// send command
DevicesManage.getInstance().setMirrorMode(did, "0", "up-down");
xxxxxxxxxx
// Receive data
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String result = intent.getStringExtra("result");
switch (intent.getAction()){
case Constants.Action.RET_SET_MIRROR_MODE:
if("ok".equals(result)){
}else {
if("unsupport".equals(result)){
}else {
}
}
break;
default:
break;
}
}
};
xxxxxxxxxx
GET /System/Time
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI command: GET /System/Time |
Return
Return | Details |
---|---|
DateTimeFormat | Time format: YYYYMMDDWhhmmss, YYYYMMDDhhmmss, MMDDYYYYWhhmmss, MMDDYYYYhhmmss, DDMMYYYYWhhmmss, DDMMYYYYhhmmss |
TimeFormat | Time format: 12-hour system/24-hour system |
SystemTime | system time |
Return example:
xxxxxxxxxx
<Time>
<DateTimeFormat><!--req,string,YYYYMMDDWhhmmss,YYYYMMDDhhmmss,MMDDYYYYWhhmmss,MMD DYYYYhhmmss,DDMMYYYYWhhmmss,DDMMYYYYhhmmss--></DateTimeFormat>
<TimeFormat><!--req,xs:string,12hour,24hour--></TimeFormat>
<SystemTime><!--req,xs:datetime,” 20040503T173008+08”--></SystemTime>
</Time>
Simple sample code
xxxxxxxxxx
// send command
DevicesManage.getInstance().cmd902(did, “GET /System/Time”, "");
xxxxxxxxxx
// Receive command
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
switch (action) {
case Constants.Action.GET_SET_CONFIG_BY_HTTP:
String http = intent.getStringExtra("http");
String responseXml = HttpUtils.getResponseXML(http);
String xmlInfo = HttpUtils.getHttpXmlInfo(responseXml);
if (xmlInfo.contains("Time")) { //Get device system time
}
default:
break;
}
}
};
xxxxxxxxxx
PUT /System/Time
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
DateTimeFormat | Time format: YYYYMMDDWhhmmss, YYYYMMDDhhmmss, MMDDYYYYWhhmmss, MMDDYYYYhhmmss, DDMMYYYYWhhmmss, DDMMYYYYhhmmss |
TimeFormat | Time format: 12-hour system/24-hour system |
SystemTime | system time |
Return
Return | Details |
---|---|
requestURL | Request Url, here is: PUT /System/Time |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
// send command
String PUT_TIME = "PUT /System/Time";
String time = "<?xml version="1.0" encoding="UTF-8" ?>
<Time Version="1.0">
<DateTimeFormat>YYYYMMDDWhhmmss</DateTimeFormat>
<TimeFormat>24hour</TimeFormat>
<SystemTime>20220411T170235</SystemTime>
</Time>";
String timeCmd = PUT_TIME + "\r\n\r\n" + time;
DevicesManage.getInstance().cmd902(dev.getDid(), timeCmd, "");
xxxxxxxxxx
// Receive command
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
switch (action) {
case Constants.Action.GET_SET_CONFIG_BY_HTTP:
String http = intent.getStringExtra("http");
String responseXml = HttpUtils.getResponseXML(http);
String xmlInfo = HttpUtils.getHttpXmlInfo(responseXml);
if (xmlInfo.contains("ResponseStatus")) { //Get device system time
RESPONSESTATUS response = XmlUtils.parseResponse(responseXml);
if (response.requestURL.contains("/System/Time")) {
}
}
default:
break;
}
}
};
xxxxxxxxxx
GET /System/NTP
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI command: GET /System/NTP |
Return
Return | Details |
---|---|
Enable | Whether to enable network time synchronization |
ServerName | Servers, 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" |
TimeZone | Time zone |
TimeSyncInterval | time interval |
return example:
xxxxxxxxxx
<NTP>
<Enable><!—req,xs:boolean--></Enable>
<ServerName><!—req,xs:string,”example: time.windows.com”--></ServerName>
<TimeZone><!--req, xs:string, POSIX time zone string,”CST-09:00:00”--></TimeZone>
<TimeSyncInterval><!—req,xs:integer--></TimeSyncInterval>
</NTP>
Simple sample code
xxxxxxxxxx
// send command
DevicesManage.getInstance().cmd902(did, "GET /System/NTP", "");
xxxxxxxxxx
// Receive command
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
switch (action) {
case Constants.Action.GET_SET_CONFIG_BY_HTTP:
String http = intent.getStringExtra("http");
String responseXml = HttpUtils.getResponseXML(http);
String xmlInfo = HttpUtils.getHttpXmlInfo(responseXml);
if (xmlInfo.contains("NTP")) { //Obtain network time synchronization information
}
default:
break;
}
}
};
xxxxxxxxxx
PUT /System/NTP
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
Enable | Whether to enable network time synchronization |
ServerName | server, 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" |
TimeZone | Time zone |
TimeSyncInterval | time interval |
Return
Return | Details |
---|---|
requestURL | Request Url, here is: PUT /System/NTP |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
// send command
String PUT_NTP = "PUT /System/NTP";
String ntp = "<?xml version="1.0" encoding="UTF-8" ?>
<NTP Version="1.0">
<Enable>true</Enable>
<ServerName>pool.ntp.org</ServerName>
<TimeZone>CST-08:00:00</TimeZone>
<TimeSyncInterval>1</TimeSyncInterval>
</NTP>";
String cmd = PUT_NTP + "\r\n\r\n" + ntp;
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
xxxxxxxxxx
// Receive command
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
switch (action) {
case Constants.Action.GET_SET_CONFIG_BY_HTTP:
String http = intent.getStringExtra("http");
String responseXml = HttpUtils.getResponseXML(http);
String xmlInfo = HttpUtils.getHttpXmlInfo(responseXml);
if (xmlInfo.contains("ResponseStatus")) {
RESPONSESTATUS response = XmlUtils.parseResponse(responseXml);
if (response.requestURL.contains("/System/NTP")) {
}
}
default:
break;
}
}
};
xxxxxxxxxx
GET /System/DST
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI command: GET /System/DST |
Return
Return | Details |
---|---|
Enable | Whether to enable daylight saving time |
Mode | Daylight saving mode: day of the week, date |
TimeDifference | Time difference |
DateModeStart | date pattern start time |
DateModeStop | date pattern end time |
WeekModeStart | Week mode start time |
WeekModeStop | end of week mode |
return example:
xxxxxxxxxx
<DST Version="1.0" xmlns="http://www.zwcloud.wang/ver10/XMLSchema">
<Enable><!—req,xs:boolean--></Enable>
<Mode><!—req,xs:string,”date,week”--></Mode>
<TimeDifference>req,xs:string, </TimeDifference>
<DateModeStart><!--req,xs:datetime,” 20040503T173008+08”--></DateModeStart>
<DateModeStop><!--req,xs:datetime,” 20040503T173008+08”--></DateModeStop>
<WeekModeStart><!--req,xs:string,” 3-1-1-2-3-6”--></WeekModeStart>
<WeekModeStop><!--req,xs:string,” 2-4-5-7-8-8”--></WeekModeStop>
</DST>
Simple sample code
xxxxxxxxxx
// send command
DevicesManage.getInstance().cmd902(did, “GET /System/DST”, "");
xxxxxxxxxx
// Receive command
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
switch (action) {
case Constants.Action.GET_SET_CONFIG_BY_HTTP:
String http = intent.getStringExtra("http");
String responseXml = HttpUtils.getResponseXML(http);
String xmlInfo = HttpUtils.getHttpXmlInfo(responseXml);
if (xmlInfo.contains("DST")) { //Obtain network time synchronization information
}
default:
break;
}
}
};
xxxxxxxxxx
PUT /System/DST
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
Enable | Whether to enable daylight saving time |
Mode | Daylight saving mode: day of the week, date |
TimeDifference | Time difference |
DateModeStart | date pattern start time |
DateModeStop | date pattern end time |
WeekModeStart | Week mode start time |
WeekModeStop | end of week mode |
Return
Return | Details |
---|---|
requestURL | Request Url, here is: PUT /System/DST |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
// send command
String PUT_DST = "PUT /System/DST";
String dst = "<?xml version="1.0" encoding="UTF-8" ?>
<DST Version="1.0">
<Enable>false</Enable>
<Mode>week</Mode>
<TimeDifference>3600</TimeDifference>
<DateModeStart>20170302T020000</DateModeStart>
<DateModeStop>20171101T020000</DateModeStop>
<WeekModeStart>3-2-0-2-0-0</WeekModeStart>
<WeekModeStop>11-1-0-2-0-0</WeekModeStop>
</DST>";
String cmd = PUT_DST + "\r\n\r\n" + dst;
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
xxxxxxxxxx
// Receive command
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
switch (action) {
case Constants.Action.GET_SET_CONFIG_BY_HTTP:
String http = intent.getStringExtra("http");
String responseXml = HttpUtils.getResponseXML(http);
String xmlInfo = HttpUtils.getHttpXmlInfo(responseXml);
if (xmlInfo.contains("ResponseStatus")) {
RESPONSESTATUS response = XmlUtils.parseResponse(responseXml);
if (response.requestURL.contains("/System/DST")) {
}
}
default:
break;
}
}
};
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
Highest | Whether to support the highest |
Higher | Whether to support higher |
High | Whether to support high |
Middle | Is it supported |
Low | Whether to support low |
Lower | Whether the support is low |
Lowest | Does it support the minimum |
return example:
xxxxxxxxxx
...
<MotionSenstive>
<Highest><!--xs:boolean--></Highest>
<Higher><!--xs:boolean--></Higher>
<High><!--xs:boolean--></High>
<Middle><!--xs:boolean--></Middle>
<Low><!--xs:boolean--></Low>
<Lower><!--xs:boolean--></Lower>
<Lowest><!--xs:boolean--></Lowest>
</MotionSenstive>
...
Simple sample code
xxxxxxxxxx
String cmd = "GET /System/DeviceCap";
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI command: GET /Network/P2PV2 |
Return
Return | Details |
---|---|
UUID | Device UUID |
return example:
xxxxxxxxxx
<P2PList>
<ID><!--req,xs:integer--></ID>
<Enable><!--req,xs:boolean--></Enable>
<P2PProtocolName><!--req,xs:string--></P2PProtocolName>
<UUID><!--req,xs:string--></UUID>
<AndroidAppDownload><!--req,xs:string--></AndroidAppDownload>
<IphoneAppDownload><!--req,xs:string--></IphoneAppDownload>
<Status><!--ro,opt,xs:string,”offline,internet-ready,intranet-ready”--></Status>
</P2PList>
Simple sample code
xxxxxxxxxx
String cmd = "GET /Network/P2PV2"
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI command: GET /Pictures/ChannelID/Motion |
Return
Return | Details |
---|---|
Enable | Whether to enable motion detection |
Senstive | sensitivity |
Trigger | linkage configuration |
Schedule | arming time |
Return:
xxxxxxxxxx
<Motion>
<Enable><!--req,xs:boolean--></Enable>
<Senstive><!--req,xs:string,”lowest,lower,low,middle,high,higher,highest”,--></Senstive>
<Trigger><!--opt-->
<Schedule><!--opt-->
</Motion>
Simple sample code
xxxxxxxxxx
String cmd = "GET /Pictures/1/Motion";
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
无
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI commands:GET /Pictures/ChannelID/Motion/RegionsV2 |
Return
Return | Details |
---|---|
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:
xxxxxxxxxx
<MotionRegionListV2>
<RegionX_0><!--xs:string,”00000000000000”--></RegionX_0>
<RegionX_1><!--xs:string, ”00000000000000”--></RegionX_1>
<RegionX_2><!--xs:string, ”00000000000000”--></RegionX_2>
<RegionX_3><!--xs:string, ”00000000000000”--></RegionX_3>
<RegionX_4><!--xs:string, ”00000000000000”--></RegionX_4>
<RegionX_5><!--xs:string,”00000000000000”--></RegionX_5>
<RegionX_6><!--xs:string,”00000000000000”--></RegionX_6>
<RegionX_7><!--xs:string,”00000000000000”--></RegionX_7>
<RegionX_8><!--xs:string,”00000000000000”--></RegionX_8>
<RegionX_9><!--xs:string,”00000000000000”--></RegionX_9>
<RegionX_10><!--xs:string,”00000000000000”--></RegionX_10>
<RegionX_11><!--xs:string,”00000000000000”--></RegionX_11>
</MotionRegionListV2>
Simple sample code
xxxxxxxxxx
String cmd = "GET /Pictures/1/Motion/RegionsV2";
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
无
Parameter
Parameter | Details |
---|---|
Enable | Whether to enable motion detection |
Senstive | sensitivity |
Trigger | linkage configuration |
Schedule | arming time |
Return
Return | Details |
---|---|
requestURL | Request Url |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
String move = "<?xml version="1.0" encoding="utf-8"?>
<Motion>
<Enable><!--req,xs:boolean--></Enable>
<Senstive><!--req,xs:string,”lowest,lower,low,middle,high,higher,highest”,--></Senstive>
<Trigger><!--opt-->
<Schedule><!--opt-->
</Motion>";
String cmd = "PUT /Pictures/1/Motion" + "\r\n\r\n" + move;
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
无
Parameter
Parameter | Details |
---|---|
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
Return | Details |
---|---|
requestURL | Request Url |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
String regions = "<?xml version="1.0" encoding="utf-8"?>
<MotionRegionListV2>
<RegionX_0><!--xs:string,”00000000000000”--></RegionX_0>
<RegionX_1><!--xs:string, ”00000000000000”--></RegionX_1>
<RegionX_2><!--xs:string, ”00000000000000”--></RegionX_2>
<RegionX_3><!--xs:string, ”00000000000000”--></RegionX_3>
<RegionX_4><!--xs:string, ”00000000000000”--></RegionX_4>
<RegionX_5><!--xs:string,”00000000000000”--></RegionX_5>
<RegionX_6><!--xs:string,”00000000000000”--></RegionX_6>
<RegionX_7><!--xs:string,”00000000000000”--></RegionX_7>
<RegionX_8><!--xs:string,”00000000000000”--></RegionX_8>
<RegionX_9><!--xs:string,”00000000000000”--></RegionX_9>
<RegionX_10><!--xs:string,”00000000000000”--></RegionX_10>
<RegionX_11><!--xs:string,”00000000000000”--></RegionX_11>
</MotionRegionListV2>";
String cmd = "PUT /Pictures/1/Motion/RegionsV2" + "\r\n\r\n" + regions;
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
multi_osd | Whether to support multi-line OSD |
Return:
xxxxxxxxxx
...
<multi_osd>true</multi_osd>
...
Simple sample code
xxxxxxxxxx
String cmd = "GET /System/DeviceCap";
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
无
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
Calendar | Time instance, including year-month-day-hour-minute-second |
Simple sample code
xxxxxxxxxx
DevicesManage.getInstance().getDeviceSysTime(did);
xxxxxxxxxx
private BroadcastReceiver receiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String result = intent.getStringExtra("result");
switch (intent.getAction()){
case Constants.Action.RET_GET_DEVICETIME:
Calendar calender = (Calendar) intent.getSerializableExtra("time");
break;
default:
break;
}
}
};
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI commands:GET /Pictures/ChannelID/OSD |
Return
Return | Details |
---|---|
DisplayTime-Enable | OSD time display switch |
DisplayTime-PosX | OSD time display X coordinate |
DisplayTime-PosY | OSD time display Y coordinate |
DisplayName-Enable | OSD name display switch |
DisplayName-PosX | OSD name display X coordinate |
DisplayName-PosY | OSD name display Y coordinate |
DisplayName-Name | OSD name display |
Return:
xxxxxxxxxx
<OSD>
<DisplayTime><!--req-->
<Enable><!--req,xs:Boolean”true”,”false”--></Enable>
<PosX><!--req,xs:integer,0-703--></PosX>
<PosY><!--req,xs:integer,0-575--></PosY>
</DisplayTime>
<DisplayName><!--req-->
<Enable><!--req,xs:boolean--></Enable>
<PosX><!--req,xs:integer,0-703--></PosX>
<PosY><!--req,xs:integer,0-575--></PosY>
<Name><!--req,xs:string,”in Unicode”--></Name>
</DisplayName>
</OSD>
Simple sample code
xxxxxxxxxx
String cmd = "GET /Pictures/1/OSD";
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
无
Parameter
Parameter | Details |
---|---|
DisplayTime-Enable | OSD time display switch |
DisplayTime-PosX | OSD time display X coordinate |
DisplayTime-PosY | OSD time display Y coordinate |
DisplayName-Enable | OSD name display switch |
DisplayName-PosX | OSD name display X coordinate |
DisplayName-PosY | OSD name display Y coordinate |
DisplayName-Name | OSD name display |
Return
Return | Details |
---|---|
requestURL | Request Url |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
String PUT_OSD = "PUT /Pictures/1/OSD";
String osd = "OSD xml Info";
String cmd = PUT_OSD + "\r\n\r\n" + osd;
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI commands:GET /Pictures/ChannelID/MultiOSDV2 |
Return
Return | Details |
---|---|
DisplayTime-Enable | OSD time display switch |
DisplayTime-PosX | OSD time display X coordinate |
DisplayTime-PosY | OSD time display Y coordinate |
ID | Single line OSD name ID |
Text | Single line OSD name content |
x | Single line OSD name X coordinate |
y | Single line OSD name Y coordinate |
Return:
xxxxxxxxxx
<MultiLineOSD>
<DisplayTime><!--req-->
<Enable><!--req,xs:boolean--></Enable>
<PosX><!--req,xs:integer,0-703--></PosX>
<PosY><!--req,xs:integer,0-575--></PosY>
</DisplayTime>
<OSD><!--req-->
<ID><!--req,xs:interger--></ID>
<Text><!--req,xs:string--></Text>
<x><!--req,xs:integer,0-703--></x>
<y><!--req,xs:integer,0-575--></y>
</OSD>
…
</MultiLineOSD>
Simple sample code
xxxxxxxxxx
String cmd = "GET /Pictures/1/MultiOSDV2";
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
无
Parameter
Parameter | Details |
---|---|
DisplayTime-Enable | OSD time display switch |
DisplayTime-PosX | OSD time display X coordinate |
DisplayTime-PosY | OSD time display Y coordinate |
ID | Single line OSD name ID |
Text | Single line OSD name content |
x | Single line OSD name X coordinate |
y | Single line OSD name Y coordinate |
Return
Return | Details |
---|---|
requestURL | Request Url |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
String PUT_OSD = "PUT /Pictures/1/MultiOSDV2";
String osd = "MultiOSDV2 xml Info";
String cmd = PUT_OSD + "\r\n\r\n" + osd;
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
无
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
StorageCapacity | Whether to support memory card |
Return:
xxxxxxxxxx
...
<StorageCapacity><!--xs:boolean--></StorageCapacity> //Display memory card capacity information
...
Simple sample code
xxxxxxxxxx
String cmd = "GET /System/DeviceCap";
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
DiskID | memory card ID |
DiskTypeNamememory card name | memory card name |
TotalCapacity | total capacity |
AvailableCapacity | available capacity |
DiskStorageType | Memory card type: SD card, samba |
DiskStorageAttribute | current 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 |
PictureCapacityPercent | Image Occupancy Ratio |
RecordCapacityPercent | Video Occupancy Ratio |
DiskFormatStatus | format 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:
xxxxxxxxxx
<DiskList>
<Disk>
<DiskID><!—ro,req,xs:integer,”0,1,2….”--></DiskID>
<DiskTypeName><!—ro,req,xs:string--></DiskTypeName>
<TotalCapacity><!—ro,req,xs:integer,the unit is MB--></TotalCapacity>
<AvailableCapacity><!—ro,req,xs:integer,the unit is MB--></AvailableCapacity>
<DiskStorageType><!—ro,req,xs:string,”SD,samba”--></DiskStorageType>
<DiskStorageAttribute><!—ro,req,xs:string,”idle,writting,reading,diskexception,diskerror,
re adonly,readwrite,nodisk,exceptionneedformat,exceptionneedChangeDisk,
formatfailedneed reboot” --></DiskStorageAttribute>
<PictureCapacityPercent><!—rw,req,xs:integer--></PictureCapacityPercent>
<RecordCapacityPercent><!—rw,req,xs:integer--></RecordCapacityPercent>
<DiskFormatStatus><!—ro,req,xs:string,”unformatted,formatting,formatted,format failure,umount failure,
device is busy”--></DiskFormatStatus>
</Disk>
</DiskList>
Simple sample code
xxxxxxxxxx
String cmd = "GET /Disk";
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
None
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI commands:PUT /Record/Format/Call |
Return
Return | Details |
---|---|
requestURL | Request Url |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
String cmd = "PUT /Record/Format/Call";
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
DiskStorageAttribute | current 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:
xxxxxxxxxx
...
<DiskStorageAttribute><!—ro,req,xs:string,”idle,writting,reading,diskexception,diskerror,
re adonly,readwrite,nodisk,exceptionneedformat,exceptionneedChangeDisk,
formatfailedneed reboot” --></DiskStorageAttribute>
...
When the value of DiskStorageAttribute is not nodisk, Details has inserted the memory card and is ready to obtain the recording configuration information
Simple sample code
xxxxxxxxxx
String cmd = "GET /Disk";
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI commands:GET /Record/ChannelID/RecordScheduleV2 |
Return
Return | Details |
---|---|
Enable | Whether to enable recording settings |
RecordType | Video 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:
xxxxxxxxxx
<RecordScheduleV2>
<Enable><!--req,xs:boolean”true”,”false”--></Enable>
<RecordType><!--rw,req,xs:string,”SequenceRecord”,”EventRecord”--></RecordType>
<TimeBlock_0>01:00-02:00</TimeBlock_0>
<TimeBlock_1>01:00-02:00</TimeBlock_1>
<TimeBlock_2>01:00-02:00</TimeBlock_2>
<TimeBlock_3>01:00-02:00</TimeBlock_3>
<TimeBlock_4>01:00-02:00</TimeBlock_4>
<TimeBlock_5>01:00-02:00</TimeBlock_5>
</RecordScheduleV2>
Simple sample code
xxxxxxxxxx
String cmd = "GET /Record/1/RecordScheduleV2";
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
None
Parameter
Parameter | Details |
---|---|
Enable | Whether to enable recording settings |
RecordType | Video 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
Return | Details |
---|---|
requestURL | Request Url |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
String recordInfo = "Record Info";
String cmd = "PUT /Record/1/RecordScheduleV2" + "\r\n\r\n" + recordInfo;
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
Support | Whether to support sensitivity 1-100 configuration |
return example:
xxxxxxxxxx
...
<HumanSensitivity> //Humanoid Detection Sensitivity
<Support><!--xs:boolean--></Support> //Supported or not sensitivity configuration
</HumanSensitivity>
...
Simple sample code
xxxxxxxxxx
String cmd = "GET /System/DeviceCap";
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
cmd | CGI commands:GET /Network/P2PV2 |
Return
Return | Details |
---|---|
UUID | Device UUID |
return example:
xxxxxxxxxx
<P2PList>
<ID><!--req,xs:integer--></ID>
<Enable><!--req,xs:boolean--></Enable>
<P2PProtocolName><!--req,xs:string--></P2PProtocolName>
<UUID><!--req,xs:string--></UUID>
<AndroidAppDownload><!--req,xs:string--></AndroidAppDownload>
<IphoneAppDownload><!--req,xs:string--></IphoneAppDownload>
<Status><!--ro,opt,xs:string,”offline,internet-ready,intranet-ready”--></Status>
</P2PList>
Simple sample code
xxxxxxxxxx
String cmd = "GET /Network/P2PV2"
DevicesManage.getInstance().cmd902(dev.getDid(), cmd, "");
Function description
Obtain humanoid detection configuration information (sensitivity supports 1-100)
xxxxxxxxxx
GET Pictures/ChannelID/PeopleDetectV1
Obtain humanoid detection configuration information (sensitivity does not support 1-100)
xxxxxxxxxx
GET Pictures/ChannelID/PeopleDetect
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
Enable | Whether to enable humanoid detection |
Senstive | Human figure sensitivity Support 1-100: 1-100 Not support 1-100: high (high), middle (medium), low (low) |
BeepAlert | alarm sound |
trigger mail | |
Ftp | Trigger FTP |
Push | Linkage push |
AlarmOut | trigger alarm output |
Snapshot | Trigger SD card capture |
Record | Trigger SD card recording |
AllDay | Whether the arming time is all day |
TimeBlockList | arming time |
TopLeftX | X coordinate of the upper left corner of the arming area |
TopLeftY | Y coordinate of the upper left corner of the arming area |
BottomRightX | The X coordinate of the lower right corner of the armed area |
BottomRightY | The Y coordinate of the lower right corner of the armed area |
return example:
xxxxxxxxxx
<PeopleDetect Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<Senstive><!--req,xs:string,”low”,”middle”,”high”--></Senstive>
<Track><!--req,xs:boolean--></Track>
<AIH265Plus><!--req,xs:boolean--></AIH265Plus>
<AIFace><!--req,xs:boolean--></AIFace>
<MainStreamOverlay><!--req,xs:boolean--></MainStreamOverlay>
<SubStreamOverlay><!--req,xs:boolean--></SubStreamOverlay>
<IsPushPeopleImage><!--req,xs:boolean--></IsPushPeopleImage>
<TrackZoom><!--req,xs:boolean--></TrackZoom>
<Trigger Version="1.0">
<NotifyAMS Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</NotifyAMS>
<BeepAlert Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</BeepAlert>
<FullScreen Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</FullScreen>
<Mail Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</Mail>
<Ftp Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</Ftp>
<Push Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</Push>
<AlarmOut Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<AlarmOutMask><!--req,xs:integer--></ AlarmOutMask >
</AlarmOut>
<Snapshot Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<SnapshotMask><!--req,xs:integer--></SnapshotMask>
</Snapshot>
<Record Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<RecordMask><!--req,xs:integer--></RecordMask>
</Record>
<PTZ Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<PTZActionList Version="1.0">
<PTZAction Version="1.0">
<ChannelID><!--req,xs:integer--></ChannelID>
<ActionName><!--req,xs:string--></ActionName>
<ActionNum><!--req,xs:integer--></ActionNum>
</PTZAction>
</PTZActionList>
</PTZ>
<LightAlarm Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</LightAlarm>
</Trigger>
<Schedule Version="1.0">
<AllDay><!--req,xs:boolean--></AllDay>
<TimeBlockList Version="1.0">
<TimeBlock_0>111111111111111111111111111111111111111111111111</TimeBlock_0>
<TimeBlock_1>111111111111111111111111111111111111111111111111</TimeBlock_1>
<TimeBlock_2>111111111111111111111111111111111111111111111111</TimeBlock_2>
<TimeBlock_3>111111111111111111111111111111111111111111111111</TimeBlock_3>
<TimeBlock_4>111111111111111111111111111111111111111111111111</TimeBlock_4>
<TimeBlock_5>111111111111111111111111111111111111111111111111</TimeBlock_5>
<TimeBlock_6>111111111111111111111111111111111111111111111111</TimeBlock_6>
</TimeBlockList>
</Schedule>
<PeopleDetectRegionList Version="1.0">
<Region Version="1.0">
<ID><!--req,xs:integer--></ID>
<TopLeftX><!--req,xs:integer--></TopLeftX>
<TopLeftY><!--req,xs:integer--></TopLeftY>
<BottomRightX><!--req,xs:integer--></BottomRightX>
<BottomRightY><!--req,xs:integer--></BottomRightY>
</Region>
</PeopleDetectRegionList>
</PeopleDetect>
Simple sample code
xxxxxxxxxx
// Sensitivity support 1-100
String cmdV1 = "GET /Pictures/1/PeopleDetectV1";
DevicesManage.getInstance().cmd902(did, cmdV1, "");
// Sensitivity does not support 1-100
String cmd = "GET /Pictures/1/PeopleDetect";
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
无
Parameter
Parameter | Details |
---|---|
Enable | Whether to enable humanoid detection |
Senstive | Human figure sensitivity Support 1-100: 1-100 Not support 1-100: high (high), middle (medium), low (low) |
BeepAlert | alarm sound |
trigger mail | |
Ftp | Trigger FTP |
Push | Linkage push |
AlarmOut | trigger alarm output |
Snapshot | Trigger SD card capture |
Record | Trigger SD card recording |
AllDay | Whether the arming time is all day |
TimeBlockList | arming time |
TopLeftX | X coordinate of the upper left corner of the arming area |
TopLeftY | Y coordinate of the upper left corner of the arming area |
BottomRightX | The X coordinate of the lower right corner of the armed area |
BottomRightY | The Y coordinate of the lower right corner of the armed area |
Return
Return | Details |
---|---|
requestURL | Request Url |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
// Sensitivity support 1-100
String info = "People Detect Info";
String cmdV1 = "PUT /Pictures/1/PeopleDetectV1" + "\r\n\r\n" + info;
DevicesManage.getInstance().cmd902(did, cmdV1, "");
// Sensitivity does not support 1-100
String info = "People Detect Info";
String cmd = "PUT /Pictures/1/PeopleDetect" + "\r\n\r\n" + info;
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
None
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
Support | Whether to zoom in on humanoid tracking |
return example:
xxxxxxxxxx
...
<AFTrack>
<Support><!--xs:boolean--></Support>
</AFTrack>
...
Simple sample code
xxxxxxxxxx
String cmd = "GET /System/PTZCap";
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
Support | Whether to support sensitivity 1-100 configuration |
return example:
xxxxxxxxxx
...
<HumanSensitivity> //Humanoid Detection Sensitivity
<Support><!--xs:boolean--></Support> //supported or not sensitivity configuration
</HumanSensitivity>
...
Simple sample code
xxxxxxxxxx
String cmd = "GET /System/DeviceCap";
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Obtain humanoid tracking configuration information (sensitivity supports 1-100)
xxxxxxxxxx
GET Pictures/ChannelID/PeopleDetectV1
Obtain humanoid tracking configuration information (sensitivity does not support 1-100)
xxxxxxxxxx
GET Pictures/ChannelID/PeopleDetect
Explain the context relationship (depending on the interface or which interfaces are used with it)
Parameter
Parameter | Details |
---|---|
did | Device did |
Return
Return | Details |
---|---|
Track | Whether humanoid tracking is turned on |
TrackZoom | Whether the humanoid tracking zoom is turned on |
return example:
xxxxxxxxxx
<PeopleDetect Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<Senstive><!--req,xs:string,”low”,”middle”,”high”--></Senstive>
<Track><!--req,xs:boolean--></Track>
<AIH265Plus><!--req,xs:boolean--></AIH265Plus>
<AIFace><!--req,xs:boolean--></AIFace>
<MainStreamOverlay><!--req,xs:boolean--></MainStreamOverlay>
<SubStreamOverlay><!--req,xs:boolean--></SubStreamOverlay>
<IsPushPeopleImage><!--req,xs:boolean--></IsPushPeopleImage>
<TrackZoom><!--req,xs:boolean--></TrackZoom>
<Trigger Version="1.0">
<NotifyAMS Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</NotifyAMS>
<BeepAlert Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</BeepAlert>
<FullScreen Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</FullScreen>
<Mail Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</Mail>
<Ftp Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</Ftp>
<Push Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</Push>
<AlarmOut Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<AlarmOutMask><!--req,xs:integer--></ AlarmOutMask >
</AlarmOut>
<Snapshot Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<SnapshotMask><!--req,xs:integer--></SnapshotMask>
</Snapshot>
<Record Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<RecordMask><!--req,xs:integer--></RecordMask>
</Record>
<PTZ Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
<PTZActionList Version="1.0">
<PTZAction Version="1.0">
<ChannelID><!--req,xs:integer--></ChannelID>
<ActionName><!--req,xs:string--></ActionName>
<ActionNum><!--req,xs:integer--></ActionNum>
</PTZAction>
</PTZActionList>
</PTZ>
<LightAlarm Version="1.0">
<Enable><!--req,xs:boolean--></Enable>
</LightAlarm>
</Trigger>
<Schedule Version="1.0">
<AllDay><!--req,xs:boolean--></AllDay>
<TimeBlockList Version="1.0">
<TimeBlock_0>111111111111111111111111111111111111111111111111</TimeBlock_0>
<TimeBlock_1>111111111111111111111111111111111111111111111111</TimeBlock_1>
<TimeBlock_2>111111111111111111111111111111111111111111111111</TimeBlock_2>
<TimeBlock_3>111111111111111111111111111111111111111111111111</TimeBlock_3>
<TimeBlock_4>111111111111111111111111111111111111111111111111</TimeBlock_4>
<TimeBlock_5>111111111111111111111111111111111111111111111111</TimeBlock_5>
<TimeBlock_6>111111111111111111111111111111111111111111111111</TimeBlock_6>
</TimeBlockList>
</Schedule>
<PeopleDetectRegionList Version="1.0">
<Region Version="1.0">
<ID><!--req,xs:integer--></ID>
<TopLeftX><!--req,xs:integer--></TopLeftX>
<TopLeftY><!--req,xs:integer--></TopLeftY>
<BottomRightX><!--req,xs:integer--></BottomRightX>
<BottomRightY><!--req,xs:integer--></BottomRightY>
</Region>
</PeopleDetectRegionList>
</PeopleDetect>
Simple sample code
xxxxxxxxxx
// 灵敏度支持1-100
String cmdV1 = "GET /Pictures/1/PeopleDetectV1";
DevicesManage.getInstance().cmd902(did, cmdV1, "");
// 灵敏度不支持1-100
String cmd = "GET /Pictures/1/PeopleDetect";
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
Explain the context relationship (depending on the interface or which interfaces are used with it)
None
Parameter
Parameter | Details |
---|---|
Track | Whether humanoid tracking is turned on |
TrackZoom | Whether the humanoid tracking zoom is turned on |
Return
Return | Details |
---|---|
requestURL | Request Url |
statusCode | Save result status code, success: 0, failure: other |
Simple sample code
xxxxxxxxxx
// Sensitivity support 1-100
String info = "People Detect Info";
String cmdV1 = "PUT /Pictures/1/PeopleDetectV1" + "\r\n\r\n" + info;
DevicesManage.getInstance().cmd902(did, cmdV1, "");
// Sensitivity does not support 1-100
String info = "People Detect Info";
String cmd = "PUT /Pictures/1/PeopleDetect" + "\r\n\r\n" + info;
DevicesManage.getInstance().cmd902(did, cmd, "");
Function description
set low-power device prefix
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
Parameter
Parameter | Details |
---|---|
List | prefix list |
Return
sample
xxxxxxxxxx
DevicesManage.getInstance().setLowPowerDidList(List<String> didPrefixList);
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
Parameter | Details |
---|---|
did | device did |
3.Return
Parameter | Details |
---|---|
did | device did |
offline | 0~70:device online >70:device offline, <0:device offline,use offline time from checkServerOffline |
4.sample
xxxxxxxxxx
DevicesManage.getInstance().wakeupQuery(did);
//only one impliment needed
DevicesManage.getInstance().setGetWakeupStateListener(new DevRetCallback.GetWakeupStateListener() {
public void onWakeUpResult(String did, int offline) {
}
});
Function description
set the AOV device playback flag
Explain the context relationship (depending on the interface or which interfaces are used with it)
call it before aov device playbackStart
Parameter
Parameter | Details |
---|---|
boolean | aov device set true |
Return
Sample
xxxxxxxxxx
DevicesManage.getInstance().setAov(true);
Function description
Calibration time when aov device playback seek
Explain the context relationship (depending on the interface or which interfaces are used with it)
call it after aov device playbackSeek
Parameter
Parameter | Details |
---|---|
long | aov Calibration seek time |
Return
Sample
xxxxxxxxxx
DevicesManage.getInstance().setAovSeekTime(seekTime - (calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET)));