search_label: BUFFER = 1; printf("Search Finger Test\n"); nRet = ZAZ_NO_FINGER; printf("1. Search: Please press finger1......\n"); while(nRet == ZAZ_NO_FINGER) { nRet=ZAZGetImage(nhanle,DEV_ADDR); counts++; if(counts > 50) printf("wating time over......\n"); else printf("wating time %d......\n",counts); } if(nRet != ZAZ_OK) { printf("ZAZGetImage is Fail ,errorr code = %d......\n",nRet); return 0; } printf("2. ZAZGetImage ok......\n"); //BYTE pImage[256*288]; //int nImageLen; //ZAZUpImage(DEV_ADDR,pImage,&nImageLen); //ZAZImgData2BMP(pImage,"fp.bmp"); nRet = ZAZGenChar(nhanle,DEV_ADDR,BUFFER); if(nRet != ZAZ_OK) { printf("ZAZGenChar is Fail ,errorr code = %d......\n",nRet); goto search_label; } printf("3. ZAZGenChar ok Buffer = %d......\n",BUFFER); int nFinger; int nSorce; nRet = ZAZSearch(nhanle,DEV_ADDR,CHAR_BUFFER_A,0,200,&nFinger,&nSorce); if(nRet != ZAZ_OK) { printf("ZAZGenChar is Fail ,errorr code = %d......\n",nRet); goto search_label; } printf("4. ZAZSearch ok ID = %d Sorce = %d......\n",nFinger,nSorce); printf("END\n");这段代码转化成没有goto的写法
时间: 2024-04-27 08:20:49 浏览: 184
搜索指纹测试
int counts = 0;
int nRet = ZAZ_NO_FINGER;
while(nRet == ZAZ_NO_FINGER) {
nRet = ZAZGetImage(nhanle, DEV_ADDR);
counts++;
if(counts > 50) {
printf("等待时间已经超过50......\n");
return 0;
}
printf("等待时间 %d......\n", counts);
}
if(nRet != ZAZ_OK) {
printf("ZAZGetImage失败,错误代码=%d......\n", nRet);
return 0;
}
printf("ZAZGetImage完成......\n");
nRet = ZAZGenChar(nhanle, DEV_ADDR, BUFFER);
if(nRet != ZAZ_OK) {
printf("ZAZGenChar失败,错误代码=%d......\n", nRet);
return 0;
}
printf("ZAZGenChar完成,Buffer=%d......\n", BUFFER);
int nFinger;
int nSorce;
nRet = ZAZSearch(nhanle, DEV_ADDR, CHAR_BUFFER_A, 0, 200, &nFinger, &nSorce);
if(nRet != ZAZ_OK) {
printf("ZAZSearch失败,错误代码=%d......\n", nRet);
return 0;
}
printf("ZAZSearch完成,ID=%d,Sorce=%d......\n", nFinger, nSorce);
printf("结束\n");
阅读全文