Closed ykptke closed 5 years ago
I tried this solution and successed. https://github.com/bulentv/js_zklib/blob/master/zklib/zkuser.js#L76-L88
setUser(uid, password = '', name = '', card_number, user_id, cb) {
const command_string = Buffer.alloc(72);
command_string.writeUInt16LE(uid, 0);
command_string[2] = 0;
command_string.write(password, 3, 11);
command_string.write(name, 11, 35);
command_string.writeUInt32LE(card_number, 35, 39);
command_string[39] = 1;
command_string.writeUInt32LE(0, 40);
command_string.write(user_id ? user_id.toString(10) : '', 48);
this.executeCmd(Commands.USER_WRQ, command_string, cb);
}
@ykptke if this code works, u can create a pull request for it
@ykptke cardno is the field for card number.
I didn't find how to set card number.