blob: dfa11de7225f44adfa7577c18c03294aa1296a56 [file] [log] [blame]
Patrick Venture33569752018-03-12 18:56:14 -07001#pragma once
2
Kun Yi35b6c672018-06-11 20:44:43 -07003#include <sdbusplus/bus.hpp>
4#include <sdbusplus/server.hpp>
Patrick Ventureb5754fd2018-09-10 13:13:58 -07005#include <xyz/openbmc_project/State/Boot/Raw/server.hpp>
Kun Yi35b6c672018-06-11 20:44:43 -07006
Patrick Venture33569752018-03-12 18:56:14 -07007/* The LPC snoop on port 80h is mapped to this dbus path. */
Kumar Thangavel0269eaf2021-08-11 15:45:18 +05308constexpr char snoopObject[] = "/xyz/openbmc_project/state/boot/raw0";
Patrick Venture33569752018-03-12 18:56:14 -07009/* The LPC snoop on port 80h is mapped to this dbus service. */
Kumar Thangavel0269eaf2021-08-11 15:45:18 +053010constexpr char snoopDbus[] = "xyz.openbmc_project.State.Boot.Raw";
Kun Yi35b6c672018-06-11 20:44:43 -070011
12template <typename... T>
Patrick Williamsaebf87c2022-07-22 19:26:54 -050013using ServerObject = typename sdbusplus::server::object_t<T...>;
Kun Yi35b6c672018-06-11 20:44:43 -070014using PostInterface = sdbusplus::xyz::openbmc_project::State::Boot::server::Raw;
15using PostObject = ServerObject<PostInterface>;
Manojkiran Edaba5258f2021-02-25 13:23:33 +053016using primary_post_code_t = uint64_t;
17using secondary_post_code_t = std::vector<uint8_t>;
18using postcode_t = std::tuple<primary_post_code_t, secondary_post_code_t>;
Kun Yi35b6c672018-06-11 20:44:43 -070019
20class PostReporter : public PostObject
21{
22 public:
Patrick Williamsaebf87c2022-07-22 19:26:54 -050023 PostReporter(sdbusplus::bus_t& bus, const char* objPath, bool defer) :
Patrick Williams80be5d82022-04-07 15:41:48 -050024 PostObject(bus, objPath,
25 defer ? PostObject::action::defer_emit
26 : PostObject::action::emit_object_added)
Kun Yi35b6c672018-06-11 20:44:43 -070027 {
28 }
29};