MyTetra Share
Делитесь знаниями!
server.h
Время создания: 28.11.2018 17:34
Раздел: Electronics - Microcontrollers - STM32 - Hunter - v3.2

#pragma once


#include "net.h"


#define SERVER_LISTEN_PORT 23

/*

My version:

typedef struct UsartLine {

uint8_t command[26]; //received command

uint8_t commandCnt; //array counter

uint8_t TcpConnectStatus; //status if connection is TCP (TcpStatus is better)

uint8_t isText; //status if transmission is text to server

} cmdLine

*/


enum server_states

{

ES_S_NONE = 0,

ES_S_ACCEPTED,

ES_S_RECEIVED,

ES_S_CLOSING,

};


struct ServerStruct

{

u8_t state; /* current connection status */

u8_t retries;

struct tcp_pcb *server_pcb; /* pointer on the current tcp_pcb */

struct pbuf *p; /* pointer on pbuf */

};


void tcpServerInit(void);

void tcpServerSendString(char* bufStr);



Так же в этом разделе:
 
MyTetra Share v.0.53
Яндекс индекс цитирования