1 Star 0 Fork 0

叶海丰/ipmi-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cmd_get_message_flags.go 1.42 KB
一键复制 编辑 原始数据 按行查看 历史
叶海丰 提交于 2024-08-02 08:43 . init
package ipmi
// 22.4 Get Message Flags Command
type GetMessageFlagsRequest struct {
}
type GetMessageFlagsResponse struct {
OEM2Available bool
OEM1Available bool
OEM0Available bool
WatchdogPreTimeoutInterruptOccurred bool
EventMessageBufferFull bool
ReceiveMessageQueueAvailable bool // One or more messages ready for reading from Receive Message Queue
}
func (req *GetMessageFlagsRequest) Command() Command {
return CommandGetMessageFlags
}
func (req *GetMessageFlagsRequest) Pack() []byte {
return []byte{}
}
func (res *GetMessageFlagsResponse) Unpack(msg []byte) error {
if len(msg) < 1 {
return ErrUnpackedDataTooShortWith(len(msg), 1)
}
b, _, _ := unpackUint8(msg, 0)
res.OEM2Available = isBit7Set(b)
res.OEM1Available = isBit6Set(b)
res.OEM0Available = isBit5Set(b)
res.WatchdogPreTimeoutInterruptOccurred = isBit3Set(b)
res.EventMessageBufferFull = isBit1Set(b)
res.ReceiveMessageQueueAvailable = isBit0Set(b)
return nil
}
func (*GetMessageFlagsResponse) CompletionCodes() map[uint8]string {
// no command-specific cc
return map[uint8]string{}
}
func (res *GetMessageFlagsResponse) Format() string {
// Todo
return ""
}
func (c *Client) GetMessageFlags() (response *GetMessageFlagsResponse, err error) {
request := &GetMessageFlagsRequest{}
response = &GetMessageFlagsResponse{}
err = c.Exchange(request, response)
return
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/rogax/ipmi-go.git
git@gitee.com:rogax/ipmi-go.git
rogax
ipmi-go
ipmi-go
86ae46cfb58e

搜索帮助

0d507c66 1850385 C8b1a773 1850385