2 .\" Copyright (c) 2007, Sun Microsystems Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH TSALARM_GET 3EXT "Sep 4, 2007"
8 tsalarm_get, tsalarm_set \- get or set alarm relays
12 cc [ \fIflag\fR... ] \fIfile\fR... \fB-ltsalarm\fR [ \fIlibrary\fR... ]
15 \fBint\fR \fBtsalarm_get\fR(\fBuint32_t\fR \fIalarm_type\fR, \fBuint32_t *\fR\fIalarm_state\fR);
20 \fBint\fR \fBtsalarm_set\fR(\fBuint32_t\fR \fIalarm_type\fR, \fBuint32_t\fR \fIalarm_state\fR);
27 \fB\fIalarm_type\fR\fR
31 The alarm type whose state is retrieved or set. Valid settings are:
35 \fB\fBTSALARM_CRITICAL\fR\fR
44 \fB\fBTSALARM_MAJOR\fR\fR
53 \fB\fBTSALARM_MINOR\fR\fR
62 \fB\fBTSALARM_USER\fR\fR
73 \fB\fIalarm_state\fR\fR
77 The state of the alarm. Valid settings are:
81 \fB\fBTSALARM_STATE_ON\fR\fR
84 The alarm state needs to be changed to "on", or is returned as "on".
90 \fB\fBTSALARM_STATE_OFF\fR\fR
93 The alarm state needs to be changed to "off", or is returned as "off".
99 \fB\fBTSALARM_STATE_UNKNOWN\fR\fR
102 The alarm state is returned as unknown.
110 The TSALARM interface provides functions through which alarm relays can be
111 controlled. The set of functions and data structures of this interface are
112 defined in the \fB<tsalarm.h>\fR header.
115 There are four alarm relays that are controlled by ILOM. Each alarm can be set
116 to "on" or "off" by using \fBtsalarm\fR interfaces provided from the host. The
117 four alarms are labeled as \fBcritical\fR, \fBmajor\fR, \fBminor\fR, and
118 \fBuser\fR. The user alarm is set by a user application depending on system
119 condition. LEDs in front of the box provide a visual indication of the four
120 alarms. The number of alarms and their meanings and labels can vary across
124 The \fBtsalarm_get()\fR function gets the state of \fIalarm_type\fR and
125 returnsit in \fIalarm_state\fR. If successful, the function returns 0.
128 The \fBtsalarm_set()\fR function sets the state of \fIalarm_type\fR to the
129 value in \fIalarm_state\fR. If successful, the function returns 0.
132 The following structures are defined in \fB<tsalarm.h>\fR:
136 typedef struct tsalarm_req {
138 uint32_t alarm_action;
146 typedef struct tsalarm_resp {
149 uint32_t alarm_state;
157 The \fBtsalarm_get()\fR and \fBtsalarm_set()\fR functions return the following
162 \fB\fBTSALARM_CHANNEL_INIT_FAILURE\fR\fR
166 Channel initialization failed.
172 \fB\fBTSALARM_COMM_FAILURE\fR\fR
176 Channel communication failed.
182 \fB\fBTSALARM_NULL_REQ_DATA\fR\fR
186 Allocating memory for request data failed.
192 \fB\fBTSALARM_SUCCESS\fR\fR
196 Successful completion.
202 \fB\fBTSALARM_UNBOUND_PACKET_RECVD\fR\fR
206 An incorrect packet was received.
211 The \fBtsalarm_get()\fR function returns the following value:
215 \fB\fBTSALARM_GET_ERROR\fR\fR
218 An error occurred while getting the alarm state.
223 The \fBtsalarm_set()\fR function returns the following value:
227 \fB\fBTSALARM_SET_ERROR\fR\fR
230 An error occurred while setting the alarm state.
235 \fBExample 1 \fRGet and set an alarm state.
238 The following example demonstrates how to get and set an alarm state.
246 #include <sys/types.h>
249 void help(char *name) {
250 printf("Syntax: %s [get <type> | set <type> <state>]\en\en", name);
251 printf(" type = { critical, major, minor, user }\en");
252 printf(" state = { on, off }\en\en");
257 int main(int argc, char **argv) {
259 uint32_t alarm_type, alarm_state;
264 if (strncmp(argv[2], "critical", 1) == 0)
265 alarm_type = TSALARM_CRITICAL;
266 else if (strncmp(argv[2], "major", 2) == 0)
267 alarm_type = TSALARM_MAJOR;
268 else if (strncmp(argv[2], "minor", 2) == 0)
269 alarm_type = TSALARM_MINOR;
270 else if (strncmp(argv[2], "user", 1) == 0)
271 alarm_type = TSALARM_USER;
275 if (strncmp(argv[1], "get", 1) == 0) {
276 tsalarm_get(alarm_type, &alarm_state);
277 printf("alarm = %d\etstate = %d\en", alarm_type, alarm_state);
279 else if (strncmp(argv[1], "set", 1) == 0) {
280 if (strncmp(argv[3], "on", 2) == 0)
281 alarm_state = TSALARM_STATE_ON;
282 else if (strncmp(argv[3], "off", 2) == 0)
283 alarm_state = TSALARM_STATE_OFF;
287 tsalarm_set(alarm_type, alarm_state);
301 See \fBattributes\fR(5) for descriptions of the following attributes:
309 ATTRIBUTE TYPE ATTRIBUTE VALUE
311 Interface Stability Uncommitted
319 \fBlibtsalarm\fR(3LIB), \fBattributes\fR(5)