44 int main(
int argc,
char** argv)
46 if (argc != 2 || !strcmp(argv[1],
"--help")) {
47 fprintf(stderr,
"Usage: %s <camera_url>\n", argv[0]);
48 fprintf(stderr,
"Writes a test sequence to unused portions of the flash to check for\n");
49 fprintf(stderr,
"proper operation. It is very improbable that you need this tool in\n");
50 fprintf(stderr,
"normal use of the camera.\n");
53 char* camera_url = argv[1];
61 fprintf(stderr,
"Matching URL %s : %s\n", camera_url, errmsg);
69 fprintf(stderr,
"Unable to create ARP entry (are you root?), continuing anyway\n");
71 fprintf(stderr,
"IP address configuration failed\n");
76 #define FLASH_SIZE_LONG ((FLASH_PAGE_SIZE + 3) / 4) 80 fprintf(stderr,
"\n*************************************************************************\n");
81 fprintf(stderr,
"Warning, this will overwrite potentially important flash memory contents.\n");
82 fprintf(stderr,
"You have 5 seconds to press CTRL+C to abort this operation.\n");
83 fprintf(stderr,
"*************************************************************************\n");
87 uint32_t incr = 282475249;
97 buffer[j] = pattern += incr;
100 fprintf(stderr,
"\nFlash write error\n");
112 fprintf(stderr,
".");
116 buffer[j] = pattern += incr;
119 fprintf(stderr,
"\nFlash read error\n");
126 fprintf(stderr,
"Mismatch in page %i\n.", i);
130 fprintf(stderr,
"\nCheck completed, %i errors.\n", errcount);
int wge100ReliableFlashRead(const IpCamList *camInfo, uint32_t address, uint8_t *pageDataOut, int *retries)
int wge100ReliableFlashWrite(const IpCamList *camInfo, uint32_t address, const uint8_t *pageDataIn, int *retries)
int wge100Configure(IpCamList *camInfo, const char *ipAddress, unsigned wait_us)
#define ERR_CONFIG_ARPFAIL
int wge100FindByUrl(const char *url, IpCamList *camera, unsigned wait_us, const char **errmsg)
int main(int argc, char **argv)