From 5100a386404edfa517186c66aa90abbb6658bda7 Mon Sep 17 00:00:00 2001 From: Patrick Venture Date: Thu, 27 Sep 2018 10:40:50 -0700 Subject: main: now seeks out shared library handlers are load-time phosphor-ipmi-blobs now detects blob handlers compiled into shared libraries on the BMC and loads them at start-up when it's loaded by phosphor-host-ipmid. Change-Id: Ib1b6b8f75aa544a263d37f71e133a9a188704de3 Signed-off-by: Patrick Venture --- example/example.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'example/example.cpp') diff --git a/example/example.cpp b/example/example.cpp index 66c8227..9209798 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -1,13 +1,18 @@ #include "example/example.hpp" #include +#include #include +#include +#include #include #include namespace blobs { +using namespace phosphor::logging; + constexpr char ExampleBlobHandler::supportedPath[]; ExampleBlob* ExampleBlobHandler::getSession(uint16_t id) @@ -165,4 +170,15 @@ bool ExampleBlobHandler::expire(uint16_t session) return false; } +void setupExampleHandler() __attribute__((constructor)); + +void setupExampleHandler() +{ + BlobManager* manager = getBlobManager(); + if (!manager->registerHandler(std::make_unique())) + { + log("Failed to register Example Handler"); + } +} + } // namespace blobs -- cgit v1.2.3