1 package org.metricshub.ipmi.core.coding.payload.sol;
2
3 /*-
4 * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
5 * IPMI Java Client
6 * ჻჻჻჻჻჻
7 * Copyright 2023 Verax Systems, MetricsHub
8 * ჻჻჻჻჻჻
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation, either version 3 of the
12 * License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Lesser Public License for more details.
18 *
19 * You should have received a copy of the GNU General Lesser Public
20 * License along with this program. If not, see
21 * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22 * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
23 */
24
25 /**
26 * Enumeration of all possible states, that Remote Console can receive from BMC during SOL communication.
27 */
28 public enum SolStatus {
29 /**
30 * Character transfer is unavailable because system is in a powered-down or sleep state.
31 */
32 CharacterTransferUnavailable(5),
33
34 /**
35 * SOL is deactivated/deactivating.
36 * (Remote console can use this to tell if SOL was deactivated by some other party,
37 * or by local pushbutton reset or power on/off).
38 */
39 SolDeactivated(4),
40
41 /**
42 * Characters were dropped between transmitting this packet and the previous packet,
43 * because the system did not pay attention to hardware flow control.
44 */
45 TransmitOverrun(3),
46
47 /**
48 * A break condition from the system has been detected.
49 * The BMC will generate this only on one packet at the start of the break.
50 */
51 Break(2),
52
53 /**
54 * When test mode active, signals that RTS is asserted on serial port.
55 * For test mode inactive, it is unused.
56 * A packet with this status will be automatically sent whenever RTS changes state.
57 * Note that this packet may not contain character data.
58 */
59 RtsAsserted(1),
60
61 /**
62 * When test mode active, signals that DTR is asserted on serial port.
63 * For test mode inactive, it is unused.
64 * A packet with this status will be automatically sent whenever DTR changes state.
65 * Note that this packet may not contain character data.
66 */
67 DtrAsserted(0);
68
69 /**
70 * ID of the status (number of bit in status field byte).
71 */
72 private final int statusNumber;
73
74 SolStatus(int statusNumber) {
75 this.statusNumber = statusNumber;
76 }
77
78 public int getStatusNumber() {
79 return statusNumber;
80 }
81 }