指纹管理

更新时间:2024-06-11 03:56:53下载pdf

获取门锁已录入的指纹列表

接口说明

ILockFingerprintManager # void getFingerprintList(long siteId, String lockDevId, int pageNo, IThingResultCallback<FingerprintListResp> callback);

参数说明

参数 说明
siteId 站点 ID
lockDevId 门锁设备 ID
pageNo 页码
callback 结果回调

示例代码

ThingOSLock.getFingerprintManager().getFingerprintList(siteId, deviceId, currentPageNo, new IThingResultCallback<FingerprintListResp>() {
    @Override
    public void onSuccess(FingerprintListResp result) {
      //Got the fingerprint list successfully
    }

    @Override
    public void onError(String errorCode, String errorMessage) {
      //Failed to get the fingerprint list
    }
});

新增限时指纹

接口说明

ILockFingerprintManager # void createLimitFingerprint(long siteId, String lockDevId, String fingerprintName, long effectiveTime, long invalidTime,
                                IThingFingerprintInputCallback inputCallback, IThingResultCallback<CreateFingerprintResp> callback);

参数说明

参数 说明
siteId 站点 ID
lockDevId 门锁设备 ID
fingerprintName 指纹名称
effectiveTime 有效期开始时间,单位毫秒
invalidTime 有效期结束时间,单位毫秒
inputCallback 录入过程回调
callback 录入结果回调

示例代码

ThingOSLock.getFingerprintManager().createLimitFingerprint(siteId, deviceId, cardName, effectiveTime, invalidTime, new IThingFingerprintInputCallback() {
                        @Override
                        public void totalInputCount(int count) {
                          //Total count you need to input
                        }

                        @Override
                        public void currentInputCount(int count) {
                          //Current input count
                        }
                    },
                    new IThingResultCallback<CreateFingerprintResp>() {
                        @Override
                        public void onSuccess(CreateFingerprintResp result) {
                          //Created a time-limited fingerprint successfully
                        }

                        @Override
                        public void onError(String errorCode, String errorMessage) {
                          //Failed to create a time-limited fingerprint
                        }
                    });

新增永久指纹

接口说明

ILockFingerprintManager # void createPermanentFingerprint(long siteId, String lockDevId, String fingerprintName,
                                    IThingFingerprintInputCallback inputCallback, IThingResultCallback<CreateFingerprintResp> callback);

参数说明

参数 说明
siteId 站点 ID
lockDevId 门锁设备 ID
fingerprintName 指纹名称
inputCallback 录入过程回调
callback 录入结果回调

示例代码

ThingOSLock.getFingerprintManager().createPermanentFingerprint(siteId, deviceId, cardName, new IThingFingerprintInputCallback() {
                        @Override
                        public void totalInputCount(int count) {
                          //Total count you need to input
                        }

                        @Override
                        public void currentInputCount(int count) {
                          //Current input count
                        }
                    },
                    new IThingResultCallback<CreateFingerprintResp>() {
                        @Override
                        public void onSuccess(CreateFingerprintResp result) {
                          //Created a permanent fingerprint successfully
                        }

                        @Override
                        public void onError(String errorCode, String errorMessage) {
                          //Failed to create a permanent fingerprint
                        }
                    });

获取指纹详情

接口说明

ILockFingerprint # void getFingerprintDetail(IThingResultCallback<FingerprintBean> callback);

参数说明

参数 说明
callback 结果回调

示例代码

ThingOSLock.newFingerprintInstance(siteId, deviceId, fingerprintId).getFingerprintDetail(new IThingResultCallback<FingerprintBean>() {
            @Override
            public void onSuccess(FingerprintBean result) {
              //Got fingerprint details successfully
            }

            @Override
            public void onError(String errorCode, String errorMessage) {
              //Failed to get fingerprint details
            }
        });

修改指纹名称

接口说明

ILockFingerprint # void updateName(String fingerprintName, IThingResultCallback<Boolean> callback);

参数说明

参数 说明
fingerprintName 指纹名称
callback 结果回调

示例代码

ThingOSLock.newFingerprintInstance(siteId, deviceId, fingerprintId).updateName(newName, new IThingResultCallback<Boolean>() {
            @Override
            public void onSuccess(Boolean result) {
              //Renamed the fingerprint successfully
            }

            @Override
            public void onError(String errorCode, String errorMessage) {
              //Failed to rename the fingerprint
            }
        });

删除指纹

接口说明

ILockFingerprint # void remove(String lockId, IThingResultCallback<Boolean> callback);

参数说明

参数 说明
lockId 指纹的 lockId,从指纹详对象中获取,对应 FingerprintBean 对象的 lockId 字段
callback 结果回调

示例代码

ThingOSLock.newFingerprintInstance(siteId, deviceId, fingerprintId).remove(fingerprintBean.lockId, new IThingResultCallback<Boolean>() {
    @Override
    public void onSuccess(Boolean result) {
      //Removed the fingerprint successfully
    }

    @Override
    public void onError(String errorCode, String errorMessage) {
      //Failed to remove the fingerprint
    }
});

清空所有指纹

接口说明

ILockFingerprint # void clearAllFingerprint(long siteId, String lockDevId, IThingResultCallback<Boolean> callback);

参数说明

参数 说明
siteId 站点 ID
lockDevId 门锁设备 ID
callback 结果回调

示例代码

ThingOSLock.getFingerprintManager().clearAllFingerprint(new IThingResultCallback<Boolean>() {
    @Override
    public void onSuccess(Boolean result) {
      //Removed all fingerprints successfully
    }

    @Override
    public void onError(String errorCode, String errorMessage) {
      //Failed to remove all fingerprints
    }
});

清空指纹是指清除当前门锁所录入的全部指纹。