MyTetra Share
Делитесь знаниями!
server.h
Время создания: 24.11.2018 13:49
Раздел: Electronics - Microcontrollers - STM32 - Hunter - v3.1

#pragma once

/*

#include "stm32f4xx_hal.h"

#include <string.h>

#include <stdlib.h>

#include <stdint.h>

#include "lwip.h"

#include "lwip/tcp.h"

*/

#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_NONE = 0,

ES_ACCEPTED,

ES_RECEIVED,

ES_CLOSING,

};

*/



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
Яндекс индекс цитирования