15d532675SSaqib Khan #pragma once
25d532675SSaqib Khan 
35d532675SSaqib Khan #include "config.h"
45d532675SSaqib Khan 
5ec4eec34SAdriana Kobylak #include "version.hpp"
6ec4eec34SAdriana Kobylak 
79155b713SAndrew Geissler #include <string>
8b0ce996aSGunnar Mills 
95d532675SSaqib Khan namespace phosphor
105d532675SSaqib Khan {
115d532675SSaqib Khan namespace software
125d532675SSaqib Khan {
135d532675SSaqib Khan namespace updater
145d532675SSaqib Khan {
155d532675SSaqib Khan 
16ec4eec34SAdriana Kobylak using VersionPurpose =
17*1e9a5f1aSPatrick Williams     sdbusplus::server::xyz::openbmc_project::software::Version::VersionPurpose;
185d532675SSaqib Khan 
19687e75e2SAdriana Kobylak /** @brief Serialization function - stores priority information to file
20780220f2SAdriana Kobylak  *  @param[in] flashId - The flash id of the version for which to store
21780220f2SAdriana Kobylak  *                       information.
225d532675SSaqib Khan  *  @param[in] priority - RedundancyPriority value for that version.
235d532675SSaqib Khan  **/
24780220f2SAdriana Kobylak void storePriority(const std::string& flashId, uint8_t priority);
255d532675SSaqib Khan 
26ec4eec34SAdriana Kobylak /** @brief Serialization function - stores purpose information to file
27780220f2SAdriana Kobylak  *  @param[in] flashId - The flash id of the version for which to store
28780220f2SAdriana Kobylak  *                       information.
29ec4eec34SAdriana Kobylak  *  @param[in] purpose - VersionPurpose value for that version.
30ec4eec34SAdriana Kobylak  **/
31780220f2SAdriana Kobylak void storePurpose(const std::string& flashId, VersionPurpose purpose);
32ec4eec34SAdriana Kobylak 
33687e75e2SAdriana Kobylak /** @brief Serialization function - restores priority information from file
34780220f2SAdriana Kobylak  *  @param[in] flashId - The flash id of the version for which to retrieve
35780220f2SAdriana Kobylak  *                       information.
365d532675SSaqib Khan  *  @param[in] priority - RedundancyPriority reference for that version.
371eef62deSSaqib Khan  *  @return true if restore was successful, false if not
385d532675SSaqib Khan  **/
39780220f2SAdriana Kobylak bool restorePriority(const std::string& flashId, uint8_t& priority);
405d532675SSaqib Khan 
41ec4eec34SAdriana Kobylak /** @brief Serialization function - restores purpose information from file
42780220f2SAdriana Kobylak  *  @param[in] flashId - The flash id of the version for which to retrieve
43780220f2SAdriana Kobylak  *                       information.
44ec4eec34SAdriana Kobylak  *  @param[in] purpose - VersionPurpose reference for that version.
45ec4eec34SAdriana Kobylak  *  @return true if restore was successful, false if not
46ec4eec34SAdriana Kobylak  **/
47780220f2SAdriana Kobylak bool restorePurpose(const std::string& flashId, VersionPurpose& purpose);
48ec4eec34SAdriana Kobylak 
49687e75e2SAdriana Kobylak /** @brief Removes the serial directory for a given version.
50780220f2SAdriana Kobylak  *  @param[in] flash Id - The flash id of the version for which to remove a
51780220f2SAdriana Kobylak  *                        file, if it exists.
525d532675SSaqib Khan  **/
53780220f2SAdriana Kobylak void removePersistDataDirectory(const std::string& flashId);
545d532675SSaqib Khan 
55fa34e023SGunnar Mills } // namespace updater
565d532675SSaqib Khan } // namespace software
57fa34e023SGunnar Mills } // namespace phosphor
58