summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-20 20:59:07 -0700
committerPatrick Venture <venture@google.com>2018-10-29 09:07:39 -0700
commitf22b36a061e4713c75233a68a86b81ed25d1e6a3 (patch)
treeff7c45a83a2624365d6466e98ef30ba2c61797c8
parent524ba9c1bd349141c79f213c56afc3b25f699593 (diff)
downloadipmi-fru-parser-f22b36a061e4713c75233a68a86b81ed25d1e6a3.zip
ipmi-fru-parser-f22b36a061e4713c75233a68a86b81ed25d1e6a3.tar.gz
IPMIFruArea: apply naming convention to member functions
Apply naming convention to member functions. Change-Id: I3b0516592dd4225f7be43c3d9cdcc9c8853d20b7 Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--fru_area.cpp6
-rw-r--r--fru_area.hpp22
-rw-r--r--writefrudata.cpp28
3 files changed, 28 insertions, 28 deletions
diff --git a/fru_area.cpp b/fru_area.cpp
index 8b09968..b983b53 100644
--- a/fru_area.cpp
+++ b/fru_area.cpp
@@ -47,7 +47,7 @@ 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::set_data(const uint8_t* value, const size_t length)
+void IPMIFruArea::setData(const uint8_t* value, const size_t length)
{
len = length;
data = new uint8_t[len];
@@ -57,8 +57,8 @@ void IPMIFruArea::set_data(const uint8_t* value, const size_t length)
//-----------------------------------------------------
// Sets the dbus parameters
//-----------------------------------------------------
-void IPMIFruArea::update_dbus_paths(const char* bus, const char* path,
- const char* intf)
+void IPMIFruArea::updateDbusPaths(const char* bus, const char* path,
+ const char* intf)
{
bus_name = bus;
obj_path = path;
diff --git a/fru_area.hpp b/fru_area.hpp
index 8cb9c00..7b10347 100644
--- a/fru_area.hpp
+++ b/fru_area.hpp
@@ -22,64 +22,64 @@ class IPMIFruArea
virtual ~IPMIFruArea();
// Sets the present bit
- inline void set_present(const bool present)
+ inline void setPresent(const bool present)
{
isPresent = present;
}
// returns fru id;
- uint8_t get_fruid() const
+ uint8_t getFruID() const
{
return fruid;
}
// Returns the length.
- size_t get_len() const
+ size_t getLength() const
{
return len;
}
// Returns the type of the current fru area
- ipmi_fru_area_type get_type() const
+ ipmi_fru_area_type getType() const
{
return type;
}
// Returns the name
- const char* get_name() const
+ const char* getName() const
{
return name.c_str();
}
// Returns SD bus name
- const char* get_bus_name() const
+ const char* getBusName() const
{
return bus_name.c_str();
}
// Retrns SD bus object path
- const char* get_obj_path() const
+ const char* getObjectPath() const
{
return obj_path.c_str();
}
// Returns SD bus interface name
- const char* get_intf_name() const
+ const char* getInterfaceName() const
{
return intf_name.c_str();
}
// Returns the data portion
- inline uint8_t* get_data() const
+ inline uint8_t* getData() const
{
return data;
}
// Accepts a pointer to data and sets it in the object.
- void set_data(const uint8_t*, const size_t);
+ void setData(const uint8_t*, const size_t);
// Sets the dbus parameters
- void update_dbus_paths(const char*, const char*, const char*);
+ void updateDbusPaths(const char*, const char*, const char*);
private:
// Unique way of identifying a FRU
diff --git a/writefrudata.cpp b/writefrudata.cpp
index 978f2b1..d6eb8f9 100644
--- a/writefrudata.cpp
+++ b/writefrudata.cpp
@@ -155,10 +155,10 @@ int updateInventory(FruAreaVector& area_vec, sd_bus* bus_sd)
// the Inventory.
for (const auto& fruArea : area_vec)
{
- fruid = fruArea->get_fruid();
+ fruid = fruArea->getFruID();
// Fill the container with information
- rc = parse_fru_area((fruArea)->get_type(), (void*)(fruArea)->get_data(),
- (fruArea)->get_len(), fruData);
+ rc = parse_fru_area((fruArea)->getType(), (void*)(fruArea)->getData(),
+ (fruArea)->getLength(), fruData);
if (rc < 0)
{
log<level::ERR>("Error parsing FRU records");
@@ -382,7 +382,7 @@ int verify_fru_data(const uint8_t* data, const size_t len)
bool remove_invalid_area(const std::unique_ptr<IPMIFruArea>& fru_area)
{
// Filter the ones that are empty
- if (!(fru_area->get_len()))
+ if (!(fru_area->getLength()))
{
return true;
}
@@ -463,9 +463,9 @@ int ipmi_populate_fru_areas(uint8_t* fru_data, const size_t data_len,
// of the fields populated. Update the data portion now.
for (auto& iter : fru_area_vec)
{
- if ((iter)->get_type() == get_fru_area_type(fru_entry))
+ if ((iter)->getType() == get_fru_area_type(fru_entry))
{
- (iter)->set_data(area_data, area_len);
+ (iter)->setData(area_data, area_len);
}
}
} // If we have fru data present
@@ -533,7 +533,7 @@ int validateFRUArea(const uint8_t fruid, const char* fru_file_name,
// Physically being present
bool present = access(fru_file_name, F_OK) == 0;
- fru_area->set_present(present);
+ fru_area->setPresent(present);
fru_area_vec.emplace_back(std::move(fru_area));
}
@@ -597,13 +597,13 @@ int validateFRUArea(const uint8_t fruid, const char* fru_file_name,
#ifdef __IPMI_DEBUG__
for (auto& iter : fru_area_vec)
{
- std::printf("FRU ID : [%d]\n", (iter)->get_fruid());
- std::printf("AREA NAME : [%s]\n", (iter)->get_name());
- std::printf("TYPE : [%d]\n", (iter)->get_type());
- std::printf("LEN : [%d]\n", (iter)->get_len());
- std::printf("BUS NAME : [%s]\n", (iter)->get_bus_name());
- std::printf("OBJ PATH : [%s]\n", (iter)->get_obj_path());
- std::printf("INTF NAME :[%s]\n", (iter)->get_intf_name());
+ std::printf("FRU ID : [%d]\n", (iter)->getFruID());
+ std::printf("AREA NAME : [%s]\n", (iter)->getName());
+ std::printf("TYPE : [%d]\n", (iter)->getType());
+ std::printf("LEN : [%d]\n", (iter)->getLength());
+ std::printf("BUS NAME : [%s]\n", (iter)->getBusName());
+ std::printf("OBJ PATH : [%s]\n", (iter)->getObjectPath());
+ std::printf("INTF NAME :[%s]\n", (iter)->getIntfName());
}
#endif
OpenPOWER on IntegriCloud