diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2018-09-14 14:50:03 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-10-18 16:43:22 -0400 |
commit | 94df8c9015798764d40665bb363bdbf27510f285 (patch) | |
tree | ce26611a482f2f03a582838faec29eeb065a6c47 /occ_pass_through.hpp | |
parent | 7db89e36d7c5649b826b607cb2d90e38bb02ab86 (diff) | |
download | openpower-occ-control-94df8c9015798764d40665bb363bdbf27510f285.tar.gz openpower-occ-control-94df8c9015798764d40665bb363bdbf27510f285.zip |
clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0.
This .clang-format matches the example one in
https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting
Change-Id: Id6760866dedbaeafd83ea8ef2e0303e30b8955aa
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'occ_pass_through.hpp')
-rw-r--r-- | occ_pass_through.hpp | 128 |
1 files changed, 63 insertions, 65 deletions
diff --git a/occ_pass_through.hpp b/occ_pass_through.hpp index 384a065..a28eb6a 100644 --- a/occ_pass_through.hpp +++ b/occ_pass_through.hpp @@ -1,9 +1,9 @@ #pragma once -#include <string> +#include <org/open_power/OCC/PassThrough/server.hpp> #include <sdbusplus/bus.hpp> #include <sdbusplus/server/object.hpp> -#include <org/open_power/OCC/PassThrough/server.hpp> +#include <string> namespace open_power { @@ -21,69 +21,67 @@ namespace sdbusRule = sdbusplus::bus::match::rules; */ class PassThrough : public Iface { - public: - PassThrough() = delete; - PassThrough(const PassThrough&) = delete; - PassThrough& operator=(const PassThrough&) = delete; - PassThrough(PassThrough&&) = default; - PassThrough& operator=(PassThrough&&) = default; - - /** @brief Ctor to put pass-through d-bus object on the bus - * @param[in] bus - Bus to attach to - * @param[in] path - Path to attach at - */ - PassThrough(sdbusplus::bus::bus& bus, - const char* path); - - ~PassThrough() - { - closeDevice(); - } - - /** @brief Pass through command to OCC - * @param[in] command - command to pass-through - * @returns OCC response as an array - */ - std::vector<std::int32_t> - send(std::vector<std::int32_t> command) override; - - private: - /** @brief Pass-through occ path on the bus */ - std::string path; - - /** @brief OCC device path - * For now, here is the hard-coded mapping until - * the udev rule is in. - * occ0 --> /dev/occ1 - * occ1 --> /dev/occ2 - * ... - */ - std::string devicePath; - - /** @brief Indicates whether or not the OCC is currently active */ - bool occActive = false; - - /** brief file descriptor associated with occ device */ - int fd = -1; - - /** @brief Subscribe to OCC Status signal - * - * Once the OCC status gets to active, only then we will get /dev/occ2 - * populated and hence need to wait on that before opening that - */ - sdbusplus::bus::match_t activeStatusSignal; - - /** Opens devicePath and populates file descritor */ - void openDevice(); - - /** Closed the fd associated with opened device */ - void closeDevice(); - - /** @brief Callback function on OCC Status change signals - * - * @param[in] msg - Data associated with subscribed signal - */ - void activeStatusEvent(sdbusplus::message::message& msg); + public: + PassThrough() = delete; + PassThrough(const PassThrough&) = delete; + PassThrough& operator=(const PassThrough&) = delete; + PassThrough(PassThrough&&) = default; + PassThrough& operator=(PassThrough&&) = default; + + /** @brief Ctor to put pass-through d-bus object on the bus + * @param[in] bus - Bus to attach to + * @param[in] path - Path to attach at + */ + PassThrough(sdbusplus::bus::bus& bus, const char* path); + + ~PassThrough() + { + closeDevice(); + } + + /** @brief Pass through command to OCC + * @param[in] command - command to pass-through + * @returns OCC response as an array + */ + std::vector<std::int32_t> send(std::vector<std::int32_t> command) override; + + private: + /** @brief Pass-through occ path on the bus */ + std::string path; + + /** @brief OCC device path + * For now, here is the hard-coded mapping until + * the udev rule is in. + * occ0 --> /dev/occ1 + * occ1 --> /dev/occ2 + * ... + */ + std::string devicePath; + + /** @brief Indicates whether or not the OCC is currently active */ + bool occActive = false; + + /** brief file descriptor associated with occ device */ + int fd = -1; + + /** @brief Subscribe to OCC Status signal + * + * Once the OCC status gets to active, only then we will get /dev/occ2 + * populated and hence need to wait on that before opening that + */ + sdbusplus::bus::match_t activeStatusSignal; + + /** Opens devicePath and populates file descritor */ + void openDevice(); + + /** Closed the fd associated with opened device */ + void closeDevice(); + + /** @brief Callback function on OCC Status change signals + * + * @param[in] msg - Data associated with subscribed signal + */ + void activeStatusEvent(sdbusplus::message::message& msg); }; } // namespace occ |