blob: bbe5667371b4f3a1d2f7d853939105494ead5acb [file] [log] [blame]
Brad Bishopadc45662016-10-28 20:00:57 -05001#include <sdbusplus/server.hpp>
2#include <xyz/openbmc_project/Inventory/Manager/server.hpp>
3
4namespace sdbusplus
5{
6namespace server
7{
8namespace xyz
9{
10namespace openbmc_project
11{
12namespace Inventory
13{
14
15Manager::Manager(bus::bus& bus, const char* path)
16 : _xyz_openbmc_project_Inventory_Manager_interface(
17 bus, path, _interface, _vtable, this)
18{
19}
20
21
22int Manager::_callback_Notify(
23 sd_bus_message* msg, void* context, sd_bus_error* error)
24{
25 auto m = message::message(sd_bus_message_ref(msg));
26
27 std::string path{};
28 std::map<std::string, std::map<std::string, sdbusplus::message::variant<std::string>>> object{};
29
30 m.read(path, object);
31
32 auto o = static_cast<Manager*>(context);
33 o->notify(path, object);
34
35 auto reply = m.new_method_return();
36 // No data to append on reply.
37
38 reply.method_return();
39
40 return 0;
41}
42
43namespace details
44{
45namespace Manager
46{
47static const auto _param_Notify =
48 utility::tuple_to_array(message::types::type_id<
49 std::string, std::map<std::string, std::map<std::string, sdbusplus::message::variant<std::string>>>>());
50}
51}
52
53
54
55const vtable::vtable_t Manager::_vtable[] = {
56 vtable::start(),
57
58 vtable::method("Notify",
59 details::Manager::_param_Notify
60 .data(),
61 nullptr,
62 _callback_Notify),
63 vtable::end()
64};
65
66} // namespace Inventory
67} // namespace openbmc_project
68} // namespace xyz
69} // namespace server
70} // namespace sdbusplus
71