def enroll_user(self, uid=0, temp_id=0, user_id=''):
        """
        start enroll user

        :param uid: uid
        :param temp_id: template id
        :param user_id: user ID
        :return: bool
        """
        command = const.CMD_STARTENROLL
        done = False
        if  not user_id:
            users = self.get_users()
            users = list(filter(lambda x: x.uid==uid, users))
            if len(users) >= 1:
                user_id = users[0].user_id
            else:
                return False
        if self.tcp:
            command_string = pack('<24sbb',str(user_id).encode(), temp_id, 1)
        else:
            command_string = pack('<Ib', int(user_id), temp_id)
        self.cancel_capture()
        cmd_response = self.__send_command(command, command_string)
        if not cmd_response.get('status'):
            raise ZKErrorResponse("Cant Enroll user #%i [%i]" %(uid, temp_id))
        self.__sock.settimeout(60)
        attempts = 3
        while attempts:
            if self.verbose: print("A:%i esperando primer regevent" % attempts)
            data_recv = self.__sock.recv(1032)
            self.__ack_ok()
            if self.verbose: print(codecs.encode(data_recv,'hex'))
            if self.tcp:
                if len(data_recv) > 16:
                    res = unpack("H", data_recv.ljust(24,b"\x00")[16:18])[0]
                    if self.verbose: print("res %i" % res)
                    if res == 0 or res == 6 or res == 4:
                        if self.verbose: print ("posible timeout  o reg Fallido")
                        break
            else:
                if len(data_recv) > 8:
                    res = unpack("H", data_recv.ljust(16,b"\x00")[8:10])[0]
                    if self.verbose: print("res %i" % res)
                    if res == 6 or res == 4:
                        if self.verbose: print ("posible timeout")
                        break
            if self.verbose: print ("A:%i esperando 2do regevent" % attempts)
            data_recv = self.__sock.recv(1032)
            self.__ack_ok()
            if self.verbose: print (codecs.encode(data_recv, 'hex'))
            if self.tcp:
                if len(data_recv) > 8:
                    res = unpack("H", data_recv.ljust(24,b"\x00")[16:18])[0]
                    if self.verbose: print("res %i" % res)
                    if res == 6 or res == 4:
                        if self.verbose: print ("posible timeout  o reg Fallido")
                        break
                    elif res == 0x64:
                        if self.verbose: print ("ok, continue?")
                        attempts -= 1
            else:
                if len(data_recv) > 8:
                    res = unpack("H", data_recv.ljust(16,b"\x00")[8:10])[0]
                    if self.verbose: print("res %i" % res)
                    if res == 6 or res == 4:
                        if self.verbose: print ("posible timeout  o reg Fallido")
                        break
                    elif res == 0x64:
                        if self.verbose: print ("ok, continue?")
                        attempts -= 1
        if attempts == 0:
            data_recv = self.__sock.recv(1032)
            self.__ack_ok()
            if self.verbose: print (codecs.encode(data_recv, 'hex'))
            if self.tcp:
                res = unpack("H", data_recv.ljust(24,b"\x00")[16:18])[0]
            else:
                res = unpack("H", data_recv.ljust(16,b"\x00")[8:10])[0]
            if self.verbose: print("res %i" % res)
            if res == 5:
                if self.verbose: print ("finger duplicate")
            if res == 6 or res == 4:
                if self.verbose: print ("posible timeout")
            if res  == 0:
                size = unpack("H", data_recv.ljust(16,b"\x00")[10:12])[0]
                pos = unpack("H", data_recv.ljust(16,b"\x00")[12:14])[0]
                if self.verbose: print("enroll ok", size, pos)
                done = True
        self.__sock.settimeout(self.__timeout)
        self.reg_event(0) # TODO: test
        self.cancel_capture()
        self.verify_user()
        return done
start enroll user

        :param uid: uid
        :param temp_id: template id
        :param user_id: user ID
        :return: bool