2020-06-17 14:51:08 +00:00
|
|
|
#ifndef WFP_IMPL_CLIENT_PROTOCOL_H
|
|
|
|
#define WFP_IMPL_CLIENT_PROTOCOL_H
|
2019-03-26 22:04:53 +00:00
|
|
|
|
2020-06-16 21:39:45 +00:00
|
|
|
#include "webfuse_provider/impl/provider.h"
|
|
|
|
#include "webfuse_provider/impl/request.h"
|
2019-03-26 22:04:53 +00:00
|
|
|
|
2020-06-16 21:39:45 +00:00
|
|
|
#include "webfuse_provider/impl/slist.h"
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2020-02-19 21:44:56 +00:00
|
|
|
struct wfp_client_config;
|
2019-03-26 22:04:53 +00:00
|
|
|
struct lws_protocols;
|
2020-02-19 21:44:56 +00:00
|
|
|
struct lws_context;
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_jsonrpc_proxy;
|
|
|
|
struct wfp_timer_manager;
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
struct wfp_client_protocol
|
|
|
|
{
|
2019-05-19 12:33:42 +00:00
|
|
|
bool is_connected;
|
2020-03-01 10:06:09 +00:00
|
|
|
bool is_shutdown_requested;
|
2019-03-26 22:04:53 +00:00
|
|
|
struct wfp_request request;
|
|
|
|
struct wfp_provider provider;
|
|
|
|
void * user_data;
|
|
|
|
struct lws * wsi;
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_timer_manager * timer_manager;
|
|
|
|
struct wfp_jsonrpc_proxy * proxy;
|
|
|
|
struct wfp_slist messages;
|
2019-03-26 22:04:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern void wfp_impl_client_protocol_init(
|
|
|
|
struct wfp_client_protocol * protocol,
|
|
|
|
struct wfp_provider const * provider,
|
|
|
|
void * user_data);
|
|
|
|
|
|
|
|
extern void wfp_impl_client_protocol_cleanup(
|
|
|
|
struct wfp_client_protocol * protocol);
|
|
|
|
|
|
|
|
extern struct wfp_client_protocol * wfp_impl_client_protocol_create(
|
2020-02-19 21:44:56 +00:00
|
|
|
struct wfp_client_config const * config);
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
extern void wfp_impl_client_protocol_dispose(
|
|
|
|
struct wfp_client_protocol * protocol);
|
|
|
|
|
|
|
|
extern void wfp_impl_client_protocol_init_lws(
|
|
|
|
struct wfp_client_protocol * protocol,
|
|
|
|
struct lws_protocols * lws_protocol);
|
|
|
|
|
2020-02-19 21:44:56 +00:00
|
|
|
extern void wfp_impl_client_protocol_connect(
|
|
|
|
struct wfp_client_protocol * protocol,
|
|
|
|
struct lws_context * context,
|
|
|
|
char const * url);
|
|
|
|
|
2020-04-07 18:37:50 +00:00
|
|
|
extern void wfp_impl_client_protocol_disconnect(
|
|
|
|
struct wfp_client_protocol * protocol);
|
|
|
|
|
2019-03-26 22:04:53 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|