Reference

This module provides functions for face and palm recognition, including enrolling users, recognizing users, and managing user data, suitable for access control and identity verification systems.

Installation Opening Recommendations

API Description

  /**
   * @fn checkState
   * @brief Check if the module is ready and idle
   * @return bool type
   * @retval true Module is ready
   * @retval false Module is not ready
   * @note Use checkState() to check status before initialization or executing commands
   */
  bool checkState(void);

  /**
   * @fn enrollUser
   * @brief Enroll face or palm for recognition
   * @details Ensure that the parameters meet the requirements.
   * @param kind eFaceUser for face enrollment, ePalmUser for palm enrollment
   * @param userName User name, length 1 to 32 characters
   * @param id Store the enrolled user ID, range 1 to 800
   * @param idAdmin Set user role, eRoleAdmin for administrator, eRoleNormal
   * @return Task execution result
   * @retval NO_ACK -1 No response from module
   * @retval ERROR  -2 User parameter error, such as invalid user type or name length
   * @retval 1 Success
   * @retval 2 Duplicate
   * @retval 3 Enrollment timeout
   */
  int8_t enrollUser(eUserKind_t kind, const char* userName, uint16_t* id, eIsAdmin_t idAdmin);

  /**
   * @fn getAllNumsFaceUserIDs
   * @brief Get the number of face users
   * @return Number of face users
   * @retval NO_ACK -1 No response from module
   */
  int16_t getAllNumsFaceUserIDs(void);

  /**
   * @fn getAllNumsPalmUserIDs
   * @brief Get the number of palm users
   * @return Number of palm users
   * @retval NO_ACK -1 No response from module
   */
  int16_t getAllNumsPalmUserIDs(void);

  /**
   * @fn getAllFaceUserIDs
   * @brief Retrieve the specific information of the face user
   * @param id_buffer store the specific information of the face user
   * @param length the length of the id_buffer
   * @return result
   * @retval NO_ACK -1 No response from module
   * @retval ERROR  -2 User parameter error:The length of the incoming array is less than the number of users.
   */
  int8_t getAllFaceUserIDs(uint16_t *id_buffer,uint16_t length);

  /**
   * @fn getRecognitionResult
   * @brief Recognize the user
   * @param ID Store the recognized user information
   * @return Execution result
   * @retval NO_ACK -1 No response from module
   * @retval 1 Success
   * @retval 2 Timeout
   * @retval 3 User not found
   */
  int8_t getRecognitionResult(sId_t* ID);

  /**
   * @fn deleteUser
   * @brief Delete specified user
   * @details The ID must fall within the valid range
   * @param id User ID, range 1 to 800
   * @return Delete result
   * @retval NO_ACK -1 No response from module
   * @retval ERROR  -2 ID out of range 1 to 800
   * @retval 1 Delete success
   * @retval 2 User not found
   * @retval 3 Unknown error, suggest retry
   */
  int8_t deleteUser(uint16_t id);

  /**
   * @fn deleteAllUser
   * @brief Delete all users
   * @return Delete result
   * @retval NO_ACK -1 No response from module
   * @retval 1 Delete success
   * @retval 2 Unknown error, suggest retry
   */
  int8_t deleteAllUser(void);

  /**
   * @fn ledColor
   * @brief Control LED status
   * @details Ensure that the parameters meet the requirements
   * @param color LED color: COLOR_GREEN green, COLOR_RED red, COLOR_WHITE white
   * @param kind LED_ON turn on, LED_OFF turn off
   * @return Execution result
   * @retval NO_ACK -1 No response from module
   * @retval ERROR -2 Invalid kind or color parameter
   * @retval 1 Success
   */
  int8_t ledColor(uint8_t color, uint8_t kind);

Was this article helpful?

TOP