中文简体    English


爱为物联Android端接口文档

1.初始化

1.1 设置SDK日志

  • 描述

设置SDK底层的日志输出,使用SDK前调用一次即可。

public void initIvySDKLog(String logFilePath, int level)
  • 参数
参数名 是否必须 类型 说明
logFilePath string 绝对路径,包含文件名
level int 日志级别,详情见LogLevel
  • 引用
package com.ivyio.sdk;

public class LogLevel {
    public static final int NO = 0;//close
    public static final int ERR = 1;//error level
    public static final int DBG = 2;//debug level
    public static final int ALL = 3;//open all
}
  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
//建议文件命名为 "前缀+yyyyMMdd.log" 格式,可针对某一天的日志输出
SDKManager.getInstance().initIvySDKLog(filePath, LogLevel.ALL);//在init之前调用
  • 备注

需要手机的存储权限


1.2 设置app层日志

  • 描述

设置app应用层的日志输出,启动app时调用。

public void initIvyAppLog(String logFilePath, boolean isEnableLog)
  • 参数
参数名 是否必须 类型 说明
logFilePath string 绝对路径,包含文件名
isEnableLog boolean 是否输出日志,默认为true
  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
//建议文件命名为 "前缀+yyyyMMdd.log" 格式,可针对某一天的日志输出
SDKManager.getInstance().initIvyAppLog(filePath,  true);
  • 备注

需要手机的存储权限


1.3 SDK初始化

  • 描述

初始化SDK,使用SDK前必须调用且调用一次即可。

public void init(Context context)
  • 参数
参数名 是否必须 类型 说明
context Context 上下文,Android环境
  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
SDKManager.getInstance().init(this);

1.4 SDK版本号

  • 描述

获取SDK版本号。

public String getSdkVersion()
  • 返回值

String类型,版本号

  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
 String sdkVersion = SDKManager.getInstance().getSdkVersion();

1.5 设置帐号区域

  • 描述

根据云平台登录的帐号区域设置,目前区分cn、com

public void setAccountZone(EIvyAccountZone accountZone)
  • 参数
参数名 是否必须 类型 说明
accountZone EIvyAccountZone 帐号区域
  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
SDKManager.getInstance().setAccountZone(EIvyAccountZone.CN);

2.设备添加

2.1 局域网搜索

  • 描述

搜索局域网中的设备

public DiscoveryDev[] discoveryDeviceInWLAN()
  • 返回值

返回数组,实际搜索到的设备信息

  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 引用
package com.ivyiot.ipclibrary.model;

/**
 *  device information by Wlan
 */
public class DiscoveryDev {
    public int version;//version
    public int type;//device type
    public String ip;//ip
    public String mask;//mask
    public String dns;//ddns
    public int port; //port
    public String mac;//mac address
    public String uid;//uid
    public String name;//device name
    public int state;//status
}
  • 示例
 // scan Wlan
DiscoveryDev[] nodes = SDKManager.getInstance().discoveryDeviceInWLAN();

2.2 二维码添加

2.2.1 二维码添加

  • 描述

创建设备配网的二维码信息

public String createQRInfo(String ssid, String wifiPwd)
  • 参数
参数名 是否必须 类型 说明
ssid String wifi名称
wifiPwd String wifi密码
  • 返回值

返回String,二维码内容信息

  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

2.2.2 二维码添加(token)

创建设备配网的二维码信息(token)

public String createQRInfo(String ssid, String wifiPwd,String token)
  • 参数
参数名 是否必须 类型 说明
ssid String wifi名称
wifiPwd String wifi密码
token String token
  • 返回值

返回String,二维码内容信息

  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
 // scan Wlan
DiscoveryDev[] nodes = SDKManager.getInstance().discoveryDeviceInWLAN();

2.2.3 二维码添加(token+不区分国内外)

  • 描述

创建设备配网的二维码信息

public void createIvyQRInfo(String uid, String wifi_ssid, String wifi_pwd,String token)
  • 参数
参数名 是否必须 类型 说明
uid String 设备UID
ssid String wifi名称
wifiPwd String wifi密码
token String 平台token
  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
SDKManager.getInstance().createIvyQRInfo(uid, wifi_ssid, wifi_password, token);

2.3 声波添加

2.3.1 有uid的添加

  • 描述

启动声波添加方式1

public void startSoundWaveAdd(String uid, String wifi_ssid, String wifi_pwd, String token)
  • 参数
参数名 是否必须 类型 说明
uid String 设备UID
ssid String wifi名称
wifiPwd String wifi密码
token String 平台token
  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
 // scan Wlan
SDKManager.getInstance().startSoundWaveAdd(uid, wifi_ssid, wifi_password, token);

2.3.2 无uid的添加

  • 描述

启动声波添加方式2

public void startSoundWaveAdd(String wifi_ssid, String wifi_pwd,String token, int addType)
  • 参数
参数名 是否必须 类型 说明
ssid String wifi名称
wifiPwd String wifi密码
token String 平台token
addType int 0:默认爱为设备 1:新的声波数据格式
  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
 // scan Wlan
SDKManager.getInstance().startSoundWaveAdd(wifi_ssid, wifi_password, token, addType);

2.3.3 带token和不区分国内外的声波添加

  • 描述

创建设备配网的二维码信息

public void startIvySoundWaveAdd(String uid, String wifi_ssid, String wifi_pwd, String token, int deviceType)
  • 参数
参数名 是否必须 类型 说明
uid String 设备UID
ssid String wifi名称
wifiPwd String wifi密码
token String 平台token
deviceType int 0:默认爱为设备 1:其他设备
  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
SDKManager.getInstance().startIvySoundWaveAdd(uid, wifi_ssid, wifi_password, token, deviceType);

3.设备连接

3.1 登陆设备

  • 描述

登陆设备

public void loginDevice(ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);

    void onError(int errorCode);//Result

    void onLoginError(int errorCode);
}


package com.ivyio.sdk;

public class Result {
    public static final int OK = 0;//success
    public static final int FAIL = 1;//fail
    public static final int HANDLE_ERR = 2;//handle error
    public static final int USR_OR_PWD_ERR = 3;//username and password error
    public static final int ARGS_ERR = 4;//param error
    public static final int APITIME_ERR = 5;//api runtime error
    public static final int DENY = 6;// access deny
    public static final int LOCKED = 7;//locked
    public static final int MAX_USER = 8;//max users
    public static final int TALK_OPENED_BY_OTHERS = 9;//talk by others
    public static final int CANCEL_BY_USER = 10;//cancel by user
    public static final int TIMEOUT = 11;//time out
    public static final int UNSUPPORT = 12;//not support
    public static final int UNKNOWN = 13;//unknown
    public static final int OFFLINE = 14;//device offile
    public static final int OK_ON_RESET_STATE = 15;//reset state
    public static final int NO_PERMISSION = 16;//no permission

    public Result() {
    }
}
  • 示例
camera.loginDevice(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {
        //login success
    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {
        //login fail,See the Result.class for error codes
    }
});

3.2 获取连接句柄

  • 描述

获取设备的连接句柄,一般用于保持设备的连接

public int getHandle()
  • 返回值

当前SDK连接句柄整型数据,从1开始,值会递增

  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 示例
IvyCamera.getHandle();

3.3 设备连接状态

  • 描述

检查设备的连接状态

public int checkHandle()
  • 返回值

设备状态

说明
0 初始化状态
1 正在连接
2 设备在线
3 设备离线
4 达到最大用户数
5 设备被锁
6 用户名或者密码错误
7 拒绝访问
8 未知
9 非法句柄
10 用户取消操作
11 恢复出厂状态
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyio.sdk;

public class HandleState {
    public static final int HANDLE_STATE_INIT = 0;//init
    public static final int HANDLE_STATE_CONNECTTING = 1;//connectting
    public static final int HANDLE_STATE_ONLINE = 2;//online
    public static final int HANDLE_STATE_OFFLINE = 3;//offLine
    public static final int HANDLE_STATE_MAX_USERS = 4;//max user
    public static final int HANDLE_STATE_LOCK = 5;//lock
    public static final int HANDLE_STATE_USR_OR_PWD_ERR = 6;//username or password error
    public static final int HANDLE_STATE_DENY = 7;//deny
    public static final int HANDLE_STATE_UNKNOWN = 8;//unknown
    public static final int HANDLE_STATE_INVALID_HANDLE = 9;//invalid handle
    public static final int HANDLE_STATE_CANCEL_BY_USR = 10;//cancel by user
    public static final int HANDLE_STATE_ON_RESET = 11;//reset

    public HandleState() {
    }
  • 示例
IvyCamera.checkHandle();

3.4 释放连接

  • 描述

释放连接 ,句柄销毁

public void destroy()
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 示例
IvyCamera.destroy();
  1. 调用此接口后,对应的SDK实例占用内存全部被释放;
  2. 请不要在不同线程销毁相同句柄,SDK无法处理这种操作,会引起Crash;
  3. 因为SDK为了让多个销毁操作可以同时进行,无法保证同一个句柄销毁的问题;如果SDK保证了同一句柄在不同线程销毁,那么当遇到多个句柄同时销毁的情况,运行速度会变的很慢,因为SDK必须使用同步保证句柄逐个销毁。

3.5 修改设备用户名和密码

