Advantech ROM-5420 B1 handleiding

62 pagina's
PDF beschikbaar

Handleiding

Je bekijkt pagina 48 van 62
ROM-5420 B1/B2 User Manual 40
int count=1;
if (argc < 2) {
help_info();
return 1;
}
t imeout = atoi(argv[1]);
sleep_sec = atoi(argv[2]);
if (sleep_sec <= 0) {
sleep_sec = 1;
printf("correct 0 or negative sleep time to %d seconds\n",
sleep_sec);
}
test = atoi(argv[3]);
printf("Starting wdt_driver (timeout: %d, sleep: %d, test: %s)\n",
timeout, sleep_sec, (test == 0) ? "ioctl" : "write");
fd = open("/dev/watchdog", O_WRONLY);
if (fd == -1) {
perror("watchdog");
exit(1);
}
printf("Trying to set timeout value=%d seconds\n", timeout);
ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
printf("The actual timeout was set to %d seconds\n", timeout);
ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
printf("Now reading back -- The timeout is %d seconds\n", timeout);
while (1) {
printf("WDT Time out counter:%d\n",count);
if ((test !=0) && (test ==count)) {
printf("Ping Watchdog (reset wdt)\n");
ioctl(fd, WDIOC_KEEPALIVE, 0);
test=0;
count=0;
}
sleep(sleep_sec);
count+=sleep_sec;
}
return 0;
}
void help_info(void)
{
printf("Usage: wdt_driver_test <timeout> <sleep> <trigger>\n");
printf(" timeout: value in seconds to cause wdt timeout/reset\n");
printf(" sleep: value in seconds to display wdt timeout\n");
printf(" trigger: value in seconds to ping the wdt\n");

Bekijk gratis de handleiding van Advantech ROM-5420 B1, stel vragen en lees de antwoorden op veelvoorkomende problemen, of gebruik onze assistent om sneller informatie in de handleiding te vinden of uitleg te krijgen over specifieke functies.

Productinformatie

MerkAdvantech
ModelROM-5420 B1
CategorieNiet gecategoriseerd
TaalNederlands
Grootte14448 MB