1*b40f4f8fSArchana Kakani #pragma once 2*b40f4f8fSArchana Kakani 3*b40f4f8fSArchana Kakani #include <sdbusplus/bus.hpp> 4*b40f4f8fSArchana Kakani #include <sdbusplus/server.hpp> 5*b40f4f8fSArchana Kakani #include <sdbusplus/server/object.hpp> 6*b40f4f8fSArchana Kakani #include <xyz/openbmc_project/Inventory/Item/Cable/server.hpp> 7*b40f4f8fSArchana Kakani 8*b40f4f8fSArchana Kakani #include <string> 9*b40f4f8fSArchana Kakani 10*b40f4f8fSArchana Kakani namespace pldm 11*b40f4f8fSArchana Kakani { 12*b40f4f8fSArchana Kakani namespace dbus 13*b40f4f8fSArchana Kakani { 14*b40f4f8fSArchana Kakani 15*b40f4f8fSArchana Kakani using ItemCable = sdbusplus::server::object_t< 16*b40f4f8fSArchana Kakani sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cable>; 17*b40f4f8fSArchana Kakani 18*b40f4f8fSArchana Kakani /** 19*b40f4f8fSArchana Kakani * @class Cable 20*b40f4f8fSArchana Kakani * @brief Dbus support for cable interface and attributes 21*b40f4f8fSArchana Kakani */ 22*b40f4f8fSArchana Kakani class Cable : public ItemCable 23*b40f4f8fSArchana Kakani { 24*b40f4f8fSArchana Kakani public: 25*b40f4f8fSArchana Kakani Cable() = delete; 26*b40f4f8fSArchana Kakani ~Cable() = default; 27*b40f4f8fSArchana Kakani Cable(const Cable&) = delete; 28*b40f4f8fSArchana Kakani Cable& operator=(const Cable&) = delete; 29*b40f4f8fSArchana Kakani Cable(sdbusplus::bus_t & bus,const std::string & objPath)30*b40f4f8fSArchana Kakani Cable(sdbusplus::bus_t& bus, const std::string& objPath) : 31*b40f4f8fSArchana Kakani ItemCable(bus, objPath.c_str()) 32*b40f4f8fSArchana Kakani { 33*b40f4f8fSArchana Kakani // cable objects does not need to be store in serialized memory 34*b40f4f8fSArchana Kakani } 35*b40f4f8fSArchana Kakani 36*b40f4f8fSArchana Kakani /** Get length of the cable in meters */ 37*b40f4f8fSArchana Kakani double length() const override; 38*b40f4f8fSArchana Kakani 39*b40f4f8fSArchana Kakani /** Set length of the cable in meters */ 40*b40f4f8fSArchana Kakani double length(double value) override; 41*b40f4f8fSArchana Kakani 42*b40f4f8fSArchana Kakani /** Get string used to provide the type of 43*b40f4f8fSArchana Kakani a cable, such as optical or coppervalue */ 44*b40f4f8fSArchana Kakani std::string cableTypeDescription() const override; 45*b40f4f8fSArchana Kakani 46*b40f4f8fSArchana Kakani /** Set Cable type description */ 47*b40f4f8fSArchana Kakani std::string cableTypeDescription(std::string value) override; 48*b40f4f8fSArchana Kakani }; 49*b40f4f8fSArchana Kakani 50*b40f4f8fSArchana Kakani } // namespace dbus 51*b40f4f8fSArchana Kakani } // namespace pldm 52