1 // Copyright 2017 AISIN AW CO.,LTD
10 #include <afb/afb-wsj1.h>
11 #include <afb/afb-ws-client.h>
14 #include "RequestManageListener.h"
17 * @brief Class for request
23 pthread_mutex_t mutex;
25 struct afb_wsj1* wsj1;
26 std::string* requestURL;
27 struct afb_wsj1_itf wsj1_itf;
30 RequestManageListener* listener;
32 uint32_t sessionHandle;
35 // Function called from thread
36 static void* BinderThread(void* param);
39 void OnReply(struct afb_wsj1_msg *msg);
40 void OnHangup(struct afb_wsj1 *wsj1);
41 void OnCallStatic(const char *api, const char *verb, struct afb_wsj1_msg *msg);
42 void OnEventStatic(const char *event, struct afb_wsj1_msg *msg);
44 static void OnReplyStatic(void *closure, struct afb_wsj1_msg *msg);
45 static void OnHangupStatic(void *closure, struct afb_wsj1 *wsj1);
46 static void OnCallStatic(void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg);
47 static void OnEventStatic(void *closure, const char *event, struct afb_wsj1_msg *msg);
49 // ==================================================================================================
51 // ==================================================================================================
56 bool Connect(const char* api_url, RequestManageListener* listener);
58 bool CallBinderAPI(const char *api, const char *verb, const char *object);
59 void SetSessionHandle(uint32_t session);
60 uint32_t GetSessionHandle();
61 void SetRouteHandle(uint32_t route);
62 uint32_t GetRouteHandle();