1 Star 0 Fork 0

叶海丰/ipmi-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
cmd_set_sensor_hysteresis.go 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
叶海丰 提交于 2024-08-02 08:43 . init
package ipmi
// 35.6 Set Sensor Hysteresis Command
type SetSensorHysteresisRequest struct {
SensorNumber uint8
PositiveHysteresis uint8
NegativeHysteresis uint8
}
type SetSensorHysteresisResponse struct {
}
func (req *SetSensorHysteresisRequest) Command() Command {
return CommandSetSensorHysteresis
}
func (req *SetSensorHysteresisRequest) Pack() []byte {
out := make([]byte, 4)
packUint8(req.SensorNumber, out, 0)
packUint8(0xff, out, 1) // reserved for future "hysteresis mask" definition. Write as FFh
packUint8(req.PositiveHysteresis, out, 2)
packUint8(req.NegativeHysteresis, out, 3)
return out
}
func (res *SetSensorHysteresisResponse) Unpack(msg []byte) error {
return nil
}
func (r *SetSensorHysteresisResponse) CompletionCodes() map[uint8]string {
return map[uint8]string{}
}
func (res *SetSensorHysteresisResponse) Format() string {
return ""
}
// This command provides a mechanism for setting the hysteresis values associated
// with the thresholds of a sensor that has threshold based event generation.
func (c *Client) SetSensorHysteresis(sensorNumber uint8, positiveHysteresis uint8, negativeHysteresis uint8) (response *SetSensorHysteresisResponse, err error) {
request := &SetSensorHysteresisRequest{
SensorNumber: sensorNumber,
PositiveHysteresis: positiveHysteresis,
NegativeHysteresis: negativeHysteresis,
}
response = &SetSensorHysteresisResponse{}
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

搜索帮助