43 #define _CRT_SECURE_NO_WARNINGS
46 #define access _access
56 #include <sys/timeb.h>
59 #define gmtime_r(timer, result) gmtime_s(result, timer)
60 #define timegm _mkgmtime
71 #define LED_PROCESSING OM_LED_YELLOW
72 #define LED_OK OM_LED_MAGENTA
73 #define LED_WARNING OM_LED_MAGENTA
74 #define LED_FAILED OM_LED_BLUE
75 #define LED_ERROR_COMMS OM_LED_CYAN
78 #define VERIFY_OPTION_ALL 0x01
79 #define VERIFY_OPTION_NO_CHECK_STOP 0x02
80 #define VERIFY_OPTION_OUTPUT_NEW 0x04
83 #define STUCK_COUNT (50 * 120)
84 #define AVERAGE_FACTOR 0.00001
85 #define AVERAGE_RANGE_MAX 0.400
86 #define AVERAGE_RANGE_OFF 0.300
88 #define IGNORE_RECENT_RESTARTS (6*60*60) // Enable this if the devices have been connected/disconnected recently (causing a break in the data)
98 unsigned char nandId[6];
106 static int globalOptions = 0;
107 static int globalAllowedRestarts = 0;
111 static const char NAND_DEVICE_DONT_CARE[6] = { 0x00 };
112 static const char NAND_DEVICE_HY27UF084G2x[6] = { 0xAD, 0xDC, 0x00 };
114 static const char NAND_DEVICE_HY27UF084G2B[6] = { 0xAD, 0xDC, 0x10, 0x95, 0x54, 0x00 };
115 static const char NAND_DEVICE_HY27UF084G2M[6] = { 0xAD, 0xDC, 0x80, 0x95, 0xAD, 0x00 };
116 static const char NAND_DEVICE_MT29F8G08AAA[6] = { 0x2C, 0xD3, 0x90, 0x2E, 0x64, 0x00 };
117 static const char NAND_DEVICE_S34ML04G1[6] = { 0x01, 0xDC, 0x90, 0x95, 0x54, 0x00 };
118 static const char NAND_DEVICE_MT29F8G08ABADA[6] = { 0x2C, 0xDC, 0x90, 0x95, 0x56, 0x00 };
120 static int OmGetNandId(
int deviceId,
unsigned char *
id,
int *present,
int *identified)
123 char response[256], *parts[16] = {0};
124 unsigned char localId[6] = {0};
128 status =
OmCommand(deviceId,
"\r\nSTATUS 7\r\n", response, 255,
"NANDID=", 2000, parts, 15);
132 if (sscanf(parts[1],
"%x:%x:%x:%x:%x:%x", &tempId[0], &tempId[1], &tempId[2], &tempId[3], &tempId[4], &tempId[5]) != 6) {
return OM_E_UNEXPECTED_RESPONSE; }
133 for (i = 0; i < 6; i++) { localId[i] = (
unsigned char)tempId[i]; }
134 if (
id != NULL) { memcpy(
id, localId, 6); }
135 if (identified != NULL)
138 if (memcmp(NAND_DEVICE_HY27UF084G2B, (
char *)localId, 6) == 0) { *identified = 1; }
139 else if (memcmp(NAND_DEVICE_HY27UF084G2M, (
char *)localId, 6) == 0) { *identified = 2; }
140 else if (memcmp(NAND_DEVICE_MT29F8G08AAA, (
char *)localId, 6) == 0) { *identified = 3; }
141 else if (memcmp(NAND_DEVICE_S34ML04G1, (
char *)localId, 6) == 0) { *identified = 4; }
142 else if (memcmp(NAND_DEVICE_MT29F8G08ABADA, (
char *)localId, 6) == 0) { *identified = 5; }
147 *present = atoi(parts[2]);
160 struct tm tParts = {0};
167 tSec = timegm(&tParts);
176 return ((
unsigned long long)tSec << 16) + fractional;
180 unsigned long long now(
void)
184 return (
unsigned long long)tp.time * 1000 + tp.millitm;
190 static char output[] =
"YYYY-MM-DD HH:MM:SS.fff";
192 struct timeb tp = {0};
193 tp.time = (time_t)(milliseconds / 1000);
194 tp.millitm = (
unsigned short)(milliseconds % 1000);
196 today = localtime(&(tp.time));
197 sprintf(output,
"%04d-%02d-%02d %02d:%02d:%02d.%03d", 1900 + today->tm_year, today->tm_mon + 1, today->tm_mday, today->tm_hour, today->tm_min, today->tm_sec, tp.millitm);
202 static bool hasGyro(
int deviceId)
206 return memcmp(serialBuffer,
"AX6", 3) == 0;
214 int batteryStartPercent = 0, batteryEndPercent = 0;
215 int batteryMaxPercent = -1, batteryMinPercent = -1;
216 unsigned long long veryFirstTime = 0;
217 unsigned long long firstTime = 0, lastTime = 0;
218 unsigned long long blockStart = 0;
219 unsigned long long previousBlockEnd = 0;
220 unsigned int minLight = 0xffff;
221 unsigned int previousSequenceId = -1;
224 unsigned int totalSamples = 0;
225 unsigned int errorFile = 0, errorEvent = 0, errorStuck = 0, errorRange = 0, errorBreaks = 0, errorRate = 0;
226 double maxAv = 0.0, peakAv = 0.0;
228 unsigned long long minInterval = 0, maxInterval = 0;
229 unsigned long long lastBlockStart = 0;
230 unsigned long long totalDuration = 0;
231 float breakTime = 0.0f;
240 float percentPerHour = 0;
242 short lx = 0, ly = 0, lz = 0, stuck = 0;
243 short lgx = 0, lgy = 0, lgz = 0, gstuck = 0;
245 int seconds, packetCount = 0;
248 char description[1024] =
"";
250 if (infile == NULL || infile[0] ==
'\0')
252 fprintf(stderr,
"ERROR: File not specified\n");
256 fprintf(stderr,
"FILE: %s\n", infile);
257 sprintf(label, infile);
258 if (
id >= 0) { sprintf(label,
"%d",
id); }
264 fprintf(stderr,
"ERROR: Problem opening file: %s\n", infile);
271 for (block = 0; ; block++)
274 unsigned long long interval;
282 if (block != 0 && block % 150 == 0) { fprintf(stderr,
":"); }
286 if (block != 0 && block % 50 == 0) { fprintf(stderr,
"."); }
300 fprintf(stderr,
"[ERROR: %d - %s]\n", numSamples,
OmErrorString(numSamples));
311 fprintf(stderr,
"[WARNING: Missing packet -- probably checksum failed? At block %d, sector %d?]\n", block, block+3);
319 fprintf(stderr,
"[ERROR: Cannot get raw data packet]\n");
327 fprintf(stderr,
"[EVENT-ERROR: 0x%02x]\n", dp->
events);
333 unsigned int timestamp;
334 unsigned short fractional;
336 blockStart =
Ticks(timestamp, fractional);
341 if (light < minLight) { minLight = light; }
352 if (previousSequenceId != (
unsigned int)-1 && previousSequenceId + 1 != dp->
sequenceId)
356 fprintf(stderr,
"WARNING: Sequence break %u -> %u\n", previousSequenceId, dp->
sequenceId);
360 long long recordingLength = (
long long)(lastTime - firstTime);
361 long long diff = (
long long)(blockStart - previousBlockEnd);
363 #ifdef IGNORE_RECENT_RESTARTS
365 struct tm *tm = localtime(&allowed);
372 fprintf(stderr,
"NOTE: Permitted recording sequence restarted @%u, length of %+.2fs (gap of %+.2fs)\n", previousSequenceId, (
float)recordingLength / 65536.0f, (
float)diff / 65536.0f);
377 fprintf(stderr,
"NOTE: Recording sequence restarted @%u, length of %+.2fs (gap of %+.2fs)\n", previousSequenceId, (
float)recordingLength / 65536.0f, (
float)diff / 65536.0f);
379 breakTime += (float)diff / 65536.0f;
382 totalDuration += recordingLength;
392 firstTime = blockStart;
393 if (veryFirstTime == 0) { veryFirstTime = firstTime; }
394 lastTime = firstTime;
396 batteryEndPercent = batteryStartPercent;
397 if (batteryMaxPercent < 0) { batteryMaxPercent = batteryStartPercent; }
398 if (batteryMinPercent < 0) { batteryMinPercent = batteryStartPercent; }
401 if (lastBlockStart > 0)
404 interval = blockStart - lastBlockStart;
407 if (previousBlockEnd != 0 && blockStart != 0 && abs((
int)(previousBlockEnd - blockStart)) >= 8000)
409 long long diff = (
long long)(blockStart - previousBlockEnd);
410 fprintf(stderr,
"WARNING: Time break in sequence by %+.2f seconds (last: %f, curr: %f)\n", (
float)diff / 65536.0f, lastBlockStart / 65536.0f, blockStart / 65536.0f);
411 fprintf(stderr,
"\n");
412 breakTime += (float)diff / 65536.0f;
417 if (first) { first = 0; minInterval = interval; maxInterval = interval; }
418 if (interval > maxInterval) { maxInterval = interval; }
419 if (interval < minInterval) { minInterval = interval; }
423 lastBlockStart = blockStart;
432 unsigned int rate = (3200 / (1 << (15 - (rateCode & 0x0f))));
433 int minPacketCount = rate - (12 * rate / 100);
434 int maxPacketCount = rate + (12 * rate / 100);
437 for (i = 0; i < numSamples; i++)
440 unsigned short fractional;
448 sprintf(timeString,
"%04d-%02d-%02d %02d:%02d:%02d.%03d",
451 (
int)fractional * 1000 / 0xffff);
454 x = buffer[numAxes * i + axisAccel + 0];
455 y = buffer[numAxes * i + axisAccel + 1];
456 z = buffer[numAxes * i + axisAccel + 2];
459 short gx = 0, gy = 0, gz = 0;
460 bool hasGyro = (axisGyro >= 0);
463 gx = buffer[numAxes * i + axisGyro + 0];
464 gy = buffer[numAxes * i + axisGyro + 1];
465 gz = buffer[numAxes * i + axisGyro + 2];
470 if (x == lx && y == ly && z == lz)
475 fprintf(stderr,
"\nERROR: Readings could be stuck at (%d, %d, %d); has been for %d consecutive readings. ", lx, ly, lz, stuck);
483 fprintf(stderr,
"\nNOTE: Readings now changed -- were at (%d, %d, %d) for total of %d consecutive readings. ", lx, ly, lz, stuck);
485 lx = x; ly = y; lz = z;
492 if (gx == lgx && gy == lgy && gz == lgz)
497 fprintf(stderr,
"\nERROR: Gyro readings could be stuck at (%d, %d, %d); has been for %d consecutive readings. ", lgx, lgy, lgz, gstuck);
505 fprintf(stderr,
"\nNOTE: Gyro readings now changed -- were at (%d, %d, %d) for total of %d consecutive readings. ", lgx, lgy, lgz, gstuck);
507 lgx = gx; lgy = gy; lgz = gz;
513 v = sqrt((x / (
double)scaleAccel) * (x / (
double)scaleAccel) + (y / (
double)scaleAccel) * (y / (
double)scaleAccel) + (z / (
double)scaleAccel) * (z / (
double)scaleAccel)) - 1.0;
515 if (fabs(av) > peakAv) { peakAv = fabs(av); }
516 if (fabs(av) > maxAv) { maxAv = fabs(av); }
524 fprintf(stderr,
"WARNING: Average SVM gone out-of-normal-range abs(avg(svm-1)): %0.3f\n", fabs(av));
530 fprintf(stderr,
"WARNING: Average SVM back in normal range, peak was abs(avg(svm-1)): %0.3f\n", peakAv);
538 if (hour != lastHour)
546 if (lastSecond == -1) { lastSecond = seconds; };
547 if (seconds != lastSecond)
549 if (firstPacket) { firstPacket = 0; }
550 else if (packetCount >= minPacketCount && packetCount <= maxPacketCount) { }
553 if (seconds == lastSecond + 1 || (seconds == 0 && lastSecond == 59))
556 fprintf(stderr,
"WARNING: 'Out of range' %d samples in second :%02d before %s]\n", packetCount, lastSecond, timeString);
561 fprintf(stderr,
"WARNING: Non-sequential second jump (%d samples in second :%02d before %s)]\n", packetCount, lastSecond, timeString);
564 lastSecond = seconds;
576 unsigned int timestamp;
577 unsigned short fractional;
579 previousBlockEnd =
Ticks(timestamp, fractional);
582 lastTime = previousBlockEnd;
584 if (batteryEndPercent > batteryMaxPercent) { batteryMaxPercent = batteryEndPercent; }
585 if (batteryEndPercent < batteryMinPercent) { batteryMinPercent = batteryEndPercent; }
591 long long recordingLength = (
long long)(lastTime - firstTime);
592 totalDuration += recordingLength;
597 int startStopFail = 0;
601 fprintf(stderr,
"\n");
605 fprintf(stderr,
"ERROR: Unable to access file header for start/stop times.\n");
613 unsigned long aStart = (
unsigned long)(veryFirstTime >> 16);
614 int startDiff = (int)(aStart - fStart);
615 if (abs(startDiff) < 80)
617 fprintf(stderr,
"NOTE: Data started near recording start time (%ds).\n", startDiff);
621 fprintf(stderr,
"ERROR: Data did not start near recording start time (%ds).\n", startDiff);
627 fprintf(stderr,
"NOTE: Recording has no start time (not verifying).\n");
634 unsigned long aEnd = (
unsigned long)(lastTime >> 16);
635 int stopDiff = (int)(aEnd - fEnd);
638 fprintf(stderr,
"NOTE: Ignoring whether data stopped near recording stop time (difference was %ds).\n", stopDiff);
640 else if (abs(stopDiff) < 80)
642 fprintf(stderr,
"NOTE: Data stopped near recording stop time (%ds).\n", stopDiff);
646 fprintf(stderr,
"ERROR: Data did not stop near recording stop time (%ds).\n", stopDiff);
652 fprintf(stderr,
"NOTE: Recording has no stop time (not verifying).\n");
657 #define CODE_ERROR_MASK 0xfffff000
658 #define CODE_WARNING_MASK 0x00000fff
661 #define CODE_WARNING_FILE 0x000001
662 #define CODE_ERROR_FILE 0x001000
665 #define CODE_WARNING_EVENT 0x000002
666 #define CODE_ERROR_EVENT 0x002000
669 #define CODE_WARNING_STUCK 0x000004
670 #define CODE_ERROR_STUCK 0x004000
673 #define CODE_WARNING_RANGE 0x000008
674 #define CODE_ERROR_RANGE 0x008000
677 #define CODE_WARNING_RATE 0x000010
678 #define CODE_ERROR_RATE 0x010000
681 #define CODE_WARNING_BREAKS 0x000020
682 #define CODE_ERROR_BREAKS 0x020000
685 #define CODE_WARNING_RESTARTS 0x000040
686 #define CODE_ERROR_RESTARTS 0x040000
689 #define CODE_WARNING_LIGHT 0x000080
690 #define CODE_ERROR_LIGHT 0x080000
693 #define CODE_WARNING_BATT 0x000100
694 #define CODE_ERROR_BATT 0x100000
697 #define CODE_WARNING_STARTSTOP 0x000200
698 #define CODE_ERROR_STARTSTOP 0x200000
701 #define CODE_WARNING_NANDHEALTH 0x000400
702 #define CODE_ERROR_NANDHEALTH 0x400000
705 #define CODE_WARNING_NANDID 0x000800
706 #define CODE_ERROR_NANDID 0x800000
724 float hours = ((totalDuration >> 16) / 60.0f / 60.0f);
725 float percentLoss = (float)batteryMaxPercent - batteryMinPercent;
727 if (hours > 0) { percentPerHour = percentLoss / hours; }
else { percentPerHour = 0; }
741 fprintf(stderr,
"---\n");
742 fprintf(stderr,
"Input file,%d,\"%s\",%d\n",
id, infile, retval);
743 fprintf(stderr,
"Summary errors: file=%d, event=%d, stuck=%d, range=%d, rate=%d, breaks=%d\n", errorFile, errorEvent, errorStuck, errorRange, errorRate, errorBreaks);
744 fprintf(stderr,
"Summary info-1: restart=%d, breakTime=%0.1fs, maxAv=%f\n", restarts, breakTime, maxAv);
745 fprintf(stderr,
"Summary info-2: minInterval=%0.3f, maxInterval=%0.3f, duration=%0.4fh\n", minInterval / 65536.0f, maxInterval / 65536.0f, ((totalDuration >> 16) / 60.0f / 60.0f));
746 fprintf(stderr,
"Summary info-3: minLight=%d, Bmax=%d%%, Bmin=%d%%, intervalFail=%d\n", minLight, batteryMaxPercent, batteryMinPercent, startStopFail);
751 if (
download->memoryHealth < 0) { ; }
761 fprintf(stderr,
"NAND #%d (%d spare)\n",
download->nandType,
download->memoryHealth);
765 fprintf(stderr,
"---\n");
767 #define HEADER "VERIFY," "id," "summary," "file," "event," "stuck," "range," "rate," "breaks," "restarts," "breakTime," "maxAv," "minInterval," "maxInterval," "duration," "minLight," "batteryMaxPercent," "batteryMinPercent," "intervalFail," "percentLoss," "description\n"
769 description[0] =
'\0';
778 if (retval &
CODE_WARNING_LIGHT ) {
char temp[32]; sprintf(temp,
"W:Light(%d);", minLight); strcat(description, temp); }
779 if (retval &
CODE_WARNING_BATT ) {
char temp[32]; sprintf(temp,
"W:Batt(%2.2f);", percentPerHour); strcat(description, temp); }
790 if (retval &
CODE_ERROR_LIGHT ) {
char temp[32]; sprintf(temp,
"E:Light(%d);", minLight); strcat(description, temp); }
791 if (retval &
CODE_ERROR_BATT ) {
char temp[32]; sprintf(temp,
"E:Batt(%2.2f);", percentPerHour); strcat(description, temp); }
796 sprintf(line,
"VERIFYX," "%s," "%d," "%d," "%d," "%d," "%d," "%d," "%d," "%d," "%.1f," "%.4f," "%.3f," "%.3f," "%.4f," "%d," "%d," "%d," "%d," "%f," "%s\n",
797 label, retval, errorFile, errorEvent, errorStuck, errorRange, errorRate, errorBreaks, restarts, breakTime, maxAv, minInterval / 65536.0f, maxInterval / 65536.0f, ((totalDuration >> 16) / 60.0f / 60.0f), minLight, batteryMaxPercent, batteryMinPercent, startStopFail, percentPerHour, description);
800 fprintf(stdout, line);
801 fprintf(stderr, line);
809 sprintf(line,
"VERIFY,%s,%s,%d,%d,%s\n",
formattedtime(
now()), label, passed, retval, description);
811 fprintf(stderr, line);
814 fprintf(stdout, line);
830 static void verify_DownloadCallback(
void *reference,
int deviceId,
OM_DOWNLOAD_STATUS status,
int value)
837 if ((value % 5) == 0) {
printf(
"<#%d@%d%%>", deviceId, value); }
841 const char *file =
download->filename;
845 printf(
"VERIFY #%d: Download complete, verify starting... (options 0x%04x)\n", deviceId, globalOptions);
849 if (verifyResult < 0)
852 sprintf(line,
"#ERROR,%s,%d,Verify failed (%d)\n",
formattedtime(
now()), deviceId, verifyResult);
853 fprintf(stderr, line);
854 fprintf(stdout, line);
866 fprintf(stderr,
"VERIFY #%d: Setting session id: %u\n", deviceId, 0);
870 fprintf(stderr,
"VERIFY #%d: Setting start/stop: INFINITY/ZERO\n", deviceId);
875 fprintf(stderr,
"VERIFY #%d: Committing new settings...\n", deviceId);
888 sprintf(line,
"#ERROR,%s,%d,Download cancelled\n",
formattedtime(
now()), deviceId);
889 fprintf(stderr, line);
890 fprintf(stdout, line);
897 sprintf(line,
"#ERROR,%s,%d,Download error (diagnostic 0x%04x)\n",
formattedtime(
now()), deviceId, value);
898 fprintf(stderr, line);
899 fprintf(stdout, line);
906 sprintf(line,
"#ERROR,%s,%d,Unexpected status %d / 0x%04x\n",
formattedtime(
now()), deviceId, status, value);
907 fprintf(stderr, line);
908 fprintf(stdout, line);
920 char newTitle[] =
"[ALERT]";
922 FLASHWINFO fwi = {0};
923 GetConsoleTitle(oldTitle,
sizeof(oldTitle));
924 SetConsoleTitle(newTitle);
926 fprintf(stderr,
"\a");
927 MessageBeep(0xffffffff);
930 hWnd = FindWindow(NULL, newTitle);
931 SetConsoleTitle(oldTitle);
934 fwi.cbSize =
sizeof(fwi);
936 fwi.dwFlags = FLASHW_ALL;
943 fprintf(stderr,
"\a");
952 static void verify_DeviceCallback(
void *reference,
int deviceId,
OM_DEVICE_STATUS status)
957 int dataBlockSize = 0, dataOffsetBlocks = 0, dataNumBlocks = 0;
960 printf(
"VERIFY #%d: Device CONNECTED (verify options 0x%04x)\n", deviceId, globalOptions);
963 result =
OmGetDataRange(deviceId, &dataBlockSize, &dataOffsetBlocks, &dataNumBlocks, &startTime, &endTime);
965 printf(
"VERIFY #%d: %d blocks data, at offset %d blocks (1 block = %d bytes)\n", deviceId, dataNumBlocks, dataOffsetBlocks, dataBlockSize);
969 OmDateTimeToString(startTime, startString);
970 OmDateTimeToString(endTime, endString);
971 printf(
"VERIFY #%d: ... %s --> %s\n", deviceId, startString, endString);
977 const char* downloadPath =
".";
984 result = OmGetNandId(deviceId,
download->nandId, NULL, &
download->nandType);
985 if (result ==
OM_E_NOT_IMPLEMENTED) { fprintf(stderr,
"NOTE: This firmware doesn't support NANDID command\n"); }
986 else if (result ==
OM_E_UNEXPECTED_RESPONSE) { fprintf(stderr,
"NOTE: Unexpected NANDID response (firmware probably doesn't support NANDID command)\n"); }
990 download->filename = (
char*)malloc(strlen(downloadPath) + 64);
992 strcpy(
download->filename, downloadPath);
1000 if (deviceId >= 0 && deviceId <= 9999)
1002 sprintf(
download->filename + strlen(
download->filename),
"CWA-%04u.CWA", deviceId);
1004 else if (deviceId >= 0 && deviceId <= 9999999)
1006 sprintf(
download->filename + strlen(
download->filename),
"CWA-%07u.CWA", deviceId);
1010 sprintf(
download->filename + strlen(
download->filename),
"CWA-%u.CWA", deviceId);
1014 if (dataNumBlocks - dataOffsetBlocks <= 0)
1019 printf(
"VERIFY #%d: Ignoring - no data stored, but local file already downloaded (manually check recent log): %s\n", deviceId,
download->filename);
1024 printf(
"VERIFY #%d: Ignoring - no data stored (no file already downloaded)\n", deviceId);
1033 printf(
"VERIFY #%d: Starting download to file: %s\n", deviceId,
download->filename);
1044 printf(
"VERIFY #%d: Device REMOVED\n", deviceId);
1050 printf(
"VERIFY #%d: Error, unexpected status %d\n", deviceId, status);
1078 fprintf(stderr,
"<.>");
1083 if (
OM_FAILED(result)) { fprintf(stderr,
"ERROR: OmShutdown() %s\n",
OmErrorString(result));
return -1; }
1093 const char *outfilename = NULL;
1096 fprintf(stderr,
"VERIFY: verify a specified binary data file contains sensible data.\n");
1097 fprintf(stderr,
"\n");
1101 const char *infile = NULL;
1104 for (i = 1; i < argc; i++)
1106 if (!strcmp(argv[i],
"-headeronly"))
1111 else if (!strcmp(argv[i],
"-stop-clear-all")) { fprintf(stderr,
"VERIFY: Option -stop-clear-all\n"); globalOptions |=
VERIFY_OPTION_ALL; }
1112 else if (!strcmp(argv[i],
"-no-check-stop")) { fprintf(stderr,
"VERIFY: Option -no-check-stop\n"); globalOptions |=
VERIFY_OPTION_NO_CHECK_STOP; }
1113 else if (!strcmp(argv[i],
"-output:new")) { fprintf(stderr,
"VERIFY: Option -output:new\n"); globalOptions |=
VERIFY_OPTION_OUTPUT_NEW; }
1114 else if (!strcmp(argv[i],
"-output:old")) { fprintf(stderr,
"VERIFY: Option -output:old\n"); globalOptions &= ~
VERIFY_OPTION_OUTPUT_NEW; }
1115 else if (!strcmp(argv[i],
"-allow-restarts")) { globalAllowedRestarts = atoi(argv[++i]); fprintf(stderr,
"VERIFY: Option -allow-restarts %d\n", globalAllowedRestarts); }
1116 else if (argv[i][0] ==
'-')
1118 fprintf(stdout,
"ERROR: Unrecognized option %s\n", argv[i]);
1125 else if (outfilename == NULL)
1127 outfilename = argv[i];
1131 fprintf(stdout,
"ERROR: Unexpected parameter %s\n", argv[i]);
1137 if (outfilename != NULL)
1139 outfile = fopen(outfilename,
"at");
1159 fprintf(stderr,
"Usage: verify <<binary-input-file> | <-stop-clear-all> [outfile.csv] | <-headeronly>> [-no-check-stop] [-allow-restarts <n>]\n");
1160 fprintf(stderr,
"\n");
1161 fprintf(stderr,
"Where: binary-input-file: the name of the binary file to verify.\n");
1162 fprintf(stderr,
"\n");
1163 fprintf(stderr,
"Example: verify data.cwa\n");
1164 fprintf(stderr,
"\n");
1167 #if defined(_WIN32) && defined(_DEBUG)
1168 if (IsDebuggerPresent()) { fprintf(stderr,
"Press [enter] to exit..."); getc(stdin); }