代码拉取完成,页面将自动刷新
package ipmi
import "fmt"
// 31.9 Clear SEL Command
type ClearSELRequest struct {
ReservationID uint16 // LS Byte first
GetErasureStatusFlag bool
}
type ClearSELResponse struct {
ErasureProgressStatus uint8
}
func (req *ClearSELRequest) Pack() []byte {
var out = make([]byte, 6)
packUint16L(req.ReservationID, out, 0)
packUint8('C', out, 2) // fixed 'C' char
packUint8('L', out, 3) // fixed 'L' char
packUint8('R', out, 4) // fixed 'R' char
if req.GetErasureStatusFlag {
packUint8(0x00, out, 5) // get erasure status
} else {
packUint8(0xaa, out, 5) // initiate erase
}
return out
}
func (req *ClearSELRequest) Command() Command {
return CommandClearSEL
}
func (res *ClearSELResponse) Unpack(msg []byte) error {
if len(msg) < 1 {
return ErrUnpackedDataTooShortWith(len(msg), 1)
}
res.ErasureProgressStatus, _, _ = unpackUint8(msg, 0)
return nil
}
func (res *ClearSELResponse) CompletionCodes() map[uint8]string {
// no command-specific cc
return map[uint8]string{}
}
func (res *ClearSELResponse) Format() string {
return fmt.Sprintf("%v", res)
}
func (c *Client) ClearSEL(reservationID uint16) (response *ClearSELResponse, err error) {
request := &ClearSELRequest{
ReservationID: reservationID,
GetErasureStatusFlag: false,
}
response = &ClearSELResponse{}
err = c.Exchange(request, response)
return
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。