Adlink CSA-5200 Manual de usuario Pagina 37

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 69
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 36
37
CSA-5200
DESCRIPTION
This function defines functions for the watchdog device according to the available
features.
int ioctl(int handle, int cmd,[int *argdx, int argcx]) may be used in client to call this
feature.
PARAMETERS
handle [IN] File handle to the watchdog;
cmd [IN] Watchdog command, such as “WDIOC_xxx”;
argxx [IN/OUT] Argument pointer, such as“WDIOS_xxx”, only used after
WDIOC_SETOPTIONS.
RETURN
0: success
-1: error
6.2.4 release
The Watchdog Driver provides several ioctl options:
Closing the watchdog device either stops the watchdog timer or in the case that nowayout is
set or the magic character wasn't written, a critical warning about a running watchdog timer
will be given.
PROTOTYPE
static int release(struct inode *inode, struct file *file)
DESCRIPTION
This function is used to check whether the watchdog device closing is expected or not. This
feature will be called automatically when closing the watchdog device file “/dev/watchdog”.
6.3 Sample Code
The following sample code is provided to illustrate how the SuperIO Watchdog timer and
LAN bypass control can be implemented.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/watchdog.h>
#define WDIOC_ENABLEBYPS _IOR(WATCHDOG_IOCTL_BASE, 101, int)
#define WDIOC_DISABLEBYPS _IOR(WATCHDOG_IOCTL_BASE, 102, int)
int fd;
/*
* This function simply sends an IOCTL to the driver, which in turn ticks
Vista de pagina 36
1 2 ... 32 33 34 35 36 37 38 39 40 41 42 ... 68 69

Comentarios a estos manuales

Sin comentarios