Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 5 additions & 70 deletions vpd-manager/include/manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,70 +219,10 @@ class Manager
const std::string& i_expandedLocationCode);

private:
#ifdef IBM_SYSTEM
/**
* @brief API to set timer to detect system VPD over D-Bus.
*
* System VPD is required before bus name for VPD-Manager is claimed. Once
* system VPD is published, VPD for other FRUs should be collected. This API
* detects id system VPD is already published on D-Bus and based on that
* triggers VPD collection for rest of the FRUs.
*
* Note: Throws exception in case of any failure. Needs to be handled by the
* caller.
*/
void SetTimerToDetectSVPDOnDbus();

/**
* @brief Set timer to detect and set VPD collection status for the system.
*
* Collection of FRU VPD is triggered in a separate thread. Resulting in
* multiple threads at a given time. The API creates a timer which on
* regular interval will check if all the threads were collected back and
* sets the status of the VPD collection for the system accordingly.
*
* @throw std::runtime_error
*/
void SetTimerToDetectVpdCollectionStatus();

/**
* @brief API to register callback for "AssetTag" property change.
*/
void registerAssetTagChangeCallback();

/**
* @brief Callback API to be triggered on "AssetTag" property change.
*
* @param[in] i_msg - The callback message.
*/
void processAssetTagChangeCallback(sdbusplus::message_t& i_msg);

/**
* @brief API to process VPD collection thread failed EEPROMs.
*/
void processFailedEeproms();

/**
* @brief API to check and update PowerVS VPD.
*
* The API will read the existing data from the DBus and if found
* different than what has been read from JSON, it will update the VPD with
* JSON data on hardware and DBus both.
*
* @param[in] i_powerVsJsonObj - PowerVS JSON object.
* @param[out] o_failedPathList - List of path failed to update.
*/
void checkAndUpdatePowerVsVpd(const nlohmann::json& i_powerVsJsonObj,
std::vector<std::string>& o_failedPathList);

/**
* @brief API to handle configuration w.r.t. PowerVS systems.
*
* Some FRUs VPD is specific to powerVS system. The API detects the
* powerVS configuration and updates the VPD accordingly.
* @brief API to register callback for Host state change.
*/
void ConfigurePowerVsSystem();
#endif
void registerHostStateChangeCallback();

/**
* @brief An api to check validity of unexpanded location code.
Expand All @@ -293,11 +233,6 @@ class Manager
*/
bool isValidUnexpandedLocationCode(const std::string& i_locationCode);

/**
* @brief API to register callback for Host state change.
*/
void registerHostStateChangeCallback();

/**
* @brief API to process host state change callback.
*
Expand All @@ -320,11 +255,11 @@ class Manager
// Shared pointer to GpioMonitor class
std::shared_ptr<GpioMonitor> m_gpioMonitor;

// Variable to hold current collection status
std::string m_vpdCollectionStatus = "NotStarted";

// Shared pointer to backup and restore class
std::shared_ptr<BackupAndRestore> m_backupAndRestoreObj;

// Shared pointer to oem specific manager class.
std::shared_ptr<Ibm_manager> m_ibmManager
};

} // namespace vpd
Loading