27 lines
559 B
C
27 lines
559 B
C
#ifndef WS_H
|
|
#define WS_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <esp_websocket_client.h>
|
|
|
|
#include "config.h"
|
|
|
|
typedef struct {
|
|
esp_websocket_client_handle_t handle;
|
|
int connected;
|
|
unsigned char rxBuffer[WS_RX_BUFFER_LEN];
|
|
uint16_t rxBuffer_wp;
|
|
uint16_t rxBuffer_rp;
|
|
unsigned char txBuffer[WS_TX_BUFFER_LEN];
|
|
uint16_t txBuffer_wp;
|
|
} ws_client_data_t;
|
|
typedef ws_client_data_t* ws_client_t;
|
|
|
|
ws_client_t ws_connect(char *url);
|
|
int ws_getchar(ws_client_t client);
|
|
void ws_putchar(ws_client_t client, char c);
|
|
void ws_sendData(ws_client_t client);
|
|
|
|
#endif
|