指纹管理

更新时间:2024-06-11 08:21:18下载pdf

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

接口说明

- (void)getFingerprintListWithSiteId:(long long)siteId
                            deviceId:(NSString *)deviceId
                              pageNo:(NSInteger)pageNo
                            pageSize:(NSInteger)pageSize
                             success:(ThingLockFingerprintSuccessList)success
                             failure:(ThingFailureError)failure;

参数说明

参数 说明
siteId 站点 ID
deviceId 门锁设备 ID
pageNo 页码
pageSize 每页数量
success 成功回调
failure 失败回调

示例代码

[ThingLockFingerprintManager.shared getFingerprintListWithSiteId:siteId
                                                        deviceId:self.devId
                                                          pageNo:self.pageNo
                                                        pageSize:20
                                                         success:^(NSArray<ThingLockFingerprintModel *> * _Nullable list, NSInteger totalPage) {
} failure:^(NSError *error) {

}];

新增限时指纹

接口说明

- (void)createLimitFingerprintWithSiteId:(long long)siteId
                                deviceId:(NSString *)deviceId
                         fingerprintName:(NSString *)fingerprintName
                   effectiveTimeInterval:(NSTimeInterval)effectiveTimeInterval
                     invalidTimeInterval:(NSTimeInterval)invalidTimeInterval
                            inputCallback:(ThingLockFingerprintInputCallback)inputCallback
                                 success:(ThingSuccessHandler)success
                                 failure:(ThingFailureError)failure;

参数说明

参数 说明
siteId 站点 ID
lockDevId 门锁设备 ID
fingerprintName 指纹名称
effectiveTimeInterval 生效时间的整点时间戳,单位秒。例如 15:32,则传入 15:00 的时间戳
invalidTimeInterval 失效时间的整点时间戳,单位秒。例如 18:24,则传入 18:00 的时间戳
inputCallback 指录入过程回调
success 成功回调
failure 失败回调

示例代码

[ThingLockFingerprintManager.shared createLimitFingerprintWithSiteId:SiteManager.shared.siteId
                                                            deviceId:self.devId
                                                     fingerprintName:self.nameLabel.text
                                               effectiveTimeInterval:effectiveTime
                                                 invalidTimeInterval:invalidTime
                                                       inputCallback:^(NSInteger currentCount, NSInteger totalCount) {
} success:^{

} failure:^(NSError *error) {

}];

新增永久指纹

接口说明

- (void)createPermanentFingerprintWithSiteId:(long long)siteId
                                    deviceId:(NSString *)deviceId
                             fingerprintName:(NSString *)fingerprintName
                               inputCallback:(ThingLockFingerprintInputCallback)inputCallback
                                     success:(ThingSuccessHandler)success
                                     failure:(ThingFailureError)failure;

参数说明

参数 说明
siteId 站点 ID
deviceId 门锁设备 ID
fingerprintName 指纹名称
inputCallback 录入过程回调
success 成功回调
failure 失败回调

示例代码

[ThingLockFingerprintManager.shared createPermanentFingerprintWithSiteId:SiteManager.shared.siteId
                                                            deviceId:self.devId
                                                     fingerprintName:self.nameLabel.text
                                                       inputCallback:^(NSInteger currentCount, NSInteger totalCount) {
} success:^{

} failure:^(NSError *error) {

}];

获取指纹详情

接口说明

- (void)getFingerprintDetailWithSiteId:(long long)siteId
                              deviceId:(NSString *)deviceId
                         fingerprintId:(NSString *)fingerprintId
                               success:(ThingLockFingerprintSuccess)success
                               failure:(ThingFailureError)failure;

参数说明

参数 说明
siteId 站点 ID
deviceId 门锁设备 ID
fingerprintId 指纹 ID
success 成功回调
failure 失败回调

示例代码

[ThingLockFingerprintManager.shared getFingerprintDetailWithSiteId:siteId
                                                          deviceId:self.devId
                                                     fingerprintId:self.fingerprintId
                                                           success:^(ThingLockFingerprintModel * _Nullable model) {


} failure:^(NSError *error) {

}];

修改指纹名称

接口说明

- (void)updateNameWithSiteId:(long long)siteId
                    deviceId:(NSString *)deviceId
               fingerprintId:(NSString *)fingerprintId
             fingerprintName:(NSString *)fingerprintName
                     success:(ThingSuccessHandler)success
                     failure:(ThingFailureError)failure;

参数说明

参数 说明
siteId 站点 ID
deviceId 门锁设备 ID
fingerprintId 指纹 ID
fingerprintName 指纹名称
success 成功回调
failure 失败回调

示例代码

[ThingLockFingerprintManager.shared updateNameWithSiteId:siteId
                                                deviceId:self.devId
                                           fingerprintId:self.model.fingerprintId
                                         fingerprintName:name
                                              success:^{

} failure:^(NSError *error) {

}];

删除指纹

接口说明

- (void)removeFingerprintWithSiteId:(long long)siteId
                           deviceId:(NSString *)deviceId
                      fingerprintId:(NSString *)fingerprintId
                             lockId:(NSString *)lockId
                            success:(ThingSuccessHandler)success
                            failure:(ThingFailureError)failure;

参数说明

参数 说明
siteId 站点 ID
deviceId 门锁设备 ID
fingerprintId 指纹 ID
lockId 指纹的 lockId,从指纹详情中获取,对应 lockId 字段
success 成功回调
failure 失败回调

示例代码

[ThingLockFingerprintManager.shared removeFingerprintWithSiteId:siteId
                                                       deviceId:self.devId
                                                  fingerprintId:self.fingerprintId
                                                         lockId:self.model.lockId
                                                        success:^{

} failure:^(NSError *error) {

}];

清空指纹

接口说明

- (void)clearAllFingerprintWithSiteId:(long long)siteId
                             deviceId:(NSString *)deviceId
                              success:(ThingSuccessHandler)success
                              failure:(ThingFailureError)failure;

参数说明

参数 说明
siteId 站点 ID
deviceId 门锁设备 ID
success 成功回调
failure 失败回调

示例代码

[ThingLockFingerprintManager.shared clearAllFingerprintWithSiteId:siteId
                                                         deviceId:self.devId
                                                          success:^{

} failure:^(NSError *error) {
  
}];

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