summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-14 14:04:38 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-09-14 14:04:38 +0200
commit8733e53f7eb82431e6d417ff9f4f38845aecd3b2 (patch)
tree2cd7b387e2281a4e2d3f889b9dd21e34c5eea471
parent329592dddc1737071547075bd9df0bc9f9643ee3 (diff)
Trying to fix the link with wsj1
original author is Aurelian. Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r--AFBClient.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/AFBClient.cpp b/AFBClient.cpp
index eb85a39..6f66a5f 100644
--- a/AFBClient.cpp
+++ b/AFBClient.cpp
@@ -8,6 +8,14 @@
#define UNUSED(x) (void)(x)
+extern "C" {
+extern struct afb_wsj1 *afb_ws_client_connect_wsj1(struct sd_event *eloop, const char *uri, struct afb_wsj1_itf *itf, void *closure);
+extern int afb_wsj1_call_s(struct afb_wsj1 *wsj1, const char *api, const char *verb, const char *object, void (*on_reply)(void *closure, struct afb_wsj1_msg *msg), void *closure);
+extern int afb_wsj1_msg_is_reply_ok(struct afb_wsj1_msg *msg);
+extern int afb_wsj1_send_event_s(struct afb_wsj1 *wsj1, const char *event, const char *object);
+static inline int afb_wsj1_reply_error_s(struct afb_wsj1_msg *msg, const char *object, const char *token);
+}
+
const char * AFBClient::wmURI = "ws://localhost:1700/api?token=wm";
const char * AFBClient::wmAPI = "winman";
@@ -84,9 +92,6 @@ void AFBClient::activateSurface(const char *label)
const char begin[] = "{\"drawing_name\":\"";
const char end[] = "\"}";
const char verb[] = "activate_surface";
- strcpy(parameter, functionParamName);
- strcat(parameter, label);
- strcat(parameter, "\"}");
char *parameter = (char *)malloc(strlen(begin) +
strlen(label) +
strlen(end) + 1);