  • 描述

修改设备的用户名和密码

public void modifyUsrNameAndPwd(final String newUsrName, final String newPwd, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
newUsrName String 新用户名
newPwd String 新密码
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

  • 示例

建议设备处于重置状态时调用

IvyCamera.modifyUsrNameAndPwd("fos", "abc123", new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

3.6 设备事件监听

3.6.1 绑定事件监听

  • 描述

绑定事件监听(添加观察者)

public synchronized void addObserver(Observer o)
  • 参数
参数名 是否必须 类型 说明
o Observer 实现Observable的观察者对象
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
  public void update(Observable o, Object arg) {
        if (arg != null) {
            Message msg = (Message) arg;
            //msg.what对应EventID里面的值, msg.obj对应消息内容
            Log.e(TAG, "update: " + msg.what + ";data=" + msg.obj);
        }
    }


public class EventID {
    /** 基站在线状态变化消息id, APP定义的。 */
    public static final int BASESTATION_HANLE_STATE_CHG = 54225;

    //连接断开
    public static final int NET_STATE_DISCONNECT = 88;

    public static final int IVY_CTRL_MSG_ONLINE_UPGRADE_STATE = 42019;
    public static final int IVY_CTRL_MSG_IPCLIST_CHG = 42020;
    // 镜像翻转
    public static final int IVY_CTRL_MSG_MIRROR_FLIP_CHG = 42021; // for foscam device
    // 红外状态变化的消息
    public static final int IVY_CTRL_MSG_DAY_NIGHT_MODE_CHG = 42022; // (IRCUT? For foscam device)
    // 预置点
    public static final int IVY_CTRL_MSG_PRESET_CHG = 42023; // for foscam device
    // 巡航路径
    public static final int IVY_CTRL_MSG_CRUISE_CHG = 42024; // for foscam device
    public static final int IVY_CTRL_MSG_PRESET_REACHED = 42025; // for foscam device
    public static final int IVY_CTRL_MSG_CURRENT_CRUISE_MAP_STATE_CHG = 42026; // for foscam device
    // PT到达边缘
    public static final int IVY_CTRL_MSG_EDGE_ARRIVED = 42027; // for foscam device
    public static final int IVY_CTRL_MSG_START_PLAY_RESULT = 42028; // only for foscam device
    public static final int IVY_CTRL_MSG_GET_PRODUCT_ALL_INFO = 42029; // only for foscam device
    public static final int IVY_CTRL_MSG_CHANNEL_STATE_CHG = 42030; // for foscam nvr and bpi
    public static final int IVY_CTRL_MSG_ARRIVE_MAX_DURATION = 42031; // only for foscam bpi
    public static final int IVY_CTRL_MSG_EXT_STATE_CHG = 42032; // only for foscam bpi
    //主码流 ipc码流信息
    public static final int IVY_CTRL_MSG_STREAM_PARAM_CHG = 42033; // only for foscam ipc
    //子码流 ipc码流信息
    public static final int IVY_CTRL_MSG_SUB_STREAM_PARAM_CHG = 42034; // only for foscam ipc
    public static final int IVY_CTRL_MSG_STREAM_TYPE_CHG = 42035; // only for foscam ipc
    public static final int IVY_CTRL_MSG_SUB_STREAM_TYPE_CHG = 42036; // only for foscam ipc
    public static final int IVY_CTRL_MSG_ABILITY_CHG = 42037; // Foscam NVR BPI use, maybe IVY Nvr use
    public static final int IVY_CTRL_MSG_VOLUME_CHG = 42038; // Foscam IPC use
    // 本地录像:本地存储空间不足
    public static final int IVY_CTRL_MSG_RECORD_ERROR_NO_ENOUGE_SPACE = 2052; // Foscam IPC use
    // 本地录像:录像文件大小达到最大值
    public static final int IVY_CTRL_MSG_RECORD_ERROR_MAX_FILE = 2053; // Foscam IPC use
    // 本地录像:分辨率切换
    public static final int IVY_CTRL_MSG_RECORD_ERROR_SOLUTION_CHG = 2054;   // Foscam IPC use
    // 本地录像:录像文件不存在
    public static final int IVY_CTRL_MSG_RECORD_ERROR_FILE_PATH_NOEXIST = 2055;  // Foscam IPC use
    // 本地录像:其他错误
    public static final int IVY_CTRL_MSG_RECORD_ERROR_UNKNOW = 2056; // Foscam IPC use
    public static final int IVY_CTRL_MSG_MUSIC_STATE_CHG = 42044;// Foscam IPC use
    public static final int IVY_CTRL_MSG_BIND_DEVICE_STATE_CHG = 42045; // Foscam BPI use, mybe IVY BPI use
    /**视频档位*/
    public static final int IVY_CTRL_MSG_VIDEO_STREAM_MODE = 42046;
    public static final int IVY_CTRL_MSG_RECORD_DOWNLOAD_PROGRESS = 2063; //   下载进度事件 (id=)
}

  • 示例
IvyCamera.addObserver(Object);

3.6.1 解绑事件监听

  • 描述

解绑事件监听(移除观察者)

public synchronized void deleteObserver(Observer o)
  • 参数
参数名 是否必须 类型 说明
o Observer 实现Observable的观察者对象
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
public class EventID {
    /** 基站在线状态变化消息id, APP定义的。 */
    public static final int BASESTATION_HANLE_STATE_CHG = 54225;

    //连接断开
    public static final int NET_STATE_DISCONNECT = 88;

    public static final int IVY_CTRL_MSG_ONLINE_UPGRADE_STATE = 42019;
    public static final int IVY_CTRL_MSG_IPCLIST_CHG = 42020;
    // 镜像翻转
    public static final int IVY_CTRL_MSG_MIRROR_FLIP_CHG = 42021; // for foscam device
    // 红外状态变化的消息
    public static final int IVY_CTRL_MSG_DAY_NIGHT_MODE_CHG = 42022; // (IRCUT? For foscam device)
    // 预置点
    public static final int IVY_CTRL_MSG_PRESET_CHG = 42023; // for foscam device
    // 巡航路径
    public static final int IVY_CTRL_MSG_CRUISE_CHG = 42024; // for foscam device
    public static final int IVY_CTRL_MSG_PRESET_REACHED = 42025; // for foscam device
    public static final int IVY_CTRL_MSG_CURRENT_CRUISE_MAP_STATE_CHG = 42026; // for foscam device
    // PT到达边缘
    public static final int IVY_CTRL_MSG_EDGE_ARRIVED = 42027; // for foscam device
    public static final int IVY_CTRL_MSG_START_PLAY_RESULT = 42028; // only for foscam device
    public static final int IVY_CTRL_MSG_GET_PRODUCT_ALL_INFO = 42029; // only for foscam device
    public static final int IVY_CTRL_MSG_CHANNEL_STATE_CHG = 42030; // for foscam nvr and bpi
    public static final int IVY_CTRL_MSG_ARRIVE_MAX_DURATION = 42031; // only for foscam bpi
    public static final int IVY_CTRL_MSG_EXT_STATE_CHG = 42032; // only for foscam bpi
    //主码流 ipc码流信息
    public static final int IVY_CTRL_MSG_STREAM_PARAM_CHG = 42033; // only for foscam ipc
    //子码流 ipc码流信息
    public static final int IVY_CTRL_MSG_SUB_STREAM_PARAM_CHG = 42034; // only for foscam ipc
    public static final int IVY_CTRL_MSG_STREAM_TYPE_CHG = 42035; // only for foscam ipc
    public static final int IVY_CTRL_MSG_SUB_STREAM_TYPE_CHG = 42036; // only for foscam ipc
    public static final int IVY_CTRL_MSG_ABILITY_CHG = 42037; // Foscam NVR BPI use, maybe IVY Nvr use
    public static final int IVY_CTRL_MSG_VOLUME_CHG = 42038; // Foscam IPC use
    // 本地录像:本地存储空间不足
    public static final int IVY_CTRL_MSG_RECORD_ERROR_NO_ENOUGE_SPACE = 2052; // Foscam IPC use
    // 本地录像:录像文件大小达到最大值
    public static final int IVY_CTRL_MSG_RECORD_ERROR_MAX_FILE = 2053; // Foscam IPC use
    // 本地录像:分辨率切换
    public static final int IVY_CTRL_MSG_RECORD_ERROR_SOLUTION_CHG = 2054;   // Foscam IPC use
    // 本地录像:录像文件不存在
    public static final int IVY_CTRL_MSG_RECORD_ERROR_FILE_PATH_NOEXIST = 2055;  // Foscam IPC use
    // 本地录像:其他错误
    public static final int IVY_CTRL_MSG_RECORD_ERROR_UNKNOW = 2056; // Foscam IPC use
    public static final int IVY_CTRL_MSG_MUSIC_STATE_CHG = 42044;// Foscam IPC use
    public static final int IVY_CTRL_MSG_BIND_DEVICE_STATE_CHG = 42045; // Foscam BPI use, mybe IVY BPI use
    /**视频档位*/
    public static final int IVY_CTRL_MSG_VIDEO_STREAM_MODE = 42046;
    public static final int IVY_CTRL_MSG_RECORD_DOWNLOAD_PROGRESS = 2063; //   下载进度事件 (id=)
}

  • 示例
camera.deleteObserver(Object);

3.7 根据设备uid获取出厂密码

  • 描述

根据设备uid获取出厂密码

public String getFactoryPassword(String uid)
  • 参数
参数名 是否必须 类型 说明
uid String 设备的uid
  • 返回值

设备出厂密码

  • 所在类

com.ivyiot.ipclibrary.sdk.SDKManager

  • 示例
SDKManager.getInstance().getFactoryPassword();

4.设备基本信息

4.1 获取设备信息

  • 描述

获取设备信息

public void getDevInfo(final ISdkCallback<DevInfo> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * 设备基础信息
 */
public class DevInfo {
    /** 设备类型 {@link com.ivyio.sdk.DevType} */
    public int devType;
    /** 平台类型 */
    public int platType;
    /** sensor类型 */
    public int sensorType;
    /** wifi类型 */
    public int wifiType;
    /** 语言 */
    public int language;
    /** 产品名字 */
    public String productName;
    /** 设备名 */
    public String devName;
    /** 应用固件版本号 */
    public String firmwareVersion;
    /** 系统固件版本号 */
    public String hardwareVersion;
    /** 序列号 */
    public String serialNo;
    /** 设备UID */
    public String uid;
    /** NAC 地址 */
    public String mac;
    /** OEM 码 */
    public int oemCode;
}
  • 示例
IvyCamera.getDevInfo(new ISdkCallback<DevInfo>() {
    @Override
        public void onSuccess(DevInfo result) {
        Log.e(TAG, "getDevInfo onSuccess. uid= " + result.uid + " ,mac= " + result.mac);
    }

    @Override
        public void onError(int errorCode) {
        Log.e(TAG, "getDevInfo onError:" + errorCode);
    }

    @Override
        public void onLoginError(int errorCode) {
        Log.e(TAG, "getDevInfo onLoginError:" + errorCode);
    }
});

4.2 获取设备能力集

  • 描述

获取设备能力集,包含设备的所有标志位

public void getDevAbility(final ISdkCallback<DevAbility> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * 设备能力集
 */
public class DevAbility {

    /** Model number */
    public int model;
    /** Whether machine support sd card */
    public boolean sdFlag;
    /** Whether machine is outdoor */
    public boolean outdoorFlag;
    /**
     * Whether machine support pt
     */
    public boolean isEnablePTZ;
    /** Whether machine support zoom */
    public boolean zoomFlag;
    /** Whether machine support rs485 */
    public boolean rs485Flag;
    /** Whether machine support io alarm */
    public boolean ioAlarmFlag;
    /** Whether machine support onvif */
    public boolean onvifFlag;
    /** Whether machine support p2p */
    public boolean p2pFlag;
    /** Whether machine support wps */
    public boolean wpsFlag;
    /** Whether machine support audio-speak */
    public boolean audioFlag;
    /** Whether machine support audio-talk */
    public boolean talkFlag;
    /** 是否支持全双工 */
    public boolean bDuplexVoice;
    /** for foscam device */
    public boolean bNetworkAdapter;
    /** true:只支持切换码流,false:切换分辨率 */
    public boolean bStreamMode;
    /** true:支持区域选择:false:不支持区域选择 */
    public boolean bMotionArea;
    /** 是否支持一键呼叫 */
    public boolean bOneKeyCall;
    /** 是否支持夜视计划 是否只支持AUTO IR(如果只支持AUTO IR,就不支持手动设置和计划设置)*/
    public boolean bNightVisionSchedule;
    /** Camera application version */
    public String appVer;
    /** 0 or 1 */
    public boolean isEnableAudioDetect;
    public boolean isEnableTemperatureDetect;
    public boolean isEnableHumidityDetect;
    public boolean isEnablePIRDetect;
    public boolean isEnableLedOnOff;
    public boolean isEnableNightLight;
    /***ipc tip voice val4 : 9*/
    public boolean isEnableIpcTipVoice;

    public boolean isEnableChangeVoice;

    public boolean isEnableWdr;
    /**是否支持SD卡格式化 val6 : 2*/
    public boolean isEnableSDCardFormat;

    /**是否支持小语种*/
    public boolean isEnableMinorLanguage;

    // Bit[4]: 是否支持refocus,为1支持,为0不支持 val6:4;
    public boolean isRefocus;
    //是否支持SD卡录像时间轴功能 val12:5
    public boolean isEnableSDCardTimeLine;
    //是否支持调节对讲音量
    public boolean isEnableSpeakVolume;
    //ability 能力集
    public long abilityArray[] = new long[3];
    //OSD 显示设备名称
    public boolean isEnableSHowDeviceName;
    //OSD 显示设备时间
    public boolean isEnableShowDeviceTime;
    //是否支持图像镜像
    public boolean isEnableMirror;
    //是否支持图像翻转
    public boolean isEnableFlip;
    //是否支持欧姆龙人脸检测算法
    public boolean isEnableOMLFaceAlgorithm;
    //是否支持神马全双工算法
    public boolean isEnableSMFullDuplex;

    //是否支持 ringbell
    public boolean isEnableRingBell;
    //是否支持isSupportlV1PIR
    public boolean isEnablelV1PIR;
    //是否支持isSupportlV3PIR
    public boolean isEnablelV3PIR;
    //是否支持isSupportWhiteLight
    public boolean isEnableWhiteLight;

    /** 是否支持 dropbox 云存储,false表示支持百度云存储(fosbaby内外销系列都只支持百度云存储) */
    public boolean isEnableDropboxStorage;

    /** 是否支持 百度推送 */
    public boolean enableBaiduPush;
    /** 是否支持 Foscam 推送 */
    public boolean enableFoscamPush;
    /** 是否支持 Foscam 存储 */
    public boolean enableFoscamStorage;
    /** 是否支持 Foscam 富媒体推送 */
    public boolean enableFoscamRichPush;
    /** 是否支持 Alexa */
    public boolean enableAlexa;
    /** 是否支持 7*24 小时云存储 */
    public boolean enable24HStorage;
    /** 是否支持 告警录像时长设置 */
    public boolean enableRecordTimeSet;
    /** 是否支持 APP 预置位巡航 */
    public boolean enablePresetCruise;
    /** 是否支持 SmartHome */
    public boolean enableSmartHome;

    //============= val 2 (reserve2) =============
    /** 是否支持 框外侦测 */
    public boolean enableOutSideDetect;
    /** 是否支持 IV侦测 */
    public boolean enableIVDetect;
    /** 是否支持 人体侦测--爱华盈通 */
    public boolean enableHumanDetect_aiwinn;
    /** 是否支持 人体侦测--珊口 */
    public boolean enableHumanDetect_sanko;
    /** 欧姆龙人形算法 val2 10 */
    public boolean enableOMLPedestrianDetect;
    //============= val 3 (reserve3) =============
    /** 是否支持 童谣 0*/
    public boolean enableBabyMusic;
    /** 是否支持 芯片加密 */
//    public boolean enableChipEncrypt;
    /** 是否支持 SoftAP */
//    public boolean enableSoftAP;
    /** 是否支持 EZLink(不区分芯片,不表示是否支持IPC扫码) */
//    public boolean enableEZLink;
    /** 是否支持 PPPoE */
//    public boolean enablePPPoE;
    /** 是否支持 夜视红外功能 */
    public boolean isEnableNightIRCut;
    /**val3 : 7 双灯源功能*/
    public boolean isEnableDualLampSource;

    /**HDR val4 : 7*/
    public boolean isEnableHDR;
    /**定时重启 val4: 2*/
    public boolean isEnableTimingReboot;
    /**是否支持H264/H265切换 val9: 2*/
    public boolean isEnableSwitchH264H265;
    /**是否支持休眠 val9: 3*/
    public boolean isEnableSleepMode;

    /**是否支持SIREN联动(Foscam) val10: 4*/
    public boolean isEnableSiren;

    /**是否支持人形跟踪(Foscam) val10: 6*/
    public boolean isEnableHumanoidTracking;
    /**隐私区域遮挡 val11: 0*/
    public boolean isEnablePrivacyMask;
    /**是否支持遮挡镜头报警 val11 : 1*/
    public boolean isEnableCameraLensOcclusion;
    /**报警档位。0表示支持5档或默认,1表示支持3个档位 val11:2*/
    public boolean isEnableAlertSensitivity_3;
    /**侦测区域个数。0表示支持其他机型默认侦测个数,1表示支持2个侦测区域个数。 val11:3*/
    public boolean isEnableAlarmArea_2;
    /**是否支持自定义报警声音 val11:4*/
    public boolean isEnableCustomAlarmTone;
    /**是否支持设备报警录像时长设置 val12:1*/
    public boolean isEnableAlarmRecordingDuration;

    /**是否支持白光灯亮度调节 val12:4*/
    public boolean isEnableWhiteLightSetting;
    // 是否支持自动对焦功能 val6: 0
    public boolean isEnableAutoFocus;
    /**是否支持下载图片 val12:4*/
    public boolean isEnableNewPictureType;
}
  • 示例
IvyCamera.getDevAbility(new ISdkCallback<DevInfo>() {
    @Override
        public void onSuccess(DevInfo result) {
        Log.e(TAG, "getDevAbility onSuccess.);
    }

    @Override
        public void onError(int errorCode) {
        Log.e(TAG, "getDevAbility onError:" + errorCode);
    }

    @Override
        public void onLoginError(int errorCode) {
        Log.e(TAG, "getDevAbility onLoginError:" + errorCode);
    }
});

5.实时播放相关

5.1 实时播放

5.1.1 打开实时播放

  • 描述

打开实时播放

public void openVideo(final IvyCamera camera, final IVideoListener videoListener)
  • 参数
参数名 是否必须 类型 说明
camera IvyCamera 设备对象
videoListener IVideoListener 视频播放回调
  • 所在类

com.ivyiot.ipclibrary.video.VideoSurfaceView

  • 引用

com.ivyiot.ipclibrary.model.IvyCamera

package com.ivyiot.ipclibrary.video;

/**
 * 视频播放监听
 */
public interface IVideoListener {
    /** 图片抓拍 */
    void snapFinished(byte[] rgb);

    /** 获取到第一帧*/
    void firstFrameDone(Bitmap rgb);

    void openVideoSucc();

    void openVideoFail(int errorCode);

    void closeVideoSucc();

    void closeVideoFail(int errorCode);
    /**网络流量速度*/
    void netFlowSpeedRefresh(String speedValue);
}
  • 示例
VideoSurfaceView.openVideo(IvyCamera, IVideoListener);

5.1.2 关闭实时播放

  • 描述

关闭实时播放

public void closeVideo()
  • 所在类

com.ivyiot.ipclibrary.video.VideoSurfaceView

  • 示例
VideoSurfaceView.closeVideo();

必须和VideoSurfaceView.openVideo(IvyCamera)方法对应上,一个Open对应一个Close且顺序不能弄错,不然会导致无法正常播放。


5.1.3 抓拍

  • 实时播放抓拍,抓拍到本地存为图片
public void snap(boolean hasSound, String imgPath, ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
hasSound boolean 是否需要抓拍声音
imgPath String 图片的绝对路径,一般文件后缀为.jpg
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.video.VideoSurfaceView

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

  • 示例

需要能正常播放时才能抓拍成功,抓拍前需要文件的读写权限

IvyCamera.snap(hasSound, imgPath, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.2 清晰度切换

5.2.1 获取码流类型

  • 描述

获取码流类型

public int getStreamType()
  • 返回值

主码流(0) or 子码流(1),见引用StreamMode

  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.model;

public class StreamMode {
    /** main stram*/
    public static final int STREAM_MAIN = 0;
    /** sub stram*/
    public static final int STREAM_SUB = 1;
}

5.2.2 设置码流类型

  • 描述

设置 主码流(0) or 子码流(1)

public void setStreamType(int streamType)
  • 参数
参数名 是否必须 类型 说明
streamType int 主码流 0,子码流 1 ,见引用StreamMode
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.model;

public class StreamMode {
    /** main stram*/
    public static final int STREAM_MAIN = 0;
    /** sub stram*/
    public static final int STREAM_SUB = 1;
}
  • 示例
IvyCamera.setStreamType(StreamMode.STREAM_MAIN);

5.2.3 获取清晰度配置

  • 描述

根据设备信息和能力集获取当前的清晰度配置

public EDefinitionItem getDefinitionItems(DevAbility devAbility, int sensorType)
  • 参数
参数名 是否必须 类型 说明
devAbility DevAbility 设备能力集
sensorType int 设备sensor类型,包含在DevInfo
  • 返回值

清晰度集合

说明
NORMAL 适用于大部分机型
MSTAR_400W Mstar 400W机型
MSTAR_313E Mstar 313E机型
LOWEST 主次码流切换的机型
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.model;



/**
 * 清晰度配置
 */
public enum EDefinitionItem {
    /**
     * 普通大众
     */
    NORMAL(new EResolutionMode[]{EResolutionMode.FHD, EResolutionMode.HD, EResolutionMode.SD}),
    /**
     * Mstar 400W
     */
    MSTAR_400W(new EResolutionMode[]{EResolutionMode.QHD, EResolutionMode.FHD, EResolutionMode.HD}),
    /**
     * Mstar 313E
     */
    MSTAR_313E(new EResolutionMode[]{EResolutionMode.FHD, EResolutionMode.HD}),
    /**
     * 主子码流切换,NVR等
     */
    LOWEST(new EResolutionMode[]{EResolutionMode.FHD, EResolutionMode.SD});

    /**
     * 当前
     */
    private EResolutionMode[] _currRules;

    /**
     * 构造函数
     */
    EDefinitionItem(EResolutionMode[] rules) {
        this._currRules = rules;
    }



    public int getLength(){
        return _currRules.length;
    }

    public EResolutionMode[] getCurrRules(){
        return _currRules;
    }




    /**
     * 分辨率选项
     */
    public enum EResolutionMode {
        QHD,
        FHD,
        HD,
        SD
    }

}

  • 示例
IvyCamera.getDefinitionItems(devAbility, devInfo);

5.2.4 设置清晰度

  • 描述

设置清晰度,针对包含三个清晰度级别的切换

public void changeDefinition(final int definition, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
definition int 清晰度数组EDefinitionItem下标
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例

必须要传入获取到的清晰度数组下标

IvyCamera.changeDefinition(index, ISdkCallback);

5.2.5 子码流切换

  • 描述

子码流切换,对应只支持主、子码流切换的机型,一般对应两个清晰度级别的切换

public void changeStream(final int index )
  • 参数
参数名 是否必须 类型 说明
index int 清晰度数组EDefinitionItem下标
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

5.3 监听

5.3.1 打开监听

  • 描述

打开音频

public void openAudio(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

  • 示例

调用此接口后,声音通道被打开,需要手动获取声音数据并播放出来。详见com.ivyiot.ipclibrary.audio.AudioThread

IvyCamera.openAudio(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {
        if (null == audioThread) {
            /**
             * @param camera IvyCamera对象
             * @param isEnableSMFullDuplex 是否支持SM回音消除,字段值从能力集获取
             */
            audioThread = new AudioThread(IvyCamera, isEnableSMFullDuplex);
            audioThread.startAudio();
            audioThread.start();
        }
    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.3.2 关闭监听

  • 描述

关闭音频

public void closeAudio(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

  • 示例

关闭监听后,需要手动停止音频播放。详见com.ivyiot.ipclibrary.audio.AudioThread

IvyCamera.closeAudio(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {
        if (null != audioThread) {
            audioThread.stopAudio();
            audioThread = null;
        }
    }

    @Override
        public void onError(int errorCode) {
    }

    @Override
        public void onLoginError(int errorCode) {
    }
});

5.4 对讲

5.4.1 打开对讲

  • 描述

打开对讲,android 6.0以上需要运行时访问麦克风权限

public void openTalk(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例

调用接口后需要手动收集手机麦克风采集到的数据发送到设备端,详见com.ivyiot.ipclibrary.audio.TalkThread

IvyCamera.openTalk(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {
        if (null == talkThread) {
            /**
             * @param camera IvyCamera对象
             * @param isEnableSMFullDuplex 是否支持SM回音消除,字段值从能力集获取
             */
            talkThread = new TalkThread(camera, false);
            talkThread.startTalk();
            talkThread.start();
        }
    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.4.2 关闭对讲

  • 描述

关闭对讲

public void closeTalk(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例

关闭对讲后,需手动停止发送数据,详见com.ivyiot.ipclibrary.audio.TalkThread

IvyCamera.closeTalk(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {
        if (null != talkThread) {
            talkThread.stopTalk();
            talkThread = null;
        }
    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.5 本地录像

5.5.1 开始录像

  • 描述

开始录像。需要成功获取到视频流数据之后才有效。

 public void startRecord(String filePath, ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
filePath String 视频文件存储的全路径(包含文件名,后缀为.mp4
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.startRecord(filePath, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.5.2 停止录像

  • 描述

停止录像

public void stopRecord(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.stopRecord(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.6 镜像翻转

5.6.1 获取镜像翻转配置

  • 描述

获取设备的镜像翻转设置

 public void getMirrorAndFlip(final ISdkCallback<Integer[]> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例

回调中返回 Integer 数组,包含两个元素,第一个为 mirror 的开关状态,第二个为 flip 的开关状态。1 表示开,0 表示关。

IvyCamera.getMirrorAndFlip(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.6.2 设置视频翻转

  • 描述

设置视频翻转开关

public void setFlip(final int enable, final ISdkCallback<Integer> callback)
  • 参数
参数名 是否必须 类型 说明
enable int 开关状态 1 开,0 关
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setFlip(enable, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.6.3 设置视频镜像

  • 描述

设置视频镜像开关

public void setMirror(final int enable, final ISdkCallback<Integer> callback)
  • 参数
参数名 是否必须 类型 说明
enable int 开关状态 1 开,0 关
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setMirror(enable, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.7 红外模式

5.7.1 获取红外模式

  • 描述

获取红外模式及开关

public void getInfraredLed(final ISdkCallback<Integer[]> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用
package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例

回调中返回 Integer 数组,包含两个元素,第一个为 mode,第二个为 onoff;
mode: 0 Auto mode , 1 Manual mode; onoff: 1 open , 0 close

IvyCamera.getInfraredLed(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.7.2 设置红外模式

  • 描述

设置红外模式及开关

public void setInfraredLed(final int mode, final int onOff, final ISdkCallback<Integer[]> callback)
  • 参数
参数名 是否必须 类型 说明
mode int 红外模式(0: 自动 1: 手动 2: 计划).
onOff int 红外打开状态 (1:open 0:close),只有在手动模式下(mode=1)生效
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

    private enum EInfraLedMode {
        /**
         * 自动
         */
        AUTO,
        /**
         * 手动
         */
        MANUEL,
        /**
         * 定时
         */
        SCHEDULE
    }
  • 示例
IvyCamera.setInfraredLed(EInfraLedMode, onOff, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.8 云台相关

5.8.1 云台控制

  • 描述

通过该接口控制 ipc 云台的 8 个方向转动,及停止,zoomIn, zoomOut, focusFar, focusNear

public void ptzControl(final int ptzCmd, final ISdkCallback<Integer> callback)
  • 参数
参数名 是否必须 类型 说明
ptzCmd int 云台的命令ID,见引用PTZCmd
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * PTZ 控制命令
 */
public class PTZCmd {
    public static final int PTZ_STOP = 0;
    public static final int PTZ_RESET = 1;
    public static final int PTZ_MOVE_UP = 2;
    public static final int PTZ_MOVE_DOWN = 3;
    public static final int PTZ_MOVE_LEFT = 4;
    public static final int PTZ_MOVE_RIGHT = 5;
    public static final int PTZ_MOVE_LEFTUP = 6;
    public static final int PTZ_MOVE_LEFTDOWN = 7;
    public static final int PTZ_MOVE_RIGHTUP = 8;
    public static final int PTZ_MOVE_RIGHTDOWN = 9;
    public static final int PTZ_SET_SPEED = 10;
    public static final int PTZ_ZOOM_IN = 11;
    public static final int PTZ_ZOOM_OUT = 12;
    public static final int PTZ_ZOOM_STOP = 13;
    public static final int PTZ_SET_ZOOM_SPEED = 14;
    public static final int PTZ_GET_ZOOM_SPEED = 15;
    public static final int PTZ_FOCUS_NEAR = 16;
    public static final int PTZ_FOCUS_FAR = 17;
    public static final int PTZ_FOCUS_STOP = 18;
    public static final int PTZ_GOTO_SLEEP = 19;
    public static final int PTZ_GOTO_WAKEUP = 20;
    public static final int PTZ_SET_PRESET_POINT = 21;
    public static final int PTZ_GOTO_PRESET_POINT = 22;
    public static final int PTZ_CLEAR_PRESET_POINT = 23;
    public static final int PTZ_GET_PRESET_POINT_LIST = 24;
    public static final int PTZ_SET_GUARD_POSITION = 25;
    public static final int PTZ_GET_GUARD_POSITION = 26;
    public static final int PTZ_START_CRUISE = 27;
    public static final int PTZ_STOP_CRUISE = 28;
    public static final int PTZ_SET_CURISE_MAP = 29;
    public static final int PTZ_CLEAR_CURISE = 30;
    public static final int PTZ_GET_CRUISE_MAP_INFO = 31;
    public static final int PTZ_SET_CURISE_CTRL_TIME = 32;
    public static final int PTZ_GET_CRUISE_MAP_LIST = 33;
    public static final int PTZ_SET_CRUISE_CTRL_MODE = 34;
    public static final int PTZ_GET_CRUISE_CTRL_MODE = 35;
    public static final int PTZ_SET_CRUISE_TIME_CUSTOMED = 36;
    public static final int PTZ_GET_CRUISE_TIME_CUSTOMED = 37;
    public static final int PTZ_SET_CRUISE_TIME = 38;
    public static final int PTZ_GET_CRUISE_TIME = 39;
    public static final int PTZ_SET_SELF_TEST_MODE = 40;
    public static final int PTZ_GET_SELF_TEST_MODE = 41;
    public static final int PTZ_SET_PRE_POINT_FOR_SELF_TEST = 42;
    public static final int PTZ_GET_PRE_POINT_FOR_SELF_TEST = 43;
}
  • 示例
public boolean onTouch(View v, MotionEvent event) {
    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN: {// XXX MotionEvent.ACTION_DOWN
            switch (v.getId()) {
                case R.id.imgbtn_ptz_up://云台上
                IvyCamera.ptzControl(PTZCmd.PTZ_MOVE_UP, null);
                break;
                case R.id.imgbtn_ptz_down://云台下
                IvyCamera.ptzControl(PTZCmd.PTZ_MOVE_DOWN, null);
                break;
                case R.id.imgbtn_ptz_left://云台左
                IvyCamera.ptzControl(PTZCmd.PTZ_MOVE_LEFT, null);
                break;
                case R.id.imgbtn_ptz_right://云台右
                IvyCamera.ptzControl(PTZCmd.PTZ_MOVE_RIGHT, null);
                break;
                case R.id.imgbtn_ptz_center://云台恢复
                IvyCamera.ptzControl(PTZCmd.PTZ_RESET, null);
                break;
                case R.id.imgbtn_ptz_zoomadd://变焦+
                IvyCamera.ptzControl(PTZCmd.PTZ_ZOOM_IN, null);
                break;
                case R.id.imgbtn_ptz_zoomreduce://变焦-
                IvyCamera.ptzControl(PTZCmd.PTZ_ZOOM_OUT, null);
                break;
                case R.id.imgbtn_ptz_focusadd://对焦+
                IvyCamera.ptzControl(PTZCmd.PTZ_FOCUS_FAR, null);
                break;
                case R.id.imgbtn_ptz_focusreduce://对焦-
                IvyCamera.ptzControl(PTZCmd.PTZ_FOCUS_NEAR, null);
                break;
            }
        }
        break;
        case MotionEvent.ACTION_UP:
        case MotionEvent.ACTION_CANCEL: {
            switch (v.getId()) {
                case R.id.imgbtn_ptz_up://云台上停止
                case R.id.imgbtn_ptz_down://云台下停止
                case R.id.imgbtn_ptz_left://云台左停止
                case R.id.imgbtn_ptz_right://云台右停止
                IvyCamera.ptzControl(PTZCmd.PTZ_STOP, null);
                break;
                case R.id.imgbtn_ptz_zoomadd://变焦+停止
                case R.id.imgbtn_ptz_zoomreduce://变焦-停止
                IvyCamera.ptzControl(PTZCmd.PTZ_STOP, true);
                break;
                case R.id.imgbtn_ptz_focusadd://对焦+停止
                case R.id.imgbtn_ptz_focusreduce://对焦-停止
                IvyCamera.ptzControl(PTZCmd.PTZ_FOCUS_STOP, true);
                break;
            }
        }
        break;
    }
    return false; // return false表示系统会继续处理
}

5.8.2 云台预置位获取

  • 描述

云台预置位集合获取

public void getPTZPresetList(final ISdkCallback<ResetPointList> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public class ResetPointList {
    /**result*/
    public int result;
    /** Current preset point count */
    public int pointCnt;
    /** The name of point */
    public String[] pointName;
}
  • 示例
IvyCamera.getPTZPresetList(new ISdkCallback<ResetPointList>() {
    @Override
        public void onSuccess(ResetPointList result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.8.3 执行云台预置位

  • 描述

执行对应预置位

public void goToPTZPresetPoint(final String pointName, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
pointName String 预置位名称,一般对应预置位列表中的预置位
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.goToPTZPresetPoint("TopMost", new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.8.4 添加预置位

  • 描述

添加预置位

public void addPTZPreset(final String pointName, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
pointName String 预置位名称,一般为英文,并且不能和已有重复
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.addPTZPreset("test1", new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.8.5 删除预置位

  • 描述

删除预置位

public void deletePTZPreset(final String pointName, final ISdkCallback<ResetPointList> callback)
  • 参数
参数名 是否必须 类型 说明
pointName String 预置位名称,一般对应预置位列表中的预置位
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public class ResetPointList {
    /**result*/
    public int result;
    /** Current preset point count */
    public int pointCnt;
    /** The name of point */
    public String[] pointName;
}
  • 示例
IvyCamera.deletePTZPreset("test1", new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.8.6 执行巡航

  • 描述

开始巡航,包含水平、垂直、定点巡航

public void startPTZCruise(final String cruiseName, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
cruiseName String 巡航名称 Horizontal、Vertical、AllPresetPoint
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.startPTZCruise("Horizontal", new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

5.8.7 停止巡航

  • 描述

停止巡航

public void stopPTZCruise(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.stopPTZCruise(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

6.SD卡

6.1 SD卡基本操作

6.1.1 查询SD卡信息

  • 描述

获取设备中 sd 卡信息

public void getSDInfo(final ISdkCallback<DevSDInfo> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

/**
 * ipc 中的 sd 卡信息
 */
public class DevSDInfo {
    /** 是否存在SD卡 */
    public boolean isExist;
    /** 剩余空间,单位:Byte */
    public long freeSpace;
    /** 总空间,单位:Byte */
    public long totalSpace;
}
  • 示例
IvyCamera.getSDInfo(new ISdkCallback<DevSDInfo>() {
    @Override
        public void onSuccess(DevSDInfo result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

6.1.2 格式化SD卡

  • 描述

格式化 sd 卡

public void formatSD(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;
/**
 * ipc 中的 sd 卡信息
 */
public class DevSDInfo {
    /** 是否存在SD卡 */
    public boolean isExist;
    /** 剩余空间,单位:Byte */
    public long freeSpace;
    /** 总空间,单位:Byte */
    public long totalSpace;
}
  • 示例
IvyCamera.formatSD(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

6.2 SD卡回放

6.2.1 查询SD卡录像

  • 描述

获取一段时间内的 sd 录像文件列表。

public void getPBList(final int startTime, final int endTime, final int recordType, final ISdkCallback<ArrayList<String>> callback)
  • 参数
参数名 是否必须 类型 说明
startTime int 搜索起始时间(UTC时间,精确到秒)
endTime int 搜索结束时间(UTC时间,精确到秒)
recordType int 文件类型: 0 schedule, 1 alert, 2 all
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例

因一天的录像数最多可超1000,因此建议分时间段查询,查询时间段不得超过一天。

//注意:Calendar类的月份从0开始。
Calendar cal = Calendar.getInstance();
//2019.9.23 00:00:00
cal.set(2022, 0, 5, 0, 0, 0);
int todayStart = (int) (cal.getTimeInMillis() / 1000);
//2019.9.23 23:59:59
cal.set(2022, 0, 5, 23, 59, 59);
int todayEnd = (int) (cal.getTimeInMillis() / 1000);
IvyCamera.getPBList(todayStart, todayEnd, 1, new ISdkCallback<ArrayList<PlaybackRecordInfo>>() {

    @Override
        public void onSuccess(ArrayList<PlaybackRecordInfo> result) {
        Log.e(TAG, "onSuccess");
    }

    @Override
        public void onError(int errorCode) {
        Log.e(TAG, "onError: " + errorCode);
    }

    @Override
        public void onLoginError(int errorCode) {
    }
});

6.2.2 打开SD卡录像回放

  • 描述

打开回放视频

public void openPBVideo(final IvyCamera camera, final PlaybackRecordInfo playbackRecordInfo, final IPBVideoListener videoListener)
  • 参数
参数名 是否必须 类型 说明
camera IvyCamera 设备对象
playbackRecordInfo PlaybackRecordInfo 录像文件路径
videoListener String 回放回调监听事件
  • 所在类

com.ivyiot.ipclibrary.video.PBVideoSurfaceView

  • 引用
package com.ivyiot.ipclibrary.video;

public interface IPBVideoListener {
    void openPBVideoSucc();

    void openPBVideoFail(int errorCode);

    void closePBVideoSucc();

    void closePBVideoFail(int errorCode);

    void pausePBVideoSucc();

    void pausePBVideoFail(int errorCode);

    void resumePBVideoSucc();

    void resumePBVideoFail(int errorCode);

    void seekPBVideoSucc();

    void seekPBVideoFail(int errorCode);

    void onPlayLoadProgress(int progress);

    void onPlayStart();

    void onPlaying(int progress);

    void onPlayComplete();

    void onPlayFail();
}
  • 示例
PBVideoSurfaceView.openPBVideo(IvyCamera, PlaybackRecordInfo, IPBVideoListener);

6.2.3 关闭SD卡录像回放

  • 描述

关闭回放视频

public void closePBVideo()
  • 所在类

com.ivyiot.ipclibrary.video.PBVideoSurfaceView

  • 示例
PBVideoSurfaceView.closeVideo();

必须和PBVideoSurfaceView.openPBVideo()方法对应上,一个Open对应一个Close且顺序不能弄错,不然会导致无法正常播放。


6.2.3 SD卡录像回放暂停

  • 描述

暂停回放视频

public void pausePBVideo()
  • 所在类

com.ivyiot.ipclibrary.video.PBVideoSurfaceView

  • 示例
PBVideoSurfaceView.pausePBVideo();

6.2.4 SD卡录像回放恢复播放

  • 描述

恢复回放视频

public void resumePBVideo()
  • 所在类

com.ivyiot.ipclibrary.video.PBVideoSurfaceView

  • 示例
PBVideoSurfaceView.resumePBVideo();

6.2.5 SD卡录像回放拖动播放

  • 描述

拖动视频进度条进行播放

public void seekPBVideo(int seekTime)
  • 参数
参数名 是否必须 类型 说明
seekTime int 要拖动到的时间点位置,0-100的值
  • 所在类

com.ivyiot.ipclibrary.video.PBVideoSurfaceView

  • 示例
PBVideoSurfaceView.seekPBVideo(100);

6.2.6 打开SD卡录像回放音频

  • 描述

打开回放音频

public void openPBAudio()
  • 所在类

com.ivyiot.ipclibrary.video.PBVideoSurfaceView

  • 示例
PBVideoSurfaceView.openPBAudio();

6.2.7 关闭SD卡录像回放音频

  • 描述

关闭回放音频

public void closePBAudio()
  • 所在类

com.ivyiot.ipclibrary.video.PBVideoSurfaceView

  • 示例
PBVideoSurfaceView.closePBAudio();

6.3 SD卡录像下载

6.3.1 SD卡录像下载

  • 描述

下载SD卡录像

public void downloadSDCardRecord(final PlaybackRecordInfo playbackRecordInfo, final String dstPath, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
playbackRecordInfo PlaybackRecordInfo 录像查询列表数据
dstPath String 要存储录像的绝对路径
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public interface PlaybackRecordInfo {

}

public class PlaybackRecordListInfoArgsType0 implements PlaybackRecordInfo{
    public int channel;
    public long sTime;
    public long eTime;
    public int recordType;

    public PlaybackRecordListInfoArgsType0() {
    }
}

public class PlaybackRecordListInfoArgsType1 implements PlaybackRecordInfo{
    public String recordPath;

    public PlaybackRecordListInfoArgsType1() {
    }
}
  • 示例
IvyCamera.downloadSDCardRecord(PlaybackRecordInfo, dstPath, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

下载进度是通过事件来传递的,需要IvyCamera创建观察者,然后在观察者里面监听update方法,则会返回IVY_CTRL_MSG_RECORD_DOWNLOAD_PROGRESS=2063的事件,拿到对应的进度加载。


6.3.2 取消下载SD卡录像

  • 描述

取消下载SD卡录像

public void cancelSDCardDownload(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.cancelSDCardDownload(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.设备设置

7.1 网络

7.1.1 获取设备WiFi列表

  • 描述

获取设备端检测到的 Wi-Fi 列表

public void getWiFiList(final ISdkCallback<ArrayList<DevWiFiDetail>> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public class DevWiFiDetail {
    /** Wi-Fi ssid */
    public String ssid;
    /** Wi-Fi mac */
    public String mac;
    /** 是否加密 */
    public boolean encryption;
    /** 信号质量 (0-100) 值越大,信号质量越高 */
    public int quality;
    /** 加密类型 */
    public int encryType;
}
  • 示例
IvyCamera.getWiFiList(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.1.2 获取设备WiFi信息

  • 描述

获取当前 Wi-Fi 信息

public void getWiFiSetting(final ISdkCallback<DevWiFiDetail> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public class DevWiFiDetail {
    /** Wi-Fi ssid */
    public String ssid;
    /** Wi-Fi mac */
    public String mac;
    /** 是否加密 */
    public boolean encryption;
    /** 信号质量 (0-100) 值越大,信号质量越高 */
    public int quality;
    /** 加密类型 */
    public int encryType;
}
  • 示例
IvyCamera.getWiFiSetting(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.1.3 设置设备WiFi信息

  • 描述

设置 Wi-Fi

public void setWiFiSetting(final DevWiFiDetail wifiDetail, final String wifiPwd, final ISdkCallback<DevWiFiDetail> callback)
  • 参数
参数名 是否必须 类型 说明
wifiDetail DevWiFiDetail wifi详细信息
wifiPwd String wifi密码
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public class DevWiFiDetail {
    /** Wi-Fi ssid */
    public String ssid;
    /** Wi-Fi mac */
    public String mac;
    /** 是否加密 */
    public boolean encryption;
    /** 信号质量 (0-100) 值越大,信号质量越高 */
    public int quality;
    /** 加密类型 */
    public int encryType;
}
  • 示例
IvyCamera.setWiFiSetting(DevWiFiDetail, wifiPassword, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.1.4 获取网络自适应状态

  • 描述

获取网络自适应状态

public void getNetworkAutoAdapt(final ISdkCallback<Integer> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.getNetworkAutoAdapt(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.1.5 设置网络自适应状态

  • 描述

设置网络自适应状态

public void setNetworkAutoAdapt(final boolean isEnable, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
isEnable boolean false 关闭;true 打开
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.getNetworkAutoAdapt(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.2 时间同步

7.2.1 获取设备系统时间

  • 描述

获取设备系统时间

public void getSystemTime(final ISdkCallback<DevSystemTime> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * ipc 系统时间
 */
public class DevSystemTime {
    /**
     * 0-Get time from NTP server
     * 1-Set time manually
     */
    public int timeSource;
    /**
     * ntp server addr Support ntp server:
     * time.nist.gov
     * time.kriss.re.kr
     * time.windows.com  (default)
     * time.nuri.net
     */
    public String ntpServer = "time.windows.com";
    /**
     * 0 YYYY-MM-DD
     * 1 DD/MM/YYYY
     * 2 MM/DD/YYYY
     */
    public int dateFormat;
    /**
     * 0 - 12 hours
     * 1 - 24 hours
     */
    public int timeFormat;
    /**
     * The seconds between local time and GMT time
     */
    public int timeZone;
    /**
     * Daylight saving time
     * 0-disable
     * 1-enable
     */
    public int isDst;
    /** Not in use currently */
    public int dst;
    public int year;
    public int mon;
    public int day;
    public int hour;
    public int minute;
    public int sec;
}
  • 示例
IvyCamera.getSystemTime(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.2.2 设置设备系统时间

  • 描述

设置设备系统时间

public void setSystemTime(final DevSystemTime devSystemTime, final ISdkCallback<DevSystemTime> callback)
  • 参数
参数名 是否必须 类型 说明
devSystemTime DevSystemTime 设备系统时间信息
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * ipc 系统时间
 */
public class DevSystemTime {
    /**
     * 0-Get time from NTP server
     * 1-Set time manually
     */
    public int timeSource;
    /**
     * ntp server addr Support ntp server:
     * time.nist.gov
     * time.kriss.re.kr
     * time.windows.com  (default)
     * time.nuri.net
     */
    public String ntpServer = "time.windows.com";
    /**
     * 0 YYYY-MM-DD
     * 1 DD/MM/YYYY
     * 2 MM/DD/YYYY
     */
    public int dateFormat;
    /**
     * 0 - 12 hours
     * 1 - 24 hours
     */
    public int timeFormat;
    /**
     * The seconds between local time and GMT time
     */
    public int timeZone;
    /**
     * Daylight saving time
     * 0-disable
     * 1-enable
     */
    public int isDst;
    /** Not in use currently */
    public int dst;
    public int year;
    public int mon;
    public int day;
    public int hour;
    public int minute;
    public int sec;
}
  • 示例
IvyCamera.setSystemTime(DevSystemTime, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.2.2 同步手机时间到设备

  • 描述

手机时间同步到设备

public void syncSystemTime(final ISdkCallback<DevSystemTime> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * ipc 系统时间
 */
public class DevSystemTime {
    /**
     * 0-Get time from NTP server
     * 1-Set time manually
     */
    public int timeSource;
    /**
     * ntp server addr Support ntp server:
     * time.nist.gov
     * time.kriss.re.kr
     * time.windows.com  (default)
     * time.nuri.net
     */
    public String ntpServer = "time.windows.com";
    /**
     * 0 YYYY-MM-DD
     * 1 DD/MM/YYYY
     * 2 MM/DD/YYYY
     */
    public int dateFormat;
    /**
     * 0 - 12 hours
     * 1 - 24 hours
     */
    public int timeFormat;
    /**
     * The seconds between local time and GMT time
     */
    public int timeZone;
    /**
     * Daylight saving time
     * 0-disable
     * 1-enable
     */
    public int isDst;
    /** Not in use currently */
    public int dst;
    public int year;
    public int mon;
    public int day;
    public int hour;
    public int minute;
    public int sec;
}
  • 示例
IvyCamera.syncSystemTime(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.3 设备音量

7.3.1 获取设备音量

  • 描述

获取设备音量

public void getAudioVolume(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.getAudioVolume(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.3.2 设置设备音量

  • 描述

设置设备音量

public void setAudioVolume(final int volume, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
volume int (0 - 100)
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setAudioVolume(100, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.4 侦测相关

7.4.1 移动侦测

7.4.1.1 获取移动侦测配置
  • 描述

获取移动侦测配置

public void getMotionDetectConfig(final ISdkCallback<DevMotionDetect> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public class DevMotionDetect {
    /** amba&hisi 是否启用 0:关闭 1:开启 */
    public int enable;
    /**
     * amba&hisi 联动,按位表示
     * <p>
     * Bit0    Ring
     * Bit1    发送邮件
     * Bit2    截图
     * Bit3    录像
     * Bit4    Io输出
     * Bit5    截图上云
     * Bit6    录像上云
     * Bit7    手机推送
     */
    public int linkage;
    /** amba&hisi 触发间隔(秒) */
    public int snapInterval;
    /** amba&hisi 触发间隔(秒) */
    public int triggerInterval;
    /** amba&hisi 移动侦测报警开关 0:关闭 1:开启 */
    public int moveAlarmEnable;
    /** amba&hisi pir侦测开关 0:关闭 1:开启 */
    public int pirAlarmEnable;
    /** hisi 灵敏度 0:low 1:normal 2:high 3:lower 4:lowest */
    public int sensitivity;
    /** hisi 区域信息 */
    public long[] areaHisi;
    /**
     * amba The motion alaram schedule of one week,
     * N = 0(Monday) ~6(Sunday)
     * For detail, see *1 bellow
     */
    public long[] schedule;
    /** amba 区域信息 */
    public DevMotionDetect.AreaInfo[] areaAmba;

    /**
     * 告警区域信息——amba
     */
    public class AreaInfo {
        /** 是否启用 0 否,1 是 */
        public int enable;
        public int x;
        public int y;
        public int width;
        public int height;
        /**
         * Motion detect sensitivity
         * 0 : Low
         * 1: Normal
         * 2: High
         * 3: Lower
         * 4: Lowest
         */
        public int sensitivity;
    }
}
  • 示例
IvyCamera.getMotionDetectConfig(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.4.1.2 设置移动侦测配置
  • 描述

设置移动侦测配置

public void setMotionDetectConfig(final DevMotionDetect detect, final ISdkCallback<DevMotionDetect> callback)
  • 参数
参数名 是否必须 类型 说明
detect DevMotionDetect 移动侦测配置
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public class DevMotionDetect {
    /** amba&hisi 是否启用 0:关闭 1:开启 */
    public int enable;
    /**
     * amba&hisi 联动,按位表示
     * <p>
     * Bit0    Ring
     * Bit1    发送邮件
     * Bit2    截图
     * Bit3    录像
     * Bit4    Io输出
     * Bit5    截图上云
     * Bit6    录像上云
     * Bit7    手机推送
     */
    public int linkage;
    /** amba&hisi 触发间隔(秒) */
    public int snapInterval;
    /** amba&hisi 触发间隔(秒) */
    public int triggerInterval;
    /** amba&hisi 移动侦测报警开关 0:关闭 1:开启 */
    public int moveAlarmEnable;
    /** amba&hisi pir侦测开关 0:关闭 1:开启 */
    public int pirAlarmEnable;
    /** hisi 灵敏度 0:low 1:normal 2:high 3:lower 4:lowest */
    public int sensitivity;
    /** hisi 区域信息 */
    public long[] areaHisi;
    /**
     * amba The motion alaram schedule of one week,
     * N = 0(Monday) ~6(Sunday)
     * For detail, see *1 bellow
     */
    public long[] schedule;
    /** amba 区域信息 */
    public DevMotionDetect.AreaInfo[] areaAmba;

    /**
     * 告警区域信息——amba
     */
    public class AreaInfo {
        /** 是否启用 0 否,1 是 */
        public int enable;
        public int x;
        public int y;
        public int width;
        public int height;
        /**
         * Motion detect sensitivity
         * 0 : Low
         * 1: Normal
         * 2: High
         * 3: Lower
         * 4: Lowest
         */
        public int sensitivity;
    }
}
  • 示例
IvyCamera.setMotionDetectConfig(DevMotionDetect, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.4.2 声音侦测

7.4.2.1 获取声音侦测配置
  • 描述

获取声音侦测配置

public void getAudioDetectConfig(final ISdkCallback<DevAudioDetect> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * Note:
 * ·FosVideo region is divided into 10*10 sub areasideo region is divided into 10*10
 * sub areas
 * ·The min unit of schedule is half an hour, scheduleN value range
 * 2N -1(N[0-48])
 * .areaN value 2N -1(N[0-10])
 */
public class DevAudioDetect {
    /**
     * Is enable motion detect alarm
     */
    public int enable;

    /**
     * Motion alarm linkage( bit3 | bit2 | bit1 | bit0 )
     * bit0:Ring
     * bit1:Send mail
     * bit2:Snap picture
     * bit3:Record
     */
    public int linkage;
    /**
     * The interval time to snap picture again
     */
    public int snapInterval;
    /**
     * Motion detect sensitivity
     * 0 : Low
     * 1: Normal
     * 2: High
     * 3: Lower
     * 4: Lowest
     */
    public int sensitivity;
    /**
     * The time of which motion detect alaram can
     * trigger again when a motion detection has happened.
     */
    public int triggerInterval;
    /**
     * The motion alaram schedule of one week,
     * N = 0(Monday) ~6(Sunday)
     * For detail, see *1 bellow
     */
    public long[] schedule = new long[7];
}
  • 示例
IvyCamera.getAudioDetectConfig( new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.4.2.2 设置声音侦测配置
  • 描述

设置声音侦测配置

public void setAudioDetectConfig(final DevAudioDetect detect, final ISdkCallback<DevAudioDetect> callback)
  • 参数
参数名 是否必须 类型 说明
detect DevAudioDetect 声音侦测配置
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * Note:
 * ·FosVideo region is divided into 10*10 sub areasideo region is divided into 10*10
 * sub areas
 * ·The min unit of schedule is half an hour, scheduleN value range
 * 2N -1(N[0-48])
 * .areaN value 2N -1(N[0-10])
 */
public class DevAudioDetect {
    /**
     * Is enable motion detect alarm
     */
    public int enable;

    /**
     * Motion alarm linkage( bit3 | bit2 | bit1 | bit0 )
     * bit0:Ring
     * bit1:Send mail
     * bit2:Snap picture
     * bit3:Record
     */
    public int linkage;
    /**
     * The interval time to snap picture again
     */
    public int snapInterval;
    /**
     * Motion detect sensitivity
     * 0 : Low
     * 1: Normal
     * 2: High
     * 3: Lower
     * 4: Lowest
     */
    public int sensitivity;
    /**
     * The time of which motion detect alaram can
     * trigger again when a motion detection has happened.
     */
    public int triggerInterval;
    /**
     * The motion alaram schedule of one week,
     * N = 0(Monday) ~6(Sunday)
     * For detail, see *1 bellow
     */
    public long[] schedule = new long[7];
}
  • 示例
IvyCamera.setAudioDetectConfig( new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.4.3 人形侦测

7.4.3.1 获取人形侦测配置
  • 描述

获取人形侦测配置

public void getPedestrianDetectConfig(final ISdkCallback<PedestrianDetectConfig> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * 人形筛选
 * 移动追踪
 */
public class PedestrianDetectConfig {

    /**
     * Is enable motion detect alarm
     */
    public int isEnable;

    /**
     * 0:default 1:senior
     */
    public int isTrackEnable;

    /**
     * Motion detect sensitivity
     * 0 : Low
     * 1: Normal
     * 2: High
     * 3: Lower
     * 4: Lowest
     */
    public int sensitivity;


    /**
     * 触发间隔
     */
    public int snapInterval;

    /**
     * 0:tilted 1: plane
     */
    public int triggerInterval;

    /**
     * Motion alarm linkage( bit3 | bit2 | bit1 | bit0 )
     * bit0:Ring
     * bit1:Send mail
     * bit2:Snap picture
     * bit3:Record
     */
    public int linkage;
}
  • 示例
IvyCamera.getPedestrianDetectConfig(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.4.3.2 设置人形侦测配置
  • 描述

设置人形侦测配置

public void setPedestrianDetectConfig(final PedestrianDetectConfig detect, final ISdkCallback<PedestrianDetectConfig> callback)
  • 参数
参数名 是否必须 类型 说明
detect PedestrianDetectConfig 人形侦测配置
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * 人形筛选
 * 移动追踪
 */
public class PedestrianDetectConfig {

    /**
     * Is enable motion detect alarm
     */
    public int isEnable;

    /**
     * 0:default 1:senior
     */
    public int isTrackEnable;

    /**
     * Motion detect sensitivity
     * 0 : Low
     * 1: Normal
     * 2: High
     * 3: Lower
     * 4: Lowest
     */
    public int sensitivity;


    /**
     * 触发间隔
     */
    public int snapInterval;

    /**
     * 0:tilted 1: plane
     */
    public int triggerInterval;

    /**
     * Motion alarm linkage( bit3 | bit2 | bit1 | bit0 )
     * bit0:Ring
     * bit1:Send mail
     * bit2:Snap picture
     * bit3:Record
     */
    public int linkage;
}
  • 示例
IvyCamera.setPedestrianDetectConfig(PedestrianDetectConfig, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.4.3.3 从设备获取 license
  • 描述

从设备获取 license

public void getPedestrianLicenseDeviceInfo(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.getPedestrianLicenseDeviceInfo(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.4.3.4 向设备写入 license
  • 描述

向设备写入 license

public void setPedestrianLicense(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setPedestrianLicense(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.5 设备休眠

7.5.1 获取休眠状态

  • 描述

获取休眠状态

public void getSleepMode(final ISdkCallback<Integer> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.getSleepMode(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

休眠状态 未启用 0;休眠 1;唤醒 2; 结束 3;


7.5.2 设备唤醒

  • 描述

设备唤醒

public void deviceWakeUp(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.deviceWakeUp(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.5.3 设备唤醒

  • 描述

设备休眠

public void deviceSleep(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.deviceSleep(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.6 重启设备

  • 描述

重启设备

public void rebootDevice(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.rebootDevice(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.7 WDR开关

7.7.1 获取WDR开关

  • 描述

获取WDR开关

public void getWDRMode(final ISdkCallback<Integer> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.rebootDevice(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

0 关闭;1 打开


7.7.2 设置WDR开关

  • 描述

设置WDR开关

public void setWDRMode(final boolean open, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
open int 1 打开;0 关闭
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setWDRMode(open, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.8 电源频率

7.8.1 获取电源频率

  • 描述

获取电源频率

public void getPowerFrequency(final ISdkCallback<Integer> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.getPowerFrequency(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

0 50hz;1 60hz;2 户外模式


7.8.1 设置电源频率

  • 描述

设置电源频率

public void setPowerFrequency(final int frequency, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
frequency int 0 50hz;1 60hz;2 户外模式
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setPowerFrequency(frequency, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.9 提示音开关

7.9.1 获取提示音开关状态

  • 描述

获取提示音开关状态

public void getVoiceTipState(final ISdkCallback<Integer> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.getVoiceTipState(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.9.2 设置提示音开关状态

  • 描述

设置提示音开关状态

public void setVoiceTipState(final boolean isEnable, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
isEnable int false 关闭;true 打开
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setVoiceTipState(isEnable, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.10 状态灯开关

7.10.1 获取状态灯开关状态

  • 描述

获取状态灯开关状态

public void getLedEnableState(final ISdkCallback<Integer> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.getLedEnableState( new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.10.2 设置状态灯开关状态

  • 描述

设置状态灯开关状态

public void setLedEnableState(final int enable, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
isEnable int 0 关闭;1 打开
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setLedEnableState(enable, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.11 OSD设置

7.11.1 获取OSD

  • 描述

获取OSD

public void getOSDSetting(final ISdkCallback<OSDSetting> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public class OSDSetting {
    /** Time stamp will display on screen or not */
    public int isEnableTimeStamp;
    /** Camera name will display on screen or not */
    public int isEnableDevName;
    /** OSD display position, currently can only be 0 */
    public int dispPos;
    /** Is OSD mask effective */
    public int isEnableOSDMask;
    /** TempAndHumid will display on screen or not */
    public int isEnableTempAndHumid;
}
  • 示例
IvyCamera.getOSDSetting(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.11.1 设置OSD

  • 描述

设置OSD

public void setOSDSetting(final OSDSetting osdSetting, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
osdSetting OSDSetting osd操作对象
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

public class OSDSetting {
    /** Time stamp will display on screen or not */
    public int isEnableTimeStamp;
    /** Camera name will display on screen or not */
    public int isEnableDevName;
    /** OSD display position, currently can only be 0 */
    public int dispPos;
    /** Is OSD mask effective */
    public int isEnableOSDMask;
    /** TempAndHumid will display on screen or not */
    public int isEnableTempAndHumid;
}
  • 示例
IvyCamera.getOSDSetting(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.12 夜视计划

7.12.1 获取夜视计划

  • 描述

获取夜视计划

public void getNightVisionSchedule(final ISdkCallback<ScheduleInfraledConfig> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * Note:
 * N:[0-2],the number of infra led switch schedule
 */
public class ScheduleInfraledConfig {
    /**
     * Start hour
     */
    public int[] startHour = new int[3];
    /**
     * Start Minitue
     */
    public int[] startMin = new int[3];
    /**
     * End hour
     */
    public int[] endHour = new int[3];
    /**
     * End minitue
     */
    public int[] endMin = new int[3];
}
  • 示例
IvyCamera.getNightVisionSchedule(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.12.2 设置夜视计划

  • 描述

设置夜视计划

public void setNightVisionSchedule(final ScheduleInfraledConfig ledConfig, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
ledConfig ScheduleInfraledConfig 夜视计划对象
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * Note:
 * N:[0-2],the number of infra led switch schedule
 */
public class ScheduleInfraledConfig {
    /**
     * Start hour
     */
    public int[] startHour = new int[3];
    /**
     * Start Minitue
     */
    public int[] startMin = new int[3];
    /**
     * End hour
     */
    public int[] endHour = new int[3];
    /**
     * End minitue
     */
    public int[] endMin = new int[3];
}
  • 示例
IvyCamera.getNightVisionSchedule(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.13 计划录像

7.13.1 获取计划录像配置

  • 描述

获取计划录像配置(只支持SD/FTP录像)

public void getScheduleRecordingConfig(final ISdkCallback<ScheduleRecordConfig> callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * Note:
 * The min unit of schedule is half an hour,
 * scheduleN value range 2N -1(N[0-48])
 */
public class ScheduleRecordConfig {
    /** Schedule-Record enable status, 0-disable,1-enable*/
    public int isEnable;
    /**
     *  Level for drop frame,
     *  0 - 30/30,
     *  1 - 24/30,
     *  2 - 15/30,
     *  3 - 8/30,
     *  4 - 4/30,
     *  5 - 1/30;
     * */
    public int recordLevel;
    /***
     * The process method when SD card is full, 
     * 0-cover the oldest video and continue record,
     * 1-stop record
     */
    public int spaceFullMode;
    /**Is recording include audio?
     *  0-no
     *  1-yes
     * */
    public int isEnableAudio;

    /**
     * stream type
     */
    public int streamType;
    /**
     * The motion alaram schedule of one week,
     * N = 0(Monday) ~6(Sunday)
     * For detail, see *1 bellow
     */
    public long[] schedule = new long[7];
}    
  • 示例
IvyCamera.getNightVisionSchedule(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.13.2 设置计划录像配置

  • 描述

设置计划录像配置(只支持SD/FTP录像)

public void setScheduleRecordingConfig(final ScheduleRecordConfig scheduleConfig, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
scheduleConfig ScheduleRecordConfig 计划录像对象
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.model;

/**
 * Note:
 * The min unit of schedule is half an hour,
 * scheduleN value range 2N -1(N[0-48])
 */
public class ScheduleRecordConfig {
    /** Schedule-Record enable status, 0-disable,1-enable*/
    public int isEnable;
    /**
     *  Level for drop frame,
     *  0 - 30/30,
     *  1 - 24/30,
     *  2 - 15/30,
     *  3 - 8/30,
     *  4 - 4/30,
     *  5 - 1/30;
     * */
    public int recordLevel;
    /***
     * The process method when SD card is full, 
     * 0-cover the oldest video and continue record,
     * 1-stop record
     */
    public int spaceFullMode;
    /**Is recording include audio?
     *  0-no
     *  1-yes
     * */
    public int isEnableAudio;

    /**
     * stream type
     */
    public int streamType;
    /**
     * The motion alaram schedule of one week,
     * N = 0(Monday) ~6(Sunday)
     * For detail, see *1 bellow
     */
    public long[] schedule = new long[7];
}    
  • 示例
IvyCamera.setScheduleRecordingConfig(ScheduleRecordConfig, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.14 云配置相关

7.14.1 固件在线升级

  • 描述

固件在线升级

public void setOnlineUpgrade(final String downloadUrl, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
downloadUrl String 固件下载地址
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setOnlineUpgrade(downloadUrl, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.14.2 设置推送配置

  • 描述

设置推送配置

public void setPushConfig(final String userTag, final String serverAddress, final int port, final boolean isRichMedia, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
userTag String 用户唯一标识
serverAddress String 云平台API地址
port String https端口,默认443
isRichMedia Boolean 是否支持富媒体
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setPushConfig("a44ad70c97f84d21b763412119f3397e", "https://test-api.myfoscam.com", "443", true, new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.14.3 设置云存储配置

  • 描述

设置云存储配置

public void setCloudRecord(final String userTag, final String streamId, final String serverAddress, final int port, final String macAddr, final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
userTag String 用户唯一标识
streamId String 云录像存储唯一标示
serverAddress String 云平台API地址
port String https端口,默认443
macAddr String 设备唯一标示
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.setCloudRecord("d85280b8e9e146679197c2dca2f54531", "1a8d226eca789c189403c112b6c1acb5104256400000000232A", "https://test-api.myfoscam.com", "443", "00000000232A", new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

7.15 重置设备

  • 描述

重置设备

public void resetDevice(final ISdkCallback callback)
  • 参数
参数名 是否必须 类型 说明
callback ISdkCallback 结果回调
  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
IvyCamera.resetDevice(new ISdkCallback() {
    @Override
        public void onSuccess(Object result) {

    }

    @Override
        public void onError(int errorCode) {

    }

    @Override
        public void onLoginError(int errorCode) {

    }
});

8.通用接口

8.1 SDK通用接口

  • 描述

SDK通用接口

public static SDKResponse sendCmd(int handle, int cmd, String cmdJsonData)
  • 参数
参数名 是否必须 类型 说明
handle int SDK句柄
cmd int 对应的命令ID,APP 与 设备端对齐定义,见引用
cmdJsonData String 命令内容,json格式的字符串
  • 返回值

SDKResponse 返回命令结果,json格式,包含sdk执行结果和设备端返回的结果

  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}

package com.ivyiot.ipclibrary.sdk;

/**
 * SDK 负责建立通道,将 APP 端和 IPC 端的命令相互透传。
 * <p>该类为 APP 与 IPC 协商的命令值。</p>
 */
public class Cmd {
    private Cmd() {
    }

    /** 基数 -- mark 2019 版新SDK (^v^) */
    private static final int BASE_CTRL_MSG = 2019;

    public static final int NET_STATE_DISCONNECT = 88;
    public static final int NET_STATE_RECONNECT = 89; // IVY Device has no this event, it is reserve
    //
    public static final int IVY_CTRL_MSG_ADD_ACCOUNT = BASE_CTRL_MSG + 20000;
    public static final int IVY_CTRL_MSG_ADD_ACCOUNT_RESP = 22020;
    public static final int IVY_CTRL_MSG_DEL_ACCOUNT = 22021;
    public static final int IVY_CTRL_MSG_DEL_ACCOUNT_RESP = 22022;
    public static final int IVY_CTRL_MSG_CHANGE_USER_INFO = 22023;
    public static final int IVY_CTRL_MSG_CHANGE_USER_INFO_RESP = 22024;
    public static final int IVY_CTRL_MSG_GET_DEVINFO = 22025;
    public static final int IVY_CTRL_MSG_GET_DEVINFO_RESP = 22026;
    public static final int IVY_CTRL_MSG_SET_DEVINFO = 22027;
    public static final int IVY_CTRL_MSG_SET_DEVINFO_RESP = 22028;
    public static final int IVY_CTRL_MSG_GET_DEVABILITY = 22029;
    public static final int IVY_CTRL_MSG_GET_DEVABILITY_RESP = 22030;
    //media
    public static final int IVY_CTRL_MSG_SET_VIDEOSTREAM_PARAM = BASE_CTRL_MSG + 22000;
    public static final int IVY_CTRL_MSG_SET_VIDEOSTREAM_PARAM_RESP = 24020;
    public static final int IVY_CTRL_MSG_GET_VIDEOSTREAM_PARAM = 24021;
    public static final int IVY_CTRL_MSG_GET_VIDEOSTREAM_PARAM_RESP = 24022;
    public static final int IVY_CTRL_MSG_SET_VIDEOSTREAM_MODE = 24023;
    public static final int IVY_CTRL_MSG_SET_VIDEOSTREAM_MODE_RESP = 24024;
    public static final int IVY_CTRL_MSG_GET_VIDEOSTREAM_MODE = 24025;
    public static final int IVY_CTRL_MSG_GET_VIDEOSTREAM_MODE_RESP = 24026;
    public static final int IVY_CTRL_MSG_SET_IMAGE_PARAM = 24027;
    public static final int IVY_CTRL_MSG_SET_IMAGE_PARAM_RESP = 24028;
    public static final int IVY_CTRL_MSG_GET_IMAGE_PARAM = 24029;
    public static final int IVY_CTRL_MSG_GET_IMAGE_PARAM_RESP = 24030;
    public static final int IVY_CTRL_MSG_SET_MOTION_DETECT_CONFIG = 24031;
    public static final int IVY_CTRL_MSG_SET_MOTION_DETECT_CONFIG_RESP = 24032;
    public static final int IVY_CTRL_MSG_GET_MOTION_DETECT_CONFIG = 24033;
    public static final int IVY_CTRL_MSG_GET_MOTION_DETECT_CONFIG_RESP = 24034;
    public static final int IVY_CTRL_MSG_SET_VIDEO_MIRROR_FLIP = 24035;
    public static final int IVY_CTRL_MSG_SET_VIDEO_MIRROR_FLIP_RESP = 24036;
    public static final int IVY_CTRL_MSG_GET_VIDEO_MIRROR_FLIP = 24037;
    public static final int IVY_CTRL_MSG_GET_VIDEO_MIRROR_FLIP_RESP = 24038;
    public static final int IVY_CTRL_MSG_SET_ENVIRONMENT = 24039;
    public static final int IVY_CTRL_MSG_SET_ENVIRONMENT_RESP = 24040;
    public static final int IVY_CTRL_MSG_GET_ENVIRONMENT = 24041;
    public static final int IVY_CTRL_MSG_GET_ENVIRONMENT_RESP = 24042;
    public static final int IVY_CTRL_MSG_SET_OSD_PARAM = 24043;
    public static final int IVY_CTRL_MSG_SET_OSD_PARAM_RESP = 24044;
    public static final int IVY_CTRL_MSG_GET_OSD_PARAM = 24045;
    public static final int IVY_CTRL_MSG_GET_OSD_PARAM_RESP = 24046;
    public static final int IVY_CTRL_MSG_SET_AUDIO_VOLUME = 24047;
    public static final int IVY_CTRL_MSG_SET_AUDIO_VOLUME_RESP = 24048;
    public static final int IVY_CTRL_MSG_GET_AUDIO_VOLUME = 24049;
    public static final int IVY_CTRL_MSG_GET_AUDIO_VOLUME_RESP = 24050;
    public static final int IVY_CTRL_MSG_GET_VIDEO_STREAM_ABLITY = 24051;
    public static final int IVY_CTRL_MSG_GET_VIDEO_STREAM_ABLITY_RESP = 24052;
    public static final int IVY_CTRL_MSG_SET_DAY_NIGHT_MODE = 24053;
    public static final int IVY_CTRL_MSG_SET_DAY_NIGHT_MODE_RESP = 24054;
    public static final int IVY_CTRL_MSG_GET_DAY_NIGHT_MODE = 24055;
    public static final int IVY_CTRL_MSG_GET_DAY_NIGHT_MODE_RESP = 24056;
    public static final int IVY_CTRL_MSG_SET_NIGHT_VISION_SCHEDULE = 24057;
    public static final int IVY_CTRL_MSG_SET_NIGHT_VISION_SCHEDULE_RESP = 24058;
    public static final int IVY_CTRL_MSG_GET_NIGHT_VISION_SCHEDULE = 24059;
    public static final int IVY_CTRL_MSG_GET_NIGHT_VISION_SCHEDULE_RESP = 24060;
    public static final int IVY_CTRL_MSG_SNAP_PICTURE = 24061;
    public static final int IVY_CTRL_MSG_SNAP_PICTURE_RESP = 24062;
    public static final int IVY_CTRL_MSG_GET_MUSIC_PLAY_STATE = 24063;
    public static final int IVY_CTRL_MSG_GET_MUSIC_PLAY_STATE_RESP = 24064;
    public static final int IVY_CTRL_MSG_SET_MUSIC_PLAY_START = 24065;
    public static final int IVY_CTRL_MSG_SET_MUSIC_PLAY_START_RESP = 24066;
    public static final int IVY_CTRL_MSG_SET_MUSIC_PLAY_STOP = 24067;
    public static final int IVY_CTRL_MSG_SET_MUSIC_PLAY_STOP_RESP = 24068;
    public static final int IVY_CTRL_MSG_SET_MUSIC_PLAY_PREV = 24069;
    public static final int IVY_CTRL_MSG_SET_MUSIC_PLAY_PREV_RESP = 24070;
    public static final int IVY_CTRL_MSG_SET_MUSIC_PLAY_NEXT = 24071;
    public static final int IVY_CTRL_MSG_SET_MUSIC_PLAY_NEXT_RESP = 24072;
    public static final int IVY_CTRL_MSG_GET_MUSIC_NAME_LIST = 24073;
    public static final int IVY_CTRL_MSG_GET_MUSIC_NAME_LIST_RESP = 24074;
    //system
    public static final int IVY_CTRL_MSG_SET_SYSTEM_TIME = BASE_CTRL_MSG + 24000;
    public static final int IVY_CTRL_MSG_SET_SYSTEM_TIME_RESP = 26020;
    public static final int IVY_CTRL_MSG_GET_SYSTEM_TIME = 26021;
    public static final int IVY_CTRL_MSG_GET_SYSTEM_TIME_RESP = 26022;
    public static final int IVY_CTRL_MSG_REBOOT_SYSTEM = 26023;
    public static final int IVY_CTRL_MSG_REBOOT_SYSTEM_RESP = 26024;
    public static final int IVY_CTRL_MSG_POWEROFF = 26025;
    public static final int IVY_CTRL_MSG_POWEROFF_RESP = 26026;
    public static final int IVY_CTRL_MSG_FACTORY_RESET = 26027;
    public static final int IVY_CTRL_MSG_FACTORY_RESET_RESP = 26028;
    public static final int IVY_CTRL_MSG_PTZ_CONTROL_CMD = 26029;
    public static final int IVY_CTRL_MSG_PTZ_CONTROL_CMD_RESP = 26030;
    public static final int IVY_CTRL_MSG_GET_DISK_INFO = 26031;
    public static final int IVY_CTRL_MSG_GET_DISK_INFO_RESP = 26032;
    public static final int IVY_CTRL_MSG_DISK_FORMAT = 26033;
    public static final int IVY_CTRL_MSG_DISK_FORMAT_RESP = 26034;
    public static final int IVY_CTRL_MSG_SET_ONLINE_UPGRADE = 26035;
    public static final int IVY_CTRL_MSG_SET_ONLINE_UPGRADE_RESP = 26036;
    public static final int IVY_CTRL_MSG_GET_SD_CARD_INFO = 26037;
    public static final int IVY_CTRL_MSG_GET_SD_CARD_INFO_RESP = 26038;
    public static final int IVY_CTRL_MSG_SD_CARD_FORMAT = 26039;
    public static final int IVY_CTRL_MSG_SD_CARD_FORMAT_RESP = 26040;
    public static final int IVY_CTRL_MSG_SET_UPNP_CONIG = 26041;
    public static final int IVY_CTRL_MSG_SET_UPNP_CONIG_RESP = 26042;
    public static final int IVY_CTRL_MSG_GET_UPNP_CONIG = 26043;
    public static final int IVY_CTRL_MSG_GET_UPNP_CONIG_RESP = 26044;
    public static final int IVY_CTRL_MSG_SET_LED_CONFIG = 26045;
    public static final int IVY_CTRL_MSG_SET_LED_CONFIG_RESP = 26046;// Deprecated
    public static final int IVY_CTRL_MSG_GET_LED_CONFIG = 26047;// Deprecated
    public static final int IVY_CTRL_MSG_GET_LED_CONFIG_RESP = 26048;// Deprecated
    public static final int IVY_CTRL_MSG_SET_MAINTAIN_CONFIG = 26049;// Deprecated
    public static final int IVY_CTRL_MSG_SET_MAINTAIN_CONFIG_RESP = 26050;
    public static final int IVY_CTRL_MSG_GET_MAINTAIN_CONFIG = 26051;
    public static final int IVY_CTRL_MSG_GET_MAINTAIN_CONFIG_RESP = 26052;
    public static final int IVY_CTRL_MSG_SET_SILENT_UPGRADE_CONFIG = 26053;
    public static final int IVY_CTRL_MSG_SET_SILENT_UPGRADE_CONFIG_RESP = 26054;
    public static final int IVY_CTRL_MSG_GET_SILENT_UPGRADE_CONFIG = 26055;
    public static final int IVY_CTRL_MSG_GET_SILENT_UPGRADE_CONFIG_RESP = 26056;
    public static final int IVY_CTRL_MSG_SWITCH_BUZZER = 26057;
    public static final int IVY_CTRL_MSG_SWITCH_BUZZER_RESP = 26058;
    public static final int IVY_CTRL_MSG_GET_BPI_BATTERY_STATUS = 26059;
    public static final int IVY_CTRL_MSG_GET_BPI_BATTERY_STATUS_RESP = 26060;
    public static final int IVY_CTRL_MSG_SET_LED_STATE = 26061;
    public static final int IVY_CTRL_MSG_SET_LED_STATE_RESP = 26062;
    public static final int IVY_CTRL_MSG_GET_LED_STATE = 26063;
    public static final int IVY_CTRL_MSG_GET_LED_STATE_RESP = 26064;
    public static final int IVY_CTRL_MSG_SET_VOICE_STATE = 26065;
    public static final int IVY_CTRL_MSG_SET_VOICE_STATE_RESP = 26066;
    public static final int IVY_CTRL_MSG_GET_VOICE_STATE = 26067;
    public static final int IVY_CTRL_MSG_GET_VOICE_STATE_RESP = 26068;
    public static final int IVY_CTRL_MSG_SET_NIGHT_LIGHT = 26069;
    public static final int IVY_CTRL_MSG_SET_NIGHT_LIGHT_RESP = 26070;
    public static final int IVY_CTRL_MSG_GET_NIGHT_LIGHT = 26071;
    public static final int IVY_CTRL_MSG_GET_NIGHT_LIGHT_RESP = 26072;
    public static final int IVY_CTRL_MSG_SET_AUDIO_ENABLE_STATE = 26073;
    // only for foscam bpi
    public static final int IVY_CTRL_MSG_SET_AUDIO_ENABLE_STATE_RESP = 26074;
    // only for foscam bpi
    public static final int IVY_CTRL_MSG_GET_AUDIO_ENABLE_STATE = 26075;
    // only for foscam bpi
    public static final int IVY_CTRL_MSG_GET_AUDIO_ENABLE_STATE_RESP = 26076;

    // only for foscam bpi
    //record
    public static final int IVY_CTRL_MSG_SET_RECORD_INFO = BASE_CTRL_MSG + 26000;
    public static final int IVY_CTRL_MSG_SET_RECORD_INFO_RESP = 28020;
    public static final int IVY_CTRL_MSG_GET_RECORD_INFO = 28021;
    public static final int IVY_CTRL_MSG_GET_RECORD_INFO_RESP = 28022;
    public static final int IVY_CTRL_MSG_GET_RECORD_LIST_RESERVE = 28023;
    // reserve
    public static final int IVY_CTRL_MSG_GET_RECORD_LIST_RESERVE_RESP = 28024;
    // reserve
    public static final int IVY_CTRL_MSG_RECORD_FILES_DOWNLOAD = 28025;
    public static final int IVY_CTRL_MSG_RECORD_FILES_DOWNLOAD_RESP = 28026;
    public static final int IVY_CTRL_MSG_RECORD_PLAYCONTROL_RESERVE = 28027;
    // reserve
    public static final int IVY_CTRL_MSG_RECORD_PLAYCONTROL_RESERVE_RESP = 28028;
    // reserve
    public static final int IVY_CTRL_MSG_SET_RECORD_HAS_AUDIO = 28029;
    public static final int IVY_CTRL_MSG_SET_RECORD_HAS_AUDIO_RESP = 28030;
    public static final int IVY_CTRL_MSG_GET_RECORD_HAS_AUDIO = 28031;
    public static final int IVY_CTRL_MSG_GET_RECORD_HAS_AUDIO_RESP = 28032;
    public static final int IVY_CTRL_MSG_SET_RECORD_MODE = 28033;
    public static final int IVY_CTRL_MSG_SET_RECORD_MODE_RESP = 28034;
    public static final int IVY_CTRL_MSG_GET_RECORD_MODE = 28035;
    public static final int IVY_CTRL_MSG_GET_RECORD_MODE_RESP = 28036;
    public static final int IVY_CTRL_MSG_SET_RECORD_STORE_LOCATION = 28037;
    public static final int IVY_CTRL_MSG_SET_RECORD_STORE_LOCATION_RESP = 28038;
    public static final int IVY_CTRL_MSG_GET_RECORD_STORE_LOCATION = 28039;
    public static final int IVY_CTRL_MSG_GET_RECORD_STORE_LOCATION_RESP = 28040;
    public static final int IVY_CTRL_MSG_SET_ENABLE_ALGORITHM = 28041;
    public static final int IVY_CTRL_MSG_SET_ENABLE_ALGORITHM_RESP = 28042;
    public static final int IVY_CTRL_MSG_GET_ENABLE_ALGORITHM = 28043;
    public static final int IVY_CTRL_MSG_GET_ENABLE_ALGORITHM_RESP = 28044;
    public static final int IVY_CTRL_MSG_SET_STROGE_CONFIG = 28045;
    public static final int IVY_CTRL_MSG_SET_STROGE_CONFIG_RESP = 28046;
    public static final int IVY_CTRL_MSG_GET_STROGE_CONFIG = 28047;
    public static final int IVY_CTRL_MSG_GET_STROGE_CONFIG_RESP = 28048;
    //network
    public static final int IVY_CTRL_MSG_SET_NET_PARAM = BASE_CTRL_MSG + 28000;
    public static final int IVY_CTRL_MSG_SET_NET_PARAM_RESP = 30020;
    public static final int IVY_CTRL_MSG_GET_NET_PARAM = 30021;
    public static final int IVY_CTRL_MSG_GET_NET_PARAM_RESP = 30022;
    public static final int IVY_CTRL_MSG_SET_WIFI_PARAM = 30023;
    public static final int IVY_CTRL_MSG_SET_WIFI_PARAM_RESP = 30024;
    public static final int IVY_CTRL_MSG_GET_WIFI_PARAM = 30025;
    public static final int IVY_CTRL_MSG_GET_WIFI_PARAM_RESP = 30026;
    public static final int IVY_CTRL_MSG_REFRESH_WIFI_AP_LIST = 30027;
    public static final int IVY_CTRL_MSG_REFRESH_WIFI_AP_LIST_RESP = 30028;
    public static final int IVY_CTRL_MSG_GET_WIFI_AP_LIST = 30029;
    public static final int IVY_CTRL_MSG_GET_WIFI_AP_LIST_RESP = 30030;
    public static final int IVY_CTRL_MSG_TEST_WIFI = 30031;
    public static final int IVY_CTRL_MSG_TEST_WIFI_RESP = 30032;
    public static final int IVY_CTRL_MSG_SET_DDNS_CONFIG = 30033;
    public static final int IVY_CTRL_MSG_SET_DDNS_CONFIG_RESP = 30034;
    public static final int IVY_CTRL_MSG_GET_DDNS_CONFIG = 30035;
    public static final int IVY_CTRL_MSG_GET_DDNS_CONFIG_RESP = 30036;
    public static final int IVY_CTRL_MSG_SET_P2P_INFO = 30037;
    public static final int IVY_CTRL_MSG_SET_P2P_INFO_RESP = 30038;
    public static final int IVY_CTRL_MSG_GET_P2P_INFO = 30039;
    public static final int IVY_CTRL_MSG_GET_P2P_INFO_RESP = 30040;
    public static final int IVY_CTRL_MSG_SET_NETWORK_ADAPTATION = 30041;
    public static final int IVY_CTRL_MSG_SET_NETWORK_ADAPTATION_RESP = 30042;
    public static final int IVY_CTRL_MSG_GET_NETWORK_ADAPTATION = 30043;
    public static final int IVY_CTRL_MSG_GET_NETWORK_ADAPTATION_RESP = 30044;
    //alarm
    public static final int IVY_CTRL_MSG_SET_AUDIO_ALARM_CONFIG = BASE_CTRL_MSG + 30000;
    public static final int IVY_CTRL_MSG_SET_AUDIO_ALARM_CONFIG_RESP = 32020;
    public static final int IVY_CTRL_MSG_GET_AUDIO_ALARM_CONFIG = 32021;
    public static final int IVY_CTRL_MSG_GET_AUDIO_ALARM_CONFIG_RESP = 32022;
    public static final int IVY_CTRL_MSG_SET_IO_ALARM_CONFIG = 32023;
    public static final int IVY_CTRL_MSG_SET_IO_ALARM_CONFIG_RESP = 32024;
    public static final int IVY_CTRL_MSG_GET_IO_ALARM_CONFIG = 32025;
    public static final int IVY_CTRL_MSG_GET_IO_ALARM_CONFIG_RESP = 32026;
    public static final int IVY_CTRL_MSG_SET_HUMIDITY_ALARM_CONFIG = 32027;
    public static final int IVY_CTRL_MSG_SET_HUMIDITY_ALARM_CONFIG_RESP = 32028;
    public static final int IVY_CTRL_MSG_GET_HUMIDITY_ALARM_CONFIG = 32029;
    public static final int IVY_CTRL_MSG_GET_HUMIDITY_ALARM_CONFIG_RESP = 32030;
    public static final int IVY_CTRL_MSG_SET_TEMPERATURE_ALARM_CONFIG = 32031;
    public static final int IVY_CTRL_MSG_SET_TEMPERATURE_ALARM_CONFIG_RESP = 32032;
    public static final int IVY_CTRL_MSG_GET_TEMPERATURE_ALARM_CONFIG = 32033;
    public static final int IVY_CTRL_MSG_GET_TEMPERATURE_ALARM_CONFIG_RESP = 32034;
    public static final int IVY_CTRL_MSG_CLEAN_IO_ALARM_OUTPUT = 32035;
    public static final int IVY_CTRL_MSG_CLEAN_IO_ALARM_OUTPUT_RESP = 32036;
    public static final int IVY_CTRL_MSG_SET_ONE_KEY_ALARM_CONFIG = 32037;
    public static final int IVY_CTRL_MSG_SET_ONE_KEY_ALARM_CONFIG_RESP = 32038;
    public static final int IVY_CTRL_MSG_GET_ONE_KEY_ALARM_CONFIG = 32039;
    public static final int IVY_CTRL_MSG_GET_ONE_KEY_ALARM_CONFIG_RESP = 32040;
    public static final int IVY_CTRL_MSG_SET_PEDESTRIAN_DECTECT_CONFIG = 32041;
    public static final int IVY_CTRL_MSG_SET_PEDESTRIAN_DECTECT_CONFIG_RESP = 32042;
    public static final int IVY_CTRL_MSG_GET_PEDESTRIAN_DECTECT_CONFIG = 32043;
    public static final int IVY_CTRL_MSG_GET_PEDESTRIAN_DECTECT_CONFIG_RESP = 32044;
    public static final int IVY_CTRL_MSG_SET_HUMAN_ALARM_CONFIG = 32045;
    public static final int IVY_CTRL_MSG_SET_HUMAN_ALARM_CONFIG_RESP = 32046;
    public static final int IVY_CTRL_MSG_GET_HUMAN_ALARM_CONFIG = 32047;
    public static final int IVY_CTRL_MSG_GET_HUMAN_ALARM_CONFIG_RESP = 32048;

    //Foscam Cloud
    public static final int IVY_CTRL_MSG_SET_PUSH_CONFIG = BASE_CTRL_MSG + 32000;
    public static final int IVY_CTRL_MSG_SET_PUSH_CONFIG_RESP = 34020;
    public static final int IVY_CTRL_MSG_GET_PUSH_CONFIG = 34021;
    public static final int IVY_CTRL_MSG_GET_PUSH_CONFIG_RESP = 34022;
    public static final int IVY_CTRL_MSG_SET_CLOUD_CONFIG = 34023;
    public static final int IVY_CTRL_MSG_SET_CLOUD_CONFIG_RESP = 34024;
    public static final int IVY_CTRL_MSG_GET_CLOUD_CONFIG = 34025;
    public static final int IVY_CTRL_MSG_GET_CLOUD_CONFIG_RESP = 34026;
    public static final int IVY_CTRL_MSG_SET_RTMP_CONFIG = 34027;
    public static final int IVY_CTRL_MSG_SET_RTMP_CONFIG_RESP = 34028;
    public static final int IVY_CTRL_MSG_GET_RTMP_CONFIG = 34029;
    public static final int IVY_CTRL_MSG_GET_RTMP_CONFIG_RESP = 34030;
    public static final int IVY_CTRL_MSG_SET_ALEXA_ENABLE = 34031;
    public static final int IVY_CTRL_MSG_SET_ALEXA_ENABLE_RESP = 34032;
    public static final int IVY_CTRL_MSG_GET_ALEXA_ENABLE = 34033;
    public static final int IVY_CTRL_MSG_GET_ALEXA_ENABLE_RESP = 34034;
    public static final int IVY_CTRL_MSG_SET_ALEXA_SLEEP = 34035;
    public static final int IVY_CTRL_MSG_SET_ALEXA_SLEEP_RESP = 34036;
    public static final int IVY_CTRL_MSG_SET_ALEXA_SERVER = 34037;
    public static final int IVY_CTRL_MSG_SET_ALEXA_SERVER_RESP = 34038;
    public static final int IVY_CTRL_MSG_GET_ALEXA_STATE = 34039;
    public static final int IVY_CTRL_MSG_GET_ALEXA_STATE_RESP = 34040;
    public static final int IVY_CTRL_MSG_SET_ALEXA_WAKEUP = 34041;
    public static final int IVY_CTRL_MSG_SET_ALEXA_WAKEUP_RESP = 34042;
    public static final int IVY_CTRL_MSG_TEST_PUSH = 34043;
    public static final int IVY_CTRL_MSG_TEST_PUSH_RESP = 34044;
    public static final int IVY_CTRL_MSG_SET_CHANNEL_SVR_EANBLE_BITS = 34045;
    public static final int IVY_CTRL_MSG_SET_CHANNEL_SVR_EANBLE_BITS_RESP = 34046;
    public static final int IVY_CTRL_MSG_GET_CHANNEL_SVR_EANBLE_BITS = 34047;
    public static final int IVY_CTRL_MSG_GET_CHANNEL_SVR_EANBLE_BITS_RESP = 34048;

    //NVR
    public static final int IVY_CTRL_MSG_ADD_IPC = BASE_CTRL_MSG + 34000;
    public static final int IVY_CTRL_MSG_ADD_IPC_RESP = 36020;
    public static final int IVY_CTRL_MSG_DEL_IPC = 36021;
    public static final int IVY_CTRL_MSG_DEL_IPC_RESP = 36022;
    public static final int IVY_CTRL_MSG_GET_IPC_LIST_INFO = 36023;
    public static final int IVY_CTRL_MSG_GET_IPC_LIST_INFO_RESP = 36024;
}
  • 示例
/**
* sdk 透传命令
*
* @param handle      连接句柄
* @param cmd         命令值,APP 与 设备端对齐定义
* @param cmdJsonData 命令内容,json格式的字符串
* @return 返回命令结果,json格式
*/
IvyCamera.sendCmd(int handle, int cmd, String cmdJsonData);

8.2 cgi命令

  • 描述

cgi命令,只支持Foscam旧机器,不支持IVY新机器

public static SDKResponse sendCGI(int handle, String cgi)
  • 参数
参数名 是否必须 类型 说明
handle int SDK句柄
cgi String cgi内容,格式:cmd=cmdName&param1=参数1&param2=参数2
  • 返回值

SDKResponse 返回命令结果,json格式,包含sdk执行结果和设备端返回的结果

  • 所在类

com.ivyiot.ipclibrary.model.IvyCamera

  • 引用

package com.ivyiot.ipclibrary.sdk;

public interface ISdkCallback<T> {

    void onSuccess(T result);//成功

    void onError(int errorCode);//失败

    void onLoginError(int errorCode);//连接失败错误
}
  • 示例
/**
     * cgi Command,support Foscam, not support IVY
     *
     * @param handle handle
     * @param cgi    cgi format:cmd=cmdName&param1=value1&param2=value2
     * @return  SDKResponse
     */
IvyCamera.sendCGI(int handle, String cgi);

文档更新时间: 2023-07-20 19:46   作者:庄小婵