EasyManuals Logo

Sun Microsystems Netra T2000 User Manual

Sun Microsystems Netra T2000
122 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #109 background imageLoading...
Page #109 background image
Appendix A Watchdog Timer Application Mode 93
The data structure used with the LOMIOCALCTL and LOMIOCALSTATE IOCTLs is as
follows:
CODE EXAMPLE A-4 LOMIOCALCTL and LOMIOCALSTATE IOCTL Data Structure
#include <fcntl.h>
#include <lom_io.h>
#define LOM_DEVICE "/dev/lom"
#define ALARM_OFF 0
#define ALARM_ON 1
int main() {
int fd, ret;
lom_aldata_t ald;
ald.alarm_no = ALARM_NUM_3;
ald.state = ALARM_OFF;
fd = open(LOM_DEVICE, O_RDWR);
if (fd == -1) {
printf("Error opening device: %s\n", LOM_DEVICE);
return (1);
}
/* Set Alarm3 to on state */
ald.state = ALARM_ON;
ioctl(fd, LOMIOCALCTL, (void *)&ald);
/* Get Alarm3 state */
ioctl(fd, LOMIOCALSTATE, (char *)&ald);
printf("alarm %d state :%d:\n", ald.alarm_no, ald.state);
/* Set Alarm3 to off state */
ald.state = ALARM_OFF;
ioctl(fd, LOMIOCALCTL, (char *)&ald);
/* Get Alarm3 state */
ioctl(fd, LOMIOCALSTATE, (char *)&ald);
printf("alarm %d state :%d:\n", ald.alarm_no, ald.state);
close (fd);
return (0);
}

Table of Contents

Other manuals for Sun Microsystems Netra T2000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sun Microsystems Netra T2000 and is the answer not in the manual?

Sun Microsystems Netra T2000 Specifications

General IconGeneral
BrandSun Microsystems
ModelNetra T2000
CategoryServer
LanguageEnglish

Related product manuals