commit
55e15e54d9
@ -84,6 +84,11 @@ users = conn.get_users()
|
||||
conn.delete_user(uid=1)
|
||||
```
|
||||
|
||||
* Remote Fingerprint Enrollment
|
||||
```
|
||||
zk.enroll_user('23')
|
||||
```
|
||||
|
||||
* Attendance Record
|
||||
```
|
||||
# Get attendances (will return list of Attendance object)
|
||||
|
21
test_user_enrollment.py
Normal file
21
test_user_enrollment.py
Normal file
@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
|
||||
from zk import ZK, const
|
||||
|
||||
sys.path.append("zk")
|
||||
|
||||
conn = None
|
||||
zk = ZK('192.168.1.201', port=4370, timeout=5)
|
||||
|
||||
try:
|
||||
conn = zk.connect()
|
||||
conn.disable_device()
|
||||
zk.set_user(26, 'Shubhamoy Chakrabarty', 0, '', '1', '26')
|
||||
zk.enroll_user('26')
|
||||
conn.enable_device()
|
||||
except Exception, e:
|
||||
print "Process terminate : {}".format(e)
|
||||
finally:
|
||||
if conn:
|
||||
conn.disconnect()
|
10
zk/base.py
10
zk/base.py
@ -417,15 +417,19 @@ class ZK(object):
|
||||
cmd_response = self.__send_command(command=command)
|
||||
print cmd_response
|
||||
|
||||
def enroll_user(self, uid):
|
||||
def enroll_user(self, uid=''):
|
||||
'''
|
||||
start enroll user
|
||||
'''
|
||||
|
||||
command = const.CMD_STARTENROLL
|
||||
uid = chr(uid % 256) + chr(uid >> 8)
|
||||
command_string = pack('2s', uid)
|
||||
cmd_response = self.__send_command(command=command, command_string=command_string)
|
||||
|
||||
checksum = 0
|
||||
session_id = self.__sesion_id
|
||||
reply_id = self.__reply_id
|
||||
response_size = 8
|
||||
cmd_response = self.__send_command(command, command_string, checksum, session_id, reply_id, response_size)
|
||||
print cmd_response
|
||||
|
||||
def clear_data(self):
|
||||
|
Loading…
Reference in New Issue
Block a user