AutoLock
1.AutoLock.getState
Get Current Lock State
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.getState | Get Current State |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| Param | Value | Desc |
|---|---|---|
| data.state | <String,Necessary> | Current lock state;["Locked","UnLocked"] |
| data.battery | <String,Necessary> | The battery of the lock; ["high","normal","low","empty"] |
2.AutoLock.lock
Lock the special lock
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.lock | Lock Lock |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| Param | Value | Desc |
|---|---|---|
| data.state | <String,Necessary> | Current lock state;"Locked" |
3.AutoLock.unlock
UnLock the special lock
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.unlock | Unlock Lock |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| Param | Value | Desc |
|---|---|---|
| data.state | <String,Necessary> | Current lock state;"Locked" |
4.AutoLock.getUserInfo
Get the user info by given user index, Admin is 0 .
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.getUserInfo | Get user info by index |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| params.userId | <String,Necessary> | The index of the user that you want to fetch info, admin is 0 |
| Param | Value | Desc |
|---|---|---|
| data.userInfo.maxCount | <Integer,Necessary> | The count of users. |
| data.userInfo.index | <Integer,Necessary> | Current userIndex. |
| data.userInfo.pwdCount | <Integer,Necessary> | The count of this user's password/card/finger |
| data.userInfo.typeCode | <Integer,Necessary> | The type of this user, ["管理员","主人",'孩子',"客人","保姆","钟点工","临时工"] |
| data.userInfo.nameBytes | <ArrayBuffer,Necessary> | The buffer of username,"GBK" encoded |
5.AutoLock.addUser
Add user for lock
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.addUser | Add User |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| params.nameBytes | <ArrayBuffer,Necessary> | The username you want to add; |
| Param | Value | Desc |
|---|---|---|
| data.userInfo.index | <Integer,Necessary> | userIndex of the new user. |
6.AutoLock.deleteUser
Delete user for this lock
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.deleteUser | Get user info by index |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| params.userId | <Integer,Necessary> | The index of user that you want to delete; |
| Param | Value | Desc|
7.AutoLock.getUserPasswords
Lock Lock
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.getUserPasswords | Get user‘s password info by index |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| params.userId | <Integer,Necessary> | The index of user; |
| params.passwordId | <Integer,Necessary> | The index of passowrd; 0 is first |
| Param | Value | Desc |
|---|---|---|
| data.passwordInfo.maxCount | <Integer,Necessary> | Count of passwords |
| data.passwordInfo.id | <Integer,Necessary> | Index of password |
| data.passwordInfo.typeCode | <Integer,Necessary> | Type of password,["密码","指纹","卡"] |
| data.passwordInfo.password | <NSString,Necessary> | Content of password |
8.AutoLock.addUserPassword
Lock Lock
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.addUserPassword | Add password for special user |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| params.userId | <Integer,Necessary> | The index of user; |
| params.password | <NSString,Necessary> | The password you want to add |
| Param | Value | Desc |
|---|
9.AutoLock.addUserCard
Lock Lock
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.addUserPassword | Add password for special user |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| params.userId | <Integer,Necessary> | The index of user; |
| params.cardNo | <NSString,Necessary> | The password you want to add |
| Param | Value | Desc |
|---|
10.AutoLock.delUserPassword
Lock Lock
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.addUserCard | Delete password |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| params.userId | <Integer,Necessary> | The index of user; |
| params.passwordId | <NSString,Necessary> | Index of password |
| params.passwordTypeCode | <NSString,Necessary> | Type of password |
| Param | Value | Desc |
|---|
11.AutoLock.clearPwd
Lock Lock
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.clearPwd | Clear all passwords |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| Param | Value | Desc |
|---|
12.AutoLock.getLogs
Get lock logs
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.getLogs | Clear all passwords |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| Param | Value | Desc |
|---|
13.AutoLock.getVersion
Get firmware info
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.getVersion | Get firmware info; |
| targetDevice | <String,Necessary> | DeviceId of this device; |
| token | <String,Necessary> | Net Token of this device; |
| Param | Value | Desc |
|---|---|---|
| data.version | <String,Necessary> | Current Version; |
| data.newVersion.versionId | <String,Optional> | Id of the newest version; |
| data.newVersion.versionCode | <String,Optional> | Code of the newest version; |
| data.newVersion.fileSize | <String,Optional> | File Size of the newest version; |
14.AutoLock.startUpgrade
Start Upgrade
| Param | Value | Desc |
|---|---|---|
| method | AutoLock.startUpgrade | Start Upgrade |
| targetDevice | <String,Necessary> | DeviceId of this device; |
| token | <String,Necessary> | Net Token of this device; |
| params.versionId | <String,Necessary> | Version Id you want to upgrade; |
| Param | Value | Desc |
|---|---|---|
| data.isStarted | <Boolean,Necessary> | Is upgrading started; |