summaryrefslogtreecommitdiffstats
path: root/src/plugins/afb
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2019-10-07 17:04:44 -0400
committerScott Murray <scott.murray@konsulko.com>2019-10-15 11:33:31 -0400
commit54be328d031b3d8be799a2563d944e06c41c66ec (patch)
treef0e8b12ee562c5d5ba58326896c0062d34ab6a0b /src/plugins/afb
parent40a0b16e2e4e8b030473254c2f04b4b377bf76f1 (diff)
Switch to appcontroller library
Remove old app-controller submodule usage in favor of library from the toolchain. Also update dynamic API calls for V3. Bug-AGL: SPEC-2856 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ida157480f95d0e8b0806a1d9af6cc396f4729850 (cherry picked from commit 0a7e93d37803ba31b18c7199cb1efc10ec83e0cc)
Diffstat (limited to 'src/plugins/afb')
-rw-r--r--src/plugins/afb/AFBApiImpl.cpp9
-rw-r--r--src/plugins/afb/AFBApiImpl.h7
-rw-r--r--src/plugins/afb/AFBRequestImpl.cpp7
-rw-r--r--src/plugins/afb/AFBRequestImpl.h7
-rw-r--r--src/plugins/afb/include/AFBEventImpl.h7
-rw-r--r--src/plugins/afb/src/AFBEventImpl.cpp9
6 files changed, 26 insertions, 20 deletions
diff --git a/src/plugins/afb/AFBApiImpl.cpp b/src/plugins/afb/AFBApiImpl.cpp
index 9af4fbc..c4cc1b1 100644
--- a/src/plugins/afb/AFBApiImpl.cpp
+++ b/src/plugins/afb/AFBApiImpl.cpp
@@ -1,5 +1,6 @@
/*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2019 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -21,7 +22,7 @@
extern "C" {
#define AFB_BINDING_VERSION 3
-#include "afb-definitions.h"
+#include <afb/afb-binding.h>
}
static std::string TAG = "vshlcore::afb::AFBApiImpl";
@@ -35,11 +36,11 @@ using namespace vshlcore::utilities::logging;
namespace vshlcore {
namespace afb {
-std::unique_ptr<AFBApiImpl> AFBApiImpl::create(AFB_ApiT api) {
+std::unique_ptr<AFBApiImpl> AFBApiImpl::create(afb_api_t api) {
return std::unique_ptr<AFBApiImpl>(new AFBApiImpl(api));
}
-AFBApiImpl::AFBApiImpl(AFB_ApiT api) : mApi(api), mLogger(Logger::create(api)) {
+AFBApiImpl::AFBApiImpl(afb_api_t api) : mApi(api), mLogger(Logger::create(api)) {
}
AFBApiImpl::~AFBApiImpl() {
@@ -58,7 +59,7 @@ int AFBApiImpl::callSync(
std::string& info) {
char* errorStr = NULL;
char* infoStr = NULL;
- int rc = AFB_ApiSync(mApi, api.c_str(), verb.c_str(), request, result, &errorStr, &infoStr);
+ int rc = afb_api_call_sync(mApi, api.c_str(), verb.c_str(), request, result, &errorStr, &infoStr);
if (errorStr) {
error = errorStr;
diff --git a/src/plugins/afb/AFBApiImpl.h b/src/plugins/afb/AFBApiImpl.h
index d6b7b31..c0c7dd5 100644
--- a/src/plugins/afb/AFBApiImpl.h
+++ b/src/plugins/afb/AFBApiImpl.h
@@ -1,5 +1,6 @@
/*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2019 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -30,7 +31,7 @@ namespace afb {
class AFBApiImpl : public vshlcore::common::interfaces::IAFBApi {
public:
- static std::unique_ptr<AFBApiImpl> create(AFB_ApiT api);
+ static std::unique_ptr<AFBApiImpl> create(afb_api_t api);
~AFBApiImpl();
@@ -45,10 +46,10 @@ public:
std::string& info) override;
private:
- AFBApiImpl(AFB_ApiT api);
+ AFBApiImpl(afb_api_t api);
// AFB API Binding
- AFB_ApiT mApi;
+ afb_api_t mApi;
// Logger
std::shared_ptr<vshlcore::common::interfaces::ILogger> mLogger;
diff --git a/src/plugins/afb/AFBRequestImpl.cpp b/src/plugins/afb/AFBRequestImpl.cpp
index 6e0f177..ab47b3f 100644
--- a/src/plugins/afb/AFBRequestImpl.cpp
+++ b/src/plugins/afb/AFBRequestImpl.cpp
@@ -1,5 +1,6 @@
/*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2019 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -16,16 +17,16 @@
#include "afb/AFBRequestImpl.h"
extern "C" {
-#include "afb-definitions.h"
+#include <afb/afb-binding.h>
}
namespace vshlcore {
namespace afb {
-std::unique_ptr<AFBRequestImpl> AFBRequestImpl::create(AFB_ReqT afbRequest) {
+std::unique_ptr<AFBRequestImpl> AFBRequestImpl::create(afb_req_t afbRequest) {
return std::unique_ptr<AFBRequestImpl>(new AFBRequestImpl(afbRequest));
}
-AFBRequestImpl::AFBRequestImpl(AFB_ReqT afbRequest) : mAfbRequest(afbRequest) {
+AFBRequestImpl::AFBRequestImpl(afb_req_t afbRequest) : mAfbRequest(afbRequest) {
}
void* AFBRequestImpl::getNativeRequest() {
diff --git a/src/plugins/afb/AFBRequestImpl.h b/src/plugins/afb/AFBRequestImpl.h
index 82772fb..725f081 100644
--- a/src/plugins/afb/AFBRequestImpl.h
+++ b/src/plugins/afb/AFBRequestImpl.h
@@ -1,5 +1,6 @@
/*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2019 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -30,16 +31,16 @@ namespace afb {
*/
class AFBRequestImpl : public vshlcore::common::interfaces::IAFBRequest {
public:
- static std::unique_ptr<AFBRequestImpl> create(AFB_ReqT afbRequest);
+ static std::unique_ptr<AFBRequestImpl> create(afb_req_t afbRequest);
// {@c IAFBRequest Implementation
void *getNativeRequest() override;
// @c IAFBRequest Implementation }
private:
- AFBRequestImpl(AFB_ReqT afbRequest);
+ AFBRequestImpl(afb_req_t afbRequest);
- AFB_ReqT mAfbRequest;
+ afb_req_t mAfbRequest;
};
} // namespace afb
diff --git a/src/plugins/afb/include/AFBEventImpl.h b/src/plugins/afb/include/AFBEventImpl.h
index 924c966..28206a4 100644
--- a/src/plugins/afb/include/AFBEventImpl.h
+++ b/src/plugins/afb/include/AFBEventImpl.h
@@ -1,5 +1,6 @@
/*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2019 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -36,7 +37,7 @@ namespace afb {
class AFBEventImpl : public vshlcore::common::interfaces::IAFBApi::IAFBEvent {
public:
static unique_ptr<AFBEventImpl>
- create(shared_ptr<vshlcore::common::interfaces::ILogger> logger, AFB_ApiT api,
+ create(shared_ptr<vshlcore::common::interfaces::ILogger> logger, afb_api_t api,
const string &eventName);
// Destructor
@@ -52,14 +53,14 @@ public:
private:
AFBEventImpl(shared_ptr<vshlcore::common::interfaces::ILogger> logger,
- AFB_ApiT api, const string &eventName);
+ afb_api_t api, const string &eventName);
// Make the event. This is a lazy make that happens
// usually during the subscribe stage.
void makeEventIfNeccessary();
// Binding API reference
- AFB_ApiT mAfbApi;
+ afb_api_t mAfbApi;
// AFB Event
afb_event_t mAfbEvent;
diff --git a/src/plugins/afb/src/AFBEventImpl.cpp b/src/plugins/afb/src/AFBEventImpl.cpp
index b7837bb..6e3b106 100644
--- a/src/plugins/afb/src/AFBEventImpl.cpp
+++ b/src/plugins/afb/src/AFBEventImpl.cpp
@@ -1,5 +1,6 @@
/*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * Copyright 2019 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
@@ -23,14 +24,14 @@ namespace afb {
unique_ptr<AFBEventImpl> AFBEventImpl::create(
shared_ptr<vshlcore::common::interfaces::ILogger> logger,
- AFB_ApiT api,
+ afb_api_t api,
const string& eventName) {
return unique_ptr<AFBEventImpl>(new AFBEventImpl(logger, api, eventName));
}
AFBEventImpl::AFBEventImpl(
shared_ptr<vshlcore::common::interfaces::ILogger> logger,
- AFB_ApiT api,
+ afb_api_t api,
const string& eventName) :
mLogger(logger),
mAfbApi(api),
@@ -52,7 +53,7 @@ bool AFBEventImpl::isValid() {
bool AFBEventImpl::subscribe(IAFBRequest& requestInterface) {
makeEventIfNeccessary();
- auto request = static_cast<AFB_ReqT>(requestInterface.getNativeRequest());
+ auto request = static_cast<afb_req_t>(requestInterface.getNativeRequest());
if (isValid() && afb_req_subscribe(request, mAfbEvent) == 0) {
return true;
}
@@ -62,7 +63,7 @@ bool AFBEventImpl::subscribe(IAFBRequest& requestInterface) {
bool AFBEventImpl::unsubscribe(IAFBRequest& requestInterface) {
makeEventIfNeccessary();
- auto request = static_cast<AFB_ReqT>(requestInterface.getNativeRequest());
+ auto request = static_cast<afb_req_t>(requestInterface.getNativeRequest());
if (isValid() && afb_req_unsubscribe(request, mAfbEvent) == 0) {
return true;
}