From 1816ff30cfb2796ec0b4b1122b03940857cd491a Mon Sep 17 00:00:00 2001 From: Patrick Venture Date: Sun, 21 Oct 2018 13:32:06 -0700 Subject: IPMIFruArea: Add doxygen to class Add doxygen to IPMIFruArea class. Change-Id: Ie28dd84c25df939671771741d7e4faca931e613e Signed-off-by: Patrick Venture --- fru_area.cpp | 7 ------- fru_area.hpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 49 insertions(+), 18 deletions(-) diff --git a/fru_area.cpp b/fru_area.cpp index b25bfef..97ac3bd 100644 --- a/fru_area.cpp +++ b/fru_area.cpp @@ -8,9 +8,6 @@ using namespace phosphor::logging; -//---------------------------------------------------------------- -// Constructor -//---------------------------------------------------------------- IPMIFruArea::IPMIFruArea(const uint8_t fruID, const ipmi_fru_area_type type, bool bmcOnlyFru) : fruID(fruID), @@ -43,10 +40,6 @@ IPMIFruArea::IPMIFruArea(const uint8_t fruID, const ipmi_fru_area_type type, } } -//----------------------------------------------------- -// For a FRU area type, accepts the data and updates -// area specific data. -//----------------------------------------------------- void IPMIFruArea::setData(const uint8_t* value, const size_t length) { data.reserve(length); // pre-allocate the space. diff --git a/fru_area.hpp b/fru_area.hpp index afd983b..0bee9af 100644 --- a/fru_area.hpp +++ b/fru_area.hpp @@ -11,63 +11,101 @@ using std::uint8_t; +/** + * IPMIFruArea represents a piece of a FRU that is accessible over IPMI. + */ class IPMIFruArea { public: IPMIFruArea() = delete; ~IPMIFruArea() = default; - // constructor + /** + * Construct an IPMIFruArea. + * + * @param[in] fruID - FRU identifier value + * @param[in] type - the type of FRU area. + * @param[in] bmcOnlyFru - Is this FRU only accessible via the BMC + */ IPMIFruArea(const uint8_t fruID, const ipmi_fru_area_type type, bool bmcOnlyFru = false); - // Sets the present bit + /** + * Set whether the FRU is present. + * + * @param[in] present - True if present. + */ inline void setPresent(const bool present) { isPresent = present; } - // returns fru id; + /** + * Retrieves the FRU's ID. + * + * @return the FRU ID. + */ uint8_t getFruID() const { return fruID; } - // Returns the length. + /** + * Returns the length of the FRU data. + * + * @return the number of bytes. + */ size_t getLength() const { return data.size(); } - // Returns the type of the current fru area + /** + * Returns the type of the current FRU area. + * + * @return the type of FRU area + */ ipmi_fru_area_type getType() const { return type; } - // Returns the name + /** + * Returns the FRU area name. + * + * @return the FRU area name + */ const char* getName() const { return name.c_str(); } - // Returns the data portion + /** + * Returns the data portion. + * + * @return pointer to data + */ inline const uint8_t* getData() const { return data.data(); } - // Accepts a pointer to data and sets it in the object. - void setData(const uint8_t*, const size_t); + /** + * Accepts a pointer to data and sets it in the object. + * + * @param[in] value - The data to copy into the FRU area + * @param[in] length - the number of bytes value points to + */ + void setData(const uint8_t* value, const size_t length); private: // Unique way of identifying a FRU uint8_t fruID = 0; - // Type of the fru matching offsets in common header + // Type of the FRU matching offsets in common header ipmi_fru_area_type type = IPMI_FRU_AREA_INTERNAL_USE; - // Name of the fru area. ( BOARD/CHASSIS/PRODUCT ) + // Name of the FRU area. ( BOARD/CHASSIS/PRODUCT ) std::string name; // Special bit for BMC readable eeprom only. -- cgit v1.2.1