public class EZGlobalSDK
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
addDevice(java.lang.String deviceSerial,
java.lang.String verifyCode)
This API is used to add devices.
|
java.lang.String |
captureCamera(java.lang.String deviceSerial,
int channelNo)
This API is used to get the url of real time pictures of the cameras. It needs to be supported by the device and generally, devices on EZVIZ cloud P2P support this protocol. (This function is the same with the refreshing home page function of EZVIZ cloud video). This API is time-consuming which is suggested to use in the thread.
|
boolean |
controlPTZ(java.lang.String deviceSerial,
int cameraNo,
EZConstants.EZPTZCommand command,
EZConstants.EZPTZAction action,
int speed)
This API is used to control PTZ.
|
int |
controlVideoFlip(java.lang.String deviceSerial,
int cameraNo,
EZConstants.EZPTZDisplayCommand command)
This API is used to mirror control the device video to flip the picture. When the camera installation is upside down, you can use this API to flip the picture. The function needs to be supported by the device.
|
EZPlayer |
createPlayer(java.lang.String deviceSerial,
int cameraNo)
The API is used to create EZPlayer object according to deviceSerial and cameraNo.
|
byte[] |
decryptData(byte[] inputData,
java.lang.String verifyCode)
This API is used to decrypt the alarm picture.
|
boolean |
deleteAlarm(java.util.List<java.lang.String> alarmIdList)
This API is used to delete alarm in batch.
|
boolean |
deleteDevice(java.lang.String deviceSerial)
This API is used to delete the current account of the device.
|
static void |
enableP2P(boolean bEnable)
This API is used to set whether supports getting stream via P2P. By default, getting stream via P2P is not supported. It is suggested that disable P2P when many people view a same video and enable P2P when the camera is only used at home. This API can be called at any time.
|
static void |
finiLib()
This API is used to free SDK resource.
|
boolean |
formatStorage(java.lang.String deviceSerial,
int partitionIndex)
This API is used to format SD card.
|
java.util.List<EZAlarmInfo> |
getAlarmList(java.lang.String deviceSerial,
int pageIndex,
int pageSize,
java.util.Calendar beginTime,
java.util.Calendar endTime)
This API is used to get alarm information list.
|
java.util.List<EZAreaInfo> |
getAreaList()
This API is used to get the area list. The interface has network operation, which is required in the thread.
|
java.util.List<EZDeviceInfo> |
getDeviceList(int pageIndex,
int pageSize)
This API is used to get the user's device list, which returns the object array of EZDeviceInfo. The API only provides the basic data of the device and generally, you don't need to call this interface and you can use getCameraList to get the camera list.
|
EZDeviceUpgradeStatus |
getDeviceUpgradeStatus(java.lang.String deviceSerial)
This API is used to get device upgrading status.
|
EZDeviceVersion |
getDeviceVersion(java.lang.String deviceSerial)
This API is used to get the version information of the device.
|
EZAccessToken |
getEZAccessToken()
This API is used to get login token.
|
static EZGlobalSDK |
getInstance() |
java.util.List<EZStorageStatus> |
getStorageStatus(java.lang.String deviceSerial)
This API is used to get the storage status (eg. initialization, or formating progress, etc.)
|
int |
getUnreadMessageCount(java.lang.String deviceSerial,
EZConstants.EZMessageType messageType)
This API is used to get the count of unread messages.
|
EZUserInfo |
getUserInfo()
This API is used to get the user information, including username, profile photo and address, etc.
|
static java.lang.String |
getVersion() |
static boolean |
initLib(Application application,
java.lang.String appKey,
java.lang.String loadLibraryAbsPath)
This API is used to initialize SDK.
|
void |
logout()
This API is used to logout.
|
void |
openChangePasswordPage()
This API is used to open the page of changing password.
|
void |
openLoginPage(int areaId)
This API is used to get Accesstoken when opening the page during login.
|
EZProbeDeviceInfo |
probeDeviceInfo(java.lang.String deviceSerial)
This API is used to search the device information, which briefly search the device information before adding the device such as online status and adding status, etc.
|
void |
releasePlayer(EZPlayer player)
This API is used to release EZPlayer object.
|
java.util.List<EZCloudRecordFile> |
searchRecordFileFromCloud(java.lang.String deviceSerial,
int cameraNo,
java.util.Calendar startTime,
java.util.Calendar endTime)
This API is used to search the record information list of cloud storage. The interface has network operation, which is required in the thread.
|
java.util.List<EZDeviceRecordFile> |
searchRecordFileFromDevice(java.lang.String deviceSerial,
int cameraNo,
java.util.Calendar startTime,
java.util.Calendar endTime)
This API is used to search the record information list of SD card. When the device is connected with NVR, the record is from NVR, not from SD card.
|
void |
setAccessToken(java.lang.String accessToken)
This API is used to set AccessToken for EZOpenSDK after login.
|
boolean |
setAlarmStatus(java.util.List<java.lang.String> alarmIdList,
EZConstants.EZAlarmStatus alarmStatus)
This API is used to set the alarm status to be marked read.
|
boolean |
setDefence(java.lang.String deviceSerial,
EZConstants.EZDefenceStatus defence)
This API is used to set the arming status and the arming of A1 and IPC devices is compatible.
|
boolean |
setDeviceEncryptStatus(java.lang.String deviceSerial,
java.lang.String validateCode,
boolean encrypt)
This API is used to enable or disable the encryption of the video and picture of the device.
|
boolean |
setDeviceName(java.lang.String deviceSerial,
java.lang.String deviceName)
This API is used to modify the device name.
|
boolean |
setVideoLevel(java.lang.String deviceSerial,
int cameraNo,
int videoLevel)
This API is used to set the video definition of the camera.
|
static void |
showSDKLog(boolean showLog)
This API is used to set whether to print the logcat logs in SDK. It is suggested that when in debug mode, it will print logs and when in release mode, it will not print logs.
|
boolean |
startConfigWifi(Context context,
java.lang.String ssid,
java.lang.String password,
DeviceDiscoveryListener l)
This API is used to start Wi-Fi configuration.
|
boolean |
stopConfigWiFi()
This API is used to stop Wi-Fi configuration.
|
void |
upgradeDevice(java.lang.String deviceSerial)
This API is used to start upgrading the device.
|
boolean |
validateSecureSMSCode(java.lang.String smsCode)
This API is used to verify the security message.
|
public static EZGlobalSDK getInstance()
public static boolean initLib(Application application, java.lang.String appKey, java.lang.String loadLibraryAbsPath)
application
- The application object of client AppappKey
- The applied app key of client ApploadLibraryAbsPath
- If the So library is in SD card, this is the path of So library.public static void finiLib()
public static java.lang.String getVersion()
public static void showSDKLog(boolean showLog)
showLog
- true means printing logs and false means don't printing logs.public static void enableP2P(boolean bEnable)
bEnable
- true-Supports P2P, false-Not supports P2Ppublic void setAccessToken(java.lang.String accessToken)
accessToken
- The accessToken obtained by login.public EZAccessToken getEZAccessToken()
public java.util.List<EZAreaInfo> getAreaList() throws BaseException
BaseException
EZAreaInfo
public void openLoginPage(int areaId)
public void logout()
public java.util.List<EZDeviceInfo> getDeviceList(int pageIndex, int pageSize) throws BaseException
pageIndex
- Home page, which begins with 0.pageSize
- Page size, which is suggested within 20.BaseException
public EZProbeDeviceInfo probeDeviceInfo(java.lang.String deviceSerial) throws BaseException
deviceSerial
- The device serial number BaseException
public java.util.List<EZAlarmInfo> getAlarmList(java.lang.String deviceSerial, int pageIndex, int pageSize, java.util.Calendar beginTime, java.util.Calendar endTime) throws BaseException
deviceSerial
- The device serial number, when it is null, search all the alarm information list of the account.pageIndex
- The current page (begin with 0)pageSize
- The list number of each page (suggests within 20)beginTime
- The start time of search time scope and both start time and end time can be set to null.endTime
- The end time of search time scope BaseException
public boolean setAlarmStatus(java.util.List<java.lang.String> alarmIdList, EZConstants.EZAlarmStatus alarmStatus) throws BaseException
alarmIdList
- The ID array of alarm information (When one alarm is marked read, the array can only has one ID.)alarmStatus
- Alarm status, it only supports to mark read via EZMessageStatusRead.BaseException
public boolean deleteAlarm(java.util.List<java.lang.String> alarmIdList) throws BaseException
alarmIdList
- Alarm ID listBaseException
public java.util.List<EZCloudRecordFile> searchRecordFileFromCloud(java.lang.String deviceSerial, int cameraNo, java.util.Calendar startTime, java.util.Calendar endTime) throws BaseException
deviceSerial
- The device serial numbercameraNo
- The camera number, EZCameraInfo.cameraNostartTime
- The start time of search time scopeendTime
- The end time of search time scopeBaseException
public java.util.List<EZDeviceRecordFile> searchRecordFileFromDevice(java.lang.String deviceSerial, int cameraNo, java.util.Calendar startTime, java.util.Calendar endTime) throws BaseException
deviceSerial
- The device serial numbercameraNo
- The camera number, EZCameraInfo.cameraNostartTime
- The start time of search time scopeendTime
- The end time of search time scopeBaseException
public boolean addDevice(java.lang.String deviceSerial, java.lang.String verifyCode) throws BaseException
deviceSerial
- The device serial numberverifyCode
- The device verification code, which is in the device body, including 6 capitals.BaseException
public boolean deleteDevice(java.lang.String deviceSerial) throws BaseException
deviceSerial
- The device serial number including 9 digits.BaseException
public boolean validateSecureSMSCode(java.lang.String smsCode) throws BaseException
smsCode
- BaseException
public boolean controlPTZ(java.lang.String deviceSerial, int cameraNo, EZConstants.EZPTZCommand command, EZConstants.EZPTZAction action, int speed) throws BaseException
deviceSerial
- The device serial numbercameraNo
- The channel numbercommand
- The PTZ control commandaction
- Start/stop speed
- Speed(0-7)BaseException
public int controlVideoFlip(java.lang.String deviceSerial, int cameraNo, EZConstants.EZPTZDisplayCommand command)
deviceSerial
- The device serial numbercameraNo
- The camera number, EZCameraInfo.cameraNocommand
- PTZ control command public byte[] decryptData(byte[] inputData, java.lang.String verifyCode)
inputData
- Data before decryptionverifyCode
- password and generally, it is verification code of the device.public boolean setDefence(java.lang.String deviceSerial, EZConstants.EZDefenceStatus defence) throws BaseException
deviceSerial
- The device serial numberdefence
- The arming status. The cameras only have two status: 0 and 1, and the siren has three status: 0-sleeping mode, 8-home mode, 16-away modeBaseException
public java.lang.String captureCamera(java.lang.String deviceSerial, int channelNo) throws BaseException
deviceSerial
- The device serial number channelNo
-The channel number BaseException
public EZDeviceVersion getDeviceVersion(java.lang.String deviceSerial) throws BaseException
deviceSerial
- The device serial numberBaseException
public boolean setDeviceEncryptStatus(java.lang.String deviceSerial, java.lang.String validateCode, boolean encrypt) throws BaseException
deviceSerial
- The device serial numbervalidateCode
- The device verification code. When enabling the encryption, verification code is not required.encrypt
- Whether to encryptBaseException
public boolean setDeviceName(java.lang.String deviceSerial, java.lang.String deviceName) throws BaseException
deviceSerial
- The device serial numberdeviceName
- The device name after modificationBaseException
public EZUserInfo getUserInfo() throws BaseException
BaseException
public int getUnreadMessageCount(java.lang.String deviceSerial, EZConstants.EZMessageType messageType) throws BaseException
deviceSerial
- The device serial number. When it is null, returns the count of unread messages of the devices.messageType
- The message type: EZMessageTypeAlarm means alarm message and EZMessageTypeLeave means leaving message (This is currently not supported.)BaseException
public java.util.List<EZStorageStatus> getStorageStatus(java.lang.String deviceSerial) throws BaseException
deviceSerial
- The device serial number.BaseException
public boolean formatStorage(java.lang.String deviceSerial, int partitionIndex) throws BaseException
deviceSerial
- The device serial number.partitionIndex
- The partition number returned by getStorageStatusBaseException
public void upgradeDevice(java.lang.String deviceSerial) throws BaseException
deviceSerial
- The device serial numberBaseException
public EZDeviceUpgradeStatus getDeviceUpgradeStatus(java.lang.String deviceSerial) throws BaseException
deviceSerial
- The device serial numberBaseException
public void openChangePasswordPage()
public boolean startConfigWifi(Context context, java.lang.String ssid, java.lang.String password, DeviceDiscoveryListener l)
context
- The applied activity contextssid
- The connecting Wi-Fi SSIDpassword
- The connecting Wi-Fi password l
- Callback, which is used to process the Wi-Fi configuration status of connecting device.public boolean stopConfigWiFi()
public EZPlayer createPlayer(java.lang.String deviceSerial, int cameraNo)
deviceSerial
- cameraNo
- public void releasePlayer(EZPlayer player)
player
- The EZPlayer object to releasepublic boolean setVideoLevel(java.lang.String deviceSerial, int cameraNo, int videoLevel) throws BaseException
deviceSerial
- The device serial numbercameraNo
- The device channel number and the default value is 1.videoLevel
- Definition. 0-Fluent 1-Balanced 2-High qualityBaseException