/openbmc/phosphor-host-ipmid/include/ipmid/ |
H A D | types.hpp | diff 4cc42556be1e69f1210e3a0a0bcff49078e39ec6 Wed Sep 11 12:28:35 CDT 2019 Sui Chen <suichen@google.com> Refactor ipmi::sensor::GetSensorResponse away from std::array
This change refactors GetSensorResponse from std::array to struct. This change depends on change #23544.
GetSensorResponse is an internal, intermediate structure, an unpacked form of a Get Sensor Reading response, providing direct access to its fields. Its life time is: GetReadingResponse -> GetSensorResponse -> ipmi::RspType.
It is written to in 5 functions in the ipmi::sensor::get namespace, by four setter functions (setOffset, setReading, setAssertionBytes, enableScanning). It is currently read from by 1 function (ipmiSensorGetSensorReading) for transforming to an ipmi::RspType.
Originally, the setter functions assumed bitwise equivalence between GetSensorResponse and GetReadingResponse, and the setter functions used reinterpret_cast to assign to a GetSensorResponse as if it were a GetReadingResponse.
With this change, the reinterpret_cast's are removed, and the set functions now accept GetSensorResponse instead of GetReadingResponse, so the code gets a bit easier to read.
Tested: Tested using a server with a BMC; sensor readings obtained through `ipmitool` appear to be correct (the reading might change within a small range): # ipmitool raw 0x04 0x2d 0x16 9B 40 00 00
Signed-off-by: Sui Chen <suichen@google.com> Change-Id: I5d454d6249f5431fb98169e6ef7c585c34024004
|
/openbmc/phosphor-host-ipmid/ |
H A D | sensorhandler.hpp | diff 4cc42556be1e69f1210e3a0a0bcff49078e39ec6 Wed Sep 11 12:28:35 CDT 2019 Sui Chen <suichen@google.com> Refactor ipmi::sensor::GetSensorResponse away from std::array
This change refactors GetSensorResponse from std::array to struct. This change depends on change #23544.
GetSensorResponse is an internal, intermediate structure, an unpacked form of a Get Sensor Reading response, providing direct access to its fields. Its life time is: GetReadingResponse -> GetSensorResponse -> ipmi::RspType.
It is written to in 5 functions in the ipmi::sensor::get namespace, by four setter functions (setOffset, setReading, setAssertionBytes, enableScanning). It is currently read from by 1 function (ipmiSensorGetSensorReading) for transforming to an ipmi::RspType.
Originally, the setter functions assumed bitwise equivalence between GetSensorResponse and GetReadingResponse, and the setter functions used reinterpret_cast to assign to a GetSensorResponse as if it were a GetReadingResponse.
With this change, the reinterpret_cast's are removed, and the set functions now accept GetSensorResponse instead of GetReadingResponse, so the code gets a bit easier to read.
Tested: Tested using a server with a BMC; sensor readings obtained through `ipmitool` appear to be correct (the reading might change within a small range): # ipmitool raw 0x04 0x2d 0x16 9B 40 00 00
Signed-off-by: Sui Chen <suichen@google.com> Change-Id: I5d454d6249f5431fb98169e6ef7c585c34024004
|
H A D | sensordatahandler.cpp | diff 4cc42556be1e69f1210e3a0a0bcff49078e39ec6 Wed Sep 11 12:28:35 CDT 2019 Sui Chen <suichen@google.com> Refactor ipmi::sensor::GetSensorResponse away from std::array
This change refactors GetSensorResponse from std::array to struct. This change depends on change #23544.
GetSensorResponse is an internal, intermediate structure, an unpacked form of a Get Sensor Reading response, providing direct access to its fields. Its life time is: GetReadingResponse -> GetSensorResponse -> ipmi::RspType.
It is written to in 5 functions in the ipmi::sensor::get namespace, by four setter functions (setOffset, setReading, setAssertionBytes, enableScanning). It is currently read from by 1 function (ipmiSensorGetSensorReading) for transforming to an ipmi::RspType.
Originally, the setter functions assumed bitwise equivalence between GetSensorResponse and GetReadingResponse, and the setter functions used reinterpret_cast to assign to a GetSensorResponse as if it were a GetReadingResponse.
With this change, the reinterpret_cast's are removed, and the set functions now accept GetSensorResponse instead of GetReadingResponse, so the code gets a bit easier to read.
Tested: Tested using a server with a BMC; sensor readings obtained through `ipmitool` appear to be correct (the reading might change within a small range): # ipmitool raw 0x04 0x2d 0x16 9B 40 00 00
Signed-off-by: Sui Chen <suichen@google.com> Change-Id: I5d454d6249f5431fb98169e6ef7c585c34024004
|
H A D | sensordatahandler.hpp | diff 4cc42556be1e69f1210e3a0a0bcff49078e39ec6 Wed Sep 11 12:28:35 CDT 2019 Sui Chen <suichen@google.com> Refactor ipmi::sensor::GetSensorResponse away from std::array
This change refactors GetSensorResponse from std::array to struct. This change depends on change #23544.
GetSensorResponse is an internal, intermediate structure, an unpacked form of a Get Sensor Reading response, providing direct access to its fields. Its life time is: GetReadingResponse -> GetSensorResponse -> ipmi::RspType.
It is written to in 5 functions in the ipmi::sensor::get namespace, by four setter functions (setOffset, setReading, setAssertionBytes, enableScanning). It is currently read from by 1 function (ipmiSensorGetSensorReading) for transforming to an ipmi::RspType.
Originally, the setter functions assumed bitwise equivalence between GetSensorResponse and GetReadingResponse, and the setter functions used reinterpret_cast to assign to a GetSensorResponse as if it were a GetReadingResponse.
With this change, the reinterpret_cast's are removed, and the set functions now accept GetSensorResponse instead of GetReadingResponse, so the code gets a bit easier to read.
Tested: Tested using a server with a BMC; sensor readings obtained through `ipmitool` appear to be correct (the reading might change within a small range): # ipmitool raw 0x04 0x2d 0x16 9B 40 00 00
Signed-off-by: Sui Chen <suichen@google.com> Change-Id: I5d454d6249f5431fb98169e6ef7c585c34024004
|
H A D | sensorhandler.cpp | diff 4cc42556be1e69f1210e3a0a0bcff49078e39ec6 Wed Sep 11 12:28:35 CDT 2019 Sui Chen <suichen@google.com> Refactor ipmi::sensor::GetSensorResponse away from std::array
This change refactors GetSensorResponse from std::array to struct. This change depends on change #23544.
GetSensorResponse is an internal, intermediate structure, an unpacked form of a Get Sensor Reading response, providing direct access to its fields. Its life time is: GetReadingResponse -> GetSensorResponse -> ipmi::RspType.
It is written to in 5 functions in the ipmi::sensor::get namespace, by four setter functions (setOffset, setReading, setAssertionBytes, enableScanning). It is currently read from by 1 function (ipmiSensorGetSensorReading) for transforming to an ipmi::RspType.
Originally, the setter functions assumed bitwise equivalence between GetSensorResponse and GetReadingResponse, and the setter functions used reinterpret_cast to assign to a GetSensorResponse as if it were a GetReadingResponse.
With this change, the reinterpret_cast's are removed, and the set functions now accept GetSensorResponse instead of GetReadingResponse, so the code gets a bit easier to read.
Tested: Tested using a server with a BMC; sensor readings obtained through `ipmitool` appear to be correct (the reading might change within a small range): # ipmitool raw 0x04 0x2d 0x16 9B 40 00 00
Signed-off-by: Sui Chen <suichen@google.com> Change-Id: I5d454d6249f5431fb98169e6ef7c585c34024004
|