File: cmd_get_self_test_results.go

package info (click to toggle)
golang-github-bougou-go-ipmi 0.7.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,880 kB
  • sloc: makefile: 38
file content (46 lines) | stat: -rw-r--r-- 1,023 bytes parent folder | download | duplicates (2)
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
package ipmi

import "context"

// 20.4 Get Self Test Results Command
type GetSelfTestResultsRequest struct {
	// empty
}

type GetSelfTestResultsResponse struct {
	Byte1 uint8
	Byte2 uint8
}

func (req *GetSelfTestResultsRequest) Command() Command {
	return CommandGetSelfTestResults
}

func (req *GetSelfTestResultsRequest) Pack() []byte {
	return []byte{}
}

func (res *GetSelfTestResultsResponse) CompletionCodes() map[uint8]string {
	return map[uint8]string{}
}

func (res *GetSelfTestResultsResponse) Unpack(msg []byte) error {
	if len(msg) < 2 {
		return ErrUnpackedDataTooShortWith(len(msg), 2)
	}
	res.Byte1, _, _ = unpackUint8(msg, 0)
	res.Byte2, _, _ = unpackUint8(msg, 1)
	return nil
}

func (res *GetSelfTestResultsResponse) Format() string {
	// Todo
	return ""
}

func (c *Client) GetSelfTestResults(ctx context.Context) (response *GetSelfTestResultsResponse, err error) {
	request := &GetSelfTestResultsRequest{}
	response = &GetSelfTestResultsResponse{}
	err = c.Exchange(ctx, request, response)
	return
}