static void verify (FpDevice *device) { GError *error = NULL; FpPrint * print = NULL; g_autoptr(GVariant) data = NULL; guint8 finger; const char *user_id; gsize user_id_len = 0; /* CV Specific variables */ cv_status status; cv_obj_handle templateHandle; cv_fp_result result = 0x00; cv_nonce captureID; /* Get the task data from the verify app */ fpi_device_get_verify_data (device, &print); g_object_get (print, "fpi-data", &data, NULL); g_debug ("data is %p", data); finger = fp_print_get_finger (print); if(!parse_print_data (data, &finger, &user_id, &user_id_len)) { G_DEBUG_HERE(); fpi_device_verify_complete (device, fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL)); } g_debug ("user_id: %s, finger: %d", user_id, finger); /* Get the template handle */ templateHandle = atoi(&user_id[15]); g_debug ("templateHandle is %d", templateHandle); // Capture the data first cvif_fingerprint_capture_start(&captureID); GCancellable cancellable, *pCancellable; pCancellable = &cancellable; pCancellable = fpi_device_get_cancellable (device); cv_status cancelStatus; // Wait for the capture to be completed interrupt while(!cvif_process_interrupt(MAX_WAIT_RX_IDENTIFY_TIME)) { if(g_cancellable_is_cancelled (pCancellable)) { cancelStatus = cv_fingerprint_capture_cancel(); if (cancelStatus != CV_SUCCESS) { fp_info("cv_fingerprint_capture_cancel failed %x : \n", cancelStatus); } fp_info ("Verify failed!\n"); fpi_device_verify_report (device, FPI_MATCH_FAIL, NULL, NULL); fpi_device_verify_complete (device, NULL); return; } } /* Now call the cv identify to verify the user */ status = cvif_fingerprint_identify(&templateHandle, 1, &result); if(CV_SUCCESS == status) { if(result == CV_MATCH_FOUND) { fp_info ("Verify was successful!\n"); fpi_device_verify_report (device, FPI_MATCH_SUCCESS, print, NULL); fpi_device_report_finger_status_changes (device, FP_FINGER_STATUS_NONE, FP_FINGER_STATUS_PRESENT); fpi_device_verify_complete (device, NULL); return; } else { fp_info ("Verify failed!\n"); fpi_device_verify_report (device, FPI_MATCH_FAIL, NULL, NULL); fpi_device_verify_complete (device, NULL); return; } } fp_info ("Verify failed!\n"); fpi_device_verify_complete (device, error); }