-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathcmd_get_supermicro_bios_version.go
45 lines (36 loc) · 1.08 KB
/
cmd_get_supermicro_bios_version.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
package ipmi
import (
"context"
"fmt"
"strings"
)
type CommandGetSupermicroBiosVersionRequest struct {
}
type CommandGetSupermicroBiosVersionResponse struct {
Version string
}
func (req *CommandGetSupermicroBiosVersionRequest) Command() Command {
return CommandGetSupermicroBiosVersion
}
func (req *CommandGetSupermicroBiosVersionRequest) Pack() []byte {
return []byte{0x00, 0x00}
}
func (res *CommandGetSupermicroBiosVersionResponse) Unpack(msg []byte) error {
res.Version = string(msg)
res.Version = strings.TrimSpace(res.Version)
return nil
}
func (res *CommandGetSupermicroBiosVersionResponse) CompletionCodes() map[uint8]string {
return map[uint8]string{}
}
func (res *CommandGetSupermicroBiosVersionResponse) Format() string {
return fmt.Sprintf(`bios.version = %s`,
res.Version,
)
}
func (c *Client) GetSupermicroBiosVersion(ctx context.Context) (response *CommandGetSupermicroBiosVersionResponse, err error) {
request := &CommandGetSupermicroBiosVersionRequest{}
response = &CommandGetSupermicroBiosVersionResponse{}
err = c.Exchange(ctx, request, response)
return
}