From 4189cc2339a723eedba5a9e53929a45d9f0ad5e9 Mon Sep 17 00:00:00 2001 From: Loïc Collignon Date: Fri, 29 Jun 2018 10:51:21 +0200 Subject: Fix build for migration to the binder from master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some definitions changed between eel and master versions of the app-framework-binder. Change-Id: I92d6f4af3193a693580d421adbd4331fcb249392 Signed-off-by: Loïc Collignon --- ahl-binding/afb-binding-common.h | 33 +++++++++++++++++++++++++++++++++ ahl-binding/ahl-binding.cpp | 4 ++-- ahl-binding/ahl-binding.hpp | 9 +-------- ahl-binding/role.cpp | 2 +- ahl-binding/role.hpp | 3 +-- 5 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 ahl-binding/afb-binding-common.h diff --git a/ahl-binding/afb-binding-common.h b/ahl-binding/afb-binding-common.h new file mode 100644 index 0000000..61118db --- /dev/null +++ b/ahl-binding/afb-binding-common.h @@ -0,0 +1,33 @@ +#pragma once + +/* + * Copyright (C) 2018 "IoT.bzh" + * Author Loïc Collignon + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define AFB_BINDING_VERSION 0 +#define AFB_BINDING_WANT_DYNAPI +#include +#include +#include + +#ifdef __cplusplus +} +#endif + diff --git a/ahl-binding/ahl-binding.cpp b/ahl-binding/ahl-binding.cpp index 37e6847..29be7a1 100644 --- a/ahl-binding/ahl-binding.cpp +++ b/ahl-binding/ahl-binding.cpp @@ -268,7 +268,7 @@ void ahl_binding_t::load_static_verbs() ahl_api_get_roles, nullptr, nullptr, - AFB_SESSION_NONE_V2)) + AFB_SESSION_NONE_X2)) { throw std::runtime_error("Failed to add 'get_role' verb to the API."); } @@ -360,7 +360,7 @@ int ahl_binding_t::create_api_verb(role_t* r) ahl_api_role, r, nullptr, - AFB_SESSION_NONE_V2)) + AFB_SESSION_NONE_X2)) { AFB_DYNAPI_ERROR(handle_, "Failed to add '%s' verb to the API.", r->uid().c_str()); diff --git a/ahl-binding/ahl-binding.hpp b/ahl-binding/ahl-binding.hpp index e76d7ef..aa4b104 100644 --- a/ahl-binding/ahl-binding.hpp +++ b/ahl-binding/ahl-binding.hpp @@ -32,14 +32,7 @@ #define HL_API_INFO "Audio high level API for AGL applications" #define HAL_MGR_API "4a-hal-manager" -extern "C" { - - #define AFB_BINDING_VERSION 0 - #define AFB_BINDING_WANT_DYNAPI - #include - #include - #include -}; +#include "afb-binding-common.h" class ahl_binding_t { diff --git a/ahl-binding/role.cpp b/ahl-binding/role.cpp index 2be3dc5..5215a60 100644 --- a/ahl-binding/role.cpp +++ b/ahl-binding/role.cpp @@ -261,7 +261,7 @@ void role_t::volume(afb_request* r, json_object* o) json_object_object_add(a, "volume", value); afb_dynapi_call( - r->dynapi, + r->api, hal_.c_str(), stream_.c_str(), a, diff --git a/ahl-binding/role.hpp b/ahl-binding/role.hpp index 1469b68..6831195 100644 --- a/ahl-binding/role.hpp +++ b/ahl-binding/role.hpp @@ -19,8 +19,7 @@ #include #include "interrupt.hpp" - -struct afb_request; +#include "afb-binding-common.h" class role_t { -- cgit 1.2.3-korg