From: hadaq Date: Wed, 21 Jul 2010 12:59:15 +0000 (+0000) Subject: update X-Git-Tag: v6.0~236 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=7d34c22c80566a91a419ebd30a9a8a3345172bdf;p=trbnettools.git update --- diff --git a/trbrich/trbrichcmd.c b/trbrich/trbrichcmd.c index bcacc81..f775c17 100644 --- a/trbrich/trbrichcmd.c +++ b/trbrich/trbrichcmd.c @@ -15,7 +15,7 @@ static const uint16_t BroadCastRich = 0xfffb; -static const char trbrichcmd_version[] = "$Revision: 1.11 $"; +static const char trbrichcmd_version[] = "$Revision: 1.12 $"; static const uint16_t adcm_uid_register = 0xc000; @@ -291,6 +291,7 @@ int main(int argc, char** argv) uint16_t trb_address = BroadCastRich; int status = 0; unsigned int timeOut = 0; + int success = 0; if (argc - optind == 2) { trb_address = (uint16_t)strtoul(argv[optind + 1], NULL, 0); @@ -318,6 +319,7 @@ int main(int argc, char** argv) tmp = buffer; end = buffer + status; + success = 1; while (tmp < end) { unsigned int len = *tmp >> 16; uint16_t endPoint = *tmp & 0xffff; @@ -331,10 +333,15 @@ int main(int argc, char** argv) "TimeOut: %d Sync Failed on EndPoint: " "0x%04x APV#: %02d\n", timeOut, endPoint, ((*tmp >> 16) &0xf)); + success = 0; } } } timeOut++; + if (success == 1) break; + } + if (success == 0) { + fprintf(stderr, "sync_apv failed\n"); } free(buffer);