30#ifndef PROTOCORE_WS_CLIENT_H
31#define PROTOCORE_WS_CLIENT_H
35#if PROTOCORE_ENABLE_WS_CLIENT
44#define PROTOCORE_WS_KEY_CAP 25
47#define PROTOCORE_WS_ACCEPT_CAP 29
64typedef void (*WsClientMessageCb)(uint8_t opcode,
const uint8_t *payload,
size_t len);
77 const char *resource_name;
79 const char *subprotocol;
89 const uint8_t *payload;
93 const uint8_t *masking_key;
111 WsClientMessageCb on_message;
159 WsHandshakeArgs handshake;
168extern WsClientVars WsClientV;
173 void (*
const accept_for_key)(
const uint8_t *work);
174 void (*
const build_opening_handshake)(
const uint8_t *work);
175 void (*
const check_server_handshake)(
const uint8_t *work);
176 void (*
const build_frame)(
const uint8_t *work);
177 void (*
const parse_frame)(
const uint8_t *work);
178 void (*
const on_message)(
const uint8_t *work);
179 void (*
const connect)(
const uint8_t *work);
180 void (*
const send_text)(
const uint8_t *work);
181 void (*
const send_binary)(
const uint8_t *work);
182 void (*
const loop)(
const uint8_t *work);
183 void (*
const connected)(
const uint8_t *work);
184 void (*
const close)(
const uint8_t *work);
189void protocore_ws_client_accept_for_key(
const uint8_t *work);
190void protocore_ws_client_build_opening_handshake(
const uint8_t *work);
191void protocore_ws_client_check_server_handshake(
const uint8_t *work);
192void protocore_ws_client_build_frame(
const uint8_t *work);
193void protocore_ws_client_parse_frame(
const uint8_t *work);
194void protocore_ws_client_on_message(
const uint8_t *work);
195void protocore_ws_client_connect(
const uint8_t *work);
196void protocore_ws_client_send_text(
const uint8_t *work);
197void protocore_ws_client_send_binary(
const uint8_t *work);
198void protocore_ws_client_loop(
const uint8_t *work);
199void protocore_ws_client_connected(
const uint8_t *work);
200void protocore_ws_client_close(
const uint8_t *work);
206static const WsClientNs WsClient __attribute__((unused)) = {
207 .accept_for_key = protocore_ws_client_accept_for_key,
208 .build_opening_handshake = protocore_ws_client_build_opening_handshake,
209 .check_server_handshake = protocore_ws_client_check_server_handshake,
210 .build_frame = protocore_ws_client_build_frame,
211 .parse_frame = protocore_ws_client_parse_frame,
212 .on_message = protocore_ws_client_on_message,
213 .connect = protocore_ws_client_connect,
214 .send_text = protocore_ws_client_send_text,
215 .send_binary = protocore_ws_client_send_binary,
216 .loop = protocore_ws_client_loop,
217 .connected = protocore_ws_client_connected,
218 .close = protocore_ws_client_close,
230#if PROTOCORE_HAS_NET_STACK
231uint8_t *protocore_ws_client_span(
void);
EMBED_ENUM_BYTE(ProtoConn, PROTO_NONE=0, PROTO_HTTP=1, PROTO_TELNET=2, PROTO_SSH=3, PROTO_MODBUS=4, PROTO_OPCUA=5, PROTO_SSH_RFWD=6, PROTO_RELAY=7, PROTO_BRIDGE=8, PROTO_NTRIP_CASTER=9, PROTO_MESH=10, PROTO_UDP=11,)
Application protocol spoken on a listener port or connection slot.