1 Star 0 Fork 0

叶海丰/ipmi-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
cmd_chassis_identify.go 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
叶海丰 提交于 2024-08-02 08:43 . init
package ipmi
// 28.5 Chassis Identify Command
// 用来定位设备,机箱定位 (机箱定位灯默认亮 interval 秒)
type ChassisIdentifyRequest struct {
IdentifyInterval uint8
ForceIdentifyOn bool
}
type ChassisIdentifyResponse struct {
// empty
}
func (req *ChassisIdentifyRequest) Pack() []byte {
out := make([]byte, 2)
packUint8(uint8(req.IdentifyInterval), out, 0)
var force uint8 = 0
if req.ForceIdentifyOn {
force = 1
}
packUint8(force, out, 1)
return out
}
func (req *ChassisIdentifyRequest) Command() Command {
return CommandChassisIdentify
}
func (res *ChassisIdentifyResponse) CompletionCodes() map[uint8]string {
return map[uint8]string{}
}
func (res *ChassisIdentifyResponse) Unpack(msg []byte) error {
return nil
}
func (res *ChassisIdentifyResponse) Format() string {
return ""
}
// This command causes the chassis to physically identify itself by a mechanism
// chosen by the system implementation; such as turning on blinking user-visible lights
// or emitting beeps via a speaker, LCD panel, etc.
func (c *Client) ChassisIdentify(interval uint8, force bool) (response *ChassisIdentifyResponse, err error) {
request := &ChassisIdentifyRequest{
IdentifyInterval: interval,
ForceIdentifyOn: force,
}
response = &ChassisIdentifyResponse{}
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
3b6556707aea

搜索帮助