1313#include " RealSenseID/SignatureCallback.h"
1414#include " RealSenseID/Status.h"
1515#include " RealSenseID/MatchResultHost.h"
16+ #include < cstddef>
1617
1718#ifdef ANDROID
1819#include " RealSenseID/AndroidSerialConfig.h"
@@ -54,7 +55,7 @@ class RSID_API FaceAuthenticator
5455 /* *
5556 * Connect to device using the given Android serial config
5657 * reconnect if already connected.
57- *
58+ *
5859 * @param[in] config Android config Serial configuration
5960 * @return Status (Status::Ok on success).
6061 */
@@ -87,6 +88,11 @@ class RSID_API FaceAuthenticator
8788 Status Unpair ();
8889#endif // RSID_SECURE
8990
91+ /* *
92+ * Max user id size is 30 bytes, 31 bytes including '\0'
93+ */
94+ static constexpr size_t MAX_USERID_LENGTH = 31 ;
95+
9096 /* *
9197 * Enroll a user.
9298 * Starts the enrollment process, which starts the camera, captures frames and then extracts
@@ -95,7 +101,8 @@ class RSID_API FaceAuthenticator
95101 * Once process is done, camera will be closed properly and device will be in ready state.
96102 *
97103 * @param[in] callback User defined callback to handle the process updates.
98- * @param[in] user_id Null terminated C string of ascii chars. Max user id size is 30 bytes (max total of 31 bytes
104+ * @param[in] user_id Null terminated C string of ascii chars. Max user id size is MAX_USERID_LENGTH bytes
105+
99106 * including the terminating zero byte). user.
100107 * @return Status (Status::Ok on success).
101108 */
@@ -116,7 +123,7 @@ class RSID_API FaceAuthenticator
116123 /* *
117124 * Start Authentication Loop.
118125 * Starts infinite authentication loop. Call Cancel to stop it.
119- *
126+ *
120127 * @param[in] callback User defined callback object to handle the process updates.
121128 * @return Status (Status::Ok on success).
122129 */
@@ -125,7 +132,7 @@ class RSID_API FaceAuthenticator
125132 /* *
126133 * Detect a spoof attempt.
127134 * This is advanced mode feature, please check if FW supports it using QueryDeviceConfig API.
128- * Starts the spoof flow which also includes face detection,
135+ * Starts the spoof flow which also includes face detection,
129136 * During the process callbacks will be called to provide information if needed.
130137 * Once process is done, camera will be closed properly and device will be in ready state.
131138 *
@@ -166,47 +173,49 @@ class RSID_API FaceAuthenticator
166173
167174 /* *
168175 * Query FW authentication settings.
169- *
176+ *
170177 * @param[out] device_config config with settings.
171178 * @return Status (Status::Ok on success).
172179 */
173180 Status QueryDeviceConfig (DeviceConfig& device_config);
174181
175182 /* *
176183 * Query the device about all enrolled users.
177- *
178- * @param[out] pre-allocated array of user ids.
184+ *
185+ * @param[out] pre-allocated array of user ids. app is expected to allocated array of length = QueryNumberOfUsers(),
186+ * each entry in the array is string of size = MAX_USERID_LENGTH
179187 * @param[in/out] number of users to retrieve.
180188 * @return Status (Status::Ok on success).
181189 */
182190 Status QueryUserIds (char ** user_ids, unsigned int & number_of_users_in_out);
183191
184192 /* *
185193 * Query the device about the number of enrolled users.
186- *
194+ *
187195 * @param[out] number of users.
188196 * @return Status (Status::Ok on success).
189197 */
190198 Status QueryNumberOfUsers (unsigned int & number_of_users);
191199
192200 /* *
193201 * Prepare device to standby - for now it's saving database of users to flash.
194- *
202+ *
195203 * @return Status (Status::Ok on success).
196204 */
197205 Status Standby ();
198206
199- /* ************************************************/
200- /* ************* Server Mode Methods **************/
201- /* ************************************************/
207+ /* *************************************************************************/
208+ /* ************************** Host Mode Methods ****************************/
209+ /* *************************************************************************/
210+
202211 /* *
203212 * Attempt to extract faceprints using enrollment flow.
204213 * Starts the enrollment process, which starts the camera, captures frames, extracts
205214 * faceprints of different face-poses, and sends them to the host.
206215 * During the process callbacks will be called to provide information if needed.
207216 * Once process is done, camera will be closed properly and device will be in ready state.
208217 *
209- * @param[in] callback User defined callback to handle the process updates.
218+ * @param[in] callback User defined callback to handle the process updates.
210219 * @return Status (Status::Ok on success).
211220 */
212221 Status ExtractFaceprintsForEnroll (EnrollFaceprintsExtractionCallback& callback);
@@ -226,8 +235,8 @@ class RSID_API FaceAuthenticator
226235 /* *
227236 * Attempt faceprints extraction in a loop using authentication flow.
228237 * Starts infinite authentication loop. Call Cancel to stop it.
229- *
230- * @param[in] callback User defined callback object to handle the process updates.
238+ *
239+ * @param[in] callback User defined callback object to handle the process updates.
231240 * @return Status (Status::Ok on success).
232241 */
233242 Status ExtractFaceprintsForAuthLoop (AuthFaceprintsExtractionCallback& callback);
@@ -240,10 +249,11 @@ class RSID_API FaceAuthenticator
240249 * @param[in] new_faceprints faceprints which were extracted from a single image of a person.
241250 * @param[in] existing_faceprints faceprints which were calculated from one or more images of the same person.
242251 * @param[in] updated_faceprints a placeholder to write the updated-faceprints into, if the match was successful.
243- * @return MatchResultHost match result, the 'success' field indicates if the two faceprints belong to the same person.
252+ * @return MatchResultHost match result, the 'success' field indicates if the two faceprints belong to the same
253+ * person.
244254 */
245255 MatchResultHost MatchFaceprints (Faceprints& new_faceprints, Faceprints& existing_faceprints,
246- Faceprints& updated_faceprints);
256+ Faceprints& updated_faceprints);
247257
248258private:
249259 FaceAuthenticatorImpl* _impl = nullptr ;
0 commit comments