#pragma once
#include "net.h"
#define TCP_NOPE 0
#define TCP_TRY_CONN 1
#define TCP_TRY_DISC 2
enum client_states
{
ES_NOT_CONNECTED = 0,
ES_CONNECTED,
ES_RECEIVED,
ES_CLOSING,
};
struct ClientStruct
{
enum client_states state; /* connection status */
struct tcp_pcb *pcb; /* pointer on the current tcp_pcb */
struct pbuf *p_tx; /* pointer on pbuf to be transmitted */
};
void tcpClientCloseConnection(struct tcp_pcb *tpcb, struct ClientStruct *es);
void tcpClientConnect(uint8_t* ip, uint16_t port);
void tcpClientSendString(char* bufStr);
void tcpClientSendInteger(uint32_t val);