更新时间:2024-06-11 03:56:42下载pdf
接口说明
ILockCardManager # void getCardList(long siteId, String lockDevId, int pageNo, IThingResultCallback<CardListResp> callback);
参数说明
参数 | 说明 |
---|---|
siteId | 站点 ID |
lockDevId | 门锁设备 ID |
pageNo | 页码 |
callback | 结果回调 |
示例代码
ThingOSLock.getCardManager().getCardList(siteId, deviceId, currentPageNo, new IThingResultCallback<CardListResp>() {
@Override
public void onSuccess(CardListResp result) {
//Got the card list successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
//Failed to get the card list
}
});
接口说明
ILockCard # void getCardDetail(IThingResultCallback<CardBean> callback);
参数说明
参数 | 说明 |
---|---|
callback | 结果回调 |
示例代码
ThingOSLock.newCardInstance(siteId, deviceId, cardId).getCardDetail(new IThingResultCallback<CardBean>() {
@Override
public void onSuccess(CardBean result) {
//Got the card details successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
//Failed to get the card details
}
});
接口说明
ILockCardManager # void createLimitCard(long siteId, String lockDevId, String cardName, long effectiveTime, long invalidTime, IThingResultCallback<CreateCardResp> callback);
参数说明
参数 | 说明 |
---|---|
siteId | 站点 ID |
lockDevId | 门锁设备 ID |
cardName | 卡片名称 |
effectiveTime | 有效期开始时间戳,单位毫秒 |
invalidTime | 有效期结束时间戳,单位毫秒 |
callback | 结果回调 |
示例代码
ThingOSLock.getCardManager().createLimitCard(siteId, deviceId, cardName, effectiveTime, invalidTime,
new IThingResultCallback<CreateCardResp>() {
@Override
public void onSuccess(CreateCardResp result) {
//Created a time-limited card successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
//Failed to create a time-limited card
}
});
接口说明
ILockCardManager # void createPermanentCard(long siteId, String lockDevId, String cardName, IThingResultCallback<CreateCardResp> callback);
参数说明
参数 | 说明 |
---|---|
siteId | 站点 ID |
lockDevId | 门锁设备 ID |
cardName | 卡片名称 |
callback | 结果回调 |
示例代码
ThingOSLock.getCardManager().createPermanentCard(siteId, deviceId, cardName, new IThingResultCallback<CreateCardResp>() {
@Override
public void onSuccess(CreateCardResp result) {
//Created a permanent card successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
//Failed to create a permanent card
}
});
接口说明
ILockCard # void updateName(String cardName, IThingResultCallback<Boolean> callback);
参数说明
参数 | 说明 |
---|---|
cardName | 卡片名称 |
callback | 结果回调 |
示例代码
ThingOSLock.newCardInstance(siteId, deviceId, cardId).updateName(cardName, new IThingResultCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
//Renamed the card successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
//Failed to rename the card
}
});
接口说明
ILockCard # void removeCard(String lockId, IThingResultCallback<Boolean> callback);
参数说明
参数 | 说明 |
---|---|
lockDevId | 当前卡片对应的 lockId ,从卡片详情 CardBean 中获取,对应 lockId 字段 |
callback | 结果回调 |
示例代码
ThingOSLock.newCardInstance(siteId, deviceId, cardId).removeCard(cardBean.lockId, new IThingResultCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
//Removed the card successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
//Failed to remove the card
}
});
接口说明
ILockCardManager # void clearAllCard(long siteId, String lockDevId, IThingResultCallback<Boolean> callback);
参数说明
参数 | 说明 |
---|---|
siteId | 站点 ID |
lockDevId | 门锁设备 ID |
callback | 结果回调 |
示例代码
ThingOSLock.newCardInstance(siteId, deviceId, cardId).removeAllCard(siteId, deviceId, new IThingResultCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
//Removed all cards successfully
}
@Override
public void onError(String errorCode, String errorMessage) {
//Failed to remove all cards
}
});
清空卡片是指清除当前门锁所录入的全部卡片。
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