-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathcmd_alert_immediate.go
77 lines (60 loc) · 1.98 KB
/
cmd_alert_immediate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package ipmi
import "context"
type AlertImmediateOperation uint8
const (
AlertImmediateOperationInitiateAlert AlertImmediateOperation = 0b00
AlertImmediateOperationGetStatus AlertImmediateOperation = 0b01
AlertImmediateOperationClearStatus AlertImmediateOperation = 0b10
AlertImmediateOperationReserved AlertImmediateOperation = 0b11
)
type AlertImmediateStatus uint8
const (
AlertImmediateStatusNoStatus AlertImmediateStatus = 0x00
AlertImmediateStatusNormalEnd AlertImmediateStatus = 0x01
AlertImmediateStatusFailedRetry AlertImmediateStatus = 0x02
AlertImmediateStatusFailedWaitACK AlertImmediateStatus = 0x03
AlertImmediateStatusInProgress AlertImmediateStatus = 0xff
)
// 30.7 Alert Immediate Command
type AlertImmediateRequest struct {
ChannelNumber uint8
DestinationSelector uint8
Operation uint8
SendAlertString bool
AlertStringSelector uint8
GeneratorID uint8
EvMRev uint8
SensorType SensorType
SensorNumber SensorNumber
EventDir EventDir
EventReadingType EventReadingType
EventData EventData
}
type AlertImmediateResponse struct {
AlertImmediateStatus uint8
}
func (req *AlertImmediateRequest) Pack() []byte {
out := make([]byte, 1)
return out
}
func (req *AlertImmediateRequest) Command() Command {
return CommandAlertImmediate
}
func (res *AlertImmediateResponse) CompletionCodes() map[uint8]string {
return map[uint8]string{
0x81: "Alert Immediate rejected due to alert already in progress",
0x82: "Alert Immediate rejected due to IPMI messaging session active on this channel",
0x83: "Platform Event Parameters (4:11) not supported",
}
}
func (res *AlertImmediateResponse) Unpack(msg []byte) error {
return nil
}
func (res *AlertImmediateResponse) Format() string {
return ""
}
func (c *Client) AlertImmediate(ctx context.Context, request *AlertImmediateRequest) (response *AlertImmediateResponse, err error) {
response = &AlertImmediateResponse{}
err = c.Exchange(ctx, request, response)
return
}