From 29f1daa03ca6a664b64ba600e50e4ec949b6cc11 Mon Sep 17 00:00:00 2001 From: Loïc Collignon Date: Fri, 19 Oct 2018 13:50:35 +0200 Subject: Migration to Afb API v3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrate the API to get rid of dynapi by using API v3 instead. Also fix possible bugs and memory leaks when startup fails. Bug: SPEC-1546 Change-Id: I7cf8e9454d6910b1258dfe671dedde3b84855fc4 Signed-off-by: Loïc Collignon --- ahl-binding/ahl-binding.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ahl-binding/ahl-binding.hpp') diff --git a/ahl-binding/ahl-binding.hpp b/ahl-binding/ahl-binding.hpp index aa4b104..0e7bd63 100644 --- a/ahl-binding/ahl-binding.hpp +++ b/ahl-binding/ahl-binding.hpp @@ -36,10 +36,10 @@ class ahl_binding_t { - using role_action = std::function; + using role_action = std::function; private: - afb_dynapi* handle_; + afb_api_t handle_; std::vector roles_; explicit ahl_binding_t(); @@ -53,19 +53,19 @@ private: void update_stream(std::string hal, std::string stream, std::string deviceuri); int create_api_verb(role_t* r); - void policy_open(afb_request* req, const role_t& role); + void policy_open(afb_req_t req, const role_t& role); public: static ahl_binding_t& instance(); - int preinit(afb_dynapi* handle); + int preinit(afb_api_t handle); int init(); void event(std::string name, json_object* arg); - void get_roles(afb_request* req); + void get_roles(afb_req_t req); const std::vector roles() const; - afb_dynapi* handle() const; + afb_api_t handle() const; - void audiorole(afb_request* req); + void audiorole(afb_req_t req); int parse_roles_config(json_object* o); }; -- cgit 1.2.3-korg