-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathcmd_get_bt_interface_capabilities.go
54 lines (44 loc) · 1.53 KB
/
cmd_get_bt_interface_capabilities.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
package ipmi
import "context"
// 22.10 Get BT Interface Capabilities Command
type GetBTInterfaceCapabilitiesRequest struct {
// empty
}
type GetBTInterfaceCapabilitiesResponse struct {
OutstandingRequestsCountSupported uint8
InputBufferMessageSizeBytes uint8
OutputBufferMessageSizeBytes uint8
BMCRequestToResponseTimeSec uint8
RecommendedRetries uint8
}
func (req *GetBTInterfaceCapabilitiesRequest) Command() Command {
return CommandGetBTInterfaceCapabilities
}
func (req *GetBTInterfaceCapabilitiesRequest) Pack() []byte {
return []byte{}
}
func (res *GetBTInterfaceCapabilitiesResponse) Unpack(msg []byte) error {
// at least 3 bytes
if len(msg) < 5 {
return ErrUnpackedDataTooShortWith(len(msg), 5)
}
res.OutstandingRequestsCountSupported, _, _ = unpackUint8(msg, 0)
res.InputBufferMessageSizeBytes, _, _ = unpackUint8(msg, 1)
res.OutputBufferMessageSizeBytes, _, _ = unpackUint8(msg, 2)
res.BMCRequestToResponseTimeSec, _, _ = unpackUint8(msg, 3)
res.RecommendedRetries, _, _ = unpackUint8(msg, 4)
return nil
}
func (*GetBTInterfaceCapabilitiesResponse) CompletionCodes() map[uint8]string {
// no command-specific cc
return map[uint8]string{}
}
func (res *GetBTInterfaceCapabilitiesResponse) Format() string {
return ""
}
func (c *Client) GetBTInterfaceCapabilities(ctx context.Context) (response *GetBTInterfaceCapabilitiesResponse, err error) {
request := &GetBTInterfaceCapabilitiesRequest{}
response = &GetBTInterfaceCapabilitiesResponse{}
err = c.Exchange(ctx, request, response)
return
}