Reference

This article delves into the UART communication protocol and API functions, providing comprehensive instructions for user management, including enrolling and deleting users, as well as enabling recognition through face, palm, and QR code methods. It highlights efficient data management techniques for optimal use.

Communication Protocol Description

  • UART communication: Baud rate 115200
  • AT commands:
  • AT+GETUSERS: Get all user information
  • AT+DELUSER=ID: Delete the specified user (e.g., AT+DELUSER=0x1001)
  • AT+DELALLUSERS: Delete all users
  • Note: Commands must end with \n

API Description

 /**
   * @fn enrollUser
   * @brief Enroll a user with face or palm information
   * @param admin  
   * @n     eNormal     Normal permission
   * @n     eAdmin:     Admin permission
   * @param userName  Enroll user name
   * @param timeout  timeout
   * @return sUserData_t
   * @n      UID                    The user ID
   * @n      userName               The user name
   * @n      admin                  The user's authority
   * @n      type                   The type of enrollment
   * @n         eNull                   Null
   * @n         eFace                   Face
   * @n         ePalm                   Palm
   * @n      result                 Registration result
   * @n         eSuccess                Success
   * @n         eFailedFaceEnrolled     Failed to enroll, the face has been enrolled
   * @n         eFailedInvalidParam     Invalid parameter
   * @n         eFailedMaxUser          Maximum number of users reached
   * @n         eFailedCamera           Failed to capture the face
   * @n         eFailedTimeout          Time out
  */
  sUserData_t enrollUser(uint8_t admin,const char* userName, uint8_t timeout);

  /**
   * @fn signedAccount
   * @brief get the information of all users
   * @return sUserData_t
   * @n       result                 Get the result
   * @n           0                      Success
   * @n           default                Failed
   * @n       userNum                The Number of users
   * @n       UIDS                   All user ids
  */
  sAllUserID_t getAllUserIDs(void);

  /**
   * @fn enableFaceFrame
   * @brief Open the face frame
   * @return true or false
  */
  bool enableFaceFrame(void);

  /**
   * @fn getRecognitionResult
   * @brief Get the recognition result
   * @param timeout 
   * @return sRecognitionData_t
   * @n       result                  he result of recognition
   * @n       userData                The user information
   * @n       noteData                The note information
   * @n       QRDdata                 The QR code information
   * @n       type                    The type of recognition
   * @n           eNull                   Null
   * @n           eFace                   Face
   * @n           ePalm                   Palm
   * @n           eQR                     QR code
  */
  recognitionData_t getRecognitionResult(uint8_t timeout);

  /**
   * @fn startContinuousFaceRecognition
   * @brief Start continuous face recognition
   * @param timeout 
   * @return sRecognitionData_t
   * @n       result                  The result of recognition
   * @n       userData                The user information
   * @n       noteData                The note information
   * @n       QRDdata                 The QR code information
   * @n       type                    The type of recognition
   * @n           eNull                   Null
   * @n           eFace                   Face
   * @n           ePalm                   Palm
   * @n           eQR                     QR code
  */
  recognitionData_t startContinuousFaceRecognition(uint8_t timeout);

  /** 
   * @fn deleteUser
   * @brief Delete a user by UID
   * @param UID 
   * @return bool
   * @n       true     Success
   * @n       false    Failed
  */
  bool deleteUser(uint16_t UID);

  /**
   * @fn deleteAllUser
   * @brief Delete all users
   * @return bool
   * @n       true     Success
   * @n       false    Failed
  */
  bool deleteAllUser(void);

Other Supplementary Information

Was this article helpful?

TOP