代码拉取完成,页面将自动刷新
package ipmi
import "fmt"
// 35.7 Get Sensor Hysteresis Command
type GetSensorHysteresisRequest struct {
SensorNumber uint8
}
type GetSensorHysteresisResponse struct {
PositiveRaw uint8
NegativeRaw uint8
}
func (req *GetSensorHysteresisRequest) Command() Command {
return CommandGetSensorHysteresis
}
func (req *GetSensorHysteresisRequest) Pack() []byte {
out := make([]byte, 2)
packUint8(req.SensorNumber, out, 0)
packUint8(0xff, out, 1) // reserved for future "hysteresis mask" definition. Write as "FFh"
return out
}
func (res *GetSensorHysteresisResponse) Unpack(msg []byte) error {
if len(msg) < 2 {
return ErrUnpackedDataTooShortWith(len(msg), 2)
}
res.PositiveRaw, _, _ = unpackUint8(msg, 0)
res.NegativeRaw, _, _ = unpackUint8(msg, 1)
return nil
}
func (r *GetSensorHysteresisResponse) CompletionCodes() map[uint8]string {
return map[uint8]string{}
}
func (res *GetSensorHysteresisResponse) Format() string {
return fmt.Sprintf(`Positive Hysteresis : %d
Negative Hysteresis : %d`,
res.PositiveRaw,
res.NegativeRaw,
)
}
// This command retrieves the present hysteresis values for the specified sensor.
// If the sensor hysteresis values are "fixed", then the hysteresis values can be obtained from the SDR for the sensor.
func (c *Client) GetSensorHysteresis(sensorNumber uint8) (response *GetSensorHysteresisResponse, err error) {
request := &GetSensorHysteresisRequest{
SensorNumber: sensorNumber,
}
response = &GetSensorHysteresisResponse{}
err = c.Exchange(request, response)
return
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。