forked from bougou/go-ipmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmd_set_front_panel_enables.go
63 lines (54 loc) · 1.57 KB
/
cmd_set_front_panel_enables.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
package ipmi
// 28.6 Set Front Panel Enables
// 定位
type SetFrontPanelEnablesRequest struct {
DisableSleepButton bool
DisableDiagnosticButton bool
DisableResetButton bool
DisablePoweroffButton bool
}
type SetFrontPanelEnablesResponse struct {
// empty
}
func (req *SetFrontPanelEnablesRequest) Pack() []byte {
out := make([]byte, 1)
var b uint8 = 0
if req.DisableSleepButton {
b = setBit3(b)
}
if req.DisableSleepButton {
b = setBit2(b)
}
if req.DisableSleepButton {
b = setBit1(b)
}
if req.DisableSleepButton {
b = setBit0(b)
}
packUint8(b, out, 1)
return out
}
func (req *SetFrontPanelEnablesRequest) Command() Command {
return CommandSetFrontPanelEnables
}
func (res *SetFrontPanelEnablesResponse) CompletionCodes() map[uint8]string {
return map[uint8]string{}
}
func (res *SetFrontPanelEnablesResponse) Unpack(msg []byte) error {
return nil
}
func (res *SetFrontPanelEnablesResponse) Format() string {
return ""
}
// The following command is used to enable or disable the buttons on the front panel of the chassis.
func (c *Client) SetFrontPanelEnables(disableSleepButton bool, disableDiagnosticButton bool, disableResetButton bool, disablePoweroffButton bool) (response *SetFrontPanelEnablesResponse, err error) {
request := &SetFrontPanelEnablesRequest{
DisableSleepButton: disableSleepButton,
DisableDiagnosticButton: disableDiagnosticButton,
DisableResetButton: disableResetButton,
DisablePoweroffButton: disablePoweroffButton,
}
response = &SetFrontPanelEnablesResponse{}
err = c.Exchange(request, response)
return
}