1 #pragma once
2 
3 #include <sdbusplus/bus.hpp>
4 #include <sdbusplus/server.hpp>
5 #include <xyz/openbmc_project/State/Boot/Raw/server.hpp>
6 
7 /* The LPC snoop on port 80h is mapped to this dbus path. */
8 constexpr char snoopObject[] = "/xyz/openbmc_project/state/boot/raw0";
9 /* The LPC snoop on port 80h is mapped to this dbus service. */
10 constexpr char snoopDbus[] = "xyz.openbmc_project.State.Boot.Raw";
11 
12 template <typename... T>
13 using ServerObject = typename sdbusplus::server::object_t<T...>;
14 using PostInterface = sdbusplus::xyz::openbmc_project::State::Boot::server::Raw;
15 using PostObject = ServerObject<PostInterface>;
16 using primary_post_code_t = uint64_t;
17 using secondary_post_code_t = std::vector<uint8_t>;
18 using postcode_t = std::tuple<primary_post_code_t, secondary_post_code_t>;
19 
20 class PostReporter : public PostObject
21 {
22   public:
PostReporter(sdbusplus::bus_t & bus,const char * objPath,bool defer)23     PostReporter(sdbusplus::bus_t& bus, const char* objPath, bool defer) :
24         PostObject(bus, objPath,
25                    defer ? PostObject::action::defer_emit
26                          : PostObject::action::emit_object_added)
27     {}
28     unsigned int rateLimit = 0;
29 };
30